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.
15 #include "frontends/Painter.h"
17 #include <boost/scoped_ptr.hpp>
30 * QLPainter - a painter implementation for Xlib
32 class QLPainter : public lyx::frontend::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
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
66 line_style = line_solid,
67 line_width = line_thin);
70 virtual void rectangle(
74 line_style = line_solid,
75 line_width = line_thin);
77 /// draw a filled rectangle
78 virtual void fillRectangle(
83 /// draw a filled (irregular) polygon
84 virtual void fillPolygon(
93 unsigned int w, unsigned int h,
102 /// draw an image from the image cache
103 virtual void image(int x, int y,
105 lyx::graphics::Image const & image);
107 /// draw a string at position x, y (y is the baseline)
108 virtual void text(int x, int y,
109 std::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 void 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 void text(int x, int y,
120 char c, LyXFont const & f);
122 /// draw small caps text
123 void smallCapsText(int x, int y,
124 QString const & str, LyXFont const & f);
126 /// set pen parameters
127 QPainter & setPen(LColor_color c,
128 line_style ls = line_solid,
129 line_width lw = line_thin);
131 /// our owner who we paint upon
135 boost::scoped_ptr<QPainter> qp_;
141 } // namespace frontend
144 #endif // QLPAINTER_H