2003-08-19 13:00:56 +00:00
|
|
|
/**
|
2007-04-25 03:01:35 +00:00
|
|
|
* \file InsetMathComment.cpp
|
2003-08-19 13:00:56 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-19 13:00:56 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2002-08-14 15:13:07 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "InsetMathComment.h"
|
2007-11-06 21:45:24 +00:00
|
|
|
|
2007-04-26 16:05:57 +00:00
|
|
|
#include "MathData.h"
|
2006-10-22 10:15:23 +00:00
|
|
|
#include "MathStream.h"
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "MathSupport.h"
|
2007-11-06 21:45:24 +00:00
|
|
|
|
2008-05-06 10:36:32 +00:00
|
|
|
#include <ostream>
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
InsetMathComment::InsetMathComment()
|
|
|
|
: InsetMathNest(1)
|
2002-08-14 15:13:07 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
InsetMathComment::InsetMathComment(docstring const & str)
|
2006-09-16 18:11:38 +00:00
|
|
|
: InsetMathNest(1)
|
2002-08-14 15:13:07 +00:00
|
|
|
{
|
2006-10-17 14:46:45 +00:00
|
|
|
// FIXME UNICODE
|
2006-10-22 10:15:23 +00:00
|
|
|
asArray(str, cell(0));
|
2002-08-14 15:13:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-30 18:03:17 +00:00
|
|
|
Inset * InsetMathComment::clone() const
|
2002-08-14 15:13:07 +00:00
|
|
|
{
|
2007-08-30 18:03:17 +00:00
|
|
|
return new InsetMathComment(*this);
|
2002-08-14 15:13:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-21 20:39:47 +00:00
|
|
|
void InsetMathComment::metrics(MetricsInfo & mi, Dimension & dim) const
|
2002-08-14 15:13:07 +00:00
|
|
|
{
|
2004-04-06 19:25:39 +00:00
|
|
|
cell(0).metrics(mi, dim);
|
|
|
|
metricsMarkers(dim);
|
2002-08-14 15:13:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathComment::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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathComment::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
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathComment::drawT(TextPainter & pain, int x, int y) const
|
2002-08-14 15:13:07 +00:00
|
|
|
{
|
|
|
|
cell(0).drawT(pain, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathComment::write(WriteStream & os) const
|
2002-08-14 15:13:07 +00:00
|
|
|
{
|
|
|
|
os << '%' << cell(0) << "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathComment::maple(MapleStream & os) const
|
2002-08-26 06:17:54 +00:00
|
|
|
{
|
|
|
|
os << '#' << cell(0) << "\n";
|
|
|
|
}
|
2002-08-14 15:13:07 +00:00
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathComment::mathematica(MathematicaStream &) const
|
2002-08-14 15:13:07 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
void InsetMathComment::octave(OctaveStream &) const
|
2002-08-14 15:13:07 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
void InsetMathComment::mathmlize(MathStream & os) const
|
2002-08-14 15:13:07 +00:00
|
|
|
{
|
|
|
|
os << MTag("comment") << cell(0) << cell(1) << ETag("comment");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
void InsetMathComment::infoize(odocstream & os) const
|
2002-08-14 15:13:07 +00:00
|
|
|
{
|
|
|
|
os << "Comment";
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|