]> git.lyx.org Git - lyx.git/blob - src/mathed/math_unknowninset.C
small up/down tweaking
[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 "math_support.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
11
12
13 MathUnknownInset::MathUnknownInset(string const & nm, bool final, bool black)
14         : name_(nm), final_(final), black_(black)
15 {}
16
17
18 MathInset * MathUnknownInset::clone() const
19 {
20         return new MathUnknownInset(*this);
21 }
22
23
24 string MathUnknownInset::name() const
25 {
26         return name_;
27 }
28
29
30 void MathUnknownInset::setName(string const & name)
31 {
32         name_ = name;
33 }
34
35
36 bool MathUnknownInset::match(MathAtom const & at) const
37 {
38         MathUnknownInset const * q = at->asUnknownInset();
39         return q && name_ == q->name_;
40 }
41
42
43 void MathUnknownInset::normalize(NormalStream & os) const
44 {
45         os << "[unknown " << name_ << ']';
46 }
47
48
49 void MathUnknownInset::metrics(MathMetricsInfo & mi) const
50 {
51         mathed_string_dim(mi.base.font, name_, dim_);
52 }
53
54
55 void MathUnknownInset::draw(MathPainterInfo & pi, int x, int y) const
56 {
57         if (black_)
58                 drawStrBlack(pi, x, y, name_);
59         else
60                 drawStrRed(pi, x, y, name_);
61 }
62
63
64 void MathUnknownInset::finalize()
65 {
66         final_ = true;
67 }
68
69
70 bool MathUnknownInset::final() const
71 {
72         return final_;
73 }
74
75
76 void MathUnknownInset::maplize(MapleStream & os) const
77 {
78         os << name_;
79 }
80
81 void MathUnknownInset::mathematicize(MathematicaStream & os) const
82 {
83         os << name_;
84 }
85
86
87 void MathUnknownInset::mathmlize(MathMLStream & os) const
88 {
89         os << MTag("mi") << name_ << ETag("mi");
90 }
91
92
93 void MathUnknownInset::octavize(OctaveStream & os) const
94 {
95         os << name_;
96 }