2001-07-27 10:08:04 +00:00
|
|
|
#include "math_symbolinset.h"
|
2001-08-09 09:19:18 +00:00
|
|
|
#include "math_parser.h"
|
|
|
|
#include "support.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-27 10:08:04 +00:00
|
|
|
MathSymbolInset::MathSymbolInset(const latexkeys * l)
|
2001-07-26 14:37:09 +00:00
|
|
|
: sym_(l)
|
2001-07-26 10:55:07 +00:00
|
|
|
{}
|
2001-02-13 13:28:32 +00:00
|
|
|
|
|
|
|
|
2001-07-27 10:08:04 +00:00
|
|
|
MathInset * MathSymbolInset::clone() const
|
2001-02-13 13:28:32 +00:00
|
|
|
{
|
2001-07-27 10:08:04 +00:00
|
|
|
return new MathSymbolInset(*this);
|
2001-02-13 13:28:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-27 10:08:04 +00:00
|
|
|
void MathSymbolInset::write(ostream & os, bool /* fragile */) const
|
2001-02-28 11:56:36 +00:00
|
|
|
{
|
2001-07-26 15:28:45 +00:00
|
|
|
os << '\\' << sym_->name << ' ';
|
2001-02-28 11:56:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-27 10:08:04 +00:00
|
|
|
void MathSymbolInset::writeNormal(ostream & os) const
|
2001-04-25 15:43:57 +00:00
|
|
|
{
|
2001-08-16 12:34:48 +00:00
|
|
|
os << "[" << sym_->name << "] ";
|
2001-04-25 15:43:57 +00:00
|
|
|
}
|
|
|
|
|
2001-07-12 07:18:29 +00:00
|
|
|
|
2001-08-06 17:20:26 +00:00
|
|
|
void MathSymbolInset::metrics(MathStyles st) const
|
2001-02-13 13:28:32 +00:00
|
|
|
{
|
2001-06-25 00:06:33 +00:00
|
|
|
size(st);
|
2001-08-09 15:19:31 +00:00
|
|
|
mathed_char_dim(LM_TC_SYMB, size_, sym_->id, ascent_, descent_, width_);
|
2001-06-25 00:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-06 17:20:26 +00:00
|
|
|
void MathSymbolInset::draw(Painter & pain, int x, int y) const
|
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-08-09 15:19:31 +00:00
|
|
|
drawChar(pain, LM_TC_SYMB, size_, x, y, sym_->id);
|
2001-02-13 13:28:32 +00:00
|
|
|
}
|
2001-08-09 08:53:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
bool MathSymbolInset::isRelOp() const
|
|
|
|
{
|
|
|
|
return sym_->id == LM_leq || sym_->id == LM_geq;
|
|
|
|
}
|