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 *);
47 /// return the width of the work area in pixels
48 virtual int paperWidth() const;
49 /// return the height of the work area in pixels
50 virtual int paperHeight() const;
52 /// draw a line from point to point
57 line_style = line_solid,
58 line_width = line_thin);
61 * lines - draw a set of lines
62 * @param xp array of points' x co-ords
63 * @param yp array of points' y co-ords
64 * @param np size of the points array
71 line_style = line_solid,
72 line_width = line_thin);
75 virtual void rectangle(
79 line_style = line_solid,
80 line_width = line_thin);
82 /// draw a filled rectangle
83 virtual void fillRectangle(
88 /// draw a filled (irregular) polygon
89 virtual void fillPolygon(
98 unsigned int w, unsigned int h,
107 /// draw an image from the image cache
108 virtual void image(int x, int y,
110 lyx::graphics::Image const & image);
112 /// draw a string at position x, y (y is the baseline)
113 virtual void text(int x, int y,
114 std::string const & str, LyXFont const & f);
116 /** Draw a string at position x, y (y is the baseline)
117 * This is just for fast drawing
119 virtual void text(int x, int y,
120 char const * str, size_t l,
123 /// draw a char at position x, y (y is the baseline)
124 virtual void text(int x, int y,
125 char c, LyXFont const & f);
127 /// draw a pixmap from the image cache
128 virtual void drawPixmap(int x, int y, QPixmap const & pixmap);
130 /// draw a pixmap from the image cache
131 virtual void drawImage(int x, int y, QImage const & image);
134 /// draw small caps text
135 void smallCapsText(int x, int y,
136 QString const & str, LyXFont const & f);
138 /// set pen parameters
139 void setQPainterPen(LColor_color col,
140 line_style ls = line_solid,
141 line_width lw = line_thin);
144 boost::scoped_ptr<QPainter> qp_;
149 LColor::color current_color_;
150 Painter::line_style current_ls_;
151 Painter::line_width current_lw_;
154 } // namespace frontend
157 #endif // QLPAINTER_H