4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
7 * \author John Levon <moz@compsoc.man.ac.uk>
18 #include <boost/smart_ptr.hpp>
29 * QLPainter - a painter implementation for Xlib
31 class QLPainter : public Painter {
33 QLPainter(QWorkArea &);
41 /// return the width of the work area in pixels
42 virtual int paperWidth() const;
43 /// return the height of the work area in pixels
44 virtual int paperHeight() const;
46 /// draw a line from point to point
47 virtual Painter & line(
50 LColor::color = LColor::foreground,
51 line_style = line_solid,
52 line_width = line_thin);
55 * lines - draw a set of lines
56 * @param xp array of points' x co-ords
57 * @param yp array of points' y co-ords
58 * @param np size of the points array
60 virtual Painter & lines(
64 LColor::color = LColor::foreground,
65 line_style = line_solid,
66 line_width = line_thin);
69 virtual Painter & rectangle(
72 LColor::color = LColor::foreground,
73 line_style = line_solid,
74 line_width = line_thin);
76 /// draw a filled rectangle
77 virtual Painter & fillRectangle(
82 /// draw a filled (irregular) polygon
83 virtual Painter & fillPolygon(
87 LColor::color = LColor::foreground);
90 virtual Painter & arc(
92 unsigned int w, unsigned int h,
94 LColor::color = LColor::foreground);
97 virtual Painter & point(
99 LColor::color = LColor::foreground);
101 /// draw an image from the image cache
102 virtual Painter & image(int x, int y,
104 grfx::GImage const & image);
106 /// draw a string at position x, y (y is the baseline)
107 virtual Painter & text(int x, int y,
108 string const & str, LyXFont const & f);
110 /** Draw a string at position x, y (y is the baseline)
111 * This is just for fast drawing
113 virtual Painter & text(int x, int y,
114 char const * str, size_t l,
117 /// draw a char at position x, y (y is the baseline)
118 virtual Painter & text(int x, int y,
119 char c, LyXFont const & f);
122 /// draw small caps text
123 void smallCapsText(int x, int y,
124 char const * str, size_t l,
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