]> git.lyx.org Git - lyx.git/blob - src/mathed/math_sizeinset.C
small up/down tweaking
[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 #include "support/LOstream.h"
13
14 using std::atoi;
15
16 MathSizeInset::MathSizeInset(latexkeys const * l)
17         : MathNestInset(1), key_(l), style_(MathStyles(atoi(l->extra.c_str())))
18 {}
19
20
21 MathInset * MathSizeInset::clone() const
22 {
23         return new MathSizeInset(*this);
24 }
25
26
27 void MathSizeInset::metrics(MathMetricsInfo & mi) const
28 {
29         MathStyleChanger dummy(mi.base, style_);
30         dim_ = cell(0).metrics(mi);
31         metricsMarkers2();
32 }
33
34
35 void MathSizeInset::draw(MathPainterInfo & pi, int x, int y) const
36 {
37         MathStyleChanger dummy(pi.base, style_);
38         cell(0).draw(pi, x + 1, y);
39         drawMarkers2(pi, x, y);
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 }
53
54
55 void MathSizeInset::infoize(std::ostream & os) const
56 {
57         os << "Size: " << key_->name;
58 }