From fec11972f2484381413f77e0071ac8f6be288bb3 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 12 Feb 2012 20:24:19 +0100 Subject: [PATCH] applied backgroundcolors.patch Signed-off-by: Sven Strickroth --- ext/scintilla/include/Scintilla.h | 3 +++ ext/scintilla/src/Editor.cxx | 11 +++++++++++ ext/scintilla/src/Editor.h | 1 + ext/scintilla/win32/ScintillaWin.cxx | 8 ++++++++ ext/scintilla/win32/scintilla.mak | 3 ++- 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ext/scintilla/include/Scintilla.h b/ext/scintilla/include/Scintilla.h index 053ec62e7..809ac2452 100644 --- a/ext/scintilla/include/Scintilla.h +++ b/ext/scintilla/include/Scintilla.h @@ -959,6 +959,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCN_AUTOCCANCELLED 2025 #define SCN_AUTOCCHARDELETED 2026 #define SCN_HOTSPOTRELEASECLICK 2027 + +#define SCN_GETBKCOLOR 3000 + /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ /* These structures are defined to be exactly the same shape as the Win32 diff --git a/ext/scintilla/src/Editor.cxx b/ext/scintilla/src/Editor.cxx index 708b9f577..b87ce7002 100644 --- a/ext/scintilla/src/Editor.cxx +++ b/ext/scintilla/src/Editor.cxx @@ -2774,6 +2774,17 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis } } + SCNotification scn = {0}; + scn.nmhdr.code = SCN_GETBKCOLOR; + scn.line = line; + scn.lParam = -1; + NotifyParent(&scn); + if (scn.lParam != -1) + { + background = scn.lParam; + overrideBackground = true; + } + bool drawWhitespaceBackground = (vsDraw.viewWhitespace != wsInvisible) && (!overrideBackground) && (vsDraw.whitespaceBackgroundSet); diff --git a/ext/scintilla/src/Editor.h b/ext/scintilla/src/Editor.h index 85f0d5745..26f539202 100644 --- a/ext/scintilla/src/Editor.h +++ b/ext/scintilla/src/Editor.h @@ -444,6 +444,7 @@ protected: // ScintillaBase subclass needs access to much of Editor virtual void SetCtrlID(int identifier); virtual int GetCtrlID() { return ctrlID; } virtual void NotifyParent(SCNotification scn) = 0; + virtual void NotifyParent(SCNotification * scn) = 0; virtual void NotifyStyleToNeeded(int endStyleNeeded); void NotifyChar(int ch); void NotifySavePoint(bool isSavePoint); diff --git a/ext/scintilla/win32/ScintillaWin.cxx b/ext/scintilla/win32/ScintillaWin.cxx index e43481099..f0068d46d 100644 --- a/ext/scintilla/win32/ScintillaWin.cxx +++ b/ext/scintilla/win32/ScintillaWin.cxx @@ -252,6 +252,7 @@ class ScintillaWin : virtual void SetCtrlID(int identifier); virtual int GetCtrlID(); virtual void NotifyParent(SCNotification scn); + virtual void NotifyParent(SCNotification * scn); virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt); virtual CaseFolder *CaseFolderForEncoding(); virtual std::string CaseMapString(const std::string &s, int caseMapping); @@ -1417,6 +1418,13 @@ void ScintillaWin::NotifyParent(SCNotification scn) { GetCtrlID(), reinterpret_cast(&scn)); } +void ScintillaWin::NotifyParent(SCNotification * scn) { + scn->nmhdr.hwndFrom = MainHWND(); + scn->nmhdr.idFrom = GetCtrlID(); + ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY, + GetCtrlID(), reinterpret_cast(scn)); +} + void ScintillaWin::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt) { //Platform::DebugPrintf("ScintillaWin Double click 0\n"); ScintillaBase::NotifyDoubleClick(pt, shift, ctrl, alt); diff --git a/ext/scintilla/win32/scintilla.mak b/ext/scintilla/win32/scintilla.mak index 5d9c4afe0..2b7c28b60 100644 --- a/ext/scintilla/win32/scintilla.mak +++ b/ext/scintilla/win32/scintilla.mak @@ -21,7 +21,8 @@ CC=cl RC=rc LD=link -CXXFLAGS=-Zi -TP -MP -W4 -EHsc -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1 +CXXFLAGS=-Zi -TP -W0 -EHsc -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1 +# For something scary:-Wp64 CXXDEBUG=-Od -MTd -DDEBUG CXXNDEBUG=-O1 -MT -DNDEBUG -GL NAME=-Fo -- 2.11.4.GIT