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
20 #include <boost/scoped_ptr.hpp>
28 * QLPainter - a painter implementation for Xlib
30 class QLPainter : public Painter {
32 QLPainter(QWorkArea &);
40 /// return the width of the work area in pixels
41 virtual int paperWidth() const;
42 /// return the height of the work area in pixels
43 virtual int paperHeight() const;
45 /// draw a line from point to point
46 virtual Painter & line(
49 LColor::color = LColor::foreground,
50 line_style = line_solid,
51 line_width = line_thin);
54 * lines - draw a set of lines
55 * @param xp array of points' x co-ords
56 * @param yp array of points' y co-ords
57 * @param np size of the points array
59 virtual Painter & lines(
63 LColor::color = LColor::foreground,
64 line_style = line_solid,
65 line_width = line_thin);
68 virtual Painter & rectangle(
71 LColor::color = LColor::foreground,
72 line_style = line_solid,
73 line_width = line_thin);
75 /// draw a filled rectangle
76 virtual Painter & fillRectangle(
81 /// draw a filled (irregular) polygon
82 virtual Painter & fillPolygon(
86 LColor::color = LColor::foreground);
89 virtual Painter & arc(
91 unsigned int w, unsigned int h,
93 LColor::color = LColor::foreground);
96 virtual Painter & point(
98 LColor::color = LColor::foreground);
100 /// draw an image from the image cache
101 virtual Painter & image(int x, int y,
103 grfx::Image const & image);
105 /// draw a string at position x, y (y is the baseline)
106 virtual Painter & text(int x, int y,
107 string const & str, LyXFont const & f);
109 /** Draw a string at position x, y (y is the baseline)
110 * This is just for fast drawing
112 virtual Painter & text(int x, int y,
113 char const * str, size_t l,
116 /// draw a char at position x, y (y is the baseline)
117 virtual Painter & text(int x, int y,
118 char c, LyXFont const & f);
120 /// draw small caps text
121 void smallCapsText(int x, int y,
122 QString const & str, LyXFont const & f);
124 /// set pen parameters
125 QPainter & setPen(LColor::color c,
126 line_style ls = line_solid,
127 line_width lw = line_thin);
129 /// our owner who we paint upon
133 boost::scoped_ptr<QPainter> qp_;
139 #endif // QLPAINTER_H