2 * \file InsetMathBrace.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 "InsetMathBrace.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
18 #include "support/std_ostream.h"
19 #include "frontends/Painter.h"
28 InsetMathBrace::InsetMathBrace()
33 InsetMathBrace::InsetMathBrace(MathArray const & ar)
40 auto_ptr<InsetBase> InsetMathBrace::doClone() const
42 return auto_ptr<InsetBase>(new InsetMathBrace(*this));
46 void InsetMathBrace::metrics(MetricsInfo & mi, Dimension & dim) const
50 mathed_char_dim(mi.base.font, '{', t);
51 dim.asc = max(cell(0).ascent(), t.asc);
52 dim.des = max(cell(0).descent(), t.des);
53 dim.wid = cell(0).width() + 2 * t.wid;
59 void InsetMathBrace::draw(PainterInfo & pi, int x, int y) const
61 LyXFont font = pi.base.font;
62 font.setColor(LColor::latex);
64 mathed_char_dim(font, '{', t);
65 pi.pain.text(x, y, '{', font);
66 cell(0).draw(pi, x + t.wid, y);
67 pi.pain.text(x + t.wid + cell(0).width(), y, '}', font);
68 drawMarkers(pi, x, y);
72 void InsetMathBrace::write(WriteStream & os) const
74 os << '{' << cell(0) << '}';
78 void InsetMathBrace::normalize(NormalStream & os) const
80 os << "[block " << cell(0) << ']';
84 void InsetMathBrace::maple(MapleStream & os) const
90 void InsetMathBrace::octave(OctaveStream & os) const
96 void InsetMathBrace::mathmlize(MathStream & os) const
98 os << MTag("mrow") << cell(0) << ETag("mrow");
102 void InsetMathBrace::mathematica(MathematicaStream & os) const
108 void InsetMathBrace::infoize(odocstream & os) const
110 os << "Nested Block: ";