]> git.lyx.org Git - lyx.git/blob - src/mathed/math_sizeinset.C
fix typo that put too many include paths for most people
[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 #include "math_support.h"
12
13
14 MathSizeInset::MathSizeInset(latexkeys const * l)
15         : MathNestInset(1), key_(l)
16 {}
17
18
19 MathInset * MathSizeInset::clone() const
20 {
21         return new MathSizeInset(*this);
22 }
23
24
25 void MathSizeInset::draw(Painter & pain, int x, int y) const
26 {
27         xcell(0).draw(pain, x + 1, y);
28         mathed_draw_framebox(pain, x, y, this);
29 }
30
31
32 void MathSizeInset::metrics(MathMetricsInfo const & mi) const
33 {
34         MathMetricsInfo m = mi;
35         m.style = MathStyles(key_->id);
36         xcell(0).metrics(m);
37         ascent_   = xcell(0).ascent_ + 1;
38         descent_  = xcell(0).descent_ + 1;
39         width_    = xcell(0).width_ + 2;
40 }
41
42
43 void MathSizeInset::write(WriteStream & os) const
44 {
45         os << "{\\" << key_->name << ' ' << cell(0) << '}';
46 }
47
48
49 void MathSizeInset::normalize(NormalStream & os) const
50 {
51         os << "[" << key_->name << ' ' << cell(0) << ']';
52 }