diff options
-rw-r--r-- | cocoa/PlatCocoa.mm | 2 | ||||
-rw-r--r-- | doc/ScintillaDoc.html | 39 | ||||
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rwxr-xr-x | gtk/PlatGTK.cxx | 2 | ||||
-rw-r--r-- | include/Scintilla.h | 2 | ||||
-rw-r--r-- | include/Scintilla.iface | 2 | ||||
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 2 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 2 |
8 files changed, 54 insertions, 1 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index acfda1e86..c9cca0ded 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -343,6 +343,8 @@ void GetPositions(CTLineRef line, std::vector<CGFloat> &positions) { const int SupportsCocoa[] = { SC_SUPPORTS_LINE_DRAWS_FINAL, SC_SUPPORTS_PIXEL_DIVISIONS, + SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH, + SC_SUPPORTS_TRANSLUCENT_STROKE, }; } diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 529859a5c..f5b20d087 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -119,7 +119,7 @@ <h1>Scintilla Documentation</h1> - <p>Last edited 16 March 2021 NH</p> + <p>Last edited 22 March 2021 NH</p> <p style="background:#90F0C0">Scintilla 5 has moved the lexers from Scintilla into a new <a href="Lexilla.html">Lexilla</a> project.<br /> @@ -3886,6 +3886,7 @@ struct Sci_TextToFind { <a class="message" href="#SCI_GRABFOCUS">SCI_GRABFOCUS</a><br /> <a class="message" href="#SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</a><br /> <a class="message" href="#SCI_GETFOCUS">SCI_GETFOCUS → bool</a><br /> + <a class="message" href="#SCI_SUPPORTSFEATURE">SCI_SUPPORTSFEATURE(int feature) → bool</a><br /> </code> <p>To forward a message <code>(WM_XXXX, WPARAM, LPARAM)</code> to Scintilla, you can use @@ -4044,6 +4045,42 @@ struct Sci_TextToFind { that have complex focus requirements such as having their own window that gets the real focus but with the need to indicate that Scintilla has the logical focus.</p> + <p><b id="SCI_SUPPORTSFEATURE">SCI_SUPPORTSFEATURE(int feature) → bool</b><br /> + Different platforms support different features and <code>SCI_SUPPORTSFEATURE</code> + can be used to check which are currently available. + For example, on Win32, Direct2D supports drawing translucent lines but GDI does not so + <code>SCI_SUPPORTSFEATURE(SC_SUPPORTS_TRANSLUCENT_STROKE)</code> + will return 1 for Direct2D and 0 for GDI. Its possible that translucent line drawing will be implemented in a future + revision to the GDI platform layer or will be implmented on particular Windows versions. + This call allows applications to tailor their settings: perhaps displaying a box with translucent coloured fill on Direct2D but + a hollow box on GDI.</p> + <p>The features that can be queried are:</p> + <table class="standard" summary="Search flags"> + <tbody> + <tr> + <td><code>SC_SUPPORTS_LINE_DRAWS_FINAL</code></td> + <td>Whether drawing a line draws its final position. Only false on Win32 GDI.</td> + </tr> + + <tr> + <td><code>SC_SUPPORTS_PIXEL_DIVISIONS</code></td> + <td>Are logical pixels larger than physical pixels? Currently only true for macOS Cocoa with 'retina' displays. + When true, creating pixmaps at twice the resolution can produce clearer output with less blur.</td> + </tr> + + <tr> + <td><code>SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH</code></td> + <td>Can lines be drawn with fractional widths like 1.5 or 0.5 pixels?</td> + </tr> + + <tr> + <td><code>SC_SUPPORTS_TRANSLUCENT_STROKE</code></td> + <td>Can translucent lines, polygons, and ellipses, be drawn?</td> + </tr> + + </tbody> + </table> + <h2 id="BraceHighlighting">Brace highlighting</h2> <code><a class="message" href="#SCI_BRACEHIGHLIGHT">SCI_BRACEHIGHLIGHT(position posA, position posB)</a><br /> diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 2159127a8..b643dce10 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -589,6 +589,10 @@ Add methods for encoding conversion. Use these changes to improve appearance. </li> + <li> + Add SCI_SUPPORTSFEATURE method to allow applications to determine which features are available + and to then choose workarounds for missing features like translucent drawing. + </li> </ul> <h3> <a href="https://www.scintilla.org/scite500.zip">Release 5.0.0</a> diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 66a1666f5..f9c0a09f7 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -225,6 +225,8 @@ public: const int SupportsGTK[] = { SC_SUPPORTS_LINE_DRAWS_FINAL, + SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH, + SC_SUPPORTS_TRANSLUCENT_STROKE, }; } diff --git a/include/Scintilla.h b/include/Scintilla.h index da104a552..edf41c5cf 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -1020,6 +1020,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 #define SC_SUPPORTS_LINE_DRAWS_FINAL 0 #define SC_SUPPORTS_PIXEL_DIVISIONS 1 +#define SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH 2 +#define SC_SUPPORTS_TRANSLUCENT_STROKE 3 #define SCI_SUPPORTSFEATURE 2750 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 6868dec0b..d386003e2 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -2878,6 +2878,8 @@ get int EOLAnnotationGetStyleOffset=2748(,) enu Supports=SC_SUPPORTS_ val SC_SUPPORTS_LINE_DRAWS_FINAL=0 val SC_SUPPORTS_PIXEL_DIVISIONS=1 +val SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH=2 +val SC_SUPPORTS_TRANSLUCENT_STROKE=3 # Get whether a feature is supported get int SupportsFeature=2750(Supports feature,) diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 248fcf194..d8925c247 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -135,6 +135,8 @@ namespace { const int SupportsQt[] = { SC_SUPPORTS_LINE_DRAWS_FINAL, + SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH, + SC_SUPPORTS_TRANSLUCENT_STROKE, }; const FontAndCharacterSet *AsFontAndCharacterSet(const Font *f) { diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 1e6dd06b4..d60b35325 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1393,6 +1393,8 @@ constexpr D2D1_RECT_F RectangleFromPRectangle(PRectangle rc) noexcept { const int SupportsD2D[] = { SC_SUPPORTS_LINE_DRAWS_FINAL, + SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH, + SC_SUPPORTS_TRANSLUCENT_STROKE, }; constexpr D2D_COLOR_F ColorFromColourAlpha(ColourAlpha colour) noexcept { |