From a922bc904e7996a256d23b4fba5841719f954e38 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Sun, 1 Jun 2014 23:32:20 +0800 Subject: [PATCH] Applied backgroundcolors.patch Signed-off-by: Sup Yut Sum --- ext/scintilla/include/Scintilla.h | 2 ++ ext/scintilla/src/Editor.cxx | 11 +++++++++++ ext/scintilla/src/Editor.h | 1 + ext/scintilla/win32/ScintillaWin.cxx | 8 ++++++++ 4 files changed, 22 insertions(+) diff --git a/ext/scintilla/include/Scintilla.h b/ext/scintilla/include/Scintilla.h index 0b80263fc..9aedb2c0c 100644 --- a/ext/scintilla/include/Scintilla.h +++ b/ext/scintilla/include/Scintilla.h @@ -1011,6 +1011,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCN_HOTSPOTRELEASECLICK 2027 #define SCN_FOCUSIN 2028 #define SCN_FOCUSOUT 2029 + +#define SCN_GETBKCOLOR 5000 /* --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 bbb3e0098..c7d97d9c6 100644 --- a/ext/scintilla/src/Editor.cxx +++ b/ext/scintilla/src/Editor.cxx @@ -2857,6 +2857,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; + } + const bool drawWhitespaceBackground = (vsDraw.viewWhitespace != wsInvisible) && (!overrideBackground) && (vsDraw.whitespaceColours.back.isSet); diff --git a/ext/scintilla/src/Editor.h b/ext/scintilla/src/Editor.h index 468b5bb7e..c8d015036 100644 --- a/ext/scintilla/src/Editor.h +++ b/ext/scintilla/src/Editor.h @@ -499,6 +499,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 44a6635ac..a0d924519 100644 --- a/ext/scintilla/win32/ScintillaWin.cxx +++ b/ext/scintilla/win32/ScintillaWin.cxx @@ -248,6 +248,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, int modifiers); virtual CaseFolder *CaseFolderForEncoding(); virtual std::string CaseMapString(const std::string &s, int caseMapping); @@ -1497,6 +1498,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, int modifiers) { //Platform::DebugPrintf("ScintillaWin Double click 0\n"); ScintillaBase::NotifyDoubleClick(pt, modifiers); -- 2.11.4.GIT