]> git.lyx.org Git - lyx.git/blob - src/mathed/math_exfuncinset.C
162792e320cc1d84db60853bcc8e91aec41626dd
[lyx.git] / src / mathed / math_exfuncinset.C
1 #include "math_exfuncinset.h"
2 #include "support.h"
3 #include "debug.h"
4 #include "support/LOstream.h"
5
6
7 using std::ostream;
8
9
10 MathExFuncInset::MathExFuncInset(string const & name)
11         : MathNestInset(1), name_(name)
12 {}
13
14
15 MathInset * MathExFuncInset::clone() const
16 {
17         return new MathExFuncInset(*this);
18 }
19
20
21 void MathExFuncInset::write(MathWriteInfo & os) const
22 {
23         os << '\\' << name_ << '{';
24         cell(0).write(os);
25         os << '}';
26 }
27
28
29 void MathExFuncInset::writeNormal(ostream & os) const
30 {
31         os << "[" << name_ << ' ';
32         cell(0).writeNormal(os);
33         os << "] ";
34 }
35
36
37 void MathExFuncInset::metrics(MathMetricsInfo const & mi) const
38 {
39         mi_ = mi;
40         mathed_string_dim(LM_TC_TEXTRM, mi_, name_, ascent_, descent_, width_);
41         lyxerr << "should not happen\n";
42 }
43
44
45 void MathExFuncInset::draw(Painter & pain, int x, int y) const
46 {  
47         drawStr(pain, LM_TC_TEXTRM, mi_, x, y, name_);
48         lyxerr << "should not happen\n";
49 }
50
51
52 string MathExFuncInset::octavize() const
53 {
54         return name_ + '(' + cell(0).octavize() + ')';
55 }