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