4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
23 /// Standard Sizes (mode styles)
37 // This is the part common to MetricsInfo and PainterInfo
43 MetricsBase(BufferView * bv, LyXFont const & font, int textwidth);
49 /// current math style (display/text/script/..)
51 /// name of current font - mathed specific
53 /// This is the width available in pixels
59 // This contains a MetricsBase and information that's only relevant during
60 // the first phase of the two-phase draw
66 MetricsInfo(BufferView * bv, LyXFont const & font, int textwidth);
74 // This contains a MetricsBase and information that's only relevant during
75 // the second phase of the two-phase draw
79 PainterInfo(BufferView * bv, Painter & pain);
81 void draw(int x, int y, char c);
90 struct TextMetricsInfo {};
93 // Generic base for temporarily changing things.
94 // The original state gets restored when the Changer is destructed.
96 template <class Struct, class Temp = Struct>
99 Changer(Struct & orig) : orig_(orig) {}
109 // temporarily change some aspect of a font
110 struct FontChanger : public Changer<LyXFont> {
112 FontChanger(LyXFont & orig, char const * font);
118 // temporarily change a full font
119 struct FontSetChanger : public Changer<MetricsBase> {
121 FontSetChanger(MetricsBase & mb, char const * font);
127 // temporarily change the style
128 struct StyleChanger : public Changer<MetricsBase> {
130 StyleChanger(MetricsBase & mb, Styles style);
136 // temporarily change the style to script style
137 struct ScriptChanger : public StyleChanger {
139 ScriptChanger(MetricsBase & mb);
143 // temporarily change the style suitable for use in fractions
144 struct FracChanger : public StyleChanger {
146 FracChanger(MetricsBase & mb);
150 // temporarily change the style suitable for use in tabulars and arrays
151 struct ArrayChanger : public StyleChanger {
153 ArrayChanger(MetricsBase & mb);
158 // temporarily change the shape of a font
159 struct ShapeChanger : public Changer<LyXFont, LyXFont::FONT_SHAPE> {
161 ShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape);
167 // temporarily change the available text width
168 struct WidthChanger : public Changer<MetricsBase>
171 WidthChanger(MetricsBase & mb, int width);
177 // temporarily change the used color
178 struct ColorChanger : public Changer<LyXFont, std::string> {
180 ColorChanger(LyXFont & font, std::string const & color);