]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_funcinset.C
use stream-like syntax for LaTeX output
[lyx.git] / src / mathed / math_funcinset.C
index 32537b799d025edb9b49db74b99b0f36b3170289..b5651b9df79b9488eb277d4b18972e80b6824aff 100644 (file)
@@ -15,7 +15,7 @@ extern LyXFont WhichFont(short type, int size);
 
 
 MathFuncInset::MathFuncInset(string const & nm)
-       : MathInset(nm)
+       : name_(nm)
 {}
 
 
@@ -25,7 +25,19 @@ MathInset * MathFuncInset::clone() const
 }
 
 
-void MathFuncInset::write(std::ostream & os, bool /* fragile */) const
+string const & MathFuncInset::name() const
+{
+       return name_;
+}
+
+
+void MathFuncInset::setName(string const & n)
+{
+       name_ = n;
+}
+
+
+void MathFuncInset::write(MathWriteInfo & os) const
 {
        os << "\\" << name_ << ' ';
 }
@@ -37,22 +49,16 @@ void MathFuncInset::writeNormal(std::ostream & os) const
 }
 
 
-void MathFuncInset::metrics(MathStyles st) 
+void MathFuncInset::metrics(MathMetricsInfo const & st) const 
 {
        size_ = st;
-       if (name_.empty()) 
-               mathed_char_dim(LM_TC_TEXTRM, size_, 'I', ascent_, descent_, width_);
-       else 
-               mathed_string_dim(LM_TC_TEXTRM, size_, name_, ascent_, descent_, width_);
+       mathed_string_dim(LM_TC_TEX, size_.size, name_, ascent_, descent_, width_);
 }
 
 
-void MathFuncInset::draw(Painter & pain, int x, int y)
+void MathFuncInset::draw(Painter & pain, int x, int y) const
 { 
        xo(x);
        yo(y);
-       if (name_.empty()) 
-               drawChar(pain, LM_TC_TEXTRM, size_, x, y, ' ');
-       else
-               drawStr(pain, LM_TC_TEXTRM, size_, x, y, name_);
+       drawStr(pain, LM_TC_TEX, size_.size, x, y, name_);
 }