]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfont.h
remove unused stuff
[lyx.git] / src / lyxfont.h
index 58943b749b092c385caa35fb53d4cd849bc41ce8..34a0b24325f9851fd4acc8b38bd73b949db94058 100644 (file)
 #define LYXFONT_H
 
 #include "LColor.h"
+#include "support/docstream.h"
+
+
+namespace lyx {
 
-#include <iosfwd>
-#include <string>
 
 class LyXLex;
 class BufferParams;
@@ -60,6 +62,8 @@ public:
                ///
                WASY_FAMILY,
                ///
+               ESINT_FAMILY,
+               ///
                INHERIT_FAMILY,
                ///
                IGNORE_FAMILY,
@@ -221,7 +225,7 @@ public:
        ///
        LColor_color color() const;
        ///
-       Language const * language() const;
+       Language const * language() const { return lang; }
        ///
        bool isRightToLeft() const;
        ///
@@ -295,14 +299,14 @@ public:
            to this font. Returns number of chars written. Base is the
            font state active now.
        */
-       int latexWriteStartChanges(std::ostream &, LyXFont const & base,
+       int latexWriteStartChanges(odocstream &, LyXFont const & base,
                                   LyXFont const & prev) const;
 
        /** Writes the tail of the LaTeX needed to change to this font.
            Returns number of chars written. Base is the font state we want
            to achieve.
        */
-       int latexWriteEndChanges(std::ostream &, LyXFont const & base,
+       int latexWriteEndChanges(odocstream &, LyXFont const & base,
                                 LyXFont const & next) const;
 
        /// Build GUI description of font state
@@ -319,7 +323,15 @@ public:
        std::ostream & operator<<(std::ostream & os, LyXFont const & font);
 
        /// Converts logical attributes to concrete shape attribute
-       LyXFont::FONT_SHAPE realShape() const;
+       // Try hard to inline this as it shows up with 4.6 % in the profiler.
+       LyXFont::FONT_SHAPE realShape() const {
+               if (bits.noun == ON)
+                       return SMALLCAPS_SHAPE;
+               if (bits.emph == ON)
+                       return (bits.shape == UP_SHAPE) ? ITALIC_SHAPE : UP_SHAPE;
+               return bits.shape;
+       }
+
 
        /** Compaq cxx 6.5 requires that the definition be public so that
            it can compile operator==()
@@ -369,6 +381,7 @@ bool LyXFont::isSymbolFont() const
        case LyXFont::MSA_FAMILY:
        case LyXFont::MSB_FAMILY:
        case LyXFont::WASY_FAMILY:
+       case LyXFont::ESINT_FAMILY:
                return true;
        default:
                return false;
@@ -400,4 +413,7 @@ bool operator!=(LyXFont const & font1, LyXFont const & font2)
        return !(font1 == font2);
 }
 
+
+} // namespace lyx
+
 #endif