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>
30 * QLPainter - a painter implementation for Xlib
32 class QLPainter : public Painter {
34 QLPainter(QWorkArea &);
42 /// return the width of the work area in pixels
43 virtual int paperWidth() const;
44 /// return the height of the work area in pixels
45 virtual int paperHeight() const;
47 /// draw a line from point to point
48 virtual Painter & line(
51 LColor::color = LColor::foreground,
52 line_style = line_solid,
53 line_width = line_thin);
56 * lines - draw a set of lines
57 * @param xp array of points' x co-ords
58 * @param yp array of points' y co-ords
59 * @param np size of the points array
61 virtual Painter & lines(
65 LColor::color = LColor::foreground,
66 line_style = line_solid,
67 line_width = line_thin);
70 virtual Painter & rectangle(
73 LColor::color = LColor::foreground,
74 line_style = line_solid,
75 line_width = line_thin);
77 /// draw a filled rectangle
78 virtual Painter & fillRectangle(
83 /// draw a filled (irregular) polygon
84 virtual Painter & fillPolygon(
88 LColor::color = LColor::foreground);
91 virtual Painter & arc(
93 unsigned int w, unsigned int h,
95 LColor::color = LColor::foreground);
98 virtual Painter & point(
100 LColor::color = LColor::foreground);
102 /// draw an image from the image cache
103 virtual Painter & image(int x, int y,
105 grfx::Image const & image);
107 /// draw a string at position x, y (y is the baseline)
108 virtual Painter & text(int x, int y,
109 string 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 Painter & text(int x, int y,
115 char const * str, size_t l,
118 /// draw a char at position x, y (y is the baseline)
119 virtual Painter & text(int x, int y,
120 char c, LyXFont const & f);
123 /// draw small caps text
124 void smallCapsText(int x, int y,
125 char const * str, size_t l,
128 /// set pen parameters
129 QPainter & setPen(LColor::color c,
130 line_style ls = line_solid,
131 line_width lw = line_thin);
133 /// our owner who we paint upon
137 boost::scoped_ptr<QPainter> qp_;
143 #endif // QLPAINTER_H