4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
10 * Full author contact details are available in file CREDITS
22 #include "frontends/Painter.h"
32 * XPainter - a painter implementation for Xlib
34 class XPainter : public Painter {
36 XPainter(XWorkArea &);
38 /// return the width of the work area in pixels
39 virtual int paperWidth() const;
40 /// return the height of the work area in pixels
41 virtual int paperHeight() const;
43 /// draw a line from point to point
44 virtual Painter & line(
47 LColor::color = LColor::foreground,
48 line_style = line_solid,
49 line_width = line_thin);
52 * lines - draw a set of lines
53 * @param xp array of points' x co-ords
54 * @param yp array of points' y co-ords
55 * @param np size of the points array
57 virtual Painter & lines(
61 LColor::color = LColor::foreground,
62 line_style = line_solid,
63 line_width = line_thin);
66 virtual Painter & rectangle(
69 LColor::color = LColor::foreground,
70 line_style = line_solid,
71 line_width = line_thin);
73 /// draw a filled rectangle
74 virtual Painter & fillRectangle(
79 /// draw a filled (irregular) polygon
80 virtual Painter & fillPolygon(
84 LColor::color = LColor::foreground);
87 virtual Painter & arc(
89 unsigned int w, unsigned int h,
91 LColor::color = LColor::foreground);
94 virtual Painter & point(
96 LColor::color = LColor::foreground);
98 /// draw an image from the image cache
99 virtual Painter & image(int x, int y,
101 grfx::Image const & image);
103 /// draw a string at position x, y (y is the baseline)
104 virtual Painter & text(int x, int y,
105 string const & str, LyXFont const & f);
107 /** Draw a string at position x, y (y is the baseline)
108 * This is just for fast drawing
110 virtual Painter & text(int x, int y,
111 char const * str, size_t l,
114 /// draw a char at position x, y (y is the baseline)
115 virtual Painter & text(int x, int y,
116 char c, LyXFont const & f);
118 /// draw a wide string at position x, y
119 Painter & text(int x, int y,
120 XChar2b const * str, size_t l,
124 /// our owner who we paint upon