2001-06-25 00:06:33 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_sizeinset.h"
|
2001-08-10 13:50:42 +00:00
|
|
|
#include "math_parser.h"
|
2001-06-27 15:33:55 +00:00
|
|
|
#include "support/LOstream.h"
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
2001-08-10 13:50:42 +00:00
|
|
|
MathSizeInset::MathSizeInset(latexkeys const * l)
|
|
|
|
: MathNestInset(1), key_(l)
|
2001-08-08 17:26:30 +00:00
|
|
|
{}
|
2001-06-25 00:06:33 +00:00
|
|
|
|
2001-06-27 15:33:55 +00:00
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
MathInset * MathSizeInset::clone() const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
|
|
|
return new MathSizeInset(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-06 17:20:26 +00:00
|
|
|
void MathSizeInset::draw(Painter & pain, int x, int y) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
|
|
|
xo(x);
|
|
|
|
yo(y);
|
|
|
|
xcell(0).draw(pain, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
void MathSizeInset::metrics(MathMetricsInfo const & st) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2001-10-19 11:25:48 +00:00
|
|
|
size_ = st;
|
|
|
|
size_.size = MathStyles(key_->id);
|
|
|
|
xcell(0).metrics(size_);
|
2001-06-25 00:06:33 +00:00
|
|
|
ascent_ = xcell(0).ascent_;
|
|
|
|
descent_ = xcell(0).descent_;
|
|
|
|
width_ = xcell(0).width_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
void MathSizeInset::write(MathWriteInfo & os) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2001-10-19 11:25:48 +00:00
|
|
|
os << "{\\" << key_->name << ' ' << cell(0) << '}';
|
2001-06-25 00:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-26 06:56:43 +00:00
|
|
|
void MathSizeInset::writeNormal(std::ostream & os) const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2001-08-10 13:50:42 +00:00
|
|
|
os << "[" << key_->name << " ";
|
2001-07-26 06:56:43 +00:00
|
|
|
cell(0).writeNormal(os);
|
2001-06-25 00:06:33 +00:00
|
|
|
os << "]";
|
|
|
|
}
|