2001-12-05 08:04:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-11-09 10:44:24 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_unknowninset.h"
|
|
|
|
#include "math_support.h"
|
|
|
|
#include "math_mathmlstream.h"
|
2001-12-05 08:04:20 +00:00
|
|
|
#include "math_streamstr.h"
|
2001-11-09 10:44:24 +00:00
|
|
|
|
|
|
|
|
2002-05-30 07:09:54 +00:00
|
|
|
MathUnknownInset::MathUnknownInset(string const & nm, bool final, bool black)
|
|
|
|
: name_(nm), final_(final), black_(black)
|
2001-11-09 10:44:24 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathUnknownInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathUnknownInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-01 15:53:46 +00:00
|
|
|
string MathUnknownInset::name() const
|
2001-11-09 10:44:24 +00:00
|
|
|
{
|
|
|
|
return name_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-09 07:01:17 +00:00
|
|
|
void MathUnknownInset::setName(string const & name)
|
2001-11-09 10:44:24 +00:00
|
|
|
{
|
2002-08-01 15:53:46 +00:00
|
|
|
name_ = name;
|
2001-11-09 10:44:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-09 10:22:35 +00:00
|
|
|
bool MathUnknownInset::match(MathAtom const & at) const
|
2002-02-01 17:01:30 +00:00
|
|
|
{
|
2002-08-09 10:22:35 +00:00
|
|
|
MathUnknownInset const * q = at->asUnknownInset();
|
2002-02-01 17:01:30 +00:00
|
|
|
return q && name_ == q->name_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 10:44:24 +00:00
|
|
|
void MathUnknownInset::normalize(NormalStream & os) const
|
|
|
|
{
|
2002-02-01 17:01:30 +00:00
|
|
|
os << "[unknown " << name_ << ']';
|
2001-11-09 10:44:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-05-30 07:09:54 +00:00
|
|
|
void MathUnknownInset::metrics(MathMetricsInfo & mi) const
|
|
|
|
{
|
2002-07-11 11:27:24 +00:00
|
|
|
mathed_string_dim(mi.base.font, name_, dim_);
|
2002-05-30 07:09:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathUnknownInset::draw(MathPainterInfo & pi, int x, int y) const
|
|
|
|
{
|
|
|
|
if (black_)
|
|
|
|
drawStrBlack(pi, x, y, name_);
|
|
|
|
else
|
|
|
|
drawStrRed(pi, x, y, name_);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-09 07:01:17 +00:00
|
|
|
void MathUnknownInset::finalize()
|
2001-11-09 10:44:24 +00:00
|
|
|
{
|
2002-05-30 07:09:54 +00:00
|
|
|
final_ = true;
|
2001-11-09 10:44:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-05-30 07:09:54 +00:00
|
|
|
bool MathUnknownInset::final() const
|
2002-03-21 17:42:56 +00:00
|
|
|
{
|
2002-05-30 07:09:54 +00:00
|
|
|
return final_;
|
2001-11-09 10:44:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathUnknownInset::maplize(MapleStream & os) const
|
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << name_;
|
2001-11-09 10:44:24 +00:00
|
|
|
}
|
|
|
|
|
2002-07-01 11:17:14 +00:00
|
|
|
void MathUnknownInset::mathematicize(MathematicaStream & os) const
|
|
|
|
{
|
|
|
|
os << name_;
|
|
|
|
}
|
|
|
|
|
2001-11-09 10:44:24 +00:00
|
|
|
|
|
|
|
void MathUnknownInset::mathmlize(MathMLStream & os) const
|
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << MTag("mi") << name_ << ETag("mi");
|
2001-11-09 10:44:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathUnknownInset::octavize(OctaveStream & os) const
|
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << name_;
|
2001-11-09 10:44:24 +00:00
|
|
|
}
|