2001-12-05 08:04:20 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
#include "math_sizeinset.h"
|
2001-08-10 13:50:42 +00:00
|
|
|
#include "math_parser.h"
|
2001-11-08 12:06:56 +00:00
|
|
|
#include "math_mathmlstream.h"
|
2001-12-05 08:04:20 +00:00
|
|
|
#include "math_streamstr.h"
|
2002-01-03 12:02:54 +00:00
|
|
|
#include "math_support.h"
|
2002-07-10 06:52:05 +00:00
|
|
|
#include "support/LOstream.h"
|
2001-06-25 00:06:33 +00:00
|
|
|
|
2003-05-14 16:29:25 +00:00
|
|
|
|
2002-07-17 15:57:03 +00:00
|
|
|
using std::atoi;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
2001-08-10 13:50:42 +00:00
|
|
|
MathSizeInset::MathSizeInset(latexkeys const * l)
|
2003-03-21 14:20:48 +00:00
|
|
|
: MathNestInset(1), key_(l), style_(Styles(atoi(l->extra.c_str())))
|
2001-08-08 17:26:30 +00:00
|
|
|
{}
|
2001-06-25 00:06:33 +00:00
|
|
|
|
2001-06-27 15:33:55 +00:00
|
|
|
|
2003-06-16 11:49:38 +00:00
|
|
|
InsetBase * MathSizeInset::clone() const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
|
|
|
return new MathSizeInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
void MathSizeInset::metrics(MetricsInfo & mi, Dimension & dim) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
StyleChanger dummy(mi.base, style_);
|
2003-05-28 13:22:36 +00:00
|
|
|
cell(0).metrics(mi, dim_);
|
|
|
|
metricsMarkers();
|
2003-06-02 10:03:27 +00:00
|
|
|
dim = dim_;
|
2001-06-25 00:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void MathSizeInset::draw(PainterInfo & pi, int x, int y) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2003-03-21 14:20:48 +00:00
|
|
|
StyleChanger dummy(pi.base, style_);
|
2002-08-02 14:29:42 +00:00
|
|
|
cell(0).draw(pi, x + 1, y);
|
2003-05-28 13:22:36 +00:00
|
|
|
drawMarkers(pi, x, y);
|
2001-06-25 00:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathSizeInset::write(WriteStream & os) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2001-12-05 08:04:20 +00:00
|
|
|
os << "{\\" << key_->name << ' ' << cell(0) << '}';
|
2001-06-25 00:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-09 08:35:57 +00:00
|
|
|
void MathSizeInset::normalize(NormalStream & os) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2002-11-27 10:30:28 +00:00
|
|
|
os << '[' << key_->name << ' ' << cell(0) << ']';
|
2001-06-25 00:06:33 +00:00
|
|
|
}
|
2002-07-10 06:52:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
void MathSizeInset::infoize(std::ostream & os) const
|
|
|
|
{
|
|
|
|
os << "Size: " << key_->name;
|
|
|
|
}
|