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