lyx_mirror/src/mathed/math_symbolinset.C
André Pönitz 811980f739 rename MathBigopInset into MathSymbolInset. That's what it is nowadays...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2365 a592a061-630c-0410-9148-cb99ea01b6c8
2001-07-27 10:08:04 +00:00

55 lines
941 B
C

#include "math_symbolinset.h"
#include "mathed/math_parser.h"
#include "support/LOstream.h"
using std::ostream;
MathSymbolInset::MathSymbolInset(const latexkeys * l)
: sym_(l)
{}
MathInset * MathSymbolInset::clone() const
{
return new MathSymbolInset(*this);
}
void MathSymbolInset::write(ostream & os, bool /* fragile */) const
{
os << '\\' << sym_->name << ' ';
}
void MathSymbolInset::writeNormal(ostream & os) const
{
os << "[bigop " << sym_->name << "] ";
}
void MathSymbolInset::metrics(MathStyles st)
{
size(st);
if (sym_->id > 0 && sym_->id < 256) {
ssym_ = string();
ssym_ += sym_->id;
code_ = (sym_->token == LM_TK_BIGSYM) ? LM_TC_BSYM : LM_TC_SYMB;
} else {
ssym_ = sym_->name;
code_ = LM_TC_TEXTRM;
}
mathed_string_dim(code_, size(), ssym_, ascent_, descent_, width_);
}
void MathSymbolInset::draw(Painter & pain, int x, int y)
{
xo(x);
yo(y);
drawStr(pain, code_, size_, x, y, ssym_);
}