2002-02-05 13:27:34 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_xarrowinset.h"
|
|
|
|
#include "math_support.h"
|
|
|
|
#include "math_parser.h"
|
|
|
|
#include "math_mathmlstream.h"
|
|
|
|
#include "math_streamstr.h"
|
|
|
|
|
|
|
|
|
|
|
|
MathXArrowInset::MathXArrowInset(string const & name)
|
|
|
|
: MathNestInset(1), name_(name)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
MathInset * MathXArrowInset::clone() const
|
2002-03-21 17:42:56 +00:00
|
|
|
{
|
2002-02-05 13:27:34 +00:00
|
|
|
return new MathXArrowInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-05-30 07:09:54 +00:00
|
|
|
void MathXArrowInset::metrics(MathMetricsInfo & mi) const
|
2002-02-05 13:27:34 +00:00
|
|
|
{
|
2002-05-30 07:09:54 +00:00
|
|
|
//MathMetricsInfo mi = st;
|
|
|
|
//smallerStyleScript(mi);
|
2002-02-05 13:27:34 +00:00
|
|
|
xcell(0).metrics(mi);
|
|
|
|
width_ = xcell(0).width() + 10;
|
|
|
|
ascent_ = xcell(0).height() + 10;
|
|
|
|
descent_ = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-05-30 07:09:54 +00:00
|
|
|
void MathXArrowInset::draw(MathPainterInfo & pain, int x, int y) const
|
2002-03-21 17:42:56 +00:00
|
|
|
{
|
2002-02-05 13:27:34 +00:00
|
|
|
xcell(0).draw(pain, x + 5, y - 10);
|
|
|
|
mathed_draw_deco(pain, x + 1, y - 7, width_ - 2, 5, name_);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathXArrowInset::write(WriteStream & os) const
|
|
|
|
{
|
|
|
|
os << '\\' << name_ << '{' << cell(0) << '}';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathXArrowInset::normalize(NormalStream & os) const
|
|
|
|
{
|
|
|
|
os << "[xarrow " << name_ << ' ' << cell(0) << ']';
|
|
|
|
}
|