aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/FbPixmap.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-09-11 23:01:34 (GMT)
committerfluxgen <fluxgen>2004-09-11 23:01:34 (GMT)
commit049e40c9eb6e6e8651b171a2a78465398c87f6a1 (patch)
tree7aef9d57e82336221d6d953617c7a5d53ee95db0 /src/FbTk/FbPixmap.cc
parentacd2176355876a7bb7afe9d026f9780a3d1c2737 (diff)
downloadfluxbox-049e40c9eb6e6e8651b171a2a78465398c87f6a1.zip
fluxbox-049e40c9eb6e6e8651b171a2a78465398c87f6a1.tar.bz2
Font::drawText takes reference to FbDrawable instead of X Drawable + some code cleaning
Diffstat (limited to 'src/FbTk/FbPixmap.cc')
-rw-r--r--src/FbTk/FbPixmap.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index 66eee21..d215e6c 100644
--- a/src/FbTk/FbPixmap.cc
+++ b/src/FbTk/FbPixmap.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbPixmap.cc,v 1.15 2004/09/11 12:33:14 rathnor Exp $ 22// $Id: FbPixmap.cc,v 1.16 2004/09/11 22:58:20 fluxgen Exp $
23 23
24#include "FbPixmap.hh" 24#include "FbPixmap.hh"
25#include "App.hh" 25#include "App.hh"
@@ -90,7 +90,7 @@ FbPixmap &FbPixmap::operator = (Pixmap pm) {
90 Window root; 90 Window root;
91 int x, y; 91 int x, y;
92 unsigned int border_width, bpp; 92 unsigned int border_width, bpp;
93 XGetGeometry(s_display, 93 XGetGeometry(display(),
94 pm, 94 pm,
95 &root, 95 &root,
96 &x, &y, 96 &x, &y,
@@ -148,7 +148,7 @@ void FbPixmap::copy(Pixmap pm) {
148 unsigned int border_width, bpp; 148 unsigned int border_width, bpp;
149 unsigned int new_width, new_height; 149 unsigned int new_width, new_height;
150 150
151 XGetGeometry(s_display, 151 XGetGeometry(display(),
152 pm, 152 pm,
153 &root, 153 &root,
154 &x, &y, 154 &x, &y,
@@ -158,20 +158,20 @@ void FbPixmap::copy(Pixmap pm) {
158 // create new pixmap and copy area 158 // create new pixmap and copy area
159 create(root, new_width, new_height, bpp); 159 create(root, new_width, new_height, bpp);
160 160
161 GC gc = XCreateGC(s_display, drawable(), 0, 0); 161 GC gc = XCreateGC(display(), drawable(), 0, 0);
162 162
163 XCopyArea(s_display, pm, drawable(), gc, 163 XCopyArea(display(), pm, drawable(), gc,
164 0, 0, 164 0, 0,
165 width(), height(), 165 width(), height(),
166 0, 0); 166 0, 0);
167 167
168 XFreeGC(s_display, gc); 168 XFreeGC(display(), gc);
169} 169}
170 170
171void FbPixmap::rotate() { 171void FbPixmap::rotate() {
172 172
173 // make an image copy 173 // make an image copy
174 XImage *src_image = XGetImage(s_display, drawable(), 174 XImage *src_image = XGetImage(display(), drawable(),
175 0, 0, // pos 175 0, 0, // pos
176 width(), height(), // size 176 width(), height(), // size
177 ~0, // plane mask 177 ~0, // plane mask
@@ -186,7 +186,7 @@ void FbPixmap::rotate() {
186 for (unsigned int x = 0; x < width(); ++x) { 186 for (unsigned int x = 0; x < width(); ++x) {
187 gc.setForeground(XGetPixel(src_image, x, y)); 187 gc.setForeground(XGetPixel(src_image, x, y));
188 // revers coordinates 188 // revers coordinates
189 XDrawPoint(s_display, new_pm.drawable(), gc.gc(), y, x); 189 XDrawPoint(display(), new_pm.drawable(), gc.gc(), y, x);
190 } 190 }
191 } 191 }
192 192
@@ -206,7 +206,7 @@ void FbPixmap::scale(unsigned int dest_width, unsigned int dest_height) {
206 (dest_width == width() && dest_height == height())) 206 (dest_width == width() && dest_height == height()))
207 return; 207 return;
208 208
209 XImage *src_image = XGetImage(s_display, drawable(), 209 XImage *src_image = XGetImage(display(), drawable(),
210 0, 0, // pos 210 0, 0, // pos
211 width(), height(), // size 211 width(), height(), // size
212 ~0, // plane mask 212 ~0, // plane mask
@@ -230,7 +230,7 @@ void FbPixmap::scale(unsigned int dest_width, unsigned int dest_height) {
230 gc.setForeground(XGetPixel(src_image, 230 gc.setForeground(XGetPixel(src_image,
231 static_cast<int>(src_x), 231 static_cast<int>(src_x),
232 static_cast<int>(src_y))); 232 static_cast<int>(src_y)));
233 XDrawPoint(s_display, new_pm.drawable(), gc.gc(), tx, ty); 233 XDrawPoint(display(), new_pm.drawable(), gc.gc(), tx, ty);
234 } 234 }
235 } 235 }
236 236
@@ -306,9 +306,9 @@ Pixmap FbPixmap::getRootPixmap(int screen_num) {
306 306
307 Pixmap root_pm = None; 307 Pixmap root_pm = None;
308 for (prop = 0; prop_ids[prop]; prop++) { 308 for (prop = 0; prop_ids[prop]; prop++) {
309 if (XGetWindowProperty(s_display, 309 if (XGetWindowProperty(display(),
310 RootWindow(s_display, screen_num), 310 RootWindow(display(), screen_num),
311 XInternAtom(s_display, prop_ids[prop], False), 311 XInternAtom(display(), prop_ids[prop], False),
312 0l, 4l, 312 0l, 4l,
313 False, XA_PIXMAP, 313 False, XA_PIXMAP,
314 &real_type, &real_format, 314 &real_type, &real_format,
@@ -333,7 +333,7 @@ Pixmap FbPixmap::getRootPixmap(int screen_num) {
333 333
334void FbPixmap::free() { 334void FbPixmap::free() {
335 if (m_pm != 0) { 335 if (m_pm != 0) {
336 XFreePixmap(s_display, m_pm); 336 XFreePixmap(display(), m_pm);
337 m_pm = 0; 337 m_pm = 0;
338 } 338 }
339 m_width = 0; 339 m_width = 0;
@@ -347,7 +347,7 @@ void FbPixmap::create(Drawable src,
347 if (src == 0) 347 if (src == 0)
348 return; 348 return;
349 349
350 m_pm = XCreatePixmap(s_display, 350 m_pm = XCreatePixmap(display(),
351 src, width, height, depth); 351 src, width, height, depth);
352 if (m_pm == 0) 352 if (m_pm == 0)
353 return; 353 return;