]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSize.C
cursor is no more damaging the background. L-shaped cursor is broken right now....
[lyx.git] / src / mathed / InsetMathSize.C
1 /**
2  * \file InsetMathSize.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 "InsetMathSize.h"
14 #include "MathData.h"
15 #include "MathStream.h"
16 #include "MathParser.h"
17 #include "MathStream.h"
18
19 #include "support/convert.h"
20 #include "support/std_ostream.h"
21
22
23 namespace lyx {
24
25 using std::auto_ptr;
26
27
28 InsetMathSize::InsetMathSize(latexkeys const * l)
29         : InsetMathNest(1), key_(l), style_(Styles(convert<int>(l->extra)))
30 {}
31
32
33 auto_ptr<InsetBase> InsetMathSize::doClone() const
34 {
35         return auto_ptr<InsetBase>(new InsetMathSize(*this));
36 }
37
38
39 void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const
40 {
41         StyleChanger dummy(mi.base, style_);
42         cell(0).metrics(mi, dim);
43         metricsMarkers(dim);
44         dim_ = dim;
45 }
46
47
48 void InsetMathSize::draw(PainterInfo & pi, int x, int y) const
49 {
50         StyleChanger dummy(pi.base, style_);
51         cell(0).draw(pi, x + 1, y);
52         drawMarkers(pi, x, y);
53 }
54
55
56 void InsetMathSize::write(WriteStream & os) const
57 {
58         os << "{\\" << key_->name << ' ' << cell(0) << '}';
59 }
60
61
62 void InsetMathSize::normalize(NormalStream & os) const
63 {
64         os << '[' << key_->name << ' ' << cell(0) << ']';
65 }
66
67
68 void InsetMathSize::infoize(odocstream & os) const
69 {
70         os << "Size: " << key_->name;
71 }
72
73
74 } // namespace lyx