7 #include "math_makeboxinset.h"
8 #include "math_support.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
11 #include "frontends/Painter.h"
16 MathMakeboxInset::MathMakeboxInset()
21 auto_ptr<InsetBase> MathMakeboxInset::clone() const
23 return auto_ptr<InsetBase>(new MathMakeboxInset(*this));
27 void MathMakeboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
29 FontSetChanger dummy(mi.base, "textnormal");
30 w_ = mathed_char_width(mi.base.font, '[');
31 MathNestInset::metrics(mi);
33 dim_ += cell(1).dim();
34 dim_ += cell(2).dim();
35 dim_.wid += 4 * w_ + 4;
41 void MathMakeboxInset::draw(PainterInfo & pi, int x, int y) const
43 FontSetChanger dummy(pi.base, "textnormal");
44 drawMarkers(pi, x, y);
46 drawStrBlack(pi, x, y, "[");
48 cell(0).draw(pi, x, y);
50 drawStrBlack(pi, x, y, "]");
53 drawStrBlack(pi, x, y, "[");
55 cell(1).draw(pi, x, y);
57 drawStrBlack(pi, x, y, "]");
60 cell(2).draw(pi, x, y);
64 void MathMakeboxInset::write(WriteStream & os) const
67 os << '[' << cell(0) << ']';
69 os << '[' << cell(1) << ']';
70 os << '{' << cell(2) << '}';
74 void MathMakeboxInset::normalize(NormalStream & os) const
76 os << "[makebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';