updated Scintilla to 2.29
[TortoiseGit.git] / ext / scintilla / src / ViewStyle.h
blobfeaa9eb23a1a180e0d28d814653844cecd7006c8
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.
8 #ifndef VIEWSTYLE_H
9 #define VIEWSTYLE_H
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
15 /**
17 class MarginStyle {
18 public:
19 int style;
20 int width;
21 int mask;
22 bool sensitive;
23 int cursor;
24 MarginStyle();
27 /**
29 class FontNames {
30 private:
31 char **names;
32 int size;
33 int max;
35 public:
36 FontNames();
37 ~FontNames();
38 void Clear();
39 const char *Save(const char *name);
42 class FontRealised : public FontSpecification, public FontMeasurements {
43 // Private so FontRealised objects can not be copied
44 FontRealised(const FontRealised &);
45 FontRealised &operator=(const FontRealised &);
46 public:
47 Font font;
48 FontRealised *frNext;
49 FontRealised(const FontSpecification &fs);
50 virtual ~FontRealised();
51 void Realise(Surface &surface, int zoomLevel);
52 FontRealised *Find(const FontSpecification &fs);
53 void FindMaxAscentDescent(unsigned int &maxAscent, unsigned int &maxDescent);
56 enum IndentView {ivNone, ivReal, ivLookForward, ivLookBoth};
58 enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2};
60 /**
62 class ViewStyle {
63 public:
64 FontNames fontNames;
65 FontRealised *frFirst;
66 size_t stylesSize;
67 Style *styles;
68 LineMarker markers[MARKER_MAX + 1];
69 Indicator indicators[INDIC_MAX + 1];
70 int lineHeight;
71 unsigned int maxAscent;
72 unsigned int maxDescent;
73 unsigned int aveCharWidth;
74 unsigned int spaceWidth;
75 bool selforeset;
76 ColourPair selforeground;
77 ColourPair selAdditionalForeground;
78 bool selbackset;
79 ColourPair selbackground;
80 ColourPair selAdditionalBackground;
81 ColourPair selbackground2;
82 int selAlpha;
83 int selAdditionalAlpha;
84 bool selEOLFilled;
85 bool whitespaceForegroundSet;
86 ColourPair whitespaceForeground;
87 bool whitespaceBackgroundSet;
88 ColourPair whitespaceBackground;
89 ColourPair selbar;
90 ColourPair selbarlight;
91 bool foldmarginColourSet;
92 ColourPair foldmarginColour;
93 bool foldmarginHighlightColourSet;
94 ColourPair foldmarginHighlightColour;
95 bool hotspotForegroundSet;
96 ColourPair hotspotForeground;
97 bool hotspotBackgroundSet;
98 ColourPair hotspotBackground;
99 bool hotspotUnderline;
100 bool hotspotSingleLine;
101 /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
102 enum { margins=5 };
103 int leftMarginWidth; ///< Spacing margin on left of text
104 int rightMarginWidth; ///< Spacing margin on left of text
105 bool symbolMargin;
106 int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin
107 MarginStyle ms[margins];
108 int fixedColumnWidth;
109 int zoomLevel;
110 WhiteSpaceVisibility viewWhitespace;
111 int whitespaceSize;
112 IndentView viewIndentationGuides;
113 bool viewEOL;
114 bool showMarkedLines;
115 ColourPair caretcolour;
116 ColourPair additionalCaretColour;
117 bool showCaretLineBackground;
118 ColourPair caretLineBackground;
119 int caretLineAlpha;
120 ColourPair edgecolour;
121 int edgeState;
122 int caretStyle;
123 int caretWidth;
124 bool someStylesProtected;
125 bool someStylesForceCase;
126 int extraFontFlag;
127 int extraAscent;
128 int extraDescent;
129 int marginStyleOffset;
130 int annotationVisible;
131 int annotationStyleOffset;
132 bool braceHighlightIndicatorSet;
133 int braceHighlightIndicator;
134 bool braceBadLightIndicatorSet;
135 int braceBadLightIndicator;
137 ViewStyle();
138 ViewStyle(const ViewStyle &source);
139 ~ViewStyle();
140 void Init(size_t stylesSize_=64);
141 void CreateFont(const FontSpecification &fs);
142 void RefreshColourPalette(Palette &pal, bool want);
143 void Refresh(Surface &surface);
144 void AllocStyles(size_t sizeNew);
145 void EnsureStyle(size_t index);
146 void ResetDefaultStyle();
147 void ClearStyles();
148 void SetStyleFontName(int styleIndex, const char *name);
149 bool ProtectionActive() const;
150 bool ValidStyle(size_t styleIndex) const;
153 #ifdef SCI_NAMESPACE
155 #endif
157 #endif