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.
15 #include "frontends/Painter.h"
19 #include <X11/Xft/Xft.h>
32 * GPainter - a painter implementation for Gtkmm
34 class GPainter : public Painter {
36 GPainter(GWorkArea &);
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 inline void setForeground(LColor_color clr);
44 inline void setLineParam(line_style ls, line_width lw);
45 XftColor * getXftColor(LColor_color clr);
46 /// draw a line from point to point
51 line_style = line_solid,
52 line_width = line_thin);
55 * lines - draw a set of lines
56 * @param xp array of points' x co-ords
57 * @param yp array of points' y co-ords
58 * @param np size of the points array
65 line_style = line_solid,
66 line_width = line_thin);
69 virtual void rectangle(
73 line_style = line_solid,
74 line_width = line_thin);
76 /// draw a filled rectangle
77 virtual void fillRectangle(
82 /// draw a filled (irregular) polygon
83 virtual void fillPolygon(
92 unsigned int w, unsigned int h,
101 /// draw an image from the image cache
102 virtual void image(int x, int y,
104 graphics::Image const & image);
106 /// draw a string at position x, y (y is the baseline)
107 virtual void text(int x, int y,
108 std::string const & str, LyXFont const & f);
110 /// draw a string at position x, y (y is the baseline)
111 virtual void 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 void text(int x, int y,
117 char c, LyXFont const & f);
124 /// our owner who we paint upon
127 Glib::RefPtr<Gdk::GC> gc_;
128 Glib::RefPtr<Gdk::Pixmap> pixmap_;
129 ColorHandler *colorhandler_;
130 LColor_color currentcolor_;
133 } // namespace frontend