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 <X11/Xft/Xft.h>
18 #include "frontends/Painter.h"
19 #include "support/std_string.h"
25 * GPainter - a painter implementation for Gtkmm
27 class GPainter : public Painter {
29 GPainter(GWorkArea &);
31 /// return the width of the work area in pixels
32 virtual int paperWidth() const;
33 /// return the height of the work area in pixels
34 virtual int paperHeight() const;
36 void setForeground(Glib::RefPtr<Gdk::GC> gc, LColor::color clr);
37 void setLineParam(Glib::RefPtr<Gdk::GC> gc,
38 line_style ls, line_width lw);
39 XftColor * getXftColor(LColor::color clr);
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 virtual Painter & text(int x, int y, wchar_t const * str, int l,
114 /// draw a char at position x, y (y is the baseline)
115 virtual Painter & text(int x, int y,
116 char c, LyXFont const & f);
118 /// draw a wide string at position x, y
119 Painter & text(int x, int y,
120 XChar2b const * str, size_t l,
124 /// our owner who we paint upon