lyx_mirror/src/mathed/math_commentinset.C
André Pönitz 38fce2feac Prepare mathed for unified two-stage drawing
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7059 a592a061-630c-0410-9148-cb99ea01b6c8
2003-05-28 13:22:36 +00:00

87 lines
1.4 KiB
C

#include <config.h>
#include "math_commentinset.h"
#include "math_mathmlstream.h"
#include "LaTeXFeatures.h"
#include "support/LOstream.h"
#include "textpainter.h"
MathCommentInset::MathCommentInset()
: MathNestInset(1)
{}
MathCommentInset::MathCommentInset(string const & str)
: MathNestInset(1)
{
cell(0) = asArray(str);
}
MathInset * MathCommentInset::clone() const
{
return new MathCommentInset(*this);
}
Dimension MathCommentInset::metrics(MetricsInfo & mi) const
{
cell(0).metrics(mi);
metricsMarkers();
return dim_;
}
void MathCommentInset::draw(PainterInfo & pi, int x, int y) const
{
cell(0).draw(pi, x + 1, y);
drawMarkers(pi, x, y);
}
void MathCommentInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
{
cell(0).metricsT(mi, dim);
}
void MathCommentInset::drawT(TextPainter & pain, int x, int y) const
{
cell(0).drawT(pain, x, y);
}
void MathCommentInset::write(WriteStream & os) const
{
os << '%' << cell(0) << "\n";
}
void MathCommentInset::maple(MapleStream & os) const
{
os << '#' << cell(0) << "\n";
}
void MathCommentInset::mathematica(MathematicaStream &) const
{}
void MathCommentInset::octave(OctaveStream &) const
{}
void MathCommentInset::mathmlize(MathMLStream & os) const
{
os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
}
void MathCommentInset::infoize(std::ostream & os) const
{
os << "Comment";
}