]> git.lyx.org Git - lyx.git/blob - src/mathed/math_sizeinset.C
forward search in math insets. ugly. seems to work. don't ask why.
[lyx.git] / src / mathed / math_sizeinset.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "math_sizeinset.h"
8 #include "math_parser.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
11
12
13 MathSizeInset::MathSizeInset(latexkeys const * l)
14         : MathNestInset(1), key_(l)
15 {}
16
17
18 MathInset * MathSizeInset::clone() const
19 {
20         return new MathSizeInset(*this);
21 }
22
23
24 void MathSizeInset::draw(Painter & pain, int x, int y) const
25 {
26         xcell(0).draw(pain, x, y);
27 }
28
29
30 void MathSizeInset::metrics(MathMetricsInfo const & mi) const
31 {
32         MathMetricsInfo m = mi;
33         m.style = MathStyles(key_->id);
34         xcell(0).metrics(m);
35         ascent_   = xcell(0).ascent_;
36         descent_  = xcell(0).descent_;
37         width_    = xcell(0).width_;
38 }
39
40
41 void MathSizeInset::write(WriteStream & os) const
42 {
43         os << "{\\" << key_->name << ' ' << cell(0) << '}';
44 }
45
46
47 void MathSizeInset::normalize(NormalStream & os) const
48 {
49         os << "[" << key_->name << ' ' << cell(0) << ']';
50 }