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