2 * \file InsetMathComment.cpp
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 "InsetMathComment.h"
16 #include "MathStream.h"
17 #include "MathSupport.h"
19 #include "frontends/Painter.h"
21 #include "MetricsInfo.h"
28 InsetMathComment::InsetMathComment(Buffer * buf)
29 : InsetMathNest(buf, 1)
33 InsetMathComment::InsetMathComment(MathData const & ar)
34 : InsetMathNest(const_cast<Buffer *>(ar.buffer()), 1)
40 InsetMathComment::InsetMathComment(Buffer * buf, docstring const & str)
41 : InsetMathNest(buf, 1)
44 asArray(str, cell(0));
48 Inset * InsetMathComment::clone() const
50 return new InsetMathComment(*this);
54 void InsetMathComment::metrics(MetricsInfo & mi, Dimension & dim) const
56 cell(0).metrics(mi, dim);
60 void InsetMathComment::draw(PainterInfo & pi, int x, int y) const
62 Dimension const & dim = dimension(*pi.base.bv);
63 pi.pain.fillRectangle(x, y - dim.asc, dim.wid, dim.height(), Color_notebg);
64 cell(0).draw(pi, x, y);
68 void InsetMathComment::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
70 cell(0).metricsT(mi, dim);
74 void InsetMathComment::drawT(TextPainter & pain, int x, int y) const
76 cell(0).drawT(pain, x, y);
80 void InsetMathComment::write(TeXMathStream & os) const
82 os << '%' << cell(0) << "\n";
86 void InsetMathComment::maple(MapleStream & os) const
88 os << '#' << cell(0) << "\n";
92 void InsetMathComment::mathmlize(MathMLStream & ms) const
94 ms << MTag("comment") << cell(0) << ETag("comment");
98 void InsetMathComment::htmlize(HtmlStream & os) const
100 os << "<!-- " << cell(0) << " -->";
104 void InsetMathComment::infoize(odocstream & os) const