]> git.lyx.org Git - lyx.git/blob - src/mathed/math_boxinset.C
IU of drawing phase one without 'semantic changes' as requested by John
[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
10 MathBoxInset::MathBoxInset(string const & name)
11         : MathNestInset(1), name_(name)
12 {}
13
14
15 MathInset * MathBoxInset::clone() const
16 {
17         return new MathBoxInset(*this);
18 }
19
20
21 void MathBoxInset::write(WriteStream & os) const
22 {
23         os << '\\' << name_ << '{' << cell(0) << '}';
24 }
25
26
27 void MathBoxInset::normalize(NormalStream & os) const
28 {
29         os << '[' << name_ << ' ';
30         //text_->write(buffer(), os);
31         os << "] ";
32 }
33
34
35 void MathBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const
36 {
37         FontSetChanger dummy(mi.base, "textnormal");
38         cell(0).metrics(mi, dim_);
39         metricsMarkers();
40         dim = dim_;
41 }
42
43
44 void MathBoxInset::draw(PainterInfo & pi, int x, int y) const
45 {
46         FontSetChanger dummy(pi.base, "textnormal");
47         cell(0).draw(pi, x, y);
48         drawMarkers(pi, x, y);
49 }
50
51
52 void MathBoxInset::infoize(std::ostream & os) const
53 {
54         os << "Box: " << name_;
55 }