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"
19 #include "frontends/Painter.h"
25 MathBraceInset::MathBraceInset()
30 MathBraceInset::MathBraceInset(MathArray const & ar)
37 auto_ptr<InsetBase> MathBraceInset::doClone() const
39 return auto_ptr<InsetBase>(new MathBraceInset(*this));
43 void MathBraceInset::metrics(MetricsInfo & mi, Dimension & dim) const
47 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 * t.wid;
56 void MathBraceInset::draw(PainterInfo & pi, int x, int y) const
58 LyXFont font = pi.base.font;
59 font.setColor(LColor::latex);
61 mathed_char_dim(font, '{', t);
62 pi.pain.text(x, y, '{', font);
63 cell(0).draw(pi, x + t.wid, y);
64 pi.pain.text(x + t.wid + cell(0).width(), y, '}', font);
65 drawMarkers(pi, x, y);
69 void MathBraceInset::write(WriteStream & os) const
71 os << '{' << cell(0) << '}';
75 void MathBraceInset::normalize(NormalStream & os) const
77 os << "[block " << cell(0) << ']';
81 void MathBraceInset::maple(MapleStream & os) const
87 void MathBraceInset::octave(OctaveStream & os) const
93 void MathBraceInset::mathmlize(MathMLStream & os) const
95 os << MTag("mrow") << cell(0) << ETag("mrow");
99 void MathBraceInset::mathematica(MathematicaStream & os) const
105 void MathBraceInset::infoize(std::ostream & os) const
107 os << "Nested Block: ";