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