]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fontoldinset.C
IU of clone() and getLabelList()
[lyx.git] / src / mathed / math_fontoldinset.C
1 #include <config.h>
2
3
4 #include "math_fontoldinset.h"
5 #include "math_mathmlstream.h"
6 #include "math_streamstr.h"
7 #include "math_support.h"
8 #include "math_parser.h"
9 #include "textpainter.h"
10 #include "support/LOstream.h"
11 #include "frontends/Painter.h"
12
13
14
15 MathFontOldInset::MathFontOldInset(latexkeys const * key)
16         : MathNestInset(1), key_(key)
17 {
18         //lock(true);
19 }
20
21
22 InsetBase * MathFontOldInset::clone() const
23 {
24         return new MathFontOldInset(*this);
25 }
26
27
28 void MathFontOldInset::metrics(MetricsInfo & mi, Dimension & dim) const
29 {
30         FontSetChanger dummy(mi.base, key_->name.c_str());
31         cell(0).metrics(mi, dim_);
32         metricsMarkers(1);
33         dim = dim_;
34 }
35
36
37 void MathFontOldInset::draw(PainterInfo & pi, int x, int y) const
38 {
39         FontSetChanger dummy(pi.base, key_->name.c_str());
40         cell(0).draw(pi, x + 1, y);
41         drawMarkers(pi, x, y);
42 }
43
44
45 void MathFontOldInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
46 {
47         cell(0).metricsT(mi, dim);
48 }
49
50
51 void MathFontOldInset::drawT(TextPainter & pain, int x, int y) const
52 {
53         cell(0).drawT(pain, x, y);
54 }
55
56
57 void MathFontOldInset::write(WriteStream & os) const
58 {
59         os << "{\\" << key_->name << ' ' << cell(0) << '}';
60 }
61
62
63 void MathFontOldInset::normalize(NormalStream & os) const
64 {
65         os << "[font " << key_->name << ' ' << cell(0) << ']';
66 }
67
68
69 void MathFontOldInset::infoize(std::ostream & os) const
70 {
71         os << "Font: " << key_->name;
72 }