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.
31 * QLPainter - a painter implementation for Qt4
33 class QLPainter : public QPainter, public Painter {
35 /// draw a line from point to point
40 line_style = line_solid,
41 line_width = line_thin);
44 * lines - draw a set of lines
45 * @param xp array of points' x co-ords
46 * @param yp array of points' y co-ords
47 * @param np size of the points array
54 line_style = line_solid,
55 line_width = line_thin);
58 virtual void rectangle(
62 line_style = line_solid,
63 line_width = line_thin);
65 /// draw a filled rectangle
66 virtual void fillRectangle(
74 unsigned int w, unsigned int h,
83 /// draw an image from the image cache
84 virtual void image(int x, int y,
86 lyx::graphics::Image const & image);
88 /// draw a string at position x, y (y is the baseline)
89 virtual int text(int x, int y,
90 lyx::docstring const & str, LyXFont const & f);
92 /** Draw a string at position x, y (y is the baseline)
93 * This is just for fast drawing
95 virtual int text(int x, int y,
96 lyx::char_type const * str, size_t l,
99 /// draw a char at position x, y (y is the baseline)
100 virtual int text(int x, int y,
101 lyx::char_type c, LyXFont const & f);
104 friend class GuiWorkArea;
105 QLPainter(QWidget *);
108 /// draw small caps text
110 \return width of the drawn text.
112 int smallCapsText(int x, int y,
113 QString const & str, LyXFont const & f);
115 /// set pen parameters
116 void setQPainterPen(LColor_color col,
117 line_style ls = line_solid,
118 line_width lw = line_thin);
123 LColor::color current_color_;
124 Painter::line_style current_ls_;
125 Painter::line_width current_lw_;
128 } // namespace frontend
131 #endif // QLPAINTER_H