aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/FbDrawable.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/FbDrawable.cc')
-rw-r--r--src/FbTk/FbDrawable.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/FbTk/FbDrawable.cc b/src/FbTk/FbDrawable.cc
index dd6e4a9..d5436c6 100644
--- a/src/FbTk/FbDrawable.cc
+++ b/src/FbTk/FbDrawable.cc
@@ -42,7 +42,7 @@ void FbDrawable::copyArea(Drawable src, GC gc,
42 unsigned int width, unsigned int height) { 42 unsigned int width, unsigned int height) {
43 if (drawable() == 0 || src == 0 || gc == 0) 43 if (drawable() == 0 || src == 0 || gc == 0)
44 return; 44 return;
45 XCopyArea(s_display, 45 XCopyArea(display(),
46 src, drawable(), gc, 46 src, drawable(), gc,
47 src_x, src_y, 47 src_x, src_y,
48 width, height, 48 width, height,
@@ -53,27 +53,27 @@ void FbDrawable::fillRectangle(GC gc, int x, int y,
53 unsigned int width, unsigned int height) { 53 unsigned int width, unsigned int height) {
54 if (drawable() == 0 || gc == 0) 54 if (drawable() == 0 || gc == 0)
55 return; 55 return;
56 XFillRectangle(s_display, 56 XFillRectangle(display(),
57 drawable(), gc, 57 drawable(), gc,
58 x, y, 58 x, y,
59 width, height); 59 width, height);
60} 60}
61 61
62void FbDrawable::drawRectangle(GC gc, int x, int y, 62void FbDrawable::drawRectangle(GC gc, int x, int y,
63 unsigned int width, unsigned int height) { 63 unsigned int width, unsigned int height) {
64 if (drawable() == 0 || gc == 0) 64 if (drawable() == 0 || gc == 0)
65 return; 65 return;
66 XDrawRectangle(s_display, 66 XDrawRectangle(display(),
67 drawable(), gc, 67 drawable(), gc,
68 x, y, 68 x, y,
69 width, height); 69 width, height);
70} 70}
71 71
72void FbDrawable::drawLine(GC gc, int start_x, int start_y, 72void FbDrawable::drawLine(GC gc, int start_x, int start_y,
73 int end_x, int end_y) { 73 int end_x, int end_y) {
74 if (drawable() == 0 || gc == 0) 74 if (drawable() == 0 || gc == 0)
75 return; 75 return;
76 XDrawLine(s_display, 76 XDrawLine(display(),
77 drawable(), 77 drawable(),
78 gc, 78 gc,
79 start_x, start_y, 79 start_x, start_y,
@@ -84,7 +84,7 @@ void FbDrawable::fillPolygon(GC gc, XPoint *points, int npoints,
84 int shape, int mode) { 84 int shape, int mode) {
85 if (drawable() == 0 || gc == 0 || points == 0 || npoints == 0) 85 if (drawable() == 0 || gc == 0 || points == 0 || npoints == 0)
86 return; 86 return;
87 XFillPolygon(s_display, 87 XFillPolygon(display(),
88 drawable(), gc, points, npoints, 88 drawable(), gc, points, npoints,
89 shape, mode); 89 shape, mode);
90} 90}
@@ -92,7 +92,7 @@ void FbDrawable::fillPolygon(GC gc, XPoint *points, int npoints,
92// x, y, width and height define a space within which we're drawing a triangle (centred) 92// x, y, width and height define a space within which we're drawing a triangle (centred)
93// scale defines number of triangles that'd fit in a space of 100 width x 100 height 93// scale defines number of triangles that'd fit in a space of 100 width x 100 height
94// (i.e. 200 = half size, 300 = a third). Its a bit backwards but it allows more flexibility 94// (i.e. 200 = half size, 300 = a third). Its a bit backwards but it allows more flexibility
95void FbDrawable::drawTriangle(GC gc, FbDrawable::TriangleType type, 95void FbDrawable::drawTriangle(GC gc, FbDrawable::TriangleType type,
96 int x, int y, unsigned int width, unsigned int height, 96 int x, int y, unsigned int width, unsigned int height,
97 int scale) { 97 int scale) {
98 if (drawable() == 0 || gc == 0 || width == 0 || height == 0) 98 if (drawable() == 0 || gc == 0 || width == 0 || height == 0)
@@ -141,7 +141,7 @@ void FbDrawable::drawTriangle(GC gc, FbDrawable::TriangleType type,
141 pts[1].x = -ax/2+1; pts[1].y = -ay; 141 pts[1].x = -ax/2+1; pts[1].y = -ay;
142 pts[2].x = ax-1; pts[2].y = 0; 142 pts[2].x = ax-1; pts[2].y = 0;
143 break; 143 break;
144 144
145 } 145 }
146 146
147 // re-centre on the specified points 147 // re-centre on the specified points
@@ -149,21 +149,21 @@ void FbDrawable::drawTriangle(GC gc, FbDrawable::TriangleType type,
149 pts[0].y += y; 149 pts[0].y += y;
150 150
151 fillPolygon(gc, 151 fillPolygon(gc,
152 pts, 3, 152 pts, 3,
153 Convex, CoordModePrevious); 153 Convex, CoordModePrevious);
154} 154}
155 155
156#ifdef NOT_USED 156#ifdef NOT_USED
157void FbDrawable::drawPoint(GC gc, int x, int y) { 157void FbDrawable::drawPoint(GC gc, int x, int y) {
158 if (drawable() == 0 || gc == 0) 158 if (drawable() == 0 || gc == 0)
159 return; 159 return;
160 XDrawPoint(s_display, drawable(), gc, x, y); 160 XDrawPoint(display(), drawable(), gc, x, y);
161} 161}
162#endif 162#endif
163 163
164XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const { 164XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const {
165 return XGetImage(s_display, drawable(), 165 return XGetImage(display(), drawable(),
166 x, y, width, height, 166 x, y, width, height,
167 AllPlanes, // plane mask 167 AllPlanes, // plane mask
168 ZPixmap); 168 ZPixmap);
169} 169}