]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_symbolinset.C
rename commandtags.h to lfuns.h and renumber/cleanup. Rebuild the tree !
[lyx.git] / src / mathed / math_symbolinset.C
index c8f7e061901e67ccc4bc05f0783435645a6a4d7d..272c38861dd09be9e9e0bddbf1a1e9f6c2dcc78c 100644 (file)
@@ -1,8 +1,4 @@
 
-#ifdef __GNUG__
-#pragma implementation 
-#endif
-
 #include <config.h>
 
 #include "math_symbolinset.h"
@@ -48,6 +44,7 @@ void MathSymbolInset::metrics(MathMetricsInfo & mi) const
        //      << "' drawn as: '" << sym_->draw
        //      << "'\n";
 
+       int const em = mathed_char_width(mi.base.font, 'M');
        MathFontSetChanger dummy(mi.base, sym_->inset.c_str());
        mathed_string_dim(mi.base.font, sym_->draw, dim_);
        // correct height for broken cmex and wasy font
@@ -57,11 +54,10 @@ void MathSymbolInset::metrics(MathMetricsInfo & mi) const
                dim_.d -= h_;
        }
        // seperate things a bit
-       int const em = mathed_char_width(mi.base.font, 'M');
        if (isRelOp())
                dim_.w += static_cast<int>(0.5*em+0.5);
        else
-               dim_.w += static_cast<int>(0.15*em+0.5);
+               dim_.w += static_cast<int>(0.1667*em+0.5);
 
        scriptable_ = false;
        if (mi.base.style == LM_ST_DISPLAY)
@@ -80,7 +76,7 @@ void MathSymbolInset::draw(MathPainterInfo & pi, int x, int y) const
        if (isRelOp())
                x += static_cast<int>(0.25*em+0.5);
        else
-               x += static_cast<int>(0.075*em+0.5);
+               x += static_cast<int>(0.0833*em+0.5);
 
        MathFontSetChanger dummy(pi.base, sym_->inset.c_str());
        drawStr(pi, pi.base.font, x, y - h_, sym_->draw);
@@ -117,11 +113,11 @@ void MathSymbolInset::validate(LaTeXFeatures & features) const
 
 void MathSymbolInset::normalize(NormalStream & os) const
 {
-       os << "[symbol " << name() << "]";
+       os << "[symbol " << name() << ']';
 }
 
 
-void MathSymbolInset::maplize(MapleStream & os) const
+void MathSymbolInset::maple(MapleStream & os) const
 {
        if (name() == "cdot")
                os << '*';
@@ -131,7 +127,18 @@ void MathSymbolInset::maplize(MapleStream & os) const
                os << name();
 }
 
-void MathSymbolInset::mathematicize(MathematicaStream & os) const
+void MathSymbolInset::maxima(MaximaStream & os) const
+{
+       if (name() == "cdot")
+               os << '*';
+       else if (name() == "infty")
+               os << "INF";
+       else
+               os << name();
+}
+
+
+void MathSymbolInset::mathematica(MathematicaStream & os) const
 {
        if ( name() == "pi")    { os << "Pi"; return;}
        if ( name() == "infty") { os << "Infinity"; return;}
@@ -166,7 +173,7 @@ void MathSymbolInset::mathmlize(MathMLStream & os) const
 }
 
 
-void MathSymbolInset::octavize(OctaveStream & os) const
+void MathSymbolInset::octave(OctaveStream & os) const
 {
        if (name() == "cdot")
                os << '*';
@@ -182,7 +189,7 @@ void MathSymbolInset::write(WriteStream & os) const
 }
 
 
-void MathSymbolInset::infoize(std::ostream & os) const
+void MathSymbolInset::infoize2(std::ostream & os) const
 {
        os << "Symbol: " << name();
 }