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
23 #include <boost/scoped_ptr.hpp>
31 * QLPainter - a painter implementation for Xlib
33 class QLPainter : public Painter {
35 QLPainter(QWorkArea &);
43 /// return the width of the work area in pixels
44 virtual int paperWidth() const;
45 /// return the height of the work area in pixels
46 virtual int paperHeight() const;
48 /// draw a line from point to point
49 virtual Painter & line(
52 LColor::color = LColor::foreground,
53 line_style = line_solid,
54 line_width = line_thin);
57 * lines - draw a set of lines
58 * @param xp array of points' x co-ords
59 * @param yp array of points' y co-ords
60 * @param np size of the points array
62 virtual Painter & lines(
66 LColor::color = LColor::foreground,
67 line_style = line_solid,
68 line_width = line_thin);
71 virtual Painter & rectangle(
74 LColor::color = LColor::foreground,
75 line_style = line_solid,
76 line_width = line_thin);
78 /// draw a filled rectangle
79 virtual Painter & fillRectangle(
84 /// draw a filled (irregular) polygon
85 virtual Painter & fillPolygon(
89 LColor::color = LColor::foreground);
92 virtual Painter & arc(
94 unsigned int w, unsigned int h,
96 LColor::color = LColor::foreground);
99 virtual Painter & point(
101 LColor::color = LColor::foreground);
103 /// draw an image from the image cache
104 virtual Painter & image(int x, int y,
106 grfx::Image const & image);
108 /// draw a string at position x, y (y is the baseline)
109 virtual Painter & text(int x, int y,
110 string const & str, LyXFont const & f);
112 /** Draw a string at position x, y (y is the baseline)
113 * This is just for fast drawing
115 virtual Painter & text(int x, int y,
116 char const * str, size_t l,
119 /// draw a char at position x, y (y is the baseline)
120 virtual Painter & text(int x, int y,
121 char c, LyXFont const & f);
123 /// draw small caps text
124 void smallCapsText(int x, int y,
125 QString const & str, LyXFont const & f);
127 /// set pen parameters
128 QPainter & setPen(LColor::color c,
129 line_style ls = line_solid,
130 line_width lw = line_thin);
132 /// our owner who we paint upon
136 boost::scoped_ptr<QPainter> qp_;
142 #endif // QLPAINTER_H