From 92290868cf9753d2df0d494cb44e2ff62a570b58 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 24 May 2021 19:31:06 +1000 Subject: Define C++ version of the Scintilla API in ScintillaTypes.h, ScintillaMessages.h and ScintillaStructures.h using scoped enumerations. Use these headers instead of Scintilla.h internally. External definitions go in the Scintilla namespace and internal definitio0ns in Scintilla::Internal. --- doc/ScintillaDoc.html | 71 ++++++++++++++++++++++++++++++++--------------- doc/ScintillaHistory.html | 4 +++ 2 files changed, 52 insertions(+), 23 deletions(-) (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 43fcab2dc..d1abef8de 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -128,7 +128,7 @@

Scintilla Documentation

-

Last edited 13 May 2021 NH

+

Last edited 25 May 2021 NH

Scintilla 5 has moved the lexers from Scintilla into a new Lexilla project.
@@ -181,6 +181,12 @@ work out how to develop using Scintilla is to see how SciTE uses it. SciTE exercises most of Scintilla's facilities.

+

There is a more type-safe binding of this API that can be used from C++. + It is implemented in the ScintillaTypes.h, ScintillaMessages.h, and ScintillaStructures.h headers. + SciTE contains (in src) a ScintillaCall module that can help further and will, in the future, be + moved into Scintilla. +

+

In the descriptions that follow, the messages are described as function calls with zero, one or two arguments. These two arguments are the standard wParam and lParam familiar to Windows programmers. These parameters are integers that @@ -274,9 +280,9 @@ alpha Translucency is set using an alpha value. - Alpha ranges from 0 (SC_ALPHA_TRANSPARENT) which is completely transparent to - 255 (SC_ALPHA_OPAQUE) which is opaque. - Previous versions used the value 256 (SC_ALPHA_NOALPHA) to indicate that drawing was to be + Alpha ranges from 0 (SC_ALPHA_TRANSPARENT) which is completely transparent to + 255 (SC_ALPHA_OPAQUE) which is opaque. + Previous versions used the value 256 (SC_ALPHA_NOALPHA) to indicate that drawing was to be performed opaquely on the base layer. This is now discouraged and code should use the …LAYER… methods to choose the layer. @@ -1649,9 +1655,9 @@ struct Sci_TextToFind { working in terms of UTF-16 code units.

SCI_GETLINECHARACTERINDEX → int
- Returns which if any indexes are active. It may be SC_LINECHARACTERINDEX_NONE(0) or one or more - of SC_LINECHARACTERINDEX_UTF32(1) if whole characters are indexed or - SC_LINECHARACTERINDEX_UTF16(2) if UTF-16 code units are indexed. + Returns which if any indexes are active. It may be SC_LINECHARACTERINDEX_NONE (0) or one or more + of SC_LINECHARACTERINDEX_UTF32 (1) if whole characters are indexed or + SC_LINECHARACTERINDEX_UTF16 (2) if UTF-16 code units are indexed. Character indexes are currently only supported for UTF-8 documents.

SCI_ALLOCATELINECHARACTERINDEX(int lineCharacterIndex)
@@ -1665,7 +1671,7 @@ struct Sci_TextToFind {

SCI_LINEFROMINDEXPOSITION(position pos, int lineCharacterIndex) → line
SCI_INDEXPOSITIONFROMLINE(line line, int lineCharacterIndex) → position
The document line of a particular character or code unit may be found by calling SCI_LINEFROMINDEXPOSITION with one of - SC_LINECHARACTERINDEX_UTF32(1) or SC_LINECHARACTERINDEX_UTF16(2). + SC_LINECHARACTERINDEX_UTF32 (1) or SC_LINECHARACTERINDEX_UTF16 (2). The inverse action, finds the starting position of a document line either in characters or code units from the document start by calling SCI_INDEXPOSITIONFROMLINE with the same lineCharacterIndex argument.

@@ -3722,7 +3728,7 @@ struct Sci_TextToFind {

SCI_SETCARETSTYLE(int caretStyle)
SCI_GETCARETSTYLE → int
The style of the caret can be set with SCI_SETCARETSTYLE. - There are separate styles for insert mode (lower 4-bits, CARETSTYLE_INS_MASK) and + There are separate styles for insert mode (lower 4-bits, CARETSTYLE_INS_MASK) and overtype mode (bit 4). @@ -4457,7 +4463,7 @@ struct Sci_TextToFind { SC_EFF_QUALITY_ANTIALIASED, SC_EFF_QUALITY_LCD_OPTIMIZED.

In case it is necessary to squeeze more options into this property, only a limited number of bits defined - by SC_EFF_QUALITY_MASK (0xf) will be used for quality.

+ by SC_EFF_QUALITY_MASK (0xF) will be used for quality.

SCI_SETCODEPAGE(int codePage)
SCI_GETCODEPAGE → int
@@ -4508,7 +4514,8 @@ struct Sci_TextToFind { Currently, there is experimental support for bidirectional text on Win32 using DirectWrite and on macOS using Cocoa. Only UTF-8 documents will show bidirectional behaviour and only in SC_BIDIRECTIONAL_L2R mode. Some features, such as virtual space may not work with - bidirectional text or may work only in some circumstances.

+ bidirectional text or may work only in some circumstances. + SC_BIDIRECTIONAL_R2L may be implemented in the future.

There are additional processing and storage costs to bidirectional text. As some applications may not want to pay the costs, bidirectional support must be explicitly enabled by calling SCI_SETBIDIRECTIONAL(SC_BIDIRECTIONAL_L2R) (1) which chooses left to right as the default direction or @@ -5169,7 +5176,7 @@ struct Sci_TextToFind { They may also be invisible when used to track pieces of content for the application as INDIC_HIDDEN.

The SCI_INDIC* messages allow you to get and set the visual appearance of the - indicators. They all use an indicator argument in the range 0 to INDICATOR_MAX(35) + indicators. They all use an indicator argument in the range 0 to INDICATOR_MAX(35) to set the indicator to style. To prevent interference the set of indicators is divided up into a range for use by lexers (0..7) a range for use by containers (8=INDICATOR_CONTAINER .. 31=INDICATOR_IME-1) @@ -5525,7 +5532,8 @@ struct Sci_TextToFind { These messages set and get the flags associated with an indicator. There is currently one flag defined, SC_INDICFLAG_VALUEFORE: when this flag is set the colour used by the indicator is not from the indicator's fore setting but instead from the value of the indicator at - that point in the file. This allows many colours to be displayed for a single indicator. The value is an SC_INDICFLAG_NONE is the default. + This allows many colours to be displayed for a single indicator. The value is an RGB integer colour that has been ored with SC_INDICVALUEBIT(0x1000000) when calling SCI_SETINDICATORVALUE. To find the colour from the value, and the value with SC_INDICVALUEMASK(0xFFFFFF). @@ -6941,8 +6949,9 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ allows it to be treated slightly different then its level may indicate. For example, blank lines should generally not be fold points and will be considered part of the preceding section even though they may have a lesser fold level. - SC_FOLDLEVELHEADERFLAG indicates that - the line is a header (fold point).

+ SC_FOLDLEVELHEADERFLAG indicates that the line is a header (fold point). + SC_FOLDLEVELNONE is a default level that may occur before folding. +

Use SCI_GETFOLDLEVEL(line) & SC_FOLDLEVELNUMBERMASK to get the fold level of a line. Likewise, use SCI_GETFOLDLEVEL(line) & SC_FOLDLEVEL*FLAG to get the @@ -6971,6 +6980,12 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){

+ + + + + + @@ -6980,44 +6995,38 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ - - - - - - - - @@ -7173,6 +7182,12 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ + + + + + + @@ -8310,6 +8325,16 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber); + + + + + + + + + + diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 4d8d0dcda..b157ee805 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -581,6 +581,10 @@ Released 23 April 2021.
  • + A more type-safe binding of Scintilla's API that can be used from C++ is implemented in the + ScintillaTypes.h, ScintillaMessages.h, and ScintillaStructures.h headers. +
  • +
  • Change the way that selections and carets are drawn to use the element APIs. The selection background colour may default to use platform APIs to discover global or user settings and may change in response to those settings changing. -- cgit v1.2.3
  • SC_FOLDFLAG_NONE0Default value.
    1
    SC_FOLDFLAG_LINEBEFORE_EXPANDED 2Draw above if expanded
    SC_FOLDFLAG_LINEBEFORE_CONTRACTED 4Draw above if not expanded
    SC_FOLDFLAG_LINEAFTER_EXPANDED 8Draw below if expanded
    SC_FOLDFLAG_LINEAFTER_CONTRACTED 16Draw below if not expanded
    SC_FOLDFLAG_LEVELNUMBERS 64display hexadecimal fold levels in line margin to aid debugging of + Display hexadecimal fold levels in line margin to aid debugging of folding. The appearance of this feature may change in the future.
    SC_FOLDFLAG_LINESTATE 128display hexadecimal line state in line margin to aid debugging of lexing and folding. + Display hexadecimal line state in line margin to aid debugging of lexing and folding. May not be used at the same time as SC_FOLDFLAG_LEVELNUMBERS.
    SC_AUTOMATICFOLD_NONE0Value with no automatic behaviour.
    SC_AUTOMATICFOLD_SHOW 1
    SC_UPDATE_NONE0x00Value without any changes.
    SC_UPDATE_CONTENT