4 #include "math_frameboxinset.h"
5 #include "math_support.h"
6 #include "math_mathmlstream.h"
7 #include "math_streamstr.h"
8 #include "frontends/Painter.h"
12 MathFrameboxInset::MathFrameboxInset()
17 MathInset * MathFrameboxInset::clone() const
19 return new MathFrameboxInset(*this);
23 void MathFrameboxInset::metrics(MetricsInfo & mi) const
25 FontSetChanger dummy(mi.base, "textnormal");
26 w_ = mathed_char_width(mi.base.font, '[');
27 MathNestInset::metrics(mi);
29 dim_ += cell(1).dim();
30 dim_ += cell(2).dim();
32 metricsMarkers2(5); // 5 pixels margin
36 void MathFrameboxInset::draw(PainterInfo & pi, int x, int y) const
38 FontSetChanger dummy(pi.base, "textnormal");
39 pi.pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2,
43 drawStrBlack(pi, x, y, "[");
45 cell(0).draw(pi, x, y);
47 drawStrBlack(pi, x, y, "]");
50 drawStrBlack(pi, x, y, "[");
52 cell(1).draw(pi, x, y);
54 drawStrBlack(pi, x, y, "]");
57 cell(2).draw(pi, x, y);
61 void MathFrameboxInset::write(WriteStream & os) const
64 os << '[' << cell(0) << ']';
66 os << '[' << cell(1) << ']';
67 os << '{' << cell(2) << '}';
71 void MathFrameboxInset::normalize(NormalStream & os) const
73 os << "[framebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';