4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
17 #include <boost/scoped_ptr.hpp>
25 * QLPainter - a painter implementation for Xlib
27 class QLPainter : public Painter {
29 QLPainter(QWorkArea &);
37 /// return the width of the work area in pixels
38 virtual int paperWidth() const;
39 /// return the height of the work area in pixels
40 virtual int paperHeight() const;
42 /// draw a line from point to point
47 line_style = line_solid,
48 line_width = line_thin);
51 * lines - draw a set of lines
52 * @param xp array of points' x co-ords
53 * @param yp array of points' y co-ords
54 * @param np size of the points array
61 line_style = line_solid,
62 line_width = line_thin);
65 virtual void rectangle(
69 line_style = line_solid,
70 line_width = line_thin);
72 /// draw a filled rectangle
73 virtual void fillRectangle(
78 /// draw a filled (irregular) polygon
79 virtual void fillPolygon(
88 unsigned int w, unsigned int h,
97 /// draw an image from the image cache
98 virtual void image(int x, int y,
100 lyx::graphics::Image const & image);
102 /// draw a string at position x, y (y is the baseline)
103 virtual void text(int x, int y,
104 std::string const & str, LyXFont const & f);
106 /** Draw a string at position x, y (y is the baseline)
107 * This is just for fast drawing
109 virtual void text(int x, int y,
110 char const * str, size_t l,
113 /// draw a char at position x, y (y is the baseline)
114 virtual void text(int x, int y,
115 char c, LyXFont const & f);
117 /// draw small caps text
118 void smallCapsText(int x, int y,
119 QString const & str, LyXFont const & f);
121 /// set pen parameters
122 QPainter & setPen(LColor_color c,
123 line_style ls = line_solid,
124 line_width lw = line_thin);
126 /// our owner who we paint upon
130 boost::scoped_ptr<QPainter> qp_;
136 #endif // QLPAINTER_H