Lines 35-40
Link Here
|
35 |
|
35 |
|
36 |
#include <X11/Xlib.h> |
36 |
#include <X11/Xlib.h> |
37 |
#include <X11/Xatom.h> |
37 |
#include <X11/Xatom.h> |
|
|
38 |
#include <X11/Xarch.h> |
38 |
#include <string.h> |
39 |
#include <string.h> |
39 |
|
40 |
|
40 |
#include "WindowMaker.h" |
41 |
#include "WindowMaker.h" |
Lines 322-336
Link Here
|
322 |
void |
323 |
void |
323 |
wNETWMUpdateDesktop(WScreen *scr) |
324 |
wNETWMUpdateDesktop(WScreen *scr) |
324 |
{ |
325 |
{ |
325 |
CARD32 *views, sizes[2]; |
326 |
long *views, sizes[2]; |
326 |
int count, i; |
327 |
int count, i; |
327 |
|
328 |
|
328 |
if (scr->workspace_count==0) |
329 |
if (scr->workspace_count==0) |
329 |
return; |
330 |
return; |
330 |
|
331 |
|
331 |
count = scr->workspace_count * 2; |
332 |
count = scr->workspace_count * 2; |
332 |
views = wmalloc(sizeof(CARD32) * count); |
333 |
views = wmalloc(sizeof(long) * count); |
333 |
/*memset(views, 0, sizeof(CARD32) * count);*/ |
334 |
/*memset(views, 0, sizeof(long) * count);*/ |
334 |
|
335 |
|
335 |
#ifdef VIRTUAL_DESKTOP |
336 |
#ifdef VIRTUAL_DESKTOP |
336 |
sizes[0] = scr->workspaces[scr->current_workspace]->width; |
337 |
sizes[0] = scr->workspaces[scr->current_workspace]->width; |
Lines 370-376
Link Here
|
370 |
0, 1, &count); |
371 |
0, 1, &count); |
371 |
if (prop) |
372 |
if (prop) |
372 |
{ |
373 |
{ |
373 |
int desktop= *(CARD32*)prop; |
374 |
int desktop= *(long*)prop; |
374 |
XFree(prop); |
375 |
XFree(prop); |
375 |
return desktop; |
376 |
return desktop; |
376 |
} |
377 |
} |
Lines 389-400
Link Here
|
389 |
* |
390 |
* |
390 |
* The logic can also be changed to accept bigger images and scale them down. |
391 |
* The logic can also be changed to accept bigger images and scale them down. |
391 |
*/ |
392 |
*/ |
392 |
static CARD32* |
393 |
static unsigned long* |
393 |
findBestIcon(CARD32 *data, unsigned long items) |
394 |
findBestIcon(unsigned long *data, unsigned long items) |
394 |
{ |
395 |
{ |
395 |
int size, wanted, d, distance; |
396 |
int size, wanted, d, distance; |
396 |
unsigned long i; |
397 |
unsigned long i; |
397 |
CARD32 *icon; |
398 |
unsigned long *icon; |
398 |
|
399 |
|
399 |
/* better use only 75% of icon_size. For 64x64 this means 48x48 |
400 |
/* better use only 75% of icon_size. For 64x64 this means 48x48 |
400 |
* This leaves room around the icon for the miniwindow title and |
401 |
* This leaves room around the icon for the miniwindow title and |
Lines 418-429
Link Here
|
418 |
|
419 |
|
419 |
|
420 |
|
420 |
static RImage* |
421 |
static RImage* |
421 |
makeRImageFromARGBData(CARD32 *data) |
422 |
makeRImageFromARGBData(unsigned long *data) |
422 |
{ |
423 |
{ |
423 |
int size, width, height, i; |
424 |
int size, width, height, i; |
424 |
RImage *image; |
425 |
RImage *image; |
425 |
unsigned char *imgdata; |
426 |
unsigned char *imgdata; |
426 |
CARD32 pixel; |
427 |
unsigned long pixel; |
427 |
|
428 |
|
428 |
width = data[0]; |
429 |
width = data[0]; |
429 |
height = data[1]; |
430 |
height = data[1]; |
Lines 436-445
Link Here
|
436 |
|
437 |
|
437 |
for (imgdata=image->data, i=2; i<size+2; i++, imgdata+=4) { |
438 |
for (imgdata=image->data, i=2; i<size+2; i++, imgdata+=4) { |
438 |
pixel = data[i]; |
439 |
pixel = data[i]; |
|
|
440 |
#if BYTE_ORDER == BIG_ENDIAN |
441 |
imgdata[2] = (pixel >> 24) & 0xff; /* A */ |
442 |
imgdata[1] = (pixel >> 16) & 0xff; /* R */ |
443 |
imgdata[0] = (pixel >> 8) & 0xff; /* G */ |
444 |
imgdata[3] = (pixel >> 0) & 0xff; /* B */ |
445 |
#else /* Little endian */ |
439 |
imgdata[3] = (pixel >> 24) & 0xff; /* A */ |
446 |
imgdata[3] = (pixel >> 24) & 0xff; /* A */ |
440 |
imgdata[0] = (pixel >> 16) & 0xff; /* R */ |
447 |
imgdata[0] = (pixel >> 16) & 0xff; /* R */ |
441 |
imgdata[1] = (pixel >> 8) & 0xff; /* G */ |
448 |
imgdata[1] = (pixel >> 8) & 0xff; /* G */ |
442 |
imgdata[2] = (pixel >> 0) & 0xff; /* B */ |
449 |
imgdata[2] = (pixel >> 0) & 0xff; /* B */ |
|
|
450 |
#endif /* endianness */ |
451 |
|
443 |
} |
452 |
} |
444 |
|
453 |
|
445 |
return image; |
454 |
return image; |
Lines 449-455
Link Here
|
449 |
static void |
458 |
static void |
450 |
updateIconImage(WScreen *scr, WWindow *wwin) |
459 |
updateIconImage(WScreen *scr, WWindow *wwin) |
451 |
{ |
460 |
{ |
452 |
CARD32 *property, *data; |
461 |
unsigned long *property, *data; |
453 |
unsigned long items, rest; |
462 |
unsigned long items, rest; |
454 |
Atom type; |
463 |
Atom type; |
455 |
int format; |
464 |
int format; |
Lines 487-493
Link Here
|
487 |
static void |
496 |
static void |
488 |
updateShowDesktop(WScreen * scr, Bool show) |
497 |
updateShowDesktop(WScreen * scr, Bool show) |
489 |
{ |
498 |
{ |
490 |
CARD32 foo; |
499 |
long foo; |
491 |
|
500 |
|
492 |
foo = (show == True); |
501 |
foo = (show == True); |
493 |
XChangeProperty(dpy, scr->root_win, net_showing_desktop, XA_CARDINAL, 32, |
502 |
XChangeProperty(dpy, scr->root_win, net_showing_desktop, XA_CARDINAL, 32, |
Lines 660-666
Link Here
|
660 |
void |
669 |
void |
661 |
wNETWMUpdateWorkarea(WScreen *scr, WArea usableArea) |
670 |
wNETWMUpdateWorkarea(WScreen *scr, WArea usableArea) |
662 |
{ |
671 |
{ |
663 |
CARD32 *area; |
672 |
long *area; |
664 |
int count, i; |
673 |
int count, i; |
665 |
|
674 |
|
666 |
/* XXX: not Xinerama compatible, |
675 |
/* XXX: not Xinerama compatible, |
Lines 670-676
Link Here
|
670 |
return; |
679 |
return; |
671 |
|
680 |
|
672 |
count = scr->workspace_count * 4; |
681 |
count = scr->workspace_count * 4; |
673 |
area = wmalloc(sizeof(CARD32) * count); |
682 |
area = wmalloc(sizeof(long) * count); |
674 |
for (i=0; i<scr->workspace_count; i++) { |
683 |
for (i=0; i<scr->workspace_count; i++) { |
675 |
area[4*i + 0] = usableArea.x1; |
684 |
area[4*i + 0] = usableArea.x1; |
676 |
area[4*i + 1] = usableArea.y1; |
685 |
area[4*i + 1] = usableArea.y1; |
Lines 793-799
Link Here
|
793 |
static void |
802 |
static void |
794 |
updateWorkspaceCount(WScreen *scr) /* changeable */ |
803 |
updateWorkspaceCount(WScreen *scr) /* changeable */ |
795 |
{ |
804 |
{ |
796 |
CARD32 count; |
805 |
long count; |
797 |
|
806 |
|
798 |
count = scr->workspace_count; |
807 |
count = scr->workspace_count; |
799 |
|
808 |
|
Lines 805-811
Link Here
|
805 |
static void |
814 |
static void |
806 |
updateCurrentWorkspace(WScreen *scr) /* changeable */ |
815 |
updateCurrentWorkspace(WScreen *scr) /* changeable */ |
807 |
{ |
816 |
{ |
808 |
CARD32 count; |
817 |
long count; |
809 |
|
818 |
|
810 |
count = scr->current_workspace; |
819 |
count = scr->current_workspace; |
811 |
|
820 |
|
Lines 852-858
Link Here
|
852 |
static void |
861 |
static void |
853 |
updateWorkspaceHint(WWindow *wwin, Bool fake, Bool del) |
862 |
updateWorkspaceHint(WWindow *wwin, Bool fake, Bool del) |
854 |
{ |
863 |
{ |
855 |
CARD32 l; |
864 |
long l; |
856 |
|
865 |
|
857 |
if (del) { |
866 |
if (del) { |
858 |
XDeleteProperty(dpy, wwin->client_win, net_wm_desktop); |
867 |
XDeleteProperty(dpy, wwin->client_win, net_wm_desktop); |