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 explicit PainterInfo(BufferView * bv);
81 void draw(int x, int y, char c);
87 /// width of current item
92 struct TextMetricsInfo {};
95 // Generic base for temporarily changing things.
96 // The original state gets restored when the Changer is destructed.
98 template <class Struct, class Temp = Struct>
101 Changer(Struct & orig) : orig_(orig) {}
111 // temporarily change some aspect of a font
112 struct FontChanger : public Changer<LyXFont> {
114 FontChanger(LyXFont & orig, char const * font);
120 // temporarily change a full font
121 struct FontSetChanger : public Changer<MetricsBase> {
123 FontSetChanger(MetricsBase & mb, char const * font);
129 // temporarily change the style
130 struct StyleChanger : public Changer<MetricsBase> {
132 StyleChanger(MetricsBase & mb, Styles style);
138 // temporarily change the style to script style
139 struct ScriptChanger : public StyleChanger {
141 ScriptChanger(MetricsBase & mb);
145 // temporarily change the style suitable for use in fractions
146 struct FracChanger : public StyleChanger {
148 FracChanger(MetricsBase & mb);
152 // temporarily change the style suitable for use in tabulars and arrays
153 struct ArrayChanger : public StyleChanger {
155 ArrayChanger(MetricsBase & mb);
160 // temporarily change the shape of a font
161 struct ShapeChanger : public Changer<LyXFont, LyXFont::FONT_SHAPE> {
163 ShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape);
169 // temporarily change the available text width
170 struct WidthChanger : public Changer<MetricsBase>
173 WidthChanger(MetricsBase & mb, int width);
179 // temporarily change the used color
180 struct ColorChanger : public Changer<LyXFont, std::string> {
182 ColorChanger(LyXFont & font, std::string const & color);