r5116 | eht16 | 2010-08-05 22:13:47 +0100 (Thu, 05 Aug 2010) | 3 lines
[geany-mirror.git] / scintilla / ViewStyle.h
blob22e365b02dcf958e99ce63cf24f72800b113638f
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 MarginStyle();
26 /**
28 class FontNames {
29 private:
30 char **names;
31 int size;
32 int max;
34 public:
35 FontNames();
36 ~FontNames();
37 void Clear();
38 const char *Save(const char *name);
41 enum IndentView {ivNone, ivReal, ivLookForward, ivLookBoth};
43 enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2};
45 /**
47 class ViewStyle {
48 public:
49 FontNames fontNames;
50 size_t stylesSize;
51 Style *styles;
52 LineMarker markers[MARKER_MAX + 1];
53 Indicator indicators[INDIC_MAX + 1];
54 int lineHeight;
55 unsigned int maxAscent;
56 unsigned int maxDescent;
57 unsigned int aveCharWidth;
58 unsigned int spaceWidth;
59 bool selforeset;
60 ColourPair selforeground;
61 ColourPair selAdditionalForeground;
62 bool selbackset;
63 ColourPair selbackground;
64 ColourPair selAdditionalBackground;
65 ColourPair selbackground2;
66 int selAlpha;
67 int selAdditionalAlpha;
68 bool selEOLFilled;
69 bool whitespaceForegroundSet;
70 ColourPair whitespaceForeground;
71 bool whitespaceBackgroundSet;
72 ColourPair whitespaceBackground;
73 ColourPair selbar;
74 ColourPair selbarlight;
75 bool foldmarginColourSet;
76 ColourPair foldmarginColour;
77 bool foldmarginHighlightColourSet;
78 ColourPair foldmarginHighlightColour;
79 bool hotspotForegroundSet;
80 ColourPair hotspotForeground;
81 bool hotspotBackgroundSet;
82 ColourPair hotspotBackground;
83 bool hotspotUnderline;
84 bool hotspotSingleLine;
85 /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
86 enum { margins=5 };
87 int leftMarginWidth; ///< Spacing margin on left of text
88 int rightMarginWidth; ///< Spacing margin on left of text
89 bool symbolMargin;
90 int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin
91 MarginStyle ms[margins];
92 int fixedColumnWidth;
93 int zoomLevel;
94 WhiteSpaceVisibility viewWhitespace;
95 int whitespaceSize;
96 IndentView viewIndentationGuides;
97 bool viewEOL;
98 bool showMarkedLines;
99 ColourPair caretcolour;
100 ColourPair additionalCaretColour;
101 bool showCaretLineBackground;
102 ColourPair caretLineBackground;
103 int caretLineAlpha;
104 ColourPair edgecolour;
105 int edgeState;
106 int caretStyle;
107 int caretWidth;
108 bool someStylesProtected;
109 int extraFontFlag;
110 int extraAscent;
111 int extraDescent;
112 int marginStyleOffset;
113 int annotationVisible;
114 int annotationStyleOffset;
116 ViewStyle();
117 ViewStyle(const ViewStyle &source);
118 ~ViewStyle();
119 void Init(size_t stylesSize_=64);
120 void RefreshColourPalette(Palette &pal, bool want);
121 void Refresh(Surface &surface);
122 void AllocStyles(size_t sizeNew);
123 void EnsureStyle(size_t index);
124 void ResetDefaultStyle();
125 void ClearStyles();
126 void SetStyleFontName(int styleIndex, const char *name);
127 bool ProtectionActive() const;
128 bool ValidStyle(size_t styleIndex) const;
131 #ifdef SCI_NAMESPACE
133 #endif
135 #endif