]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfont.h
* GuiView.C (updateTab): do not update early if current tab has
[lyx.git] / src / lyxfont.h
index 58943b749b092c385caa35fb53d4cd849bc41ce8..0cfaaf24c5d94dbbcd5427f2a5b60f698dce5032 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,18 +299,21 @@ public:
            to this font. Returns number of chars written. Base is the
            font state active now.
        */
-       int latexWriteStartChanges(std::ostream &, LyXFont const & base,
-                                  LyXFont const & prev) const;
+       int latexWriteStartChanges(odocstream &, LyXFont const & base,
+                                  LyXFont const & prev,
+                                  BufferParams const &) 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,
-                                LyXFont const & next) const;
+       int latexWriteEndChanges(odocstream &, LyXFont const & base,
+                                LyXFont const & next,
+                                BufferParams const &) const;
+
 
        /// Build GUI description of font state
-       std::string const stateText(BufferParams * params) const;
+       docstring const stateText(BufferParams * params) const;
 
        ///
        LColor_color realColor() const;
@@ -319,7 +326,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 +384,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 +416,7 @@ bool operator!=(LyXFont const & font1, LyXFont const & font2)
        return !(font1 == font2);
 }
 
+
+} // namespace lyx
+
 #endif