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 void 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();
39 void MathMakeboxInset::draw(PainterInfo & pi, int x, int y) const
41 FontSetChanger dummy(pi.base, "textnormal");
42 drawMarkers2(pi, x, y);
44 drawStrBlack(pi, x, y, "[");
46 cell(0).draw(pi, x, y);
48 drawStrBlack(pi, x, y, "]");
51 drawStrBlack(pi, x, y, "[");
53 cell(1).draw(pi, x, y);
55 drawStrBlack(pi, x, y, "]");
58 cell(2).draw(pi, x, y);
62 void MathMakeboxInset::write(WriteStream & os) const
65 os << '[' << cell(0) << ']';
67 os << '[' << cell(1) << ']';
68 os << '{' << cell(2) << '}';
72 void MathMakeboxInset::normalize(NormalStream & os) const
74 os << "[makebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';