Move document encoding conversion with BOM support to encodings.[ch]
[geany-mirror.git] / scintilla / src / ViewStyle.h
blobcd6dc1a28b5e13c597ec82b916709db87bbbcb4e
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 bool someStylesForceCase;
110 int extraFontFlag;
111 int extraAscent;
112 int extraDescent;
113 int marginStyleOffset;
114 int annotationVisible;
115 int annotationStyleOffset;
117 ViewStyle();
118 ViewStyle(const ViewStyle &source);
119 ~ViewStyle();
120 void Init(size_t stylesSize_=64);
121 void RefreshColourPalette(Palette &pal, bool want);
122 void Refresh(Surface &surface);
123 void AllocStyles(size_t sizeNew);
124 void EnsureStyle(size_t index);
125 void ResetDefaultStyle();
126 void ClearStyles();
127 void SetStyleFontName(int styleIndex, const char *name);
128 bool ProtectionActive() const;
129 bool ValidStyle(size_t styleIndex) const;
132 #ifdef SCI_NAMESPACE
134 #endif
136 #endif