]> git.lyx.org Git - lyx.git/blobdiff - src/FontInfo.h
Add the emf and wmf graphics format as parameters to LFUN_PASTE.
[lyx.git] / src / FontInfo.h
index dd8f81a9956a68a25351b8f994255da1d44585c1..8db78d5ce1a492fe52e7ada0ecbf491cc1df9ba2 100644 (file)
@@ -4,7 +4,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Jean-Marc Lasgouttes
  * \author Angus Leeming
  * \author Dekel Tsur
@@ -19,6 +19,7 @@
 #include "tex2lyx/Font.h"
 #else
 
+#include "Color.h"
 #include "ColorCode.h"
 #include "FontEnums.h"
 
@@ -29,9 +30,9 @@ class FontInfo
 {
 public:
        ///
-       FontInfo::FontInfo();
+       FontInfo();
        ///
-       FontInfo::FontInfo(
+       FontInfo(
                FontFamily family,
                FontSeries series,
                FontShape shape,
@@ -41,9 +42,9 @@ public:
                FontState emph,
                FontState underbar,
                FontState noun,
-               FontState number
-               ): family_(family), series_(series), shape_(shape), size_(size), 
-               color_(color), background_(background), emph_(emph),
+               FontState number)
+               : family_(family), series_(series), shape_(shape), size_(size), 
+               color_(color), background_(background), paint_color_(), emph_(emph),
                underbar_(underbar), noun_(noun), number_(number)
        {}
 
@@ -88,11 +89,14 @@ public:
        /// Is a given font fully resolved?
        bool resolved() const;
 
-       ///
-       ColorCode realColor() const;
+       /// The real color of the font. This can be the color that is 
+       /// set for painting, the color of the font or a default color.
+       Color realColor() const;
+       /// Sets the color which is used during painting
+       void setPaintColor(Color c) { paint_color_ = c; }
 
        /// Converts logical attributes to concrete shape attribute
-       // Try hard to inline this as it shows up with 4.6 % in the profiler.
+       /// Try hard to inline this as it shows up with 4.6 % in the profiler.
        FontShape realShape() const
        {
                if (noun_ == FONT_ON)
@@ -119,22 +123,6 @@ public:
                }
        }
 
-       /*
-       FontInfo & operator=(FontInfo const & rhs)
-       {
-               family_ = rhs.family_;
-               series_ = rhs.series_;
-               shape_ = rhs.shape_;
-               size_ = rhs.size_;
-               color_ = rhs.color_;
-               background_ = rhs.background_;
-               emph_ = rhs.emph_;
-               underbar_ = rhs.underbar_;
-               noun_ = rhs.noun_;
-               number_ = rhs.number_;
-       }
-       */
-
 private:
        friend bool operator==(FontInfo const & lhs, FontInfo const & rhs);
 
@@ -150,6 +138,8 @@ private:
        ColorCode color_;
        ///
        ColorCode background_;
+       /// The color used for painting
+       Color paint_color_;
        ///
        FontState emph_;
        ///