3 #include "math_frameboxinset.h"
4 #include "math_support.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7 #include "frontends/Painter.h"
10 MathFrameboxInset::MathFrameboxInset()
15 InsetBase * MathFrameboxInset::clone() const
17 return new MathFrameboxInset(*this);
21 void MathFrameboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
23 FontSetChanger dummy(mi.base, "textnormal");
24 w_ = mathed_char_width(mi.base.font, '[');
25 MathNestInset::metrics(mi);
27 dim_ += cell(1).dim();
28 dim_ += cell(2).dim();
34 void MathFrameboxInset::draw(PainterInfo & pi, int x, int y) const
36 FontSetChanger dummy(pi.base, "textnormal");
37 pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
38 dim_.width() - 2, dim_.height() - 2, LColor::foreground);
41 drawStrBlack(pi, x, y, "[");
43 cell(0).draw(pi, x, y);
45 drawStrBlack(pi, x, y, "]");
48 drawStrBlack(pi, x, y, "[");
50 cell(1).draw(pi, x, y);
52 drawStrBlack(pi, x, y, "]");
55 cell(2).draw(pi, x, y);
59 void MathFrameboxInset::write(WriteStream & os) const
62 os << '[' << cell(0) << ']';
64 os << '[' << cell(1) << ']';
65 os << '{' << cell(2) << '}';
69 void MathFrameboxInset::normalize(NormalStream & os) const
71 os << "[framebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';