]> git.lyx.org Git - lyx.git/blob - src/mathed/math_sizeinset.C
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_sizeinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_sizeinset.h"
6 #include "math_parser.h"
7 #include "support/LOstream.h"
8
9
10 MathSizeInset::MathSizeInset(latexkeys const * l)
11         : MathNestInset(1), key_(l)
12 {}
13
14
15 MathInset * MathSizeInset::clone() const
16 {
17         return new MathSizeInset(*this);
18 }
19
20
21 void MathSizeInset::draw(Painter & pain, int x, int y) const
22 {
23         xo(x);
24         yo(y);
25         xcell(0).draw(pain, x, y);
26 }
27
28
29 void MathSizeInset::metrics(MathStyles /* st */) const
30 {
31         xcell(0).metrics(MathStyles(key_->id));
32         ascent_   = xcell(0).ascent_;
33         descent_  = xcell(0).descent_;
34         width_    = xcell(0).width_;
35 }
36
37
38 void MathSizeInset::write(std::ostream & os, bool fragile) const
39 {
40         os << "{\\" << key_->name << " ";
41         cell(0).write(os, fragile);
42         os << "}";
43 }
44
45
46 void MathSizeInset::writeNormal(std::ostream & os) const
47 {
48         os << "[" << key_->name << " ";
49         cell(0).writeNormal(os);
50         os << "]";
51 }