• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revisão29228 (tree)
Hora2021-07-03 15:46:03
Autorstefankueng

Mensagem de Log

adjust and apply the background colors patch

Mudança Sumário

Diff

--- trunk/ext/scintilla/backgroundcolors.patch (revision 29227)
+++ trunk/ext/scintilla/backgroundcolors.patch (revision 29228)
@@ -1,8 +1,8 @@
11 Index: include/Scintilla.h
22 ===================================================================
3---- include/Scintilla.h (revision 29201)
3+--- include/Scintilla.h (revision 29226)
44 +++ include/Scintilla.h (working copy)
5-@@ -1201,6 +1201,8 @@
5+@@ -1242,6 +1242,8 @@
66
77 #endif
88
@@ -13,33 +13,41 @@
1313 * So older code that treats Scintilla as a RichEdit will work. */
1414 Index: src/Editor.cxx
1515 ===================================================================
16---- src/Editor.cxx (revision 29201)
16+--- src/Editor.cxx (revision 29226)
1717 +++ src/Editor.cxx (working copy)
18-@@ -114,6 +114,7 @@
18+@@ -117,6 +117,7 @@
1919 }
2020
21- Editor::Editor() : durationWrapOneLine(0.00001, 0.000001, 0.0001) {
22-+ view.editor = this;
21+ Editor::Editor() : durationWrapOneByte(0.000001, 0.0000001, 0.00001) {
22++ view.editor = this;
2323 ctrlID = 0;
2424
2525 stylesValid = false;
2626 Index: src/Editor.h
2727 ===================================================================
28---- src/Editor.h (revision 29201)
28+--- src/Editor.h (revision 29226)
2929 +++ src/Editor.h (working copy)
30-@@ -630,6 +630,7 @@
30+@@ -7,6 +7,7 @@
31+
32+ #ifndef EDITOR_H
33+ #define EDITOR_H
34++#include "Scintilla.h"
35+
36+ namespace Scintilla::Internal {
37+
38+@@ -663,6 +664,7 @@
3139 public:
3240 ~Editor() override;
3341
34-+ virtual void NotifyParent(SCNotification * scn) = 0;
42++ virtual void NotifyParent(SCNotification *scn) = 0;
3543 // Public so the COM thunks can access it.
3644 bool IsUnicodeMode() const noexcept;
3745 // Public so scintilla_send_message can use it.
3846 Index: src/EditView.cxx
3947 ===================================================================
40---- src/EditView.cxx (revision 29201)
48+--- src/EditView.cxx (revision 29226)
4149 +++ src/EditView.cxx (working copy)
42-@@ -59,6 +59,7 @@
50+@@ -61,6 +61,7 @@
4351 #include "MarginView.h"
4452 #include "EditView.h"
4553 #include "ElapsedPeriod.h"
@@ -46,8 +54,8 @@
4654 +#include "Editor.h"
4755
4856 using namespace Scintilla;
49-
50-@@ -184,6 +185,7 @@
57+ using namespace Scintilla::Internal;
58+@@ -187,6 +188,7 @@
5159 tabArrowHeight = 4;
5260 customDrawTabArrow = nullptr;
5361 customDrawWrapMarker = nullptr;
@@ -54,13 +62,13 @@
5462 + editor = NULL;
5563 }
5664
57- EditView::~EditView() {
58-@@ -2139,7 +2141,17 @@
65+ EditView::~EditView() = default;
66+@@ -2200,7 +2202,17 @@
5967 }
6068
6169 // See if something overrides the line background colour.
62-- const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
63-+ ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
70+- const std::optional<ColourRGBA> background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
71++ std::optional<ColourRGBA> background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
6472 + SCNotification scn = { 0 };
6573 + scn.nmhdr.code = SCN_GETBKCOLOR;
6674 + scn.line = line;
@@ -69,7 +77,7 @@
6977 + ((Editor*)editor)->NotifyParent(&scn);
7078 + if (scn.lParam != -1)
7179 + {
72-+ background = ColourOptional(true, scn.lParam);
80++ background = ColourRGBA::FromRGB(scn.lParam);
7381 + }
7482
7583 const Sci::Position posLineStart = model.pdoc->LineStart(line);
@@ -76,9 +84,9 @@
7684
7785 Index: src/EditView.h
7886 ===================================================================
79---- src/EditView.h (revision 29201)
87+--- src/EditView.h (revision 29226)
8088 +++ src/EditView.h (working copy)
81-@@ -79,6 +79,7 @@
89+@@ -78,6 +78,7 @@
8290 std::unique_ptr<Surface> pixmapLine;
8391 std::unique_ptr<Surface> pixmapIndentGuide;
8492 std::unique_ptr<Surface> pixmapIndentGuideHighlight;
@@ -88,21 +96,21 @@
8896 PositionCache posCache;
8997 Index: win32/ScintillaWin.cxx
9098 ===================================================================
91---- win32/ScintillaWin.cxx (revision 29201)
99+--- win32/ScintillaWin.cxx (revision 29226)
92100 +++ win32/ScintillaWin.cxx (working copy)
93-@@ -431,6 +431,7 @@
101+@@ -436,6 +436,7 @@
94102 void SetCtrlID(int identifier) override;
95103 int GetCtrlID() override;
96- void NotifyParent(SCNotification scn) override;
104+ void NotifyParent(NotificationData scn) override;
97105 + virtual void NotifyParent(SCNotification * scn);
98- void NotifyDoubleClick(Point pt, int modifiers) override;
106+ void NotifyDoubleClick(Point pt, KeyMod modifiers) override;
99107 std::unique_ptr<CaseFolder> CaseFolderForEncoding() override;
100108 std::string CaseMapString(const std::string &s, CaseMapping caseMapping) override;
101-@@ -2319,6 +2320,13 @@
109+@@ -2336,6 +2337,13 @@
102110 GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
103111 }
104112
105-+void ScintillaWin::NotifyParent(SCNotification * scn) {
113++void ScintillaWin::NotifyParent(SCNotification *scn) {
106114 + scn->nmhdr.hwndFrom = MainHWND();
107115 + scn->nmhdr.idFrom = GetCtrlID();
108116 + ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY,
@@ -109,6 +117,6 @@
109117 + GetCtrlID(), reinterpret_cast<LPARAM>(scn));
110118 +}
111119 +
112- void ScintillaWin::NotifyDoubleClick(Point pt, int modifiers) {
120+ void ScintillaWin::NotifyDoubleClick(Point pt, KeyMod modifiers) {
113121 //Platform::DebugPrintf("ScintillaWin Double click 0\n");
114122 ScintillaBase::NotifyDoubleClick(pt, modifiers);
--- trunk/ext/scintilla/include/Scintilla.h (revision 29227)
+++ trunk/ext/scintilla/include/Scintilla.h (revision 29228)
@@ -1242,6 +1242,8 @@
12421242
12431243 #endif
12441244
1245+#define SCN_GETBKCOLOR 5000
1246+
12451247 /* These structures are defined to be exactly the same shape as the Win32
12461248 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
12471249 * So older code that treats Scintilla as a RichEdit will work. */
--- trunk/ext/scintilla/src/EditView.cxx (revision 29227)
+++ trunk/ext/scintilla/src/EditView.cxx (revision 29228)
@@ -61,6 +61,7 @@
6161 #include "MarginView.h"
6262 #include "EditView.h"
6363 #include "ElapsedPeriod.h"
64+#include "Editor.h"
6465
6566 using namespace Scintilla;
6667 using namespace Scintilla::Internal;
@@ -187,6 +188,7 @@
187188 tabArrowHeight = 4;
188189 customDrawTabArrow = nullptr;
189190 customDrawWrapMarker = nullptr;
191+ editor = NULL;
190192 }
191193
192194 EditView::~EditView() = default;
@@ -2200,7 +2202,17 @@
22002202 }
22012203
22022204 // See if something overrides the line background colour.
2203- const std::optional<ColourRGBA> background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
2205+ std::optional<ColourRGBA> background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
2206+ SCNotification scn = { 0 };
2207+ scn.nmhdr.code = SCN_GETBKCOLOR;
2208+ scn.line = line;
2209+ scn.lParam = -1;
2210+ if (editor)
2211+ ((Editor*)editor)->NotifyParent(&scn);
2212+ if (scn.lParam != -1)
2213+ {
2214+ background = ColourRGBA::FromRGB(scn.lParam);
2215+ }
22042216
22052217 const Sci::Position posLineStart = model.pdoc->LineStart(line);
22062218
--- trunk/ext/scintilla/src/EditView.h (revision 29227)
+++ trunk/ext/scintilla/src/EditView.h (revision 29228)
@@ -78,6 +78,7 @@
7878 std::unique_ptr<Surface> pixmapLine;
7979 std::unique_ptr<Surface> pixmapIndentGuide;
8080 std::unique_ptr<Surface> pixmapIndentGuideHighlight;
81+ void *editor;
8182
8283 LineLayoutCache llc;
8384 PositionCache posCache;
--- trunk/ext/scintilla/src/Editor.cxx (revision 29227)
+++ trunk/ext/scintilla/src/Editor.cxx (revision 29228)
@@ -117,6 +117,7 @@
117117 }
118118
119119 Editor::Editor() : durationWrapOneByte(0.000001, 0.0000001, 0.00001) {
120+ view.editor = this;
120121 ctrlID = 0;
121122
122123 stylesValid = false;
--- trunk/ext/scintilla/src/Editor.h (revision 29227)
+++ trunk/ext/scintilla/src/Editor.h (revision 29228)
@@ -7,6 +7,7 @@
77
88 #ifndef EDITOR_H
99 #define EDITOR_H
10+#include "Scintilla.h"
1011
1112 namespace Scintilla::Internal {
1213
@@ -663,6 +664,7 @@
663664 public:
664665 ~Editor() override;
665666
667+ virtual void NotifyParent(SCNotification *scn) = 0;
666668 // Public so the COM thunks can access it.
667669 bool IsUnicodeMode() const noexcept;
668670 // Public so scintilla_send_message can use it.
--- trunk/ext/scintilla/win32/ScintillaWin.cxx (revision 29227)
+++ trunk/ext/scintilla/win32/ScintillaWin.cxx (revision 29228)
@@ -436,6 +436,7 @@
436436 void SetCtrlID(int identifier) override;
437437 int GetCtrlID() override;
438438 void NotifyParent(NotificationData scn) override;
439+ virtual void NotifyParent(SCNotification * scn);
439440 void NotifyDoubleClick(Point pt, KeyMod modifiers) override;
440441 std::unique_ptr<CaseFolder> CaseFolderForEncoding() override;
441442 std::string CaseMapString(const std::string &s, CaseMapping caseMapping) override;
@@ -2336,6 +2337,13 @@
23362337 GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
23372338 }
23382339
2340+void ScintillaWin::NotifyParent(SCNotification *scn) {
2341+ scn->nmhdr.hwndFrom = MainHWND();
2342+ scn->nmhdr.idFrom = GetCtrlID();
2343+ ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY,
2344+ GetCtrlID(), reinterpret_cast<LPARAM>(scn));
2345+}
2346+
23392347 void ScintillaWin::NotifyDoubleClick(Point pt, KeyMod modifiers) {
23402348 //Platform::DebugPrintf("ScintillaWin Double click 0\n");
23412349 ScintillaBase::NotifyDoubleClick(pt, modifiers);
Show on old repository browser