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
, int technology
);
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 int largestMarkerHeight
;
70 Indicator indicators
[INDIC_MAX
+ 1];
73 unsigned int maxAscent
;
74 unsigned int maxDescent
;
75 XYPOSITION aveCharWidth
;
76 XYPOSITION spaceWidth
;
78 ColourDesired selforeground
;
79 ColourDesired selAdditionalForeground
;
81 ColourDesired selbackground
;
82 ColourDesired selAdditionalBackground
;
83 ColourDesired selbackground2
;
85 int selAdditionalAlpha
;
87 bool whitespaceForegroundSet
;
88 ColourDesired whitespaceForeground
;
89 bool whitespaceBackgroundSet
;
90 ColourDesired whitespaceBackground
;
92 ColourDesired selbarlight
;
93 bool foldmarginColourSet
;
94 ColourDesired foldmarginColour
;
95 bool foldmarginHighlightColourSet
;
96 ColourDesired foldmarginHighlightColour
;
97 bool hotspotForegroundSet
;
98 ColourDesired hotspotForeground
;
99 bool hotspotBackgroundSet
;
100 ColourDesired hotspotBackground
;
101 bool hotspotUnderline
;
102 bool hotspotSingleLine
;
103 /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
105 int leftMarginWidth
; ///< Spacing margin on left of text
106 int rightMarginWidth
; ///< Spacing margin on right of text
107 int maskInLine
; ///< Mask for markers to be put into text because there is nowhere for them to go in margin
108 MarginStyle ms
[margins
];
109 int fixedColumnWidth
;
111 WhiteSpaceVisibility viewWhitespace
;
113 IndentView viewIndentationGuides
;
115 ColourDesired caretcolour
;
116 ColourDesired additionalCaretColour
;
117 bool showCaretLineBackground
;
118 ColourDesired caretLineBackground
;
120 ColourDesired 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 Refresh(Surface
&surface
);
143 void AllocStyles(size_t sizeNew
);
144 void EnsureStyle(size_t index
);
145 void ResetDefaultStyle();
147 void SetStyleFontName(int styleIndex
, const char *name
);
148 bool ProtectionActive() const;
149 bool ValidStyle(size_t styleIndex
) const;
150 void CalcLargestMarkerHeight();