]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/ViewStyle.h
887170eaac1ee17685c9a17dc174965f9a6c4db6
[wxWidgets.git] / src / stc / scintilla / src / ViewStyle.h
1 // Scintilla source code edit control
2 /** @file ViewStyle.h
3 ** Store information on how the document is to be viewed.
4 **/
5 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
7
8 #ifndef VIEWSTYLE_H
9 #define VIEWSTYLE_H
10
11 /**
12 */
13 class MarginStyle {
14 public:
15 bool symbol;
16 int width;
17 int mask;
18 bool sensitive;
19 MarginStyle();
20 };
21
22 /**
23 */
24 class FontNames {
25 private:
26 char *names[STYLE_MAX + 1];
27 int max;
28
29 public:
30 FontNames();
31 ~FontNames();
32 void Clear();
33 const char *Save(const char *name);
34 };
35
36 enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2};
37
38 /**
39 */
40 class ViewStyle {
41 public:
42 FontNames fontNames;
43 Style styles[STYLE_MAX + 1];
44 LineMarker markers[MARKER_MAX + 1];
45 Indicator indicators[INDIC_MAX + 1];
46 int lineHeight;
47 unsigned int maxAscent;
48 unsigned int maxDescent;
49 unsigned int aveCharWidth;
50 unsigned int spaceWidth;
51 bool selforeset;
52 ColourPair selforeground;
53 bool selbackset;
54 ColourPair selbackground;
55 ColourPair selbackground2;
56 bool whitespaceForegroundSet;
57 ColourPair whitespaceForeground;
58 bool whitespaceBackgroundSet;
59 ColourPair whitespaceBackground;
60 ColourPair selbar;
61 ColourPair selbarlight;
62 /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
63 enum { margins=3 };
64 int leftMarginWidth; ///< Spacing margin on left of text
65 int rightMarginWidth; ///< Spacing margin on left of text
66 bool symbolMargin;
67 int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin
68 MarginStyle ms[margins];
69 int fixedColumnWidth;
70 int zoomLevel;
71 WhiteSpaceVisibility viewWhitespace;
72 bool viewIndentationGuides;
73 bool viewEOL;
74 bool showMarkedLines;
75 ColourPair caretcolour;
76 bool showCaretLineBackground;
77 ColourPair caretLineBackground;
78 ColourPair edgecolour;
79 int edgeState;
80 int caretWidth;
81
82 ViewStyle();
83 ViewStyle(const ViewStyle &source);
84 ~ViewStyle();
85 void Init();
86 void RefreshColourPalette(Palette &pal, bool want);
87 void Refresh(Surface &surface);
88 void ResetDefaultStyle();
89 void ClearStyles();
90 void SetStyleFontName(int styleIndex, const char *name);
91 };
92
93 #endif