]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QLPainter.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / QLPainter.h
index 6a9f7a0dc894c7cc85f09971839f341a0763c4a8..291b337f3493c2561824d24d1ed22581df1c2a8e 100644 (file)
@@ -21,30 +21,28 @@ class LyXFont;
 class QPaintDevice;
 class QPainter;
 class QString;
-class QPixmap;\r
-class QImage;\r
-class QWorkArea;
+class QPixmap;
+class QImage;
+
+namespace lyx {
+namespace frontend {
+
+class GuiWorkArea;
 
 /**
  * QLPainter - a painter implementation for Qt4
  */
 class QLPainter : public Painter {
 public:
-       QLPainter(QWorkArea *);
+       QLPainter(GuiWorkArea *);
 
        ~QLPainter();
 
-       /// begin painting\r
-       /**\r
-       Not used in the the Qt4 frontend.\r
-       */
-       virtual void start() {}
+       /// begin painting
+       virtual void start();
 
        /// end painting
-       /**\r
-       Not used in the the Qt4 frontend.\r
-       */\r
-       virtual void end() {}
+       virtual void end();
 
        /// return the width of the work area in pixels
        virtual int paperWidth() const;
@@ -87,13 +85,6 @@ public:
                int w, int h,
                LColor_color);
 
-       /// draw a filled (irregular) polygon
-       virtual void fillPolygon(
-               int const * xp,
-               int const * yp,
-               int np,
-               LColor_color);
-
        /// draw an arc
        virtual void arc(
                int x, int y,
@@ -113,32 +104,32 @@ public:
 
        /// draw a string at position x, y (y is the baseline)
        virtual void text(int x, int y,
-               std::string const & str, LyXFont const & f);
+               lyx::docstring const & str, LyXFont const & f);
 
        /** Draw a string at position x, y (y is the baseline)
         *  This is just for fast drawing
         */
        virtual void text(int x, int y,
-               char const * str, size_t l,
+                lyx::char_type const * str, size_t l,
                LyXFont const & f);
 
        /// draw a char at position x, y (y is the baseline)
        virtual void text(int x, int y,
-               char c, LyXFont const & f);
+                lyx::char_type c, LyXFont const & f);
 
        /// draw a pixmap from the image cache
        virtual void drawPixmap(int x, int y, QPixmap const & pixmap);
 
-       /// draw a pixmap from the image cache\r
-       virtual void drawImage(int x, int y, QImage const & image);\r
-\r
+       /// draw a pixmap from the image cache
+       virtual void drawImage(int x, int y, QImage const & image);
+
 private:
        /// draw small caps text
        void smallCapsText(int x, int y,
                QString const & str, LyXFont const & f);
 
        /// set pen parameters
-       QPainter & setQPainterPen(QPainter & qp, LColor_color c,
+       void setQPainterPen(LColor_color col,
                line_style ls = line_solid,
                line_width lw = line_thin);
 
@@ -146,7 +137,14 @@ private:
        boost::scoped_ptr<QPainter> qp_;
 
        /// the working area
-       QWorkArea * qwa_;
+       GuiWorkArea * qwa_;
+
+       LColor::color current_color_;
+       Painter::line_style current_ls_;
+       Painter::line_width current_lw_;
 };
 
+} // namespace frontend
+} // namespace lyx
+
 #endif // QLPAINTER_H