2002-07-09 09:46:31 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "math_envinset.h"
|
|
|
|
#include "math_mathmlstream.h"
|
|
|
|
#include "math_streamstr.h"
|
2002-07-09 10:06:27 +00:00
|
|
|
#include "support/LOstream.h"
|
2002-07-09 09:46:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
MathEnvInset::MathEnvInset(string const & name)
|
|
|
|
: MathNestInset(1), name_(name)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathEnvInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathEnvInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathEnvInset::metrics(MetricsInfo & mi) const
|
2002-07-09 09:46:31 +00:00
|
|
|
{
|
2002-08-02 14:29:42 +00:00
|
|
|
dim_ = cell(0).metrics(mi);
|
2002-07-11 11:27:24 +00:00
|
|
|
metricsMarkers2();
|
2002-07-09 09:46:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathEnvInset::draw(PainterInfo & pi, int x, int y) const
|
2002-07-09 09:46:31 +00:00
|
|
|
{
|
2002-08-02 14:29:42 +00:00
|
|
|
cell(0).draw(pi, x + 1, y);
|
2002-07-09 09:46:31 +00:00
|
|
|
drawMarkers2(pi, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathEnvInset::write(WriteStream & os) const
|
|
|
|
{
|
|
|
|
os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathEnvInset::normalize(NormalStream & os) const
|
|
|
|
{
|
2002-11-27 10:30:28 +00:00
|
|
|
os << "[env " << name_ << ' ' << cell(0) << ']';
|
2002-07-09 09:46:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathEnvInset::infoize(std::ostream & os) const
|
|
|
|
{
|
|
|
|
os << "Env: " << name_;
|
|
|
|
}
|