]> git.lyx.org Git - lyx.git/blob - src/mathed/math_envinset.C
split LyXText::rowlist_ into individual Paragraph::rows_ chunks
[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 using std::auto_ptr;
9
10
11 MathEnvInset::MathEnvInset(string const & name)
12         : MathNestInset(1), name_(name)
13 {}
14
15
16 auto_ptr<InsetBase> MathEnvInset::clone() const
17 {
18         return auto_ptr<InsetBase>(new MathEnvInset(*this));
19 }
20
21
22 void MathEnvInset::metrics(MetricsInfo & mi, Dimension & dim) const
23 {
24         cell(0).metrics(mi, dim_);
25         metricsMarkers();
26         dim = dim_;
27 }
28
29
30 void MathEnvInset::draw(PainterInfo & pi, int x, int y) const
31 {
32         cell(0).draw(pi, x + 1, y);
33         drawMarkers(pi, x, y);
34 }
35
36
37 void MathEnvInset::write(WriteStream & os) const
38 {
39         os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
40 }
41
42
43 void MathEnvInset::normalize(NormalStream & os) const
44 {
45         os << "[env " << name_ << ' ' << cell(0) << ']';
46 }
47
48
49 void MathEnvInset::infoize(std::ostream & os) const
50 {
51         os << "Env: " << name_;
52 }