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