]> git.lyx.org Git - lyx.git/blob - src/mathed/math_exfuncinset.C
fonts as insets
[lyx.git] / src / mathed / math_exfuncinset.C
1 #include <config.h>
2
3 #include "math_exfuncinset.h"
4 #include "math_support.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7
8
9 MathExFuncInset::MathExFuncInset(string const & name)
10         : MathNestInset(1), name_(name)
11 {}
12
13
14 MathInset * MathExFuncInset::clone() const
15 {
16         return new MathExFuncInset(*this);
17 }
18
19
20 void MathExFuncInset::metrics(MathMetricsInfo & mi) const
21 {
22         mathed_string_dim(mi.base.font, name_, ascent_, descent_, width_);
23 }
24
25
26 void MathExFuncInset::draw(MathPainterInfo & pi, int x, int y) const
27 {
28         drawStrBlack(pi, x, y, name_);
29 }
30
31
32 void MathExFuncInset::normalize(NormalStream & os) const
33 {
34         os << '[' << name_ << ' ' << cell(0) << ']';
35 }
36
37
38 void MathExFuncInset::maplize(MapleStream & os) const
39 {
40         os << name_ << '(' << cell(0) << ')';
41 }
42
43
44 void MathExFuncInset::mathmlize(MathMLStream & os) const
45 {
46         os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
47 }
48
49
50 void MathExFuncInset::octavize(OctaveStream & os) const
51 {
52         os << name_ << '(' << cell(0) << ')';
53 }
54
55
56 void MathExFuncInset::write(WriteStream & os) const
57 {
58         os << '\\' << name_ << '{' << cell(0) << '}';
59 }