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