From 06e90a488e2be98e72db7e06c32b38a1ded4aa90 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 17a60c165..e3c2fbc43 100644 --- a/ext/scintilla/include/Scintilla.h +++ b/ext/scintilla/include/Scintilla.h @@ -948,6 +948,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 7eaec652d..f68acfc08 100644 --- a/ext/scintilla/src/Editor.cxx +++ b/ext/scintilla/src/Editor.cxx @@ -2769,6 +2769,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 bd6186a24..ad8c078e2 100644 --- a/ext/scintilla/src/Editor.h +++ b/ext/scintilla/src/Editor.h @@ -426,6 +426,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 7cae5aab1..cdc642e25 100644 --- a/ext/scintilla/win32/ScintillaWin.cxx +++ b/ext/scintilla/win32/ScintillaWin.cxx @@ -250,6 +250,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); @@ -1419,6 +1420,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 254af0cdd..de853104d 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