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;
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,
/// 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);
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