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(
85 unsigned int w, unsigned int h,
94 /// draw an image from the image cache
95 virtual void image(int x, int y,
97 graphics::Image const & image);
99 /// draw a string at position x, y (y is the baseline)
100 virtual void text(int x, int y,
101 std::string const & str, LyXFont const & f);
103 /// draw a string at position x, y (y is the baseline)
104 virtual void 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 void text(int x, int y,
110 char c, LyXFont const & f);
117 /// our owner who we paint upon
120 Glib::RefPtr<Gdk::GC> gc_;
121 Glib::RefPtr<Gdk::Pixmap> pixmap_;
122 ColorHandler *colorhandler_;
123 LColor_color currentcolor_;
126 } // namespace frontend