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