]> git.lyx.org Git - lyx.git/blob - src/mathed/math_envinset.C
IU of clone() and getLabelList()
[lyx.git] / src / mathed / math_envinset.C
1 #include <config.h>
2
3 #include "math_envinset.h"
4 #include "math_mathmlstream.h"
5 #include "math_streamstr.h"
6 #include "support/LOstream.h"
7
8
9 MathEnvInset::MathEnvInset(string const & name)
10         : MathNestInset(1), name_(name)
11 {}
12
13
14 InsetBase * MathEnvInset::clone() const
15 {
16         return new MathEnvInset(*this);
17 }
18
19
20 void MathEnvInset::metrics(MetricsInfo & mi, Dimension & dim) const
21 {
22         cell(0).metrics(mi, dim_);
23         metricsMarkers();
24         dim = dim_;
25 }
26
27
28 void MathEnvInset::draw(PainterInfo & pi, int x, int y) const
29 {
30         cell(0).draw(pi, x + 1, y);
31         drawMarkers(pi, x, y);
32 }
33
34
35 void MathEnvInset::write(WriteStream & os) const
36 {
37         os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
38 }
39
40
41 void MathEnvInset::normalize(NormalStream & os) const
42 {
43         os << "[env " << name_ << ' ' << cell(0) << ']';
44 }
45
46
47 void MathEnvInset::infoize(std::ostream & os) const
48 {
49         os << "Env: " << name_;
50 }