7 #include "math_braceinset.h"
8 #include "math_parser.h"
9 #include "math_support.h"
10 #include "math_mathmlstream.h"
11 #include "support/LOstream.h"
16 MathBraceInset::MathBraceInset()
21 MathInset * MathBraceInset::clone() const
23 return new MathBraceInset(*this);
27 void MathBraceInset::metrics(MathMetricsInfo & mi) const
31 mathed_char_dim(mi.base.font, '{', a, d, wid_);
32 ascent_ = max(xcell(0).ascent(), a);
33 descent_ = max(xcell(0).descent(), a);
34 width_ = xcell(0).width() + 2 * wid_;
38 void MathBraceInset::draw(MathPainterInfo & pi, int x, int y) const
40 LyXFont font = pi.base.font;
41 font.setColor(LColor::latex);
42 drawChar(pi, font, x, y, '{');
43 xcell(0).draw(pi, x + wid_, y);
44 drawChar(pi, font, x + width_ - wid_, y, '}');
48 void MathBraceInset::write(WriteStream & os) const
50 os << '{' << cell(0) << '}';
54 void MathBraceInset::normalize(NormalStream & os) const
56 os << "[block " << cell(0) << ']';
60 void MathBraceInset::infoize(std::ostream & os) const
62 os << "Nested Block: ";