32 |
extern BOOL grab_keyboard; |
extern BOOL grab_keyboard; |
33 |
extern BOOL hide_decorations; |
extern BOOL hide_decorations; |
34 |
extern char title[]; |
extern char title[]; |
35 |
extern int server_bpp; |
extern int g_server_bpp; |
36 |
extern int win_button_size; |
extern int win_button_size; |
37 |
BOOL enable_compose = False; |
BOOL enable_compose = False; |
38 |
BOOL focused; |
BOOL focused; |
105 |
static Colormap xcolmap; |
static Colormap xcolmap; |
106 |
static uint32 *colmap; |
static uint32 *colmap; |
107 |
|
|
108 |
#define TRANSLATE(col) ( server_bpp != 8 ? translate_colour(col) : owncolmap ? col : translate_colour(colmap[col]) ) |
#define TRANSLATE(col) ( g_server_bpp != 8 ? translate_colour(col) : owncolmap ? col : translate_colour(colmap[col]) ) |
109 |
#define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col)); |
#define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col)); |
110 |
#define SET_BACKGROUND(col) XSetBackground(display, gc, TRANSLATE(col)); |
#define SET_BACKGROUND(col) XSetBackground(display, gc, TRANSLATE(col)); |
111 |
|
|
218 |
static uint32 |
static uint32 |
219 |
translate_colour(uint32 colour) |
translate_colour(uint32 colour) |
220 |
{ |
{ |
221 |
switch (server_bpp) |
switch (g_server_bpp) |
222 |
{ |
{ |
223 |
case 15: |
case 15: |
224 |
switch (bpp) |
switch (bpp) |
419 |
uint8 *out = (uint8 *) xmalloc(size); |
uint8 *out = (uint8 *) xmalloc(size); |
420 |
uint8 *end = out + size; |
uint8 *end = out + size; |
421 |
|
|
422 |
switch (server_bpp) |
switch (g_server_bpp) |
423 |
{ |
{ |
424 |
case 24: |
case 24: |
425 |
switch (bpp) |
switch (bpp) |
616 |
xclip_init(); |
xclip_init(); |
617 |
|
|
618 |
/* todo take this out when high colour is done */ |
/* todo take this out when high colour is done */ |
619 |
printf("server bpp %d client bpp %d depth %d\n", server_bpp, bpp, depth); |
printf("server bpp %d client bpp %d depth %d\n", g_server_bpp, bpp, depth); |
620 |
|
|
621 |
return True; |
return True; |
622 |
} |
} |
802 |
/* Multi_key compatible version */ |
/* Multi_key compatible version */ |
803 |
{ |
{ |
804 |
XmbLookupString(IC, |
XmbLookupString(IC, |
805 |
&xevent.xkey, str, sizeof(str), &keysym, &status); |
&xevent.xkey, str, sizeof(str), &keysym, |
806 |
|
&status); |
807 |
if (!((status == XLookupKeySym) || (status == XLookupBoth))) |
if (!((status == XLookupKeySym) || (status == XLookupBoth))) |
808 |
{ |
{ |
809 |
error("XmbLookupString failed with status 0x%x\n", |
error("XmbLookupString failed with status 0x%x\n", |
1000 |
} |
} |
1001 |
break; |
break; |
1002 |
|
|
1003 |
/* clipboard stuff */ |
/* clipboard stuff */ |
1004 |
case SelectionNotify: |
case SelectionNotify: |
1005 |
xclip_handle_SelectionNotify(&xevent.xselection); |
xclip_handle_SelectionNotify(&xevent.xselection); |
1006 |
break; |
break; |
1069 |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
1070 |
bitmap = XCreatePixmap(display, wnd, width, height, depth); |
bitmap = XCreatePixmap(display, wnd, width, height, depth); |
1071 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
1072 |
(char *) tdata, width, height, server_bpp == 8 ? 8 : bpp, 0); |
(char *) tdata, width, height, g_server_bpp == 8 ? 8 : bpp, 0); |
1073 |
|
|
1074 |
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
1075 |
|
|
1086 |
uint8 *tdata; |
uint8 *tdata; |
1087 |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
1088 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
1089 |
(char *) tdata, width, height, server_bpp == 8 ? 8 : bpp, 0); |
(char *) tdata, width, height, g_server_bpp == 8 ? 8 : bpp, 0); |
1090 |
|
|
1091 |
if (ownbackstore) |
if (ownbackstore) |
1092 |
{ |
{ |
1720 |
|
|
1721 |
XFree(image); |
XFree(image); |
1722 |
} |
} |
|
|
|