2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995-2000 The LyX Team
9 * ======================================================*/
21 // This is only included to provide stuff for the non-public sections
24 #include "PainterBase.h"
30 /** An inplementation for the X Window System. Xlib.
32 Classes similar to this one can be made for gtk+, Qt, etc.
34 class Painter : public PainterBase {
37 explicit Painter(WorkArea &);
39 /// Draw a line from point to point
40 PainterBase & line(int x1, int y1, int x2, int y2,
41 LColor::color = LColor::foreground,
42 enum line_style = line_solid,
43 enum line_width = line_thin);
45 /// Here xp and yp are arrays of points
46 PainterBase & lines(int const * xp, int const * yp, int np,
47 LColor::color = LColor::foreground,
48 enum line_style = line_solid,
49 enum line_width = line_thin);
51 /// Here xp and yp are arrays of points
52 PainterBase & fillPolygon(int const * xp, int const * yp, int np,
53 LColor::color = LColor::foreground);
55 /// Draw lines from x1,y1 to x2,y2. They are arrays
56 PainterBase & segments(int const * x1, int const * y1,
57 int const * x2, int const * y2, int ns,
58 LColor::color = LColor::foreground,
59 enum line_style = line_solid,
60 enum line_width = line_thin);
63 PainterBase & rectangle(int x, int y, int w, int h,
64 LColor::color = LColor::foreground,
65 enum line_style = line_solid,
66 enum line_width = line_thin);
69 PainterBase & arc(int x, int y, unsigned int w, unsigned int h,
71 LColor::color = LColor::foreground);
74 PainterBase & point(int x, int y, LColor::color = LColor::foreground);
77 PainterBase & fillRectangle(int x, int y, int w, int h,
78 LColor::color = LColor::background);
80 /// For the figure inset
81 PainterBase & pixmap(int x, int y, int w, int h, Pixmap bitmap);
83 /// Draw a string at position x, y (y is the baseline)
84 PainterBase & text(int x, int y,
85 string const & str, LyXFont const & f);
87 /** Draw a string at position x, y (y is the baseline)
88 This is just for fast drawing */
89 PainterBase & text(int x, int y, char const * str, int l,
92 /// Draw a char at position x, y (y is the baseline)
93 PainterBase & text(int x, int y, char c, LyXFont const & f);
95 /// Draw a wide string at position x, y
96 PainterBase & text(int x, int y, XChar2b const * str, int l,
99 /// Check the font, and if set, draw an underline
100 void underline(LyXFont const & f, int x, int y, int width);