2 * \file math_braceinset.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "math_braceinset.h"
14 #include "math_support.h"
15 #include "math_mathmlstream.h"
16 #include "support/std_ostream.h"
22 MathBraceInset::MathBraceInset()
27 MathBraceInset::MathBraceInset(MathArray const & ar)
34 auto_ptr<InsetBase> MathBraceInset::clone() const
36 return auto_ptr<InsetBase>(new MathBraceInset(*this));
40 void MathBraceInset::metrics(MetricsInfo & mi, Dimension & dim) const
44 mathed_char_dim(mi.base.font, '{', t);
46 dim_.asc = max(cell(0).ascent(), t.asc);
47 dim_.des = max(cell(0).descent(), t.des);
48 dim_.wid = cell(0).width() + 2 * wid_;
53 void MathBraceInset::draw(PainterInfo & pi, int x, int y) const
55 LyXFont font = pi.base.font;
56 font.setColor(LColor::latex);
57 drawChar(pi, font, x, y, '{');
58 cell(0).draw(pi, x + wid_, y);
59 drawChar(pi, font, x + dim_.width() - wid_, y, '}');
63 void MathBraceInset::write(WriteStream & os) const
65 os << '{' << cell(0) << '}';
69 void MathBraceInset::normalize(NormalStream & os) const
71 os << "[block " << cell(0) << ']';
75 void MathBraceInset::maple(MapleStream & os) const
81 void MathBraceInset::octave(OctaveStream & os) const
87 void MathBraceInset::mathmlize(MathMLStream & os) const
89 os << MTag("mrow") << cell(0) << ETag("mrow");
93 void MathBraceInset::mathematica(MathematicaStream & os) const
99 void MathBraceInset::infoize(std::ostream & os) const
101 os << "Nested Block: ";