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_data.h"
15 #include "math_mathmlstream.h"
16 #include "math_support.h"
18 #include "support/std_ostream.h"
24 MathBraceInset::MathBraceInset()
29 MathBraceInset::MathBraceInset(MathArray const & ar)
36 auto_ptr<InsetBase> MathBraceInset::clone() const
38 return auto_ptr<InsetBase>(new MathBraceInset(*this));
42 void MathBraceInset::metrics(MetricsInfo & mi, Dimension & dim) const
46 mathed_char_dim(mi.base.font, '{', t);
48 dim.asc = max(cell(0).ascent(), t.asc);
49 dim.des = max(cell(0).descent(), t.des);
50 dim.wid = cell(0).width() + 2 * dim.wid;
56 void MathBraceInset::draw(PainterInfo & pi, int x, int y) const
58 LyXFont font = pi.base.font;
59 font.setColor(LColor::latex);
60 drawChar(pi, font, x, y, '{');
61 cell(0).draw(pi, x + wid_, y);
62 drawChar(pi, font, x + dim_.width() - wid_, y, '}');
63 drawMarkers(pi, x, y);
67 void MathBraceInset::write(WriteStream & os) const
69 os << '{' << cell(0) << '}';
73 void MathBraceInset::normalize(NormalStream & os) const
75 os << "[block " << cell(0) << ']';
79 void MathBraceInset::maple(MapleStream & os) const
85 void MathBraceInset::octave(OctaveStream & os) const
91 void MathBraceInset::mathmlize(MathMLStream & os) const
93 os << MTag("mrow") << cell(0) << ETag("mrow");
97 void MathBraceInset::mathematica(MathematicaStream & os) const
103 void MathBraceInset::infoize(std::ostream & os) const
105 os << "Nested Block: ";