2002-06-18 15:44:30 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "math_numberinset.h"
|
|
|
|
#include "math_mathmlstream.h"
|
|
|
|
#include "math_streamstr.h"
|
|
|
|
#include "math_support.h"
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
|
|
|
|
MathNumberInset::MathNumberInset(string const & s)
|
|
|
|
: str_(s)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathNumberInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathNumberInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathNumberInset::metrics(MetricsInfo & mi) const
|
2002-06-18 15:44:30 +00:00
|
|
|
{
|
2002-07-11 11:27:24 +00:00
|
|
|
mathed_string_dim(mi.base.font, str_, dim_);
|
2002-06-18 15:44:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathNumberInset::draw(PainterInfo & pi, int x, int y) const
|
2002-06-18 15:44:30 +00:00
|
|
|
{
|
|
|
|
//lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
|
|
|
|
drawStr(pi, pi.base.font, x, y, str_);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathNumberInset::normalize(NormalStream & os) const
|
|
|
|
{
|
2002-11-27 10:30:28 +00:00
|
|
|
os << "[number " << str_ << ']';
|
2002-06-18 15:44:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-02-14 14:30:09 +00:00
|
|
|
void MathNumberInset::maple(MapleStream & os) const
|
2002-06-18 15:44:30 +00:00
|
|
|
{
|
|
|
|
os << str_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-02-14 14:30:09 +00:00
|
|
|
void MathNumberInset::octave(OctaveStream & os) const
|
2002-06-18 15:44:30 +00:00
|
|
|
{
|
|
|
|
os << str_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathNumberInset::mathmlize(MathMLStream & os) const
|
|
|
|
{
|
|
|
|
os << "<mi> " << str_ << " </mi>";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathNumberInset::write(WriteStream & os) const
|
|
|
|
{
|
|
|
|
os << str_;
|
|
|
|
}
|