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 "MathMLStream.h"
16 #include "MathSupport.h"
18 #include "support/std_ostream.h"
19 #include "frontends/Painter.h"
25 InsetMathBrace::InsetMathBrace()
30 InsetMathBrace::InsetMathBrace(MathArray const & ar)
37 auto_ptr<InsetBase> InsetMathBrace::doClone() const
39 return auto_ptr<InsetBase>(new InsetMathBrace(*this));
43 void InsetMathBrace::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 InsetMathBrace::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 InsetMathBrace::write(WriteStream & os) const
71 os << '{' << cell(0) << '}';
75 void InsetMathBrace::normalize(NormalStream & os) const
77 os << "[block " << cell(0) << ']';
81 void InsetMathBrace::maple(MapleStream & os) const
87 void InsetMathBrace::octave(OctaveStream & os) const
93 void InsetMathBrace::mathmlize(MathMLStream & os) const
95 os << MTag("mrow") << cell(0) << ETag("mrow");
99 void InsetMathBrace::mathematica(MathematicaStream & os) const
105 void InsetMathBrace::infoize(std::ostream & os) const
107 os << "Nested Block: ";