2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995-2001 The LyX Team
9 * ======================================================*/
21 // This is only included to provide stuff for the non-public sections
24 #include "PainterBase.h"
29 /** An inplementation for the X Window System. Xlib.
31 Classes similar to this one can be made for gtk+, Qt, etc.
33 class Painter : public PainterBase {
36 explicit Painter(WorkArea &);
38 /// Draw a line from point to point
39 PainterBase & line(int x1, int y1, int x2, int y2,
40 LColor::color = LColor::foreground,
41 enum line_style = line_solid,
42 enum line_width = line_thin);
44 /// Here xp and yp are arrays of points
45 PainterBase & lines(int const * xp, int const * yp, int np,
46 LColor::color = LColor::foreground,
47 enum line_style = line_solid,
48 enum line_width = line_thin);
50 /// Here xp and yp are arrays of points
51 PainterBase & fillPolygon(int const * xp, int const * yp, int np,
52 LColor::color = LColor::foreground);
54 /// Draw lines from x1,y1 to x2,y2. They are arrays
55 PainterBase & segments(int const * x1, int const * y1,
56 int const * x2, int const * y2, int ns,
57 LColor::color = LColor::foreground,
58 enum line_style = line_solid,
59 enum line_width = line_thin);
62 PainterBase & rectangle(int x, int y, int w, int h,
63 LColor::color = LColor::foreground,
64 enum line_style = line_solid,
65 enum line_width = line_thin);
68 PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
70 LColor::color = LColor::foreground);
73 PainterBase & point(int x, int y, LColor::color = LColor::foreground);
76 PainterBase & fillRectangle(int x, int y, int w, int h,
79 /// For the graphics inset.
80 PainterBase & image(int x, int y, int w, int h, LyXImage const * image);
83 PainterBase & pixmap(int x, int y, int w, int h, Pixmap bitmap);
85 /// Draw a string at position x, y (y is the baseline)
86 PainterBase & text(int x, int y,
87 string const & str, LyXFont const & f);
89 /** Draw a string at position x, y (y is the baseline)
90 This is just for fast drawing */
91 PainterBase & text(int x, int y, char const * str, size_t l,
94 /// Draw a char at position x, y (y is the baseline)
95 PainterBase & text(int x, int y, char c, LyXFont const & f);
97 /// Draw a wide string at position x, y
98 PainterBase & text(int x, int y, XChar2b const * str, int l,
101 /// Check the font, and if set, draw an underline
102 void underline(LyXFont const & f, int x, int y, int width);