2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995-2001 The LyX Team
9 * ======================================================*/
20 // This is only included to provide stuff for the non-public sections
23 #include "PainterBase.h"
28 /** An inplementation for the X Window System. Xlib.
29 Classes similar to this one can be made for gtk+, Qt, etc.
31 class Painter : public PainterBase {
34 explicit Painter(WorkArea &);
36 /// Draw a line from point to point
37 PainterBase & line(int x1, int y1, int x2, int y2,
38 LColor::color = LColor::foreground,
39 enum line_style = line_solid,
40 enum line_width = line_thin);
42 /// Here xp and yp are arrays of points
43 PainterBase & lines(int const * xp, int const * yp, int np,
44 LColor::color = LColor::foreground,
45 enum line_style = line_solid,
46 enum line_width = line_thin);
48 /// Here xp and yp are arrays of points
49 PainterBase & fillPolygon(int const * xp, int const * yp, int np,
50 LColor::color = LColor::foreground);
52 /// Draw lines from x1,y1 to x2,y2. They are arrays
53 PainterBase & segments(int const * x1, int const * y1,
54 int const * x2, int const * y2, int ns,
55 LColor::color = LColor::foreground,
56 enum line_style = line_solid,
57 enum line_width = line_thin);
60 PainterBase & rectangle(int x, int y, int w, int h,
61 LColor::color = LColor::foreground,
62 enum line_style = line_solid,
63 enum line_width = line_thin);
66 PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
68 LColor::color = LColor::foreground);
71 PainterBase & point(int x, int y, LColor::color = LColor::foreground);
74 PainterBase & fillRectangle(int x, int y, int w, int h,
77 /// For the graphics inset.
78 PainterBase & image(int x, int y, int w, int h,
79 grfx::GImage const & image);
81 /// Draw a string at position x, y (y is the baseline)
82 PainterBase & text(int x, int y,
83 string const & str, LyXFont const & f);
85 /** Draw a string at position x, y (y is the baseline)
86 This is just for fast drawing */
87 PainterBase & text(int x, int y, char const * str, size_t l,
90 /// Draw a char at position x, y (y is the baseline)
91 PainterBase & text(int x, int y, char c, LyXFont const & f);
93 /// Draw a wide string at position x, y
94 PainterBase & text(int x, int y, XChar2b const * str, int l,
97 /// Check the font, and if set, draw an underline
98 void underline(LyXFont const & f, int x, int y, int width);