]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathFontOld.cpp
Pick up some stitches dropped by Abdel ;-)
[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 bool 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         if (dim_ == dim)
42                 return false;
43         dim_ = dim;
44         return true;
45 }
46
47
48 void InsetMathFontOld::draw(PainterInfo & pi, int x, int y) const
49 {
50         FontSetChanger dummy(pi.base, key_->name.c_str());
51         cell(0).draw(pi, x + 1, y);
52         drawMarkers(pi, x, y);
53 }
54
55
56 void InsetMathFontOld::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
57 {
58         cell(0).metricsT(mi, dim);
59 }
60
61
62 void InsetMathFontOld::drawT(TextPainter & pain, int x, int y) const
63 {
64         cell(0).drawT(pain, x, y);
65 }
66
67
68 void InsetMathFontOld::write(WriteStream & os) const
69 {
70         os << "{\\" << key_->name << ' ' << cell(0) << '}';
71 }
72
73
74 void InsetMathFontOld::normalize(NormalStream & os) const
75 {
76         os << "[font " << key_->name << ' ' << cell(0) << ']';
77 }
78
79
80 void InsetMathFontOld::infoize(odocstream & os) const
81 {
82         os << "Font: " << key_->name;
83 }
84
85
86 } // namespace lyx