#include "math_bigopinset.h"
#include "math_bigopinset.h"
-#include "Painter.h"
-#include "mathed/support.h"
+#include "mathed/math_parser.h"
#include "support/LOstream.h"
using std::ostream;
#include "support/LOstream.h"
using std::ostream;
-MathBigopInset::MathBigopInset(string const & name, int id)
- : MathInset(0, name), sym_(id)
+MathBigopInset::MathBigopInset(const latexkeys * l)
+ : sym_(l)
void MathBigopInset::write(ostream & os, bool /* fragile */) const
{
void MathBigopInset::write(ostream & os, bool /* fragile */) const
{
- //bool f = sym_ != LM_int && sym_ != LM_oint && size() == LM_ST_DISPLAY;
- os << '\\' << name();
+ os << '\\' << sym_->name;
}
void MathBigopInset::writeNormal(ostream & os) const
{
}
void MathBigopInset::writeNormal(ostream & os) const
{
- os << "[bigop " << name() << "] ";
+ os << "[bigop " << sym_->name << "] ";
}
void MathBigopInset::metrics(MathStyles st)
{
}
void MathBigopInset::metrics(MathStyles st)
{
- //cerr << "\nBigopDraw: " << name_ << ": " << sym_ << "\n";
- if (sym_ && (sym_ < 256 || sym_ == LM_oint)) {
+ if (sym_->id > 0 && sym_->id < 256) {
- ssym_ += (sym_ == LM_oint) ? LM_int : sym_;
code_ = LM_TC_BSYM;
} else {
code_ = LM_TC_BSYM;
} else {
code_ = LM_TC_TEXTRM;
}
mathed_string_dim(code_, size(), ssym_, ascent_, descent_, width_);
code_ = LM_TC_TEXTRM;
}
mathed_string_dim(code_, size(), ssym_, ascent_, descent_, width_);
- if (sym_ == LM_oint)
- width_ += 2;
yo(y);
drawStr(pain, code_, size_, x, y, ssym_);
yo(y);
drawStr(pain, code_, size_, x, y, ssym_);
-
- if (sym_ == LM_oint) {
- int xx = x - 1;
- int yy = y - (ascent_ - descent_) / 2;
- pain.arc(xx, yy, width_, width_, 0, 360 * 64, LColor::mathline);
- }
/// big operators
class MathBigopInset : public MathInset {
public:
///
/// big operators
class MathBigopInset : public MathInset {
public:
///
- MathBigopInset(string const &, int);
+ explicit MathBigopInset(latexkeys const *);
///
MathInset * clone() const;
///
///
MathInset * clone() const;
///
bool isScriptable() const { return true; }
private:
///
bool isScriptable() const { return true; }
private:
///
+ latexkeys const * sym_;
switch (l->token) {
case LM_TK_BIGSYM:
case LM_TK_FUNCLIM:
switch (l->token) {
case LM_TK_BIGSYM:
case LM_TK_FUNCLIM:
- p = new MathBigopInset(s, l->id);
+ p = new MathBigopInset(l);
{"nu", LM_TK_SYM, LM_nu, LMB_NONE},
{"nwarrow", LM_TK_SYM, LM_nwarrow, LMB_NONE},
{"odot", LM_TK_SYM, LM_odot, LMB_OPERATOR},
{"nu", LM_TK_SYM, LM_nu, LMB_NONE},
{"nwarrow", LM_TK_SYM, LM_nwarrow, LMB_NONE},
{"odot", LM_TK_SYM, LM_odot, LMB_OPERATOR},
- {"oint", LM_TK_BIGSYM, LM_oint, LMB_NONE},
+ //{"oint", LM_TK_BIGSYM, LM_oint, LMB_NONE},
{"omega", LM_TK_SYM, LM_omega, LMB_NONE},
{"ominus", LM_TK_SYM, LM_ominus, LMB_OPERATOR},
{"oplus", LM_TK_SYM, LM_oplus, LMB_OPERATOR},
{"omega", LM_TK_SYM, LM_omega, LMB_NONE},
{"ominus", LM_TK_SYM, LM_ominus, LMB_OPERATOR},
{"oplus", LM_TK_SYM, LM_oplus, LMB_OPERATOR},
case LM_TK_BIGSYM:
case LM_TK_FUNCLIM:
limits = 0;
case LM_TK_BIGSYM:
case LM_TK_FUNCLIM:
limits = 0;
- array.push_back(new MathBigopInset(yylval.l->name, yylval.l->id));
+ array.push_back(new MathBigopInset(yylval.l));