4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Abdelrazak Younes
10 * Full author contact details are available in file CREDITS.
18 #include <boost/scoped_ptr.hpp>
29 * QLPainter - a painter implementation for Qt4
31 class QLPainter : public Painter {
33 QLPainter(QWorkArea *);
39 Not used in the the Qt4 frontend.
\r
41 virtual void start() {}
45 Not used in the the Qt4 frontend.
\r
49 /// return the width of the work area in pixels
50 virtual int paperWidth() const;
51 /// return the height of the work area in pixels
52 virtual int paperHeight() const;
54 /// draw a line from point to point
59 line_style = line_solid,
60 line_width = line_thin);
63 * lines - draw a set of lines
64 * @param xp array of points' x co-ords
65 * @param yp array of points' y co-ords
66 * @param np size of the points array
73 line_style = line_solid,
74 line_width = line_thin);
77 virtual void rectangle(
81 line_style = line_solid,
82 line_width = line_thin);
84 /// draw a filled rectangle
85 virtual void fillRectangle(
90 /// draw a filled (irregular) polygon
91 virtual void fillPolygon(
100 unsigned int w, unsigned int h,
109 /// draw an image from the image cache
110 virtual void image(int x, int y,
112 lyx::graphics::Image const & image);
114 /// draw a string at position x, y (y is the baseline)
115 virtual void text(int x, int y,
116 std::string const & str, LyXFont const & f);
118 /** Draw a string at position x, y (y is the baseline)
119 * This is just for fast drawing
121 virtual void text(int x, int y,
122 char const * str, size_t l,
125 /// draw a char at position x, y (y is the baseline)
126 virtual void text(int x, int y,
127 char c, LyXFont const & f);
129 /// draw a pixmap from the image cache
130 virtual void drawPixmap(int x, int y, QPixmap const & pixmap);
132 /// draw a pixmap from the image cache
\r
133 virtual void drawImage(int x, int y, QImage const & image);
\r
136 /// draw small caps text
137 void smallCapsText(int x, int y,
138 QString const & str, LyXFont const & f);
140 /// set pen parameters
141 QPainter & setQPainterPen(QPainter & qp, LColor_color c,
142 line_style ls = line_solid,
143 line_width lw = line_thin);
146 boost::scoped_ptr<QPainter> qp_;
152 #endif // QLPAINTER_H