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.
17 #include "support/std_string.h"
19 #include <boost/scoped_ptr.hpp>
27 * QLPainter - a painter implementation for Xlib
29 class QLPainter : public Painter {
31 QLPainter(QWorkArea &);
39 /// return the width of the work area in pixels
40 virtual int paperWidth() const;
41 /// return the height of the work area in pixels
42 virtual int paperHeight() const;
44 /// draw a line from point to point
45 virtual Painter & line(
49 line_style = line_solid,
50 line_width = line_thin);
53 * lines - draw a set of lines
54 * @param xp array of points' x co-ords
55 * @param yp array of points' y co-ords
56 * @param np size of the points array
58 virtual Painter & lines(
63 line_style = line_solid,
64 line_width = line_thin);
67 virtual Painter & rectangle(
71 line_style = line_solid,
72 line_width = line_thin);
74 /// draw a filled rectangle
75 virtual Painter & fillRectangle(
80 /// draw a filled (irregular) polygon
81 virtual Painter & fillPolygon(
88 virtual Painter & arc(
90 unsigned int w, unsigned int h,
95 virtual Painter & point(
99 /// draw an image from the image cache
100 virtual Painter & image(int x, int y,
102 lyx::graphics::Image const & image);
104 /// draw a string at position x, y (y is the baseline)
105 virtual Painter & text(int x, int y,
106 string const & str, LyXFont const & f);
108 /** Draw a string at position x, y (y is the baseline)
109 * This is just for fast drawing
111 virtual Painter & text(int x, int y,
112 char const * str, size_t l,
115 /// draw a char at position x, y (y is the baseline)
116 virtual Painter & text(int x, int y,
117 char c, LyXFont const & f);
119 /// draw small caps text
120 void smallCapsText(int x, int y,
121 QString const & str, LyXFont const & f);
123 /// set pen parameters
124 QPainter & setPen(LColor_color c,
125 line_style ls = line_solid,
126 line_width lw = line_thin);
128 /// our owner who we paint upon
132 boost::scoped_ptr<QPainter> qp_;
138 #endif // QLPAINTER_H