]> git.lyx.org Git - features.git/blob - src/mathed/math_envinset.C
Replace LString.h with support/std_string.h,
[features.git] / src / mathed / math_envinset.C
1 /**
2  * \file math_envinset.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_envinset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16 #include "support/std_ostream.h"
17
18 using std::auto_ptr;
19
20
21 MathEnvInset::MathEnvInset(string const & name)
22         : MathNestInset(1), name_(name)
23 {}
24
25
26 auto_ptr<InsetBase> MathEnvInset::clone() const
27 {
28         return auto_ptr<InsetBase>(new MathEnvInset(*this));
29 }
30
31
32 void MathEnvInset::metrics(MetricsInfo & mi, Dimension & dim) const
33 {
34         cell(0).metrics(mi, dim_);
35         metricsMarkers();
36         dim = dim_;
37 }
38
39
40 void MathEnvInset::draw(PainterInfo & pi, int x, int y) const
41 {
42         cell(0).draw(pi, x + 1, y);
43         drawMarkers(pi, x, y);
44 }
45
46
47 void MathEnvInset::write(WriteStream & os) const
48 {
49         os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
50 }
51
52
53 void MathEnvInset::normalize(NormalStream & os) const
54 {
55         os << "[env " << name_ << ' ' << cell(0) << ']';
56 }
57
58
59 void MathEnvInset::infoize(std::ostream & os) const
60 {
61         os << "Env: " << name_;
62 }