]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathEnv.cpp
Sort the language nesting mess with polyglossia
[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
15 #include "MathData.h"
16 #include "MathStream.h"
17 #include "MathStream.h"
18
19 #include "support/gettext.h"
20 #include "support/lstrings.h"
21
22 #include <ostream>
23
24 using namespace lyx::support;
25
26 namespace lyx {
27
28 InsetMathEnv::InsetMathEnv(Buffer * buf, docstring const & name)
29         : InsetMathNest(buf, 1), name_(name)
30 {}
31
32
33 Inset * InsetMathEnv::clone() const
34 {
35         return new InsetMathEnv(*this);
36 }
37
38
39 void InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const
40 {
41         cell(0).metrics(mi, dim);
42         metricsMarkers(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         MathEnsurer ensurer(os);
56         os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
57 }
58
59
60 void InsetMathEnv::normalize(NormalStream & os) const
61 {
62         os << "[env " << name_ << ' ' << cell(0) << ']';
63 }
64
65
66 void InsetMathEnv::infoize(odocstream & os) const
67 {
68         os << bformat(_("Environment: %1$s"), name_);
69 }
70
71
72 } // namespace lyx