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>
33 * QLPainter - a painter implementation for Qt4
35 class QLPainter : public Painter {
37 QLPainter(GuiWorkArea *);
43 Not used in the the Qt4 frontend.
45 virtual void start() {}
49 Not used in the the Qt4 frontend.
53 /// return the width of the work area in pixels
54 virtual int paperWidth() const;
55 /// return the height of the work area in pixels
56 virtual int paperHeight() const;
58 /// draw a line from point to point
63 line_style = line_solid,
64 line_width = line_thin);
67 * lines - draw a set of lines
68 * @param xp array of points' x co-ords
69 * @param yp array of points' y co-ords
70 * @param np size of the points array
77 line_style = line_solid,
78 line_width = line_thin);
81 virtual void rectangle(
85 line_style = line_solid,
86 line_width = line_thin);
88 /// draw a filled rectangle
89 virtual void fillRectangle(
94 /// draw a filled (irregular) polygon
95 virtual void fillPolygon(
104 unsigned int w, unsigned int h,
113 /// draw an image from the image cache
114 virtual void image(int x, int y,
116 lyx::graphics::Image const & image);
118 /// draw a string at position x, y (y is the baseline)
119 virtual void text(int x, int y,
120 std::string const & str, LyXFont const & f);
122 /** Draw a string at position x, y (y is the baseline)
123 * This is just for fast drawing
125 virtual void text(int x, int y,
126 char const * str, size_t l,
129 /// draw a char at position x, y (y is the baseline)
130 virtual void text(int x, int y,
131 char c, LyXFont const & f);
133 /// draw a pixmap from the image cache
134 virtual void drawPixmap(int x, int y, QPixmap const & pixmap);
136 /// draw a pixmap from the image cache
137 virtual void drawImage(int x, int y, QImage const & image);
140 /// draw small caps text
141 void smallCapsText(int x, int y,
142 QString const & str, LyXFont const & f);
144 /// set pen parameters
145 void setQPainterPen(QPainter & qp, LColor_color col,
146 line_style ls = line_solid,
147 line_width lw = line_thin);
150 boost::scoped_ptr<QPainter> qp_;
155 LColor::color current_color_;
156 Painter::line_style current_ls_;
157 Painter::line_width current_lw_;
160 } // namespace frontend
163 #endif // QLPAINTER_H