#endif
#include "math_unknowninset.h"
-#include "font.h"
-#include "Painter.h"
#include "math_support.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
-extern LyXFont WhichFont(short type, int size);
-
-
-MathUnknownInset::MathUnknownInset(string const & nm)
- : name_(nm)
+MathUnknownInset::MathUnknownInset(string const & nm, bool final, bool black)
+ : name_(nm), final_(final), black_(black)
{}
}
-void MathUnknownInset::setName(string const & n)
+string & MathUnknownInset::name()
{
- name_ = n;
+ return name_;
}
}
-void MathUnknownInset::metrics(MathMetricsInfo const & mi) const
+void MathUnknownInset::metrics(MathMetricsInfo & mi) const
+{
+ mathed_string_dim(mi.base.font, name_, ascent_, descent_, width_);
+}
+
+
+void MathUnknownInset::draw(MathPainterInfo & pi, int x, int y) const
+{
+ if (black_)
+ drawStrBlack(pi, x, y, name_);
+ else
+ drawStrRed(pi, x, y, name_);
+}
+
+
+void MathUnknownInset::finalize()
{
- mi_ = mi;
- mathed_string_dim(LM_TC_TEX, mi_, name_, ascent_, descent_, width_);
+ final_ = true;
}
-void MathUnknownInset::draw(Painter & pain, int x, int y) const
-{
- drawStr(pain, LM_TC_TEX, mi_, x, y, name_);
+bool MathUnknownInset::final() const
+{
+ return final_;
}