]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/XPainter.h
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / XPainter.h
1 // -*- C++ -*-
2 /**
3  * \file XPainter.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #ifndef XPAINTER_H
14 #define XPAINTER_H
15
16
17 #include <config.h>
18
19 #include "frontends/Painter.h"
20 #include "LString.h"
21
22 #include <X11/Xlib.h>
23
24
25 class LyXFont;
26 class XWorkArea;
27
28 /**
29  * XPainter - a painter implementation for Xlib
30  */
31 class XPainter : public Painter {
32 public:
33         XPainter(XWorkArea &);
34
35         /// return the width of the work area in pixels
36         virtual int paperWidth() const;
37         /// return the height of the work area in pixels
38         virtual int paperHeight() const;
39
40         /// draw a line from point to point
41         virtual Painter & line(
42                 int x1, int y1,
43                 int x2, int y2,
44                 LColor::color = LColor::foreground,
45                 line_style = line_solid,
46                 line_width = line_thin);
47
48         /**
49          * lines -  draw a set of lines
50          * @param xp array of points' x co-ords
51          * @param yp array of points' y co-ords
52          * @param np size of the points array
53          */
54         virtual Painter & lines(
55                 int const * xp,
56                 int const * yp,
57                 int np,
58                 LColor::color = LColor::foreground,
59                 line_style = line_solid,
60                 line_width = line_thin);
61
62         /// draw a rectangle
63         virtual Painter & rectangle(
64                 int x, int y,
65                 int w, int h,
66                 LColor::color = LColor::foreground,
67                 line_style = line_solid,
68                 line_width = line_thin);
69
70         /// draw a filled rectangle
71         virtual Painter & fillRectangle(
72                 int x, int y,
73                 int w, int h,
74                 LColor::color);
75
76         /// draw a filled (irregular) polygon
77         virtual Painter & fillPolygon(
78                 int const * xp,
79                 int const * yp,
80                 int np,
81                 LColor::color = LColor::foreground);
82
83         /// draw an arc
84         virtual Painter & arc(
85                 int x, int y,
86                 unsigned int w, unsigned int h,
87                 int a1, int a2,
88                 LColor::color = LColor::foreground);
89
90         /// draw a pixel
91         virtual Painter & point(
92                 int x, int y,
93                 LColor::color = LColor::foreground);
94
95         /// draw an image from the image cache
96         virtual Painter & image(int x, int y,
97                 int w, int h,
98                 grfx::Image const & image);
99
100         /// draw a string at position x, y (y is the baseline)
101         virtual Painter & text(int x, int y,
102                 string const & str, LyXFont const & f);
103
104         /** Draw a string at position x, y (y is the baseline)
105          *  This is just for fast drawing
106          */
107         virtual Painter & text(int x, int y,
108                 char const * str, size_t l,
109                 LyXFont const & f);
110
111         /// draw a char at position x, y (y is the baseline)
112         virtual Painter & text(int x, int y,
113                 char c, LyXFont const & f);
114
115         /// draw a wide string at position x, y
116         Painter & text(int x, int y,
117                 XChar2b const * str, size_t l,
118                 LyXFont const & f);
119
120 private:
121         /// our owner who we paint upon
122         XWorkArea & owner_;
123 };
124
125 #endif // XPAINTER_H