aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-26 18:02:24 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-26 18:02:24 +1100
commitceb3ef8f45e5599d3993d347dfff2ac249902d97 (patch)
treec9af0a34f4552311f6858ae5fe6a91149672fe6f
parent7a3c73483c17da8f669fe3551ad274a02144486a (diff)
downloadscintilla-mirror-ceb3ef8f45e5599d3993d347dfff2ac249902d97.tar.gz
Add SC_SUPPORTS_PIXEL_MODIFICATION to differentiate character cell and
pixel oriented platforms.
-rw-r--r--cocoa/PlatCocoa.mm1
-rw-r--r--doc/ScintillaDoc.html12
-rwxr-xr-xgtk/PlatGTK.cxx1
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface1
-rw-r--r--qt/ScintillaEditBase/PlatQt.cpp1
-rw-r--r--win32/PlatWin.cxx11
7 files changed, 26 insertions, 2 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 0e1897438..bec70e8b9 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -345,6 +345,7 @@ const int SupportsCocoa[] = {
SC_SUPPORTS_PIXEL_DIVISIONS,
SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH,
SC_SUPPORTS_TRANSLUCENT_STROKE,
+ SC_SUPPORTS_PIXEL_MODIFICATION,
};
}
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index f5b20d087..40353de52 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -4059,23 +4059,33 @@ struct Sci_TextToFind {
<tbody>
<tr>
<td><code>SC_SUPPORTS_LINE_DRAWS_FINAL</code></td>
+ <td>0</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>1</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>2</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>
+ <td>3</td>
+ <td>Can translucent lines, polygons, ellipses, and text be drawn?</td>
+ </tr>
+
+ <tr>
+ <td><code>SC_SUPPORTS_PIXEL_MODIFICATION</code></td>
+ <td>4</td>
+ <td>Can individual pixels be modified? This is false for character cell platforms like curses.</td>
</tr>
</tbody>
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 580e42414..df5eaa6a7 100755
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -220,6 +220,7 @@ const int SupportsGTK[] = {
SC_SUPPORTS_LINE_DRAWS_FINAL,
SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH,
SC_SUPPORTS_TRANSLUCENT_STROKE,
+ SC_SUPPORTS_PIXEL_MODIFICATION,
};
}
diff --git a/include/Scintilla.h b/include/Scintilla.h
index edf41c5cf..81869efec 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -1022,6 +1022,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_SUPPORTS_PIXEL_DIVISIONS 1
#define SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH 2
#define SC_SUPPORTS_TRANSLUCENT_STROKE 3
+#define SC_SUPPORTS_PIXEL_MODIFICATION 4
#define SCI_SUPPORTSFEATURE 2750
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index d910e8776..13a007ecd 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -2881,6 +2881,7 @@ 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
+val SC_SUPPORTS_PIXEL_MODIFICATION=4
# 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 16f699e8e..ee91f8311 100644
--- a/qt/ScintillaEditBase/PlatQt.cpp
+++ b/qt/ScintillaEditBase/PlatQt.cpp
@@ -137,6 +137,7 @@ const int SupportsQt[] = {
SC_SUPPORTS_LINE_DRAWS_FINAL,
SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH,
SC_SUPPORTS_TRANSLUCENT_STROKE,
+ SC_SUPPORTS_PIXEL_MODIFICATION,
};
const FontAndCharacterSet *AsFontAndCharacterSet(const Font *f) {
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 4ecd19c0e..064871463 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -211,6 +211,10 @@ void LoadDpiForWindow() noexcept {
HINSTANCE hinstPlatformRes {};
+const int SupportsGDI[] = {
+ SC_SUPPORTS_PIXEL_MODIFICATION,
+};
+
constexpr BYTE Win32MapFontQuality(int extraFontFlag) noexcept {
switch (extraFontFlag & SC_EFF_QUALITY_MASK) {
@@ -582,7 +586,11 @@ void SurfaceGDI::Release() noexcept {
Clear();
}
-int SurfaceGDI::Supports(int /* feature */) noexcept {
+int SurfaceGDI::Supports(int feature) noexcept {
+ for (const int f : SupportsGDI) {
+ if (f == feature)
+ return 1;
+ }
return 0;
}
@@ -1255,6 +1263,7 @@ const int SupportsD2D[] = {
SC_SUPPORTS_LINE_DRAWS_FINAL,
SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH,
SC_SUPPORTS_TRANSLUCENT_STROKE,
+ SC_SUPPORTS_PIXEL_MODIFICATION,
};
constexpr D2D_COLOR_F ColorFromColourAlpha(ColourAlpha colour) noexcept {