diff options
author | nyamatongwe <unknown> | 2007-06-02 05:18:13 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2007-06-02 05:18:13 +0000 |
commit | 284a7cde23d26ccc5c5b75aaa9c1e69e659a4adc (patch) | |
tree | 22d32a8aeccfda9902240bfca1ffad692136f45c /src/Editor.h | |
parent | b78f4e0f1eeb340c23b3c9df896da7405c2e0217 (diff) | |
download | scintilla-mirror-284a7cde23d26ccc5c5b75aaa9c1e69e659a4adc.tar.gz |
Addition of PositionCache module which adds cacing of string
to position information and segments long pieces of text so they
can be handled more efficiently.
Diffstat (limited to 'src/Editor.h')
-rw-r--r-- | src/Editor.h | 87 |
1 files changed, 1 insertions, 86 deletions
diff --git a/src/Editor.h b/src/Editor.h index a31777611..213b0e361 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -46,92 +46,6 @@ public: }; /** - */ -class LineLayout { -private: - friend class LineLayoutCache; - int *lineStarts; - int lenLineStarts; - /// Drawing is only performed for @a maxLineLength characters on each line. - int lineNumber; - bool inCache; -public: - enum { wrapWidthInfinite = 0x7ffffff }; - int maxLineLength; - int numCharsInLine; - enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity; - int xHighlightGuide; - bool highlightColumn; - int selStart; - int selEnd; - bool containsCaret; - int edgeColumn; - char *chars; - unsigned char *styles; - int styleBitsSet; - char *indicators; - int *positions; - char bracePreviousStyles[2]; - - // Hotspot support - int hsStart; - int hsEnd; - - // Wrapped line support - int widthLine; - int lines; - - LineLayout(int maxLineLength_); - virtual ~LineLayout(); - void Resize(int maxLineLength_); - void Free(); - void Invalidate(validLevel validity_); - int LineStart(int line) { - if (line <= 0) { - return 0; - } else if ((line >= lines) || !lineStarts) { - return numCharsInLine; - } else { - return lineStarts[line]; - } - } - void SetLineStart(int line, int start); - void SetBracesHighlight(Range rangeLine, Position braces[], - char bracesMatchStyle, int xHighlight); - void RestoreBracesHighlight(Range rangeLine, Position braces[]); -}; - -/** - */ -class LineLayoutCache { - int level; - int length; - int size; - LineLayout **cache; - bool allInvalidated; - int styleClock; - int useCount; - void Allocate(int length_); - void AllocateForLevel(int linesOnScreen, int linesInDoc); -public: - LineLayoutCache(); - virtual ~LineLayoutCache(); - void Deallocate(); - enum { - llcNone=SC_CACHE_NONE, - llcCaret=SC_CACHE_CARET, - llcPage=SC_CACHE_PAGE, - llcDocument=SC_CACHE_DOCUMENT - }; - void Invalidate(LineLayout::validLevel validity_); - void SetLevel(int level_); - int GetLevel() { return level; } - LineLayout *Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_, - int linesOnScreen, int linesInDoc); - void Dispose(LineLayout *ll); -}; - -/** * Hold a piece of text selected for copying or dragging. * The text is expected to hold a terminating '\0' and this is counted in len. */ @@ -233,6 +147,7 @@ protected: // ScintillaBase subclass needs access to much of Editor Surface *pixmapIndentGuideHighlight; LineLayoutCache llc; + PositionCache posCache; KeyMap kmap; |