]> git.lyx.org Git - lyx.git/blob - src/mathed/math_sizeinset.C
fonts as insets
[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::metrics(MathMetricsInfo & mi) const
26 {
27         //MathStyleChanger dummy(mi.base, MathStyles(key_->id));
28         xcell(0).metrics(mi);
29         ascent_   = xcell(0).ascent_ + 1;
30         descent_  = xcell(0).descent_ + 1;
31         width_    = xcell(0).width_ + 2;
32 }
33
34
35 void MathSizeInset::draw(MathPainterInfo & pi, int x, int y) const
36 {
37         //MathStyleChanger dummy(pi.base, MathStyles(key_->id));
38         xcell(0).draw(pi, x + 1, y);
39         mathed_draw_framebox(pi, x, y, this);
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 }