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"
15 MathMakeboxInset::MathMakeboxInset()
20 MathInset * MathMakeboxInset::clone() const
22 return new MathMakeboxInset(*this);
26 Dimension MathMakeboxInset::metrics(MetricsInfo & mi) const
28 FontSetChanger dummy(mi.base, "textnormal");
29 w_ = mathed_char_width(mi.base.font, '[');
30 MathNestInset::metrics(mi);
32 dim_ += cell(1).dim();
33 dim_ += cell(2).dim();
34 dim_.wid += 4 * w_ + 4;
40 void MathMakeboxInset::draw(PainterInfo & pi, int x, int y) const
42 FontSetChanger dummy(pi.base, "textnormal");
43 drawMarkers(pi, x, y);
45 drawStrBlack(pi, x, y, "[");
47 cell(0).draw(pi, x, y);
49 drawStrBlack(pi, x, y, "]");
52 drawStrBlack(pi, x, y, "[");
54 cell(1).draw(pi, x, y);
56 drawStrBlack(pi, x, y, "]");
59 cell(2).draw(pi, x, y);
63 void MathMakeboxInset::write(WriteStream & os) const
66 os << '[' << cell(0) << ']';
68 os << '[' << cell(1) << ']';
69 os << '{' << cell(2) << '}';
73 void MathMakeboxInset::normalize(NormalStream & os) const
75 os << "[makebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';