]>
Commit | Line | Data |
---|---|---|
9ce192d4 RD |
1 | // Scintilla source code edit control |
2 | // ViewStyle.h - store information on how the document is to be viewed | |
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 VIEWSTYLE_H | |
7 | #define VIEWSTYLE_H | |
8 | ||
9 | class MarginStyle { | |
10 | public: | |
11 | bool symbol; | |
12 | int width; | |
13 | int mask; | |
14 | bool sensitive; | |
15 | MarginStyle(); | |
16 | }; | |
17 | ||
f6bcfd97 BP |
18 | class FontNames { |
19 | private: | |
20 | char *names[STYLE_MAX + 1]; | |
21 | int max; | |
22 | public: | |
23 | FontNames(); | |
24 | ~FontNames(); | |
25 | void Clear(); | |
26 | const char *Save(const char *name); | |
27 | }; | |
28 | ||
d134f170 | 29 | enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2}; |
9ce192d4 RD |
30 | class ViewStyle { |
31 | public: | |
f6bcfd97 | 32 | FontNames fontNames; |
9ce192d4 RD |
33 | Style styles[STYLE_MAX + 1]; |
34 | LineMarker markers[MARKER_MAX + 1]; | |
35 | Indicator indicators[INDIC_MAX + 1]; | |
36 | int lineHeight; | |
37 | unsigned int maxAscent; | |
38 | unsigned int maxDescent; | |
39 | unsigned int aveCharWidth; | |
40 | unsigned int spaceWidth; | |
41 | bool selforeset; | |
42 | ColourPair selforeground; | |
43 | bool selbackset; | |
44 | ColourPair selbackground; | |
d134f170 | 45 | ColourPair selbackground2; |
9ce192d4 RD |
46 | ColourPair selbar; |
47 | ColourPair selbarlight; | |
48 | // Margins are ordered: Line Numbers, Selection Margin, Spacing Margin | |
49 | int leftMarginWidth; // Spacing margin on left of text | |
50 | int rightMarginWidth; // Spacing margin on left of text | |
51 | enum { margins=3 }; | |
52 | bool symbolMargin; | |
53 | int maskInLine; // Mask for markers to be put into text because there is nowhere for them to go in margin | |
54 | MarginStyle ms[margins]; | |
55 | int fixedColumnWidth; | |
56 | int zoomLevel; | |
d134f170 RD |
57 | WhiteSpaceVisibility viewWhitespace; |
58 | bool viewIndentationGuides; | |
9ce192d4 RD |
59 | bool viewEOL; |
60 | bool showMarkedLines; | |
61 | ColourPair caretcolour; | |
62 | ColourPair edgecolour; | |
d134f170 | 63 | int edgeState; |
9ce192d4 RD |
64 | |
65 | ViewStyle(); | |
66 | ViewStyle(const ViewStyle &source); | |
67 | ~ViewStyle(); | |
68 | void Init(); | |
69 | void RefreshColourPalette(Palette &pal, bool want); | |
70 | void Refresh(Surface &surface); | |
71 | void ResetDefaultStyle(); | |
72 | void ClearStyles(); | |
f6bcfd97 | 73 | void SetStyleFontName(int styleIndex, const char *name); |
9ce192d4 RD |
74 | }; |
75 | ||
76 | #endif |