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.
8 * Full author contact details are available in file CREDITS.
13 #include "math_envinset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16 #include "support/std_ostream.h"
21 MathEnvInset::MathEnvInset(string const & name)
22 : MathNestInset(1), name_(name)
26 auto_ptr<InsetBase> MathEnvInset::clone() const
28 return auto_ptr<InsetBase>(new MathEnvInset(*this));
32 void MathEnvInset::metrics(MetricsInfo & mi, Dimension & dim) const
34 cell(0).metrics(mi, dim_);
40 void MathEnvInset::draw(PainterInfo & pi, int x, int y) const
42 cell(0).draw(pi, x + 1, y);
43 drawMarkers(pi, x, y);
47 void MathEnvInset::write(WriteStream & os) const
49 os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
53 void MathEnvInset::normalize(NormalStream & os) const
55 os << "[env " << name_ << ' ' << cell(0) << ']';
59 void MathEnvInset::infoize(std::ostream & os) const
61 os << "Env: " << name_;