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