2001-12-05 08:04:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-11-07 13:15:59 +00:00
|
|
|
#include "math_exfuncinset.h"
|
2001-11-08 12:15:12 +00:00
|
|
|
#include "math_support.h"
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "math_mathmlstream.h"
|
2001-12-05 08:04:20 +00:00
|
|
|
#include "math_streamstr.h"
|
2001-11-07 13:15:59 +00:00
|
|
|
|
|
|
|
|
2001-11-13 18:33:48 +00:00
|
|
|
MathExFuncInset::MathExFuncInset(string const & name)
|
2001-11-07 13:15:59 +00:00
|
|
|
: MathNestInset(1), name_(name)
|
2001-11-13 18:33:48 +00:00
|
|
|
{}
|
2001-11-07 13:15:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathExFuncInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathExFuncInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 12:01:10 +00:00
|
|
|
void MathExFuncInset::metrics(MathMetricsInfo const & mi) const
|
2001-11-07 13:15:59 +00:00
|
|
|
{
|
2002-03-19 16:55:58 +00:00
|
|
|
whichFont(font_, LM_TC_TEXTRM, mi);
|
|
|
|
mathed_string_dim(font_, name_, ascent_, descent_, width_);
|
2001-11-09 12:01:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathExFuncInset::draw(Painter & pain, int x, int y) const
|
|
|
|
{
|
2002-03-19 16:55:58 +00:00
|
|
|
drawStr(pain, font_, x, y, name_);
|
2001-11-07 13:15:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathExFuncInset::normalize(NormalStream & os) const
|
2001-11-07 13:15:59 +00:00
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << '[' << name_ << ' ' << cell(0) << ']';
|
2001-11-07 13:15:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 12:01:10 +00:00
|
|
|
void MathExFuncInset::maplize(MapleStream & os) const
|
2001-11-07 13:15:59 +00:00
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << name_ << '(' << cell(0) << ')';
|
2001-11-07 13:15:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 12:01:10 +00:00
|
|
|
void MathExFuncInset::mathmlize(MathMLStream & os) const
|
|
|
|
{
|
|
|
|
os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
|
2001-11-07 13:15:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-07 17:30:26 +00:00
|
|
|
void MathExFuncInset::octavize(OctaveStream & os) const
|
2001-11-07 13:15:59 +00:00
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << name_ << '(' << cell(0) << ')';
|
2001-11-07 13:15:59 +00:00
|
|
|
}
|
2001-11-09 12:01:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
void MathExFuncInset::write(WriteStream & os) const
|
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << '\\' << name_ << '{' << cell(0) << '}';
|
2001-11-09 12:01:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|