]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_funcinset.C
enable direct input of #1...#9; some whitespace changes
[lyx.git] / src / mathed / math_funcinset.C
index 9932510580690f8b7c20a19e9c358265c50c3986..b7dedc3cc3c41521e5b7944daf9053f8e978b499 100644 (file)
@@ -1,3 +1,5 @@
+#include <config.h>
+
 #ifdef __GNUG__
 #pragma implementation
 #endif
@@ -5,11 +7,10 @@
 #include "math_funcinset.h"
 #include "font.h"
 #include "Painter.h"
-#include "mathed/support.h"
-#include "support/LOstream.h"
-
+#include "math_support.h"
+#include "math_mathmlstream.h"
+#include "math_streamstr.h"
 
-using std::ostream;
 
 extern LyXFont WhichFont(short type, int size);
 
@@ -37,28 +38,51 @@ void MathFuncInset::setName(string const & n)
 }
 
 
-void MathFuncInset::write(std::ostream & os, bool /* fragile */) const
+void MathFuncInset::metrics(MathMetricsInfo const & mi) const 
 {
-       os << "\\" << name_ << ' ';
+       mi_ = mi;
+       mathed_string_dim(LM_TC_TEXTRM, mi_, name_, ascent_, descent_, width_);
+}
+
+
+void MathFuncInset::draw(Painter & pain, int x, int y) const
+{ 
+       drawStr(pain, LM_TC_TEXTRM, mi_, x, y, name_);
 }
 
 
-void MathFuncInset::writeNormal(std::ostream & os) const
+bool MathFuncInset::match(MathInset * p) const
 {
-       os << "[" << name_ << "] ";
+       MathFuncInset const * q = p->asFuncInset();
+       return q && name_ == q->name_;
 }
 
 
-void MathFuncInset::metrics(MathStyles st) const 
+void MathFuncInset::maplize(MapleStream & os) const
 {
-       size_ = st;
-       mathed_string_dim(LM_TC_TEX, size_, name_, ascent_, descent_, width_);
+       os << ' ' << name_;
 }
 
 
-void MathFuncInset::draw(Painter & pain, int x, int y) const
-{ 
-       xo(x);
-       yo(y);
-       drawStr(pain, LM_TC_TEX, size_, x, y, name_);
+void MathFuncInset::mathmlize(MathMLStream & os) const
+{
+       os << MTag("mi") << name_ << ETag("mi");
+}
+
+
+void MathFuncInset::octavize(OctaveStream & os) const
+{
+       os << ' ' << name_;
+}
+
+
+void MathFuncInset::normalize(NormalStream & os) const
+{
+       os << "[func " << name_ << ']';
+}
+
+
+void MathFuncInset::write(WriteStream & os) const
+{
+       os << "\\" << name_ << ' ';
 }