]> git.lyx.org Git - lyx.git/blob - src/mathed/math_funcinset.C
search & replace for symbols & function
[lyx.git] / src / mathed / math_funcinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_funcinset.h"
6 #include "font.h"
7 #include "Painter.h"
8 #include "math_support.h"
9 #include "math_mathmlstream.h"
10
11
12
13 extern LyXFont WhichFont(short type, int size);
14
15
16 MathFuncInset::MathFuncInset(string const & nm)
17         : name_(nm)
18 {}
19
20
21 MathInset * MathFuncInset::clone() const
22 {
23         return new MathFuncInset(*this);
24 }
25
26
27 string const & MathFuncInset::name() const
28 {
29         return name_;
30 }
31
32
33 void MathFuncInset::setName(string const & n)
34 {
35         name_ = n;
36 }
37
38
39 void MathFuncInset::metrics(MathMetricsInfo const & mi) const 
40 {
41         mi_ = mi;
42         mathed_string_dim(LM_TC_TEXTRM, mi_, name_, ascent_, descent_, width_);
43 }
44
45
46 void MathFuncInset::draw(Painter & pain, int x, int y) const
47
48         drawStr(pain, LM_TC_TEXTRM, mi_, x, y, name_);
49 }
50
51
52 bool MathFuncInset::match(MathInset * p) const
53 {
54         MathFuncInset const * q = p->asFuncInset();
55         return q && name_ == q->name_;
56 }
57
58
59 void MathFuncInset::maplize(MapleStream & os) const
60 {
61         os << ' ' << name_.c_str();
62 }
63
64
65 void MathFuncInset::mathmlize(MathMLStream & os) const
66 {
67         os << MTag("mi") << name_.c_str() << ETag("mi");
68 }
69
70
71 void MathFuncInset::octavize(OctaveStream & os) const
72 {
73         os << ' ' << name_.c_str();
74 }
75
76
77 void MathFuncInset::normalize(NormalStream & os) const
78 {
79         os << "[func " << name_.c_str() << ']';
80 }
81
82
83 void MathFuncInset::write(WriteStream & os) const
84 {
85         os << "\\" << name_.c_str() << ' ';
86 }