]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathFontOld.cpp
Coding style
[lyx.git] / src / mathed / InsetMathFontOld.cpp
1 /**
2  * \file InsetMathFontOld.cpp
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 "InsetMathFontOld.h"
14
15 #include "MathData.h"
16 #include "MathStream.h"
17 #include "MathParser.h"
18 #include "MetricsInfo.h"
19
20 #include <ostream>
21
22
23 namespace lyx {
24
25 InsetMathFontOld::InsetMathFontOld(latexkeys const * key)
26         : InsetMathNest(1), key_(key)
27 {
28         //lock(true);
29 }
30
31
32 Inset * InsetMathFontOld::clone() const
33 {
34         return new InsetMathFontOld(*this);
35 }
36
37
38 void InsetMathFontOld::metrics(MetricsInfo & mi, Dimension & dim) const
39 {
40         FontSetChanger dummy(mi.base, key_->name.c_str());
41         cell(0).metrics(mi, dim);
42         metricsMarkers(dim);
43 }
44
45
46 void InsetMathFontOld::draw(PainterInfo & pi, int x, int y) const
47 {
48         FontSetChanger dummy(pi.base, key_->name.c_str());
49         cell(0).draw(pi, x + 1, y);
50         drawMarkers(pi, x, y);
51 }
52
53
54 void InsetMathFontOld::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
55 {
56         cell(0).metricsT(mi, dim);
57 }
58
59
60 void InsetMathFontOld::drawT(TextPainter & pain, int x, int y) const
61 {
62         cell(0).drawT(pain, x, y);
63 }
64
65
66 void InsetMathFontOld::write(WriteStream & os) const
67 {
68         os << "{\\" << key_->name << ' ' << cell(0) << '}';
69 }
70
71
72 void InsetMathFontOld::normalize(NormalStream & os) const
73 {
74         os << "[font " << key_->name << ' ' << cell(0) << ']';
75 }
76
77
78 void InsetMathFontOld::infoize(odocstream & os) const
79 {
80         os << "Font: " << key_->name;
81 }
82
83
84 } // namespace lyx