From ed43d472889655b39777a7b2e8f01e487acf62b4 Mon Sep 17 00:00:00 2001
From: Neil
Date: Sat, 1 Jul 2017 12:20:47 +1000
Subject: Deprecate single phase drawing.
---
doc/ScintillaDoc.html | 30 ++++++++++++++++++++----------
doc/ScintillaHistory.html | 4 ++++
include/Scintilla.h | 5 +++--
include/Scintilla.iface | 15 ++++++++-------
src/Editor.cxx | 2 ++
5 files changed, 37 insertions(+), 19 deletions(-)
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 32408be16..20a2925c6 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -95,6 +95,9 @@
.provisional {
background: #FFB000;
}
+ .deprecated {
+ text-decoration: line-through red;
+ }
.parameter {
font-style:italic;
}
@@ -3578,8 +3581,6 @@ struct Sci_TextToFind {
SCI_GETBUFFEREDDRAW → bool
SCI_SETPHASESDRAW(int phases)
SCI_GETPHASESDRAW → int
- SCI_SETTWOPHASEDRAW(bool twoPhase)
- SCI_GETTWOPHASEDRAW → bool
SCI_SETTECHNOLOGY(int technology)
SCI_GETTECHNOLOGY → int
SCI_SETFONTQUALITY(int fontQuality)
@@ -3620,12 +3621,15 @@ struct Sci_TextToFind {
SCI_GETPHASESDRAW → int
There are several orders in which the text area may be drawn offering a trade-off between speed
and allowing all pixels of text to be seen even when they overlap other elements.
- In single phase drawing (SC_PHASES_ONE) each
+
In single phase drawing (SC_PHASES_ONE) each
run of characters in one style is drawn along with its background.
If a character overhangs the end of a run, such as in "V_" where the
"V" is in a different style from the "_", then this can cause the right hand
side of the "V" to be overdrawn by the background of the "_" which
cuts it off.
+
+ Single phase drawing is deprecated and should not be used by applications.
+
Two phase drawing (SC_PHASES_TWO)
fixes this by drawing all the backgrounds of a line first and then drawing the text
in transparent mode. Lines are drawn separately and no line will overlap another
@@ -3648,11 +3652,6 @@ struct Sci_TextToFind {
SCI_SETLAYOUTCACHE(SC_CACHE_PAGE)
or higher can ensure that multiple phase drawing is not significantly slower.
- SCI_SETTWOPHASEDRAW(bool twoPhase)
- SCI_GETTWOPHASEDRAW → bool
- This property has been replaced with the preceding PHASESDRAW property which is more general,
- allowing multiple phase drawing as well as one and two phase drawing.
-
SCI_SETTECHNOLOGY(int technology)
SCI_GETTECHNOLOGY → int
The technology property allows choosing between different drawing APIs and options.
@@ -4531,8 +4530,8 @@ struct Sci_TextToFind {
SCI_INDICSETUNDER(int indicator, bool under)
SCI_INDICGETUNDER(int indicator) → bool
These two messages set and get whether an indicator is drawn under text or over(default).
- Drawing under text works only for indicators when two phase drawing
- is enabled.
+ Drawing under text does not work with the deprecated single phase drawing
+ mode.
SCI_INDICSETHOVERSTYLE(int indicator, int
indicatorStyle)
@@ -8136,6 +8135,8 @@ EM_FORMATRANGE
SCI_SETKEYSUNICODE(bool keysUnicode)
SCI_GETKEYSUNICODE → bool
+ SCI_SETTWOPHASEDRAW(bool twoPhase)
+ SCI_GETTWOPHASEDRAW → bool
SCI_SETSTYLEBITS(int bits)
SCI_GETSTYLEBITS → int
SCI_GETSTYLEBITSNEEDED → int
@@ -8145,6 +8146,15 @@ EM_FORMATRANGE
SCI_GETKEYSUNICODE → bool Deprecated
On Windows, Scintilla no longer supports narrow character windows so input is always treated as Unicode.
+ SCI_SETTWOPHASEDRAW(bool twoPhase)
+ SCI_GETTWOPHASEDRAW → bool
+ This property has been replaced with the preceding PHASESDRAW property which is more general,
+ allowing multiple phase drawing as well as one and two phase drawing.
+
+ Single phase drawing SC_PHASES_ONE, is deprecated and should be replaced with
+ 2-phase SC_PHASES_TWO or multi-phase SC_PHASES_MULTIPLE drawing.
+
+
The following are features that should be removed from calling code but are still
defined to avoid breaking callers.
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 629208d68..a2f255b16 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -882,6 +882,10 @@
have been removed and can no longer be used in client code.
+ Single phase drawing SC_PHASES_ONE is deprecated along with the
+ SCI_SETTWOPHASEDRAW and SCI_GETTWOPHASEDRAW messages.
+
+
Accessibility support allowing screen readers to work added on GTK+ and Cocoa.
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 6f18af9a9..1a0108270 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -571,8 +571,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETVSCROLLBAR 2280
#define SCI_GETVSCROLLBAR 2281
#define SCI_APPENDTEXT 2282
-#define SCI_GETTWOPHASEDRAW 2283
-#define SCI_SETTWOPHASEDRAW 2284
#define SC_PHASES_ONE 0
#define SC_PHASES_TWO 1
#define SC_PHASES_MULTIPLE 2
@@ -1205,6 +1203,9 @@ struct SCNotification {
#define SCI_SETKEYSUNICODE 2521
#define SCI_GETKEYSUNICODE 2522
+#define SCI_GETTWOPHASEDRAW 2283
+#define SCI_SETTWOPHASEDRAW 2284
+
#define CharacterRange Sci_CharacterRange
#define TextRange Sci_TextRange
#define TextToFind Sci_TextToFind
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 135be3b4e..8406fa6fc 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -1419,13 +1419,6 @@ get bool GetVScrollBar=2281(,)
# Append a string to the end of the document without changing the selection.
fun void AppendText=2282(int length, string text)
-# Is drawing done in two phases with backgrounds drawn before foregrounds?
-get bool GetTwoPhaseDraw=2283(,)
-
-# In twoPhaseDraw mode, drawing is performed in two phases, first the background
-# and then the foreground. This avoids chopping off characters that overlap the next run.
-set void SetTwoPhaseDraw=2284(bool twoPhase,)
-
enu PhasesDraw=SC_PHASES_
val SC_PHASES_ONE=0
val SC_PHASES_TWO=1
@@ -4870,3 +4863,11 @@ set void SetKeysUnicode=2521(bool keysUnicode,)
# Are keys always interpreted as Unicode?
get bool GetKeysUnicode=2522(,)
+
+# Is drawing done in two phases with backgrounds drawn before foregrounds?
+get bool GetTwoPhaseDraw=2283(,)
+
+# In twoPhaseDraw mode, drawing is performed in two phases, first the background
+# and then the foreground. This avoids chopping off characters that overlap the next run.
+set void SetTwoPhaseDraw=2284(bool twoPhase,)
+
diff --git a/src/Editor.cxx b/src/Editor.cxx
index bf81bb8ea..2294105b2 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6413,6 +6413,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETBUFFEREDDRAW:
return view.bufferedDraw;
+#ifdef INCLUDE_DEPRECATED_FEATURES
case SCI_GETTWOPHASEDRAW:
return view.phasesDraw == EditView::phasesTwo;
@@ -6420,6 +6421,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
if (view.SetTwoPhaseDraw(wParam != 0))
InvalidateStyleRedraw();
break;
+#endif
case SCI_GETPHASESDRAW:
return view.phasesDraw;
--
cgit v1.2.3