From e056a167c96e226dc7487f5df2263d17a4dec399 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 27 Mar 2021 09:40:14 +1100 Subject: Add APIs for setting translucency and stroke width of markers. --- doc/ScintillaDoc.html | 45 +++++++++++++++++++++++++++++++++++---------- doc/ScintillaHistory.html | 5 +++++ 2 files changed, 40 insertions(+), 10 deletions(-) (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index ea1484501..ccbdf6550 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -251,6 +251,17 @@ system and the current screen mode. + + colouralpha + + Colours are set using the RGBA format (Red, Green, Blue, Alpha). + This is similar to colour but with a byte + of alpha added. They are combined as: + red | (green << 8) | (blue << 16) | (alpha << 24). + Fully opaque uses an alpha of 255. SC_ALPHA_NOALPHA is not possible for + colouralpha values. + + alpha @@ -4051,7 +4062,7 @@ struct Sci_TextToFind { For example, on Win32, Direct2D supports drawing translucent lines but GDI does not so SCI_SUPPORTSFEATURE(SC_SUPPORTS_TRANSLUCENT_STROKE) 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. + revision to the GDI platform layer or will be implemented 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.

The features that can be queried are:

@@ -4321,12 +4332,15 @@ struct Sci_TextToFind { SCI_MARKERDEFINERGBAIMAGE(int markerNumber, const char *pixels)
SCI_MARKERSYMBOLDEFINED(int markerNumber) → int
- SCI_MARKERSETFORE(int markerNumber, colour - fore)
- SCI_MARKERSETBACK(int markerNumber, colour - back)
+ SCI_MARKERSETFORE(int markerNumber, colour fore)
+ SCI_MARKERSETFORETRANSLUCENT(int markerNumber, colouralpha fore)
+ SCI_MARKERSETBACK(int markerNumber, colour back)
+ SCI_MARKERSETBACKTRANSLUCENT(int markerNumber, colouralpha back)
SCI_MARKERSETBACKSELECTED(int markerNumber, colour back)
+ SCI_MARKERSETBACKSELECTEDTRANSLUCENT(int markerNumber, colouralpha + back)
+ SCI_MARKERSETSTROKEWIDTH(int markerNumber, int hundredths)
SCI_MARKERENABLEHIGHLIGHT(bool enabled)
SCI_MARKERSETALPHA(int markerNumber, alpha alpha)
SCI_MARKERADD(line line, int markerNumber) → int
@@ -4540,18 +4554,30 @@ struct Sci_TextToFind { or SC_MARK_PIXMAP if defined with SCI_MARKERDEFINEPIXMAP or SC_MARK_RGBAIMAGE if defined with SCI_MARKERDEFINERGBAIMAGE.

-

SCI_MARKERSETFORE(int markerNumber, colour fore)
+

+ SCI_MARKERSETFORE(int markerNumber, colour fore)
+ SCI_MARKERSETFORETRANSLUCENT(int markerNumber, colouralpha fore)
SCI_MARKERSETBACK(int markerNumber, colour back)
- These two messages set the foreground and background colour of a marker number.
+ SCI_MARKERSETBACKTRANSLUCENT(int markerNumber, colouralpha back)
+ These messages set the foreground and background colour of a marker number. + The TRANSLUCENT variants can define different degrees of opacity.
SCI_MARKERSETBACKSELECTED(int markerNumber, colour back)
+ SCI_MARKERSETBACKSELECTEDTRANSLUCENT(int markerNumber, colouralpha back)
This message sets the highlight background colour of a marker number when its folding block is selected. The default colour is #FF0000.

+ +

SCI_MARKERSETSTROKEWIDTH(int markerNumber, int hundredths)
+ This message sets the stroke width used to draw the marker in hundredths of a pixel. + The default value is 100 indicating a single pixel wide line.

+

SCI_MARKERENABLEHIGHLIGHT(bool enabled)
This message allows to enable/disable the highlight folding block when it is selected. (i.e. block that contains the caret)

+

SCI_MARKERSETALPHA(int markerNumber, alpha alpha)
When markers are drawn in the content area, either because there is no margin for them or they are of SC_MARK_BACKGROUND or SC_MARK_UNDERLINE types, they may be drawn translucently by - setting an alpha value.

+ setting an alpha value. This is only for the content area - in margins, translucency is achieved through the SCI_MARKERSET…TRANSLUCENT + methods.

SCI_MARKERADD(line line, int markerNumber) → int
This message adds marker number markerNumber to a line. The message returns -1 if @@ -5009,8 +5035,7 @@ struct Sci_TextToFind { SCI_INDICATORFILLRANGE(position start, position lengthFill)
SCI_INDICATORCLEARRANGE(position start, position lengthClear)
These two messages fill or clear a range for the current indicator. - SCI_INDICATORFILLRANGE fills with the - the current value. + SCI_INDICATORFILLRANGE fills with the current value.

diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 47f16e0ce..614866e30 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -600,6 +600,11 @@ Add SCI_INDICSETSTROKEWIDTH to set stroke width of indicators.

  • + Add methods to set translucency and stroke width of markers. + SCI_MARKERSETFORETRANSLUCENT, SCI_MARKERSETBACKTRANSLUCENT, + SCI_MARKERSETBACKSELECTEDTRANSLUCENT, SCI_MARKERSETSTROKEWIDTH. +
  • +
  • Change graphics coordinates from float (32-bit) to double (64-bit). Fixes uneven line heights in large documents on Cocoa. Increases memory use. -- cgit v1.2.3