]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/Style.h
wxRTC: save and load the 'shown' status in case there's a situation where layout...
[wxWidgets.git] / src / stc / scintilla / src / Style.h
1 // Scintilla source code edit control
2 /** @file Style.h
3 ** Defines the font and colour style for a class of text.
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.
7
8 #ifndef STYLE_H
9 #define STYLE_H
10
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
14
15 struct FontSpecification {
16 const char *fontName;
17 int weight;
18 bool italic;
19 int size;
20 int characterSet;
21 int extraFontFlag;
22 FontSpecification() :
23 fontName(0),
24 weight(SC_WEIGHT_NORMAL),
25 italic(false),
26 size(10 * SC_FONT_SIZE_MULTIPLIER),
27 characterSet(0),
28 extraFontFlag(0) {
29 }
30 bool EqualTo(const FontSpecification &other) const;
31 };
32
33 // Just like Font but only has a copy of the FontID so should not delete it
34 class FontAlias : public Font {
35 // Private so FontAlias objects can not be copied
36 FontAlias(const FontAlias &);
37 FontAlias &operator=(const FontAlias &);
38 public:
39 FontAlias();
40 virtual ~FontAlias();
41 void MakeAlias(Font &fontOrigin);
42 void ClearFont();
43 };
44
45 struct FontMeasurements {
46 unsigned int ascent;
47 unsigned int descent;
48 XYPOSITION aveCharWidth;
49 XYPOSITION spaceWidth;
50 int sizeZoomed;
51 FontMeasurements();
52 void Clear();
53 };
54
55 /**
56 */
57 class Style : public FontSpecification, public FontMeasurements {
58 public:
59 ColourDesired fore;
60 ColourDesired back;
61 bool eolFilled;
62 bool underline;
63 enum ecaseForced {caseMixed, caseUpper, caseLower};
64 ecaseForced caseForce;
65 bool visible;
66 bool changeable;
67 bool hotspot;
68
69 FontAlias font;
70
71 Style();
72 Style(const Style &source);
73 ~Style();
74 Style &operator=(const Style &source);
75 void Clear(ColourDesired fore_, ColourDesired back_,
76 int size_,
77 const char *fontName_, int characterSet_,
78 int weight_, bool italic_, bool eolFilled_,
79 bool underline_, ecaseForced caseForce_,
80 bool visible_, bool changeable_, bool hotspot_);
81 void ClearTo(const Style &source);
82 void Copy(Font &font_, const FontMeasurements &fm_);
83 bool IsProtected() const { return !(changeable && visible);}
84 };
85
86 #ifdef SCI_NAMESPACE
87 }
88 #endif
89
90 #endif