From 6bddf57deb97b522c7b8e0293fcd15c95a2d9823 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 19 Jan 2013 10:43:41 +1100 Subject: Add methods for Unicode line ends and substyles to IDocument and ILexer producing IDocumentWithLineEnd and ILexerWithSubStyles. --- doc/ScintillaDoc.html | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index c39075c75..1e5352506 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -79,7 +79,7 @@

Scintilla Documentation

-

Last edited 3/January/2013 NH

+

Last edited 18/January/2013 NH

There is an overview of the internal design of Scintilla.
@@ -5899,6 +5899,27 @@ needs to be folded as this allowed fixing up the last line from the previous fol The new approach allows the lexer to decide whether to backtrack or to handle this more efficiently.

+

ILexerWithSubStyles

+ +

+To allow lexers to report which line ends they support, and to support substyles, +Ilexer is extended to ILexerWithSubStyles. +

+ +
+class ILexerWithSubStyles : public ILexer {
+public:
+        virtual int SCI_METHOD LineEndTypesSupported() = 0;
+        virtual int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) = 0;
+        virtual int SCI_METHOD SubStylesStart(int styleBase) = 0;
+        virtual int SCI_METHOD SubStylesLength(int styleBase) = 0;
+        virtual void SCI_METHOD FreeSubStyles() = 0;
+        virtual void SCI_METHOD SetIdentifiers(int style, const char *identifiers) = 0;
+        virtual int SCI_METHOD DistanceToSecondaryStyles() = 0;
+        virtual const char * SCI_METHOD GetSubStyleBases() = 0;
+};
+
+

IDocument

@@ -6047,7 +6068,22 @@ exceptions. Exceptions should not be thrown over build boundaries as the two sides may be built with different compilers or incompatible exception options.

-

The ILexer and IDocument interfaces may be +

IDocumentWithLineEnd

+ +

+To allow lexers to determine the end position of a line and thus more easily support Unicode line ends +IDocument is extended to IDocumentWithLineEnd. +

+ +
+class IDocumentWithLineEnd : public IDocument {
+public:
+        virtual int SCI_METHOD LineEnd(int line) const = 0;
+};
+
+ +

The ILexer, ILexerWithSubStyles, IDocument, and +IDocumentWithLineEnd interfaces may be expanded in the future with extended versions (ILexer2...). The Version method indicates which interface is implemented and thus which methods may be called.

-- cgit v1.2.3