4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
8 * \author John Levon <moz@compsoc.man.ac.uk>
20 #include "frontends/Painter.h"
30 * XPainter - a painter implementation for Xlib
32 class XPainter : public Painter {
34 XPainter(XWorkArea &);
36 /// return the width of the work area in pixels
37 virtual int paperWidth() const;
38 /// return the height of the work area in pixels
39 virtual int paperHeight() const;
41 /// draw a line from point to point
42 virtual Painter & line(
45 LColor::color = LColor::foreground,
46 line_style = line_solid,
47 line_width = line_thin);
50 * lines - draw a set of lines
51 * @param xp array of points' x co-ords
52 * @param yp array of points' y co-ords
53 * @param np size of the points array
55 virtual Painter & lines(
59 LColor::color = LColor::foreground,
60 line_style = line_solid,
61 line_width = line_thin);
64 virtual Painter & rectangle(
67 LColor::color = LColor::foreground,
68 line_style = line_solid,
69 line_width = line_thin);
71 /// draw a filled rectangle
72 virtual Painter & fillRectangle(
77 /// draw a filled (irregular) polygon
78 virtual Painter & fillPolygon(
82 LColor::color = LColor::foreground);
85 virtual Painter & arc(
87 unsigned int w, unsigned int h,
89 LColor::color = LColor::foreground);
92 virtual Painter & point(
94 LColor::color = LColor::foreground);
96 /// draw an image from the image cache
97 virtual Painter & image(int x, int y,
99 grfx::GImage const & image);
101 /// draw a string at position x, y (y is the baseline)
102 virtual Painter & text(int x, int y,
103 string const & str, LyXFont const & f);
105 /** Draw a string at position x, y (y is the baseline)
106 * This is just for fast drawing
108 virtual Painter & text(int x, int y,
109 char const * str, size_t l,
112 /// draw a char at position x, y (y is the baseline)
113 virtual Painter & text(int x, int y,
114 char c, LyXFont const & f);
116 /// draw a wide string at position x, y
117 Painter & text(int x, int y,
118 XChar2b const * str, size_t l,
122 /// our owner who we paint upon