diff options
author | nyamatongwe <devnull@localhost> | 2000-03-08 01:38:23 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-03-08 01:38:23 +0000 |
commit | 25019a2eed18227eea1db18f6d52d4c5c44a2283 (patch) | |
tree | 83eec8af8ccee95c3f5a3f4185c1ae2cda3cd4db /src/ContractionState.h | |
parent | bf3d80d54d696ad123f9415dda1c6fe62c7a20cc (diff) | |
download | scintilla-mirror-25019a2eed18227eea1db18f6d52d4c5c44a2283.tar.gz |
Initial revision
Diffstat (limited to 'src/ContractionState.h')
-rw-r--r-- | src/ContractionState.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/ContractionState.h b/src/ContractionState.h new file mode 100644 index 000000000..9e17a7693 --- /dev/null +++ b/src/ContractionState.h @@ -0,0 +1,50 @@ +// Scintilla source code edit control +// ContractionState.h - manages visibility of lines for folding +// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org> +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef CONTRACTIONSTATE_H +#define CONTRACTIONSTATE_H + +class OneLine { +public: + int displayLine; // position within set of visible lines + int docLine; // inverse of displayLine + bool visible; + bool expanded; + + OneLine(); + virtual ~OneLine() {} +}; + +class ContractionState { + void Grow(int sizeNew); + enum { growSize = 4000 }; + int linesInDoc; + int linesInDisplay; + mutable OneLine *lines; + int size; + mutable bool valid; + void MakeValid() const; +public: + ContractionState(); + virtual ~ContractionState(); + + void Clear(); + + int LinesInDoc() const; + int LinesDisplayed() const; + int DisplayFromDoc(int lineDoc) const; + int DocFromDisplay(int lineDisplay) const; + + void InsertLines(int lineDoc, int lineCount); + void DeleteLines(int lineDoc, int lineCount); + + bool GetVisible(int lineDoc) const; + bool SetVisible(int lineDocStart, int lineDocEnd, bool visible); + + bool GetExpanded(int lineDoc) const; + bool SetExpanded(int lineDoc, bool expanded); +}; + +#endif |