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
19 #include "frontends/Painter.h"
29 * XPainter - a painter implementation for Xlib
31 class XPainter : public Painter {
33 XPainter(XWorkArea &);
35 /// return the width of the work area in pixels
36 virtual int paperWidth() const;
37 /// return the height of the work area in pixels
38 virtual int paperHeight() const;
40 /// draw a line from point to point
41 virtual Painter & line(
44 LColor::color = LColor::foreground,
45 line_style = line_solid,
46 line_width = line_thin);
49 * lines - draw a set of lines
50 * @param xp array of points' x co-ords
51 * @param yp array of points' y co-ords
52 * @param np size of the points array
54 virtual Painter & lines(
58 LColor::color = LColor::foreground,
59 line_style = line_solid,
60 line_width = line_thin);
63 virtual Painter & rectangle(
66 LColor::color = LColor::foreground,
67 line_style = line_solid,
68 line_width = line_thin);
70 /// draw a filled rectangle
71 virtual Painter & fillRectangle(
76 /// draw a filled (irregular) polygon
77 virtual Painter & fillPolygon(
81 LColor::color = LColor::foreground);
84 virtual Painter & arc(
86 unsigned int w, unsigned int h,
88 LColor::color = LColor::foreground);
91 virtual Painter & point(
93 LColor::color = LColor::foreground);
95 /// draw an image from the image cache
96 virtual Painter & 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 Painter & text(int x, int y,
102 string 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 Painter & text(int x, int y,
108 char const * str, size_t l,
111 /// draw a char at position x, y (y is the baseline)
112 virtual Painter & text(int x, int y,
113 char c, LyXFont const & f);
115 /// draw a wide string at position x, y
116 Painter & text(int x, int y,
117 XChar2b const * str, size_t l,
121 /// our owner who we paint upon