]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fontoldinset.C
Standardise the header blurb in mathed.
[lyx.git] / src / mathed / math_fontoldinset.C
1 /**
2  * \file math_fontoldinset.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "math_fontoldinset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16 #include "math_support.h"
17 #include "math_parser.h"
18 #include "textpainter.h"
19 #include "support/LOstream.h"
20 #include "frontends/Painter.h"
21
22 using std::auto_ptr;
23
24
25 MathFontOldInset::MathFontOldInset(latexkeys const * key)
26         : MathNestInset(1), key_(key)
27 {
28         //lock(true);
29 }
30
31
32 auto_ptr<InsetBase> MathFontOldInset::clone() const
33 {
34         return auto_ptr<InsetBase>(new MathFontOldInset(*this));
35 }
36
37
38 void MathFontOldInset::metrics(MetricsInfo & mi, Dimension & dim) const
39 {
40         FontSetChanger dummy(mi.base, key_->name.c_str());
41         cell(0).metrics(mi, dim_);
42         metricsMarkers(1);
43         dim = dim_;
44 }
45
46
47 void MathFontOldInset::draw(PainterInfo & pi, int x, int y) const
48 {
49         FontSetChanger dummy(pi.base, key_->name.c_str());
50         cell(0).draw(pi, x + 1, y);
51         drawMarkers(pi, x, y);
52 }
53
54
55 void MathFontOldInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
56 {
57         cell(0).metricsT(mi, dim);
58 }
59
60
61 void MathFontOldInset::drawT(TextPainter & pain, int x, int y) const
62 {
63         cell(0).drawT(pain, x, y);
64 }
65
66
67 void MathFontOldInset::write(WriteStream & os) const
68 {
69         os << "{\\" << key_->name << ' ' << cell(0) << '}';
70 }
71
72
73 void MathFontOldInset::normalize(NormalStream & os) const
74 {
75         os << "[font " << key_->name << ' ' << cell(0) << ']';
76 }
77
78
79 void MathFontOldInset::infoize(std::ostream & os) const
80 {
81         os << "Font: " << key_->name;
82 }