2001-02-13 13:28:32 +00:00
|
|
|
#include "math_bigopinset.h"
|
2001-07-26 14:37:09 +00:00
|
|
|
#include "mathed/math_parser.h"
|
2001-02-14 15:00:50 +00:00
|
|
|
#include "support/LOstream.h"
|
|
|
|
|
2001-07-12 07:18:29 +00:00
|
|
|
|
2001-02-14 15:00:50 +00:00
|
|
|
using std::ostream;
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2001-07-26 14:37:09 +00:00
|
|
|
MathBigopInset::MathBigopInset(const latexkeys * l)
|
|
|
|
: sym_(l)
|
2001-07-26 10:55:07 +00:00
|
|
|
{}
|
2001-02-13 13:28:32 +00:00
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
MathInset * MathBigopInset::clone() const
|
2001-02-13 13:28:32 +00:00
|
|
|
{
|
2001-06-25 00:06:33 +00:00
|
|
|
return new MathBigopInset(*this);
|
2001-02-13 13:28:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-26 06:56:43 +00:00
|
|
|
void MathBigopInset::write(ostream & os, bool /* fragile */) const
|
2001-02-28 11:56:36 +00:00
|
|
|
{
|
2001-07-26 14:37:09 +00:00
|
|
|
os << '\\' << sym_->name;
|
2001-02-28 11:56:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-26 06:56:43 +00:00
|
|
|
void MathBigopInset::writeNormal(ostream & os) const
|
2001-04-25 15:43:57 +00:00
|
|
|
{
|
2001-07-26 14:37:09 +00:00
|
|
|
os << "[bigop " << sym_->name << "] ";
|
2001-04-25 15:43:57 +00:00
|
|
|
}
|
|
|
|
|
2001-07-12 07:18:29 +00:00
|
|
|
|
2001-07-26 06:56:43 +00:00
|
|
|
void MathBigopInset::metrics(MathStyles st)
|
2001-02-13 13:28:32 +00:00
|
|
|
{
|
2001-06-25 00:06:33 +00:00
|
|
|
size(st);
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2001-07-26 14:37:09 +00:00
|
|
|
if (sym_->id > 0 && sym_->id < 256) {
|
2001-07-12 07:18:29 +00:00
|
|
|
ssym_ = string();
|
2001-07-26 14:37:09 +00:00
|
|
|
ssym_ += sym_->id;
|
2001-07-12 07:18:29 +00:00
|
|
|
code_ = LM_TC_BSYM;
|
2001-02-13 13:28:32 +00:00
|
|
|
} else {
|
2001-07-26 14:37:09 +00:00
|
|
|
ssym_ = sym_->name;
|
2001-07-12 07:18:29 +00:00
|
|
|
code_ = LM_TC_TEXTRM;
|
2001-02-13 13:28:32 +00:00
|
|
|
}
|
2001-06-27 14:10:35 +00:00
|
|
|
|
2001-07-26 06:46:50 +00:00
|
|
|
mathed_string_dim(code_, size(), ssym_, ascent_, descent_, width_);
|
2001-06-25 00:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MathBigopInset::draw(Painter & pain, int x, int y)
|
2001-07-12 07:18:29 +00:00
|
|
|
{
|
2001-06-25 00:06:33 +00:00
|
|
|
xo(x);
|
|
|
|
yo(y);
|
2001-06-27 14:10:35 +00:00
|
|
|
|
2001-07-26 06:46:50 +00:00
|
|
|
drawStr(pain, code_, size_, x, y, ssym_);
|
2001-02-13 13:28:32 +00:00
|
|
|
}
|