aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-03-15 10:15:10 +1100
committerNeil <nyamatongwe@gmail.com>2018-03-15 10:15:10 +1100
commit601277bddb0a4d871b8ab90e88b5d7dfde3ec2a3 (patch)
tree8b66bcf23cff57af312098c98147c5169fd92065
parent49daf8127b8d8df7a307be5c4a2b65a6a6708678 (diff)
downloadscintilla-mirror-601277bddb0a4d871b8ab90e88b5d7dfde3ec2a3.tar.gz
Use forward class definitions of XPM and RGBAImage so only code that uses them
needs to #include "XPM.h". Move definition of standard methods on LineMarker from header to implementation to reduce included text and further isolate use of XPM and RGBAImage.
-rw-r--r--cocoa/ScintillaCocoa.h1
-rw-r--r--gtk/ScintillaGTK.cxx1
-rw-r--r--gtk/ScintillaGTKAccessible.cxx1
-rw-r--r--qt/ScintillaEdit/ScintillaDocument.cpp1
-rw-r--r--qt/ScintillaEditBase/ScintillaQt.h1
-rw-r--r--src/EditModel.cxx1
-rw-r--r--src/EditView.cxx1
-rw-r--r--src/Editor.cxx1
-rw-r--r--src/LineMarker.cxx39
-rw-r--r--src/LineMarker.h42
-rw-r--r--src/MarginView.cxx1
-rw-r--r--src/PositionCache.cxx1
-rw-r--r--src/ScintillaBase.cxx1
-rw-r--r--win32/ScintillaWin.cxx1
14 files changed, 46 insertions, 47 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h
index 9ef83e8b0..e86c00724 100644
--- a/cocoa/ScintillaCocoa.h
+++ b/cocoa/ScintillaCocoa.h
@@ -43,7 +43,6 @@
#include "CallTip.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 48aa30a71..6a9af496b 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -56,7 +56,6 @@
#include "CallTip.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/gtk/ScintillaGTKAccessible.cxx b/gtk/ScintillaGTKAccessible.cxx
index 05d6b768c..89854c416 100644
--- a/gtk/ScintillaGTKAccessible.cxx
+++ b/gtk/ScintillaGTKAccessible.cxx
@@ -105,7 +105,6 @@
#include "CallTip.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/qt/ScintillaEdit/ScintillaDocument.cpp b/qt/ScintillaEdit/ScintillaDocument.cpp
index 5e80a33bd..9df4fbfe1 100644
--- a/qt/ScintillaEdit/ScintillaDocument.cpp
+++ b/qt/ScintillaEdit/ScintillaDocument.cpp
@@ -24,7 +24,6 @@
#include "CellBuffer.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/qt/ScintillaEditBase/ScintillaQt.h b/qt/ScintillaEditBase/ScintillaQt.h
index 37a5e1bbe..cd0c26277 100644
--- a/qt/ScintillaEditBase/ScintillaQt.h
+++ b/qt/ScintillaEditBase/ScintillaQt.h
@@ -40,7 +40,6 @@
#include "CallTip.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "AutoComplete.h"
diff --git a/src/EditModel.cxx b/src/EditModel.cxx
index 08888ba38..2f4a6a6af 100644
--- a/src/EditModel.cxx
+++ b/src/EditModel.cxx
@@ -34,7 +34,6 @@
#include "CellBuffer.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 97d8a718c..35d1ee777 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -39,7 +39,6 @@
#include "PerLine.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 04138e844..277a53c19 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -38,7 +38,6 @@
#include "PerLine.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index 261916e11..820ab9fae 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -24,6 +24,45 @@
using namespace Scintilla;
+LineMarker::~LineMarker() {
+}
+
+LineMarker::LineMarker() {
+ markType = SC_MARK_CIRCLE;
+ fore = ColourDesired(0, 0, 0);
+ back = ColourDesired(0xff, 0xff, 0xff);
+ backSelected = ColourDesired(0xff, 0x00, 0x00);
+ alpha = SC_ALPHA_NOALPHA;
+ customDraw = nullptr;
+}
+
+LineMarker::LineMarker(const LineMarker &) {
+ // Defined to avoid pxpm and image being blindly copied, not as a complete copy constructor.
+ markType = SC_MARK_CIRCLE;
+ fore = ColourDesired(0, 0, 0);
+ back = ColourDesired(0xff, 0xff, 0xff);
+ backSelected = ColourDesired(0xff, 0x00, 0x00);
+ alpha = SC_ALPHA_NOALPHA;
+ pxpm.reset();
+ image.reset();
+ customDraw = nullptr;
+}
+
+LineMarker &LineMarker::operator=(const LineMarker &other) {
+ // Defined to avoid pxpm and image being blindly copied, not as a complete assignment operator.
+ if (this != &other) {
+ markType = SC_MARK_CIRCLE;
+ fore = ColourDesired(0, 0, 0);
+ back = ColourDesired(0xff, 0xff, 0xff);
+ backSelected = ColourDesired(0xff, 0x00, 0x00);
+ alpha = SC_ALPHA_NOALPHA;
+ pxpm.reset();
+ image.reset();
+ customDraw = nullptr;
+ }
+ return *this;
+}
+
void LineMarker::SetXPM(const char *textForm) {
pxpm = std::make_unique<XPM>(textForm);
markType = SC_MARK_PIXMAP;
diff --git a/src/LineMarker.h b/src/LineMarker.h
index 6b66e03e8..28a63cd3b 100644
--- a/src/LineMarker.h
+++ b/src/LineMarker.h
@@ -10,6 +10,9 @@
namespace Scintilla {
+class XPM;
+class RGBAImage;
+
typedef void (*DrawLineMarkerFn)(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, int tFold, int marginStyle, const void *lineMarker);
/**
@@ -30,41 +33,10 @@ public:
* it instead of creating a new method(s) in the Surface class that existing
* platforms must implement as empty. */
DrawLineMarkerFn customDraw;
- LineMarker() {
- markType = SC_MARK_CIRCLE;
- fore = ColourDesired(0,0,0);
- back = ColourDesired(0xff,0xff,0xff);
- backSelected = ColourDesired(0xff,0x00,0x00);
- alpha = SC_ALPHA_NOALPHA;
- customDraw = nullptr;
- }
- LineMarker(const LineMarker &) {
- // Defined to avoid pxpm and image being blindly copied, not as a complete copy constructor.
- markType = SC_MARK_CIRCLE;
- fore = ColourDesired(0,0,0);
- back = ColourDesired(0xff,0xff,0xff);
- backSelected = ColourDesired(0xff,0x00,0x00);
- alpha = SC_ALPHA_NOALPHA;
- pxpm.reset();
- image.reset();
- customDraw = nullptr;
- }
- ~LineMarker() {
- }
- LineMarker &operator=(const LineMarker &other) {
- // Defined to avoid pxpm and image being blindly copied, not as a complete assignment operator.
- if (this != &other) {
- markType = SC_MARK_CIRCLE;
- fore = ColourDesired(0,0,0);
- back = ColourDesired(0xff,0xff,0xff);
- backSelected = ColourDesired(0xff,0x00,0x00);
- alpha = SC_ALPHA_NOALPHA;
- pxpm.reset();
- image.reset();
- customDraw = nullptr;
- }
- return *this;
- }
+ LineMarker();
+ LineMarker(const LineMarker &);
+ virtual ~LineMarker();
+ LineMarker &operator=(const LineMarker &other);
void SetXPM(const char *textForm);
void SetXPM(const char *const *linesForm);
void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);
diff --git a/src/MarginView.cxx b/src/MarginView.cxx
index ff19840c4..5a56b28ad 100644
--- a/src/MarginView.cxx
+++ b/src/MarginView.cxx
@@ -36,7 +36,6 @@
#include "CellBuffer.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index 3d0888c68..3bb0f7e28 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -32,7 +32,6 @@
#include "CellBuffer.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index b1d9fd081..febc4f11f 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -44,7 +44,6 @@
#include "CallTip.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 0edb3c823..a04b63f57 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -65,7 +65,6 @@
#include "CallTip.h"
#include "KeyMap.h"
#include "Indicator.h"
-#include "XPM.h"
#include "LineMarker.h"
#include "Style.h"
#include "ViewStyle.h"