7 #include "math_funcinset.h"
8 #include "frontends/font_metrics.h"
9 #include "frontends/Painter.h"
10 #include "math_support.h"
11 #include "math_mathmlstream.h"
12 #include "math_streamstr.h"
15 extern LyXFont WhichFont(short type, int size);
18 MathFuncInset::MathFuncInset(string const & nm)
23 MathInset * MathFuncInset::clone() const
25 return new MathFuncInset(*this);
29 string const & MathFuncInset::name() const
35 void MathFuncInset::setName(string const & n)
41 void MathFuncInset::metrics(MathMetricsInfo & mi) const
43 mathed_string_dim(mi.font_, name_, ascent_, descent_, width_);
47 void MathFuncInset::draw(Painter & pain, int x, int y) const
49 drawStr(pain, mi.font_, x, y, name_);
53 bool MathFuncInset::match(MathInset * p) const
55 MathFuncInset const * q = p->asFuncInset();
56 return q && name_ == q->name_;
60 void MathFuncInset::maplize(MapleStream & os) const
66 void MathFuncInset::mathmlize(MathMLStream & os) const
68 os << MTag("mi") << name_ << ETag("mi");
72 void MathFuncInset::octavize(OctaveStream & os) const
78 void MathFuncInset::normalize(NormalStream & os) const
80 os << "[func " << name_ << ']';
84 void MathFuncInset::write(WriteStream & os) const
86 os << "\\" << name_ << ' ';