]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fontoldinset.C
the clone auto_ptr patch
[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 using std::auto_ptr;
14
15
16 MathFontOldInset::MathFontOldInset(latexkeys const * key)
17         : MathNestInset(1), key_(key)
18 {
19         //lock(true);
20 }
21
22
23 auto_ptr<InsetBase> MathFontOldInset::clone() const
24 {
25         return auto_ptr<InsetBase>(new MathFontOldInset(*this));
26 }
27
28
29 void MathFontOldInset::metrics(MetricsInfo & mi, Dimension & dim) const
30 {
31         FontSetChanger dummy(mi.base, key_->name.c_str());
32         cell(0).metrics(mi, dim_);
33         metricsMarkers(1);
34         dim = dim_;
35 }
36
37
38 void MathFontOldInset::draw(PainterInfo & pi, int x, int y) const
39 {
40         FontSetChanger dummy(pi.base, key_->name.c_str());
41         cell(0).draw(pi, x + 1, y);
42         drawMarkers(pi, x, y);
43 }
44
45
46 void MathFontOldInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
47 {
48         cell(0).metricsT(mi, dim);
49 }
50
51
52 void MathFontOldInset::drawT(TextPainter & pain, int x, int y) const
53 {
54         cell(0).drawT(pain, x, y);
55 }
56
57
58 void MathFontOldInset::write(WriteStream & os) const
59 {
60         os << "{\\" << key_->name << ' ' << cell(0) << '}';
61 }
62
63
64 void MathFontOldInset::normalize(NormalStream & os) const
65 {
66         os << "[font " << key_->name << ' ' << cell(0) << ']';
67 }
68
69
70 void MathFontOldInset::infoize(std::ostream & os) const
71 {
72         os << "Font: " << key_->name;
73 }