]> git.lyx.org Git - lyx.git/blob - src/mathed/math_numberinset.C
Prepare mathed for unified two-stage drawing
[lyx.git] / src / mathed / math_numberinset.C
1 #include <config.h>
2
3
4 #include "math_numberinset.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7 #include "math_support.h"
8 #include "debug.h"
9
10
11 MathNumberInset::MathNumberInset(string const & s)
12         : str_(s)
13 {}
14
15
16 MathInset * MathNumberInset::clone() const
17 {
18         return new MathNumberInset(*this);
19 }
20
21
22 Dimension MathNumberInset::metrics(MetricsInfo & mi) const
23 {
24         Dimension dim;
25         mathed_string_dim(mi.base.font, str_, dim);
26         return dim;
27 }
28
29
30 void MathNumberInset::draw(PainterInfo & pi, int x, int y) const
31 {
32         //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
33         drawStr(pi, pi.base.font, x, y, str_);
34 }
35
36
37 void MathNumberInset::normalize(NormalStream & os) const
38 {
39         os << "[number " << str_ << ']';
40 }
41
42
43 void MathNumberInset::maple(MapleStream & os) const
44 {
45         os << str_;
46 }
47
48
49 void MathNumberInset::octave(OctaveStream & os) const
50 {
51         os << str_;
52 }
53
54
55 void MathNumberInset::mathmlize(MathMLStream & os) const
56 {
57         os << "<mi> " << str_ << " </mi>";
58 }
59
60
61 void MathNumberInset::write(WriteStream & os) const
62 {
63         os << str_;
64 }