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>
35 * QLPainter - a painter implementation for Qt4
37 class QLPainter : public Painter {
39 QLPainter(GuiWorkArea *);
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(
93 unsigned int w, unsigned int h,
102 /// draw an image from the image cache
103 virtual void image(int x, int y,
105 lyx::graphics::Image const & image);
107 /// draw a string at position x, y (y is the baseline)
108 virtual int text(int x, int y,
109 lyx::docstring const & str, LyXFont const & f);
111 /** Draw a string at position x, y (y is the baseline)
112 * This is just for fast drawing
114 virtual int text(int x, int y,
115 lyx::char_type const * str, size_t l,
118 /// draw a char at position x, y (y is the baseline)
119 virtual int text(int x, int y,
120 lyx::char_type c, LyXFont const & f);
122 /// draw a pixmap from the image cache
123 virtual void drawPixmap(int x, int y, QPixmap const & pixmap);
125 /// draw a pixmap from the image cache
126 virtual void drawImage(int x, int y, QImage const & image);
129 /// draw small caps text
131 \return width of the drawn text.
133 int smallCapsText(int x, int y,
134 QString const & str, LyXFont const & f);
136 /// set pen parameters
137 void setQPainterPen(LColor_color col,
138 line_style ls = line_solid,
139 line_width lw = line_thin);
142 boost::scoped_ptr<QPainter> qp_;
147 LColor::color current_color_;
148 Painter::line_style current_ls_;
149 Painter::line_width current_lw_;
152 } // namespace frontend
155 #endif // QLPAINTER_H