#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__)
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);
+ // FIXME UNICODE
+ docstring n(sym_->draw.begin(), sym_->draw.end());
+ pi.draw(x, y - h_, n);
}
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