]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathEnv.C
cursor is no more damaging the background. L-shaped cursor is broken right now....
[lyx.git] / src / mathed / InsetMathEnv.C
1 /**
2  * \file InsetMathEnv.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 "InsetMathEnv.h"
14 #include "MathData.h"
15 #include "MathStream.h"
16 #include "MathStream.h"
17 #include "support/std_ostream.h"
18
19
20 namespace lyx {
21
22
23 using std::string;
24 using std::auto_ptr;
25
26
27 InsetMathEnv::InsetMathEnv(docstring const & name)
28         : InsetMathNest(1), name_(name)
29 {}
30
31
32 auto_ptr<InsetBase> InsetMathEnv::doClone() const
33 {
34         return auto_ptr<InsetBase>(new InsetMathEnv(*this));
35 }
36
37
38 void InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const
39 {
40         cell(0).metrics(mi, dim);
41         metricsMarkers(dim);
42         dim_ = dim;
43 }
44
45
46 void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const
47 {
48         cell(0).draw(pi, x + 1, y);
49         drawMarkers(pi, x, y);
50 }
51
52
53 void InsetMathEnv::write(WriteStream & os) const
54 {
55         os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
56 }
57
58
59 void InsetMathEnv::normalize(NormalStream & os) const
60 {
61         os << "[env " << name_ << ' ' << cell(0) << ']';
62 }
63
64
65 void InsetMathEnv::infoize(odocstream & os) const
66 {
67         os << "Env: " << name_;
68 }
69
70
71 } // namespace lyx