]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/ContractionState.h
Don't call busy cursor when creating a message
[wxWidgets.git] / src / stc / scintilla / src / ContractionState.h
1 // Scintilla source code edit control
2 // ContractionState.h - manages visibility of lines for folding
3 // Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
4 // The License.txt file describes the conditions under which this software may be distributed.
5
6 #ifndef CONTRACTIONSTATE_H
7 #define CONTRACTIONSTATE_H
8
9 class OneLine {
10 public:
11 int displayLine; // position within set of visible lines
12 int docLine; // inverse of displayLine
13 bool visible;
14 bool expanded;
15
16 OneLine();
17 virtual ~OneLine() {}
18 };
19
20 class ContractionState {
21 void Grow(int sizeNew);
22 enum { growSize = 4000 };
23 int linesInDoc;
24 int linesInDisplay;
25 mutable OneLine *lines;
26 int size;
27 mutable bool valid;
28 void MakeValid() const;
29 public:
30 ContractionState();
31 virtual ~ContractionState();
32
33 void Clear();
34
35 int LinesInDoc() const;
36 int LinesDisplayed() const;
37 int DisplayFromDoc(int lineDoc) const;
38 int DocFromDisplay(int lineDisplay) const;
39
40 void InsertLines(int lineDoc, int lineCount);
41 void DeleteLines(int lineDoc, int lineCount);
42
43 bool GetVisible(int lineDoc) const;
44 bool SetVisible(int lineDocStart, int lineDocEnd, bool visible);
45
46 bool GetExpanded(int lineDoc) const;
47 bool SetExpanded(int lineDoc, bool expanded);
48
49 void ShowAll();
50 };
51
52 #endif