1 // Scintilla source code edit control
3 ** Store information on how the document is to be viewed.
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.
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
&);
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};
65 FontRealised
*frFirst
;
68 LineMarker markers
[MARKER_MAX
+ 1];
69 Indicator indicators
[INDIC_MAX
+ 1];
71 unsigned int maxAscent
;
72 unsigned int maxDescent
;
73 unsigned int aveCharWidth
;
74 unsigned int spaceWidth
;
76 ColourPair selforeground
;
77 ColourPair selAdditionalForeground
;
79 ColourPair selbackground
;
80 ColourPair selAdditionalBackground
;
81 ColourPair selbackground2
;
83 int selAdditionalAlpha
;
85 bool whitespaceForegroundSet
;
86 ColourPair whitespaceForeground
;
87 bool whitespaceBackgroundSet
;
88 ColourPair whitespaceBackground
;
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
103 int leftMarginWidth
; ///< Spacing margin on left of text
104 int rightMarginWidth
; ///< Spacing margin on left of text
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
;
110 WhiteSpaceVisibility viewWhitespace
;
112 IndentView viewIndentationGuides
;
114 bool showMarkedLines
;
115 ColourPair caretcolour
;
116 ColourPair additionalCaretColour
;
117 bool showCaretLineBackground
;
118 ColourPair caretLineBackground
;
120 ColourPair edgecolour
;
124 bool someStylesProtected
;
125 bool someStylesForceCase
;
129 int marginStyleOffset
;
130 int annotationVisible
;
131 int annotationStyleOffset
;
132 bool braceHighlightIndicatorSet
;
133 int braceHighlightIndicator
;
134 bool braceBadLightIndicatorSet
;
135 int braceBadLightIndicator
;
138 ViewStyle(const ViewStyle
&source
);
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();
148 void SetStyleFontName(int styleIndex
, const char *name
);
149 bool ProtectionActive() const;
150 bool ValidStyle(size_t styleIndex
) const;