]> git.lyx.org Git - lyx.git/blob - src/mathed/math_specialcharinset.C
use stream-like syntax for LaTeX output
[lyx.git] / src / mathed / math_specialcharinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_specialcharinset.h"
6 #include "support/LOstream.h"
7 #include "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 int MathSpecialCharInset::ascent() const
22 {
23         return mathed_char_ascent(LM_TC_CONST, size(), char_);
24 }
25
26
27 int MathSpecialCharInset::descent() const
28 {
29         return mathed_char_descent(LM_TC_CONST, size(), char_);
30 }
31
32
33 int MathSpecialCharInset::width() const
34 {
35         return mathed_char_width(LM_TC_CONST, size(), char_);
36 }
37
38
39 void MathSpecialCharInset::metrics(MathMetricsInfo const & st) const
40 {
41         size_ = st;
42 }
43
44
45 void MathSpecialCharInset::draw(Painter & pain, int x, int y) const
46
47         xo(x);
48         yo(y);
49         drawChar(pain, LM_TC_CONST, size(), x, y, char_);
50 }
51
52
53 void MathSpecialCharInset::write(MathWriteInfo & os) const
54 {
55         os << "\\" << char_;
56 }
57
58
59 void MathSpecialCharInset::writeNormal(std::ostream & os) const
60 {
61         os << "\\" << char_;
62 }