From 7d3a087d2e149d95e1e267fd6191dd0312fe3c0a Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 19 Jan 2013 11:10:41 +1100 Subject: Implement APIs for Unicode line ends and substyles and expose to message interface. Expose IDocumentWithLineEnd interface on Document. --- doc/ScintillaDoc.html | 62 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 1e5352506..436a931f2 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -2176,17 +2176,29 @@ struct Sci_TextToFind {

Line endings

-

Scintilla can interpret any of the three major line end conventions, Macintosh (\r), Unix - (\n) and CP/M / DOS / Windows (\r\n). When the user presses the Enter key, one of these line +

Scintilla can handle the major line end conventions and, depending on settings and + the current lexer also support additional Unicode line ends.

+ +

Scintilla can interpret any of the Macintosh (\r), Unix (\n) and Windows (\r\n) + line ends. + When the user presses the Enter key, one of these line end strings is inserted into the buffer. The default is \r\n in Windows and \n in Unix, but this can be changed with the SCI_SETEOLMODE message. You can also convert the entire document to one of these line endings with SCI_CONVERTEOLS. Finally, you can choose to display the line endings with SCI_SETVIEWEOL.

+ +

For the UTF-8 encoding, three additional Unicode line ends, + Next Line (NEL=U+0085), Line Separator (LS=U+2028), and Paragraph Separator (PS=U+2029) + may optionally be interpreted when Unicode line ends is turned on and the current lexer also supports + Unicode line ends.

+ SCI_SETEOLMODE(int eolMode)
SCI_GETEOLMODE
SCI_CONVERTEOLS(int eolMode)
SCI_SETVIEWEOL(bool visible)
SCI_GETVIEWEOL
+ + SCI_GETLINEENDTYPESSUPPORTED

SCI_SETEOLMODE(int eolMode)
@@ -2209,6 +2221,12 @@ struct Sci_TextToFind { (CR), (LF), or (CR)(LF). SCI_GETVIEWEOL returns the current state.

+

SCI_GETLINEENDTYPESSUPPORTED
+ SCI_GETLINEENDTYPESSUPPORTED reports the different types of line ends supported + by the current lexer. This is a bit set although there is currently only a single choice + with either SC_LINE_END_TYPE_DEFAULT (0) or SC_LINE_END_TYPE_UNICODE (1). + These values are also used by the other messages concerned with Unicode line ends.

+

Styling

The styling messages allow you to assign styles to text. The standard Scintilla settings @@ -5638,8 +5656,16 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions)
SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)
- SCI_GETSTYLEBITSNEEDED -
+ SCI_GETSTYLEBITSNEEDED
+ + SCI_GETSUBSTYLEBASES(<unused>, char *styles)
+ SCI_DISTANCETOSECONDARYSTYLES
+ SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles)
+ SCI_FREESUBSTYLES
+ SCI_GETSUBSTYLESSTART(int styleBase)
+ SCI_GETSUBSTYLESLENGTH(int styleBase)
+ SCI_SETIDENTIFIERS(int style, const char *identifiers)
+

SCI_SETLEXER(int lexer)
@@ -5785,6 +5811,34 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ to SCI_SETSTYLEBITS.

+

Substyles

+

Lexers may support several different sublanguages and each sublanguage may want to style some number of + sets of identifiers (or similar lexemes such as documentation keywords) uniquely. Preallocating a large number for each + purpose would exhaust the number of allowed styles quickly. + This is alleviated by substyles which allow the application to determine how many sets of identifiers to allocate for + each purpose. + Lexers have to explicitly support this feature by implementing the methods in ILexerWithSubStyles.

+ +

SCI_GETSUBSTYLEBASES(<unused>, char *styles)
+ Fill styles with a byte for each style that can be split into substyles.

+ +

SCI_DISTANCETOSECONDARYSTYLES
+ Returns the distance between a primary style and its corresponding secondary style.

+ +

SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles)
+ Allocate some number of substyles for a particular base style returning the first substyle number allocated. + Substyles are allocated contiguously.

+ +

SCI_FREESUBSTYLES
+ Free all allocated substyles.

+ +

SCI_GETSUBSTYLESSTART(int styleBase)
+ SCI_GETSUBSTYLESLENGTH(int styleBase)
+ Return the start and length of the substyles allocated for a base style.

+ +

SCI_SETIDENTIFIERS(int style, const char *identifiers)
+ Similar to SCI_SETKEYWORDS but for substyles.

+

Lexer Objects

Lexers are programmed as objects that implement the ILexer interface and that interact -- cgit v1.2.3