#include "InsetMathSymbol.h"
#include "dimension.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
#include "MathStream.h"
#include "MathSupport.h"
#include "MathParser.h"
#include "LaTeXFeatures.h"
#include "debug.h"
-using lyx::docstring;
+
+namespace lyx {
using std::string;
using std::auto_ptr;
InsetMathSymbol::InsetMathSymbol(char const * name)
- : sym_(in_word_set(name)), h_(0), width_(0), scriptable_(false)
+ : sym_(in_word_set(from_ascii(name))), h_(0), width_(0), scriptable_(false)
{}
-InsetMathSymbol::InsetMathSymbol(string const & name)
- : sym_(in_word_set(name.c_str())), h_(0), width_(0), scriptable_(false)
+InsetMathSymbol::InsetMathSymbol(docstring const & name)
+ : sym_(in_word_set(name)), h_(0), width_(0), scriptable_(false)
{}
}
-string InsetMathSymbol::name() const
+docstring InsetMathSymbol::name() const
{
return sym_->name;
}
// << "'" << std::endl;
int const em = mathed_char_width(mi.base.font, 'M');
- FontSetChanger dummy(mi.base, sym_->inset.c_str());
+ FontSetChanger dummy(mi.base, sym_->inset);
mathed_string_dim(mi.base.font, sym_->draw, dim);
// correct height for broken cmex and wasy font
-#if defined(__APPLE__) && defined(__GNUC__)
- if (sym_->inset == "cmex") {
- h_ = 4 * dim.des / 5;
- dim.asc += 0*h_;
- dim.des -= h_;
- h_ = dim.asc;
- } else if (sym_->inset == "wasy") {
- h_ = 4 * dim.des / 5;
- dim.asc += h_;
- dim.des -= h_;
- }
-#else
if (sym_->inset == "cmex" || sym_->inset == "wasy") {
h_ = 4 * dim.des / 5;
dim.asc += h_;
dim.des -= h_;
}
-#endif
+
// seperate things a bit
if (isRelOp())
dim.wid += static_cast<int>(0.5 * em + 0.5);
scriptable_ = false;
if (mi.base.style == LM_ST_DISPLAY)
- if (sym_->inset == "cmex" || sym_->extra == "funclim")
+ if (sym_->inset == "cmex" || sym_->inset == "esint" ||
+ sym_->extra == "funclim")
scriptable_ = true;
width_ = dim.wid;
x += static_cast<int>(0.0833*em+0.5);
FontSetChanger dummy(pi.base, sym_->inset.c_str());
- string const sym = sym_->draw;
- docstring const dsym(sym.begin(), sym.end());
- pi.draw(x, y - h_, dsym);
+ pi.draw(x, y - h_, sym_->draw);
}
return
sym_->inset == "cmex" ||
sym_->inset == "lyxboldsymb" ||
+ sym_->inset == "esint" ||
sym_->extra == "funclim";
}
void InsetMathSymbol::validate(LaTeXFeatures & features) const
{
if (!sym_->requires.empty())
- features.require(sym_->requires);
+ features.require(to_utf8(sym_->requires));
}
}
-char const * MathMLtype(string const & s)
+char const * MathMLtype(docstring const & s)
{
if (s == "mathop")
return "mo";
}
-void InsetMathSymbol::mathmlize(MathMLStream & os) const
+void InsetMathSymbol::mathmlize(MathStream & os) const
{
char const * type = MathMLtype(sym_->extra);
os << '<' << type << "> ";
}
-void InsetMathSymbol::infoize2(std::ostream & os) const
+void InsetMathSymbol::infoize2(odocstream & os) const
{
os << "Symbol: " << name();
}
+
+
+} // namespace lyx