diff options
author | 2014-11-09 00:51:36 -0500 | |
---|---|---|
committer | 2014-11-09 00:51:36 -0500 | |
commit | dc78648075624c6b3aba1eb97b3dad6ebb030cd7 (patch) | |
tree | 4a9f79716b123b44e1d61e35fd682d651577c1e0 /src | |
parent | 1d65d265c83a2ead67a3b59764b72c21a332eb33 (diff) | |
download | textadept-dc78648075624c6b3aba1eb97b3dad6ebb030cd7.tar.gz textadept-dc78648075624c6b3aba1eb97b3dad6ebb030cd7.zip |
Patch Scintilla in order to allow custom line markers; src/scintilla.patch
This is for drawing nearly all line markers as text in the terminal version.
This patch is subject to change until Neil applies or modifies the upstream
patch I sent.
Diffstat (limited to 'src')
-rw-r--r-- | src/scintilla.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/scintilla.patch b/src/scintilla.patch index a236f8fa..2dbf4d6d 100644 --- a/src/scintilla.patch +++ b/src/scintilla.patch @@ -233,3 +233,66 @@ diff -r 326449de45d0 src/MarginView.h MarginView(); void DropGraphics(bool freeObjects); +diff -r 326449de45d0 src/LineMarker.cxx +--- a/src/LineMarker.cxx Thu Sep 25 09:48:50 2014 +1000 ++++ b/src/LineMarker.cxx Sun Nov 09 00:50:17 2014 -0500 +@@ -72,6 +72,11 @@ + } + + void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const { ++ if (customDraw != NULL) { ++ customDraw(surface, rcWhole, fontForCharacter, tFold, marginStyle, this); ++ return; ++ } ++ + ColourDesired colourHead = back; + ColourDesired colourBody = back; + ColourDesired colourTail = back; +diff -r 326449de45d0 src/LineMarker.h +--- a/src/LineMarker.h Thu Sep 25 09:48:50 2014 +1000 ++++ b/src/LineMarker.h Sun Nov 09 00:50:17 2014 -0500 +@@ -12,6 +12,8 @@ + namespace Scintilla { + #endif + ++typedef void (*DrawLineMarkerFn)(Surface *, PRectangle &, Font &, int, int, const void *); ++ + /** + */ + class LineMarker { +@@ -25,6 +27,11 @@ + int alpha; + XPM *pxpm; + RGBAImage *image; ++ /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native ++ * Draw function for drawing line markers. Allow those platforms to override ++ * 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); +@@ -33,6 +40,7 @@ + alpha = SC_ALPHA_NOALPHA; + pxpm = NULL; + image = NULL; ++ customDraw = NULL; + } + LineMarker(const LineMarker &) { + // Defined to avoid pxpm being blindly copied, not as a complete copy constructor +@@ -43,6 +51,7 @@ + alpha = SC_ALPHA_NOALPHA; + pxpm = NULL; + image = NULL; ++ customDraw = NULL; + } + ~LineMarker() { + delete pxpm; +@@ -60,6 +69,7 @@ + pxpm = NULL; + delete image; + image = NULL; ++ customDraw = NULL; + } + return *this; + } |