diff options
author | nyamatongwe <unknown> | 2000-03-08 01:38:23 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-03-08 01:38:23 +0000 |
commit | 7fbd8e2a34d2f5084ce26ad95d7c70ae4de6a233 (patch) | |
tree | 83eec8af8ccee95c3f5a3f4185c1ae2cda3cd4db /src/ContractionState.h | |
parent | 8eba2a95b6aa25489c28eabfcd54e0389de78899 (diff) | |
download | scintilla-mirror-7fbd8e2a34d2f5084ce26ad95d7c70ae4de6a233.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 |