]> git.lyx.org Git - lyx.git/blob - src/mathed/math_specialcharinset.C
Painter and scrollbar API patches
[lyx.git] / src / mathed / math_specialcharinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_specialcharinset.h"
6 #include "math_mathmlstream.h"
7 #include "math_support.h"
8
9
10 MathSpecialCharInset::MathSpecialCharInset(char c)
11         : char_(c)
12 {}
13
14
15 MathInset * MathSpecialCharInset::clone() const
16 {
17         return new MathSpecialCharInset(*this);
18 }
19
20
21 void MathSpecialCharInset::metrics(MathMetricsInfo & mi) const
22 {
23         MathShapeChanger dummy(mi.base.font, LyXFont::ITALIC_SHAPE);
24         mathed_char_dim(mi.base.font, char_, ascent_, descent_, width_);
25 }
26
27
28 void MathSpecialCharInset::draw(MathPainterInfo & pi, int x, int y) const
29 {
30         MathShapeChanger dummy(pi.base.font, LyXFont::ITALIC_SHAPE);
31         pi.draw(x, y, char_);
32 }
33
34
35 void MathSpecialCharInset::write(WriteStream & os) const
36 {
37         os << "\\" << char_;
38 }
39
40
41 void MathSpecialCharInset::normalize(NormalStream & os) const
42 {
43         os << "\\" << char_;
44 }