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.
30 Classes similar to this one can be made for gtk+, Qt, etc.
32 class Painter : public PainterBase {
35 explicit Painter(WorkArea &);
37 /// Draw a line from point to point
38 PainterBase & line(int x1, int y1, int x2, int y2,
39 LColor::color = LColor::foreground,
40 enum line_style = line_solid,
41 enum line_width = line_thin);
43 /// Here xp and yp are arrays of points
44 PainterBase & lines(int const * xp, int const * yp, int np,
45 LColor::color = LColor::foreground,
46 enum line_style = line_solid,
47 enum line_width = line_thin);
49 /// Here xp and yp are arrays of points
50 PainterBase & fillPolygon(int const * xp, int const * yp, int np,
51 LColor::color = LColor::foreground);
53 /// Draw lines from x1,y1 to x2,y2. They are arrays
54 PainterBase & segments(int const * x1, int const * y1,
55 int const * x2, int const * y2, int ns,
56 LColor::color = LColor::foreground,
57 enum line_style = line_solid,
58 enum line_width = line_thin);
61 PainterBase & rectangle(int x, int y, int w, int h,
62 LColor::color = LColor::foreground,
63 enum line_style = line_solid,
64 enum line_width = line_thin);
67 PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
69 LColor::color = LColor::foreground);
72 PainterBase & point(int x, int y, LColor::color = LColor::foreground);
75 PainterBase & fillRectangle(int x, int y, int w, int h,
78 /// For the graphics inset.
79 PainterBase & image(int x, int y, int w, int h, LyXImage const * image);
82 PainterBase & pixmap(int x, int y, int w, int h, Pixmap bitmap);
84 /// Draw a string at position x, y (y is the baseline)
85 PainterBase & text(int x, int y,
86 string const & str, LyXFont const & f);
88 /** Draw a string at position x, y (y is the baseline)
89 This is just for fast drawing */
90 PainterBase & text(int x, int y, char const * str, size_t l,
93 /// Draw a char at position x, y (y is the baseline)
94 PainterBase & text(int x, int y, char c, LyXFont const & f);
96 /// Draw a wide string at position x, y
97 PainterBase & text(int x, int y, XChar2b const * str, int l,
100 /// Check the font, and if set, draw an underline
101 void underline(LyXFont const & f, int x, int y, int width);