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.
16 #include "frontends/Painter.h"
17 #include "support/std_string.h"
26 * XPainter - a painter implementation for Xlib
28 class XPainter : public Painter {
30 XPainter(XWorkArea &);
32 /// return the width of the work area in pixels
33 virtual int paperWidth() const;
34 /// return the height of the work area in pixels
35 virtual int paperHeight() const;
37 /// draw a line from point to point
38 virtual Painter & line(
42 line_style = line_solid,
43 line_width = line_thin);
46 * lines - draw a set of lines
47 * @param xp array of points' x co-ords
48 * @param yp array of points' y co-ords
49 * @param np size of the points array
51 virtual Painter & lines(
56 line_style = line_solid,
57 line_width = line_thin);
60 virtual Painter & rectangle(
64 line_style = line_solid,
65 line_width = line_thin);
67 /// draw a filled rectangle
68 virtual Painter & fillRectangle(
73 /// draw a filled (irregular) polygon
74 virtual Painter & fillPolygon(
81 virtual Painter & arc(
83 unsigned int w, unsigned int h,
88 virtual Painter & point(
92 /// draw an image from the image cache
93 virtual Painter & image(int x, int y,
95 lyx::graphics::Image const & image);
97 /// draw a string at position x, y (y is the baseline)
98 virtual Painter & text(int x, int y,
99 string const & str, LyXFont const & f);
101 /** Draw a string at position x, y (y is the baseline)
102 * This is just for fast drawing
104 virtual Painter & text(int x, int y,
105 char const * str, size_t l,
108 /// draw a char at position x, y (y is the baseline)
109 virtual Painter & text(int x, int y,
110 char c, LyXFont const & f);
112 /// draw a wide string at position x, y
113 Painter & text(int x, int y,
114 XChar2b const * str, size_t l,
118 /// our owner who we paint upon