]> git.lyx.org Git - lyx.git/blob - src/mathed/math_sizeinset.C
Point fix, earlier forgotten
[lyx.git] / src / mathed / math_sizeinset.C
1 /**
2  * \file math_sizeinset.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_sizeinset.h"
14 #include "math_parser.h"
15 #include "math_mathmlstream.h"
16 #include "math_streamstr.h"
17 #include "math_support.h"
18 #include "support/LOstream.h"
19
20 using std::atoi;
21 using std::auto_ptr;
22
23
24 MathSizeInset::MathSizeInset(latexkeys const * l)
25         : MathNestInset(1), key_(l), style_(Styles(atoi(l->extra.c_str())))
26 {}
27
28
29 auto_ptr<InsetBase> MathSizeInset::clone() const
30 {
31         return auto_ptr<InsetBase>(new MathSizeInset(*this));
32 }
33
34
35 void MathSizeInset::metrics(MetricsInfo & mi, Dimension & dim) const
36 {
37         StyleChanger dummy(mi.base, style_);
38         cell(0).metrics(mi, dim_);
39         metricsMarkers();
40         dim = dim_;
41 }
42
43
44 void MathSizeInset::draw(PainterInfo & pi, int x, int y) const
45 {
46         StyleChanger dummy(pi.base, style_);
47         cell(0).draw(pi, x + 1, y);
48         drawMarkers(pi, x, y);
49 }
50
51
52 void MathSizeInset::write(WriteStream & os) const
53 {
54         os << "{\\" << key_->name << ' ' << cell(0) << '}';
55 }
56
57
58 void MathSizeInset::normalize(NormalStream & os) const
59 {
60         os << '[' << key_->name << ' ' << cell(0) << ']';
61 }
62
63
64 void MathSizeInset::infoize(std::ostream & os) const
65 {
66         os << "Size: " << key_->name;
67 }