From cb89b64ddd0acca99c5e3f60cc54eab9ed4db909 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Sat, 22 Mar 2014 22:56:50 +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 0f653cd27..c68511170 100644 --- a/ext/scintilla/include/Scintilla.h +++ b/ext/scintilla/include/Scintilla.h @@ -1008,6 +1008,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 b5fb56664..ce8a89240 100644 --- a/ext/scintilla/src/Editor.cxx +++ b/ext/scintilla/src/Editor.cxx @@ -2828,6 +2828,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 98327dc48..1b871f432 100644 --- a/ext/scintilla/src/Editor.h +++ b/ext/scintilla/src/Editor.h @@ -494,6 +494,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 2fb616022..b22419c2f 100644 --- a/ext/scintilla/win32/ScintillaWin.cxx +++ b/ext/scintilla/win32/ScintillaWin.cxx @@ -242,6 +242,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); @@ -1422,6 +1423,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); -- 2.11.4.GIT