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(
86 unsigned int w, unsigned int h,
95 /// draw an image from the image cache
96 virtual void image(int x, int y,
98 lyx::graphics::Image const & image);
100 /// draw a string at position x, y (y is the baseline)
101 virtual void text(int x, int y,
102 lyx::docstring const & str, LyXFont const & f);
104 /** Draw a string at position x, y (y is the baseline)
105 * This is just for fast drawing
107 virtual void text(int x, int y,
108 lyx::char_type const * str, size_t l,
111 /// draw a char at position x, y (y is the baseline)
112 virtual void text(int x, int y,
113 lyx::char_type c, LyXFont const & f);
115 /// draw small caps text
116 void smallCapsText(int x, int y,
117 QString const & str, LyXFont const & f);
119 /// set pen parameters
120 QPainter & setPen(LColor_color c,
121 line_style ls = line_solid,
122 line_width lw = line_thin);
124 /// our owner who we paint upon
128 boost::scoped_ptr<QPainter> qp_;
134 } // namespace frontend
137 #endif // QLPAINTER_H