]> git.lyx.org Git - lyx.git/blob - src/mathed/math_numberinset.C
the clone auto_ptr patch
[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 using std::auto_ptr;
11
12
13 MathNumberInset::MathNumberInset(string const & s)
14         : str_(s)
15 {}
16
17
18 auto_ptr<InsetBase> MathNumberInset::clone() const
19 {
20         return auto_ptr<InsetBase>(new MathNumberInset(*this));
21 }
22
23
24 void MathNumberInset::metrics(MetricsInfo & mi, Dimension & dim) const
25 {
26         mathed_string_dim(mi.base.font, str_, 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 }