2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file math_commentinset.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2002-08-14 15:13:07 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "math_commentinset.h"
|
2003-09-07 21:25:37 +00:00
|
|
|
|
#include "math_data.h"
|
2002-08-14 15:13:07 +00:00
|
|
|
|
#include "math_mathmlstream.h"
|
2003-09-07 21:25:37 +00:00
|
|
|
|
#include "math_support.h"
|
2003-09-05 17:23:11 +00:00
|
|
|
|
#include "support/std_ostream.h"
|
2002-08-14 15:13:07 +00:00
|
|
|
|
|
2003-07-25 17:11:25 +00:00
|
|
|
|
using std::auto_ptr;
|
|
|
|
|
|
2002-08-14 15:13:07 +00:00
|
|
|
|
|
|
|
|
|
MathCommentInset::MathCommentInset()
|
|
|
|
|
: MathNestInset(1)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MathCommentInset::MathCommentInset(string const & str)
|
|
|
|
|
: MathNestInset(1)
|
|
|
|
|
{
|
2003-06-02 10:03:27 +00:00
|
|
|
|
asArray(str, cell(0));
|
2002-08-14 15:13:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 17:11:25 +00:00
|
|
|
|
auto_ptr<InsetBase> MathCommentInset::clone() const
|
2002-08-14 15:13:07 +00:00
|
|
|
|
{
|
2003-07-25 17:11:25 +00:00
|
|
|
|
return auto_ptr<InsetBase>(new MathCommentInset(*this));
|
2002-08-14 15:13:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void MathCommentInset::metrics(MetricsInfo & mi, Dimension & dim) const
|
2002-08-14 15:13:07 +00:00
|
|
|
|
{
|
2003-05-28 13:22:36 +00:00
|
|
|
|
cell(0).metrics(mi);
|
2002-08-14 15:13:07 +00:00
|
|
|
|
metricsMarkers();
|
2003-06-02 10:03:27 +00:00
|
|
|
|
dim = dim_;
|
2002-08-14 15:13:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
|
void MathCommentInset::draw(PainterInfo & pi, int x, int y) const
|
2002-08-14 15:13:07 +00:00
|
|
|
|
{
|
|
|
|
|
cell(0).draw(pi, x + 1, y);
|
|
|
|
|
drawMarkers(pi, x, y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-28 13:22:36 +00:00
|
|
|
|
void MathCommentInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
|
2002-08-14 15:13:07 +00:00
|
|
|
|
{
|
2003-05-28 13:22:36 +00:00
|
|
|
|
cell(0).metricsT(mi, dim);
|
2002-08-14 15:13:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void MathCommentInset::maple(MapleStream & os) const
|
2002-08-26 06:17:54 +00:00
|
|
|
|
{
|
|
|
|
|
os << '#' << cell(0) << "\n";
|
|
|
|
|
}
|
2002-08-14 15:13:07 +00:00
|
|
|
|
|
|
|
|
|
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void MathCommentInset::mathematica(MathematicaStream &) const
|
2002-08-14 15:13:07 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void MathCommentInset::octave(OctaveStream &) const
|
2002-08-14 15:13:07 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MathCommentInset::mathmlize(MathMLStream & os) const
|
|
|
|
|
{
|
|
|
|
|
os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MathCommentInset::infoize(std::ostream & os) const
|
|
|
|
|
{
|
|
|
|
|
os << "Comment";
|
|
|
|
|
}
|