]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathEnv.cpp
a0051ade0a003c470cfa0280b37b900bc356836f
[lyx.git] / src / mathed / InsetMathEnv.cpp
1 /**
2  * \file InsetMathEnv.cpp
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 InsetMathEnv::InsetMathEnv(docstring const & name)
23         : InsetMathNest(1), name_(name)
24 {}
25
26
27 Inset * InsetMathEnv::clone() const
28 {
29         return new InsetMathEnv(*this);
30 }
31
32
33 bool InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const
34 {
35         cell(0).metrics(mi, dim);
36         metricsMarkers(dim);
37         if (dim_ == dim)
38                 return false;
39         dim_ = dim;
40         return true;
41 }
42
43
44 void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const
45 {
46         cell(0).draw(pi, x + 1, y);
47         drawMarkers(pi, x, y);
48 }
49
50
51 void InsetMathEnv::write(WriteStream & os) const
52 {
53         os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
54 }
55
56
57 void InsetMathEnv::normalize(NormalStream & os) const
58 {
59         os << "[env " << name_ << ' ' << cell(0) << ']';
60 }
61
62
63 void InsetMathEnv::infoize(odocstream & os) const
64 {
65         os << "Env: " << name_;
66 }
67
68
69 } // namespace lyx