]> git.lyx.org Git - lyx.git/blob - src/mathed/math_boxinset.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_boxinset.C
1 #include <config.h>
2
3 #include "math_boxinset.h"
4 #include "math_support.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7 #include "support/LOstream.h"
8
9 using std::auto_ptr;
10
11
12 MathBoxInset::MathBoxInset(string const & name)
13         : MathNestInset(1), name_(name)
14 {}
15
16
17 auto_ptr<InsetBase> MathBoxInset::clone() const
18 {
19         return auto_ptr<InsetBase>(new MathBoxInset(*this));
20 }
21
22
23 void MathBoxInset::write(WriteStream & os) const
24 {
25         os << '\\' << name_ << '{' << cell(0) << '}';
26 }
27
28
29 void MathBoxInset::normalize(NormalStream & os) const
30 {
31         os << '[' << name_ << ' ';
32         //text_->write(buffer(), os);
33         os << "] ";
34 }
35
36
37 void MathBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const
38 {
39         FontSetChanger dummy(mi.base, "textnormal");
40         cell(0).metrics(mi, dim_);
41         metricsMarkers();
42         dim = dim_;
43 }
44
45
46 void MathBoxInset::draw(PainterInfo & pi, int x, int y) const
47 {
48         FontSetChanger dummy(pi.base, "textnormal");
49         cell(0).draw(pi, x, y);
50         drawMarkers(pi, x, y);
51 }
52
53
54 void MathBoxInset::infoize(std::ostream & os) const
55 {
56         os << "Box: " << name_;
57 }