diff options
Diffstat (limited to 'include/Accessor.h')
| -rw-r--r-- | include/Accessor.h | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/include/Accessor.h b/include/Accessor.h index e31a8de6d..031ad7a91 100644 --- a/include/Accessor.h +++ b/include/Accessor.h @@ -3,6 +3,8 @@  // Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>  // The License.txt file describes the conditions under which this software may be distributed. +enum { wsSpace = 1, wsTab = 2, wsSpaceTab = 4, wsInconsistent=8}; +  class Accessor {  protected:  	// bufferSize is a trade off between time taken to copy the characters and SendMessage overhead @@ -15,12 +17,15 @@ protected:  	int endPos;  	int lenDoc;  	int offset;	// Optional but including an offset makes GCC generate better code  +	int codePage;	 +	bool InternalIsLeadByte(char ch);  	void Fill(int position);  public:  	Accessor(WindowID id_, PropSet &props_, int offset_=0) :   			id(id_), props(props_), startPos(0x7FFFFFFF), endPos(0),  -			lenDoc(-1), offset(offset_) { +			lenDoc(-1), offset(offset_), codePage(0) {  	} +	void SetCodePage(int codePage_) { codePage = codePage_; }  	char operator[](int position) {  		position += offset;  		if (position < startPos || position >= endPos) { @@ -40,6 +45,9 @@ public:  		}  		return buf[position - startPos];  	} +	bool IsLeadByte(char ch) { +		return codePage && InternalIsLeadByte(ch); +	}  	char StyleAt(int position);  	int GetLine(int position);  	int LineStart(int line); @@ -54,6 +62,10 @@ public:  	PropSet &GetPropSet() { return props; }  }; +class StylingContext; + +typedef bool (*PFNIsCommentLeader)(StylingContext &styler, int pos, int len); +  class StylingContext : public Accessor {  	char styleBuf[bufferSize];  	int validLen; @@ -71,5 +83,6 @@ public:  	int GetLine(int position);  	void SetLevel(int line, int level);  	void Flush(); +	int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);  }; | 
