2001-12-18 03:16:46 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-11-12 16:45:09 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_casesinset.h"
|
|
|
|
#include "math_parser.h"
|
|
|
|
#include "math_mathmlstream.h"
|
|
|
|
#include "math_support.h"
|
|
|
|
#include "Painter.h"
|
|
|
|
|
|
|
|
|
|
|
|
MathCasesInset::MathCasesInset(row_type n)
|
|
|
|
: MathGridInset(2, n, 'c', "ll")
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathCasesInset::clone() const
|
|
|
|
{
|
|
|
|
return new MathCasesInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathCasesInset::metrics(MathMetricsInfo const & mi) const
|
|
|
|
{
|
|
|
|
MathGridInset::metrics(mi);
|
|
|
|
width_ += 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathCasesInset::draw(Painter & pain, int x, int y) const
|
|
|
|
{
|
|
|
|
mathed_draw_deco(pain, x + 1, y - ascent(), 6, height(), "{");
|
|
|
|
MathGridInset::draw(pain, x + 8, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathCasesInset::write(WriteStream & os) const
|
|
|
|
{
|
2001-12-03 16:24:50 +00:00
|
|
|
if (os.fragile())
|
2001-11-12 16:45:09 +00:00
|
|
|
os << "\\protect";
|
2002-03-19 16:55:58 +00:00
|
|
|
os << "\\begin{cases}\n";
|
2001-11-12 16:45:09 +00:00
|
|
|
MathGridInset::write(os);
|
2001-12-03 16:24:50 +00:00
|
|
|
if (os.fragile())
|
2001-11-12 16:45:09 +00:00
|
|
|
os << "\\protect";
|
2002-03-18 13:05:52 +00:00
|
|
|
os << "\\end{cases}";
|
2001-11-12 16:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathCasesInset::normalize(NormalStream & os) const
|
|
|
|
{
|
|
|
|
os << "[cases ";
|
|
|
|
MathGridInset::normalize(os);
|
|
|
|
os << "]";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathCasesInset::maplize(MapleStream & os) const
|
|
|
|
{
|
|
|
|
os << "cases(";
|
|
|
|
MathGridInset::maplize(os);
|
|
|
|
os << ")";
|
|
|
|
}
|