2 * \file math_commentinset.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_commentinset.h"
14 #include "math_data.h"
15 #include "math_mathmlstream.h"
16 #include "math_support.h"
17 #include "support/std_ostream.h"
23 MathCommentInset::MathCommentInset()
28 MathCommentInset::MathCommentInset(string const & str)
31 asArray(str, cell(0));
35 auto_ptr<InsetBase> MathCommentInset::doClone() const
37 return auto_ptr<InsetBase>(new MathCommentInset(*this));
41 void MathCommentInset::metrics(MetricsInfo & mi, Dimension & dim) const
43 cell(0).metrics(mi, dim);
49 void MathCommentInset::draw(PainterInfo & pi, int x, int y) const
51 cell(0).draw(pi, x + 1, y);
52 drawMarkers(pi, x, y);
56 void MathCommentInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
58 cell(0).metricsT(mi, dim);
62 void MathCommentInset::drawT(TextPainter & pain, int x, int y) const
64 cell(0).drawT(pain, x, y);
68 void MathCommentInset::write(WriteStream & os) const
70 os << '%' << cell(0) << "\n";
74 void MathCommentInset::maple(MapleStream & os) const
76 os << '#' << cell(0) << "\n";
80 void MathCommentInset::mathematica(MathematicaStream &) const
84 void MathCommentInset::octave(OctaveStream &) const
88 void MathCommentInset::mathmlize(MathMLStream & os) const
90 os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
94 void MathCommentInset::infoize(std::ostream & os) const