My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
ext/scintilla/include/Scintilla.h | 1 +
ext/scintilla/src/EditView.cxx | 14 +++++++++++++-
ext/scintilla/src/EditView.h | 1 +
ext/scintilla/src/Editor.cxx | 1 +
ext/scintilla/src/Editor.h | 1 +
ext/scintilla/win32/ScintillaWin.cxx | 8 ++++++++
6 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/ext/scintilla/include/Scintilla.h b/ext/scintilla/include/Scintilla.h
index b5c1c8f..9f8cf5d 100644
--- a/ext/scintilla/include/Scintilla.h
+++ b/ext/scintilla/include/Scintilla.h
@@ -1029,6 +1029,7 @@ 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/EditView.cxx b/ext/scintilla/src/EditView.cxx
index 6c26913..0d26631 100644
--- a/ext/scintilla/src/EditView.cxx
+++ b/ext/scintilla/src/EditView.cxx
@@ -46,6 +46,7 @@
#include "EditModel.h"
#include "MarginView.h"
#include "EditView.h"
+#include "Editor.h"

#ifdef SCI_NAMESPACE
using namespace Scintilla;
@@ -185,6 +186,7 @@ EditView::EditView() {
pixmapIndentGuideHighlight = 0;
llc.SetLevel(LineLayoutCache::llcCaret);
posCache.SetSize(0x400);
+ editor = NULL;
}

EditView::~EditView() {
@@ -1623,7 +1625,17 @@ void EditView::DrawLine(Surface *surface, const EditModel &model, const ViewStyl
}

// See if something overrides the line background color.
- const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
+ ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
+ SCNotification scn = { 0 };
+ scn.nmhdr.code = SCN_GETBKCOLOR;
+ scn.line = line;
+ scn.lParam = -1;
+ if (editor)
+ ((Editor*)editor)->NotifyParent(&scn);
+ if (scn.lParam != -1) {
+ background.Set(scn.lParam);
+ background.isSet = true;
+ }

const int posLineStart = model.pdoc->LineStart(line);

diff --git a/ext/scintilla/src/EditView.h b/ext/scintilla/src/EditView.h
index ceeb7ac..aad49ad 100644
--- a/ext/scintilla/src/EditView.h
+++ b/ext/scintilla/src/EditView.h
@@ -74,6 +74,7 @@ public:
Surface *pixmapLine;
Surface *pixmapIndentGuide;
Surface *pixmapIndentGuideHighlight;
+ void *editor;

LineLayoutCache llc;
PositionCache posCache;
diff --git a/ext/scintilla/src/Editor.cxx b/ext/scintilla/src/Editor.cxx
index eb96689..add27c2 100644
--- a/ext/scintilla/src/Editor.cxx
+++ b/ext/scintilla/src/Editor.cxx
@@ -99,6 +99,7 @@ static inline bool IsAllSpacesOrTabs(const char *s, unsigned int len) {
}

Editor::Editor() {
+ view.editor = this;
ctrlID = 0;

stylesValid = false;
diff --git a/ext/scintilla/src/Editor.h b/ext/scintilla/src/Editor.h
index 58e67a0..5558864 100644
--- a/ext/scintilla/src/Editor.h
+++ b/ext/scintilla/src/Editor.h
@@ -559,6 +559,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len);

public:
+ virtual void NotifyParent(SCNotification * scn) = 0;
// Public so the COM thunks can access it.
bool IsUnicodeMode() const;
// Public so scintilla_send_message can use it.
diff --git a/ext/scintilla/win32/ScintillaWin.cxx b/ext/scintilla/win32/ScintillaWin.cxx
index 2c6bab1..78584bb 100644
--- a/ext/scintilla/win32/ScintillaWin.cxx
+++ b/ext/scintilla/win32/ScintillaWin.cxx
@@ -264,6 +264,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);
@@ -1662,6 +1663,13 @@ void ScintillaWin::NotifyParent(SCNotification scn) {
GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
}

+void ScintillaWin::NotifyParent(SCNotification * scn) {
+ scn->nmhdr.hwndFrom = MainHWND();
+ scn->nmhdr.idFrom = GetCtrlID();
+ ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY,
+ GetCtrlID(), reinterpret_cast<LPARAM>(scn));
+}
+
void ScintillaWin::NotifyDoubleClick(Point pt, int modifiers) {
//Platform::DebugPrintf("ScintillaWin Double click 0\n");
ScintillaBase::NotifyDoubleClick(pt, modifiers);

File info

Size: 4633 bytes, 121 lines
Powered by Google Project Hosting