413 |
translate_image(int width, int height, uint8 * data) |
translate_image(int width, int height, uint8 * data) |
414 |
{ |
{ |
415 |
int size = width * height * bpp / 8; |
int size = width * height * bpp / 8; |
416 |
uint8 *out = xmalloc(size); |
uint8 *out = (uint8*)xmalloc(size); |
417 |
uint8 *end = out + size; |
uint8 *end = out + size; |
418 |
|
|
419 |
switch (server_bpp) |
switch (server_bpp) |
787 |
case ClientMessage: |
case ClientMessage: |
788 |
/* the window manager told us to quit */ |
/* the window manager told us to quit */ |
789 |
if ((xevent.xclient.message_type == protocol_atom) |
if ((xevent.xclient.message_type == protocol_atom) |
790 |
&& (xevent.xclient.data.l[0] == kill_atom)) |
&& ((Atom)xevent.xclient.data.l[0] == kill_atom)) |
791 |
/* Quit */ |
/* Quit */ |
792 |
return 0; |
return 0; |
793 |
break; |
break; |
1137 |
scanline = (width + 7) / 8; |
scanline = (width + 7) / 8; |
1138 |
offset = scanline * height; |
offset = scanline * height; |
1139 |
|
|
1140 |
cursor = xmalloc(offset); |
cursor = (uint8*)xmalloc(offset); |
1141 |
memset(cursor, 0, offset); |
memset(cursor, 0, offset); |
1142 |
|
|
1143 |
mask = xmalloc(offset); |
mask = (uint8*)xmalloc(offset); |
1144 |
memset(mask, 0, offset); |
memset(mask, 0, offset); |
1145 |
|
|
1146 |
/* approximate AND and XOR masks with a monochrome X pointer */ |
/* approximate AND and XOR masks with a monochrome X pointer */ |
1219 |
int i, ncolours = colours->ncolours; |
int i, ncolours = colours->ncolours; |
1220 |
if (!owncolmap) |
if (!owncolmap) |
1221 |
{ |
{ |
1222 |
uint32 *map = xmalloc(sizeof(*colmap) * ncolours); |
uint32 *map = (uint32*)xmalloc(sizeof(*colmap) * ncolours); |
1223 |
XColor xentry; |
XColor xentry; |
1224 |
XColor xc_cache[256]; |
XColor xc_cache[256]; |
1225 |
uint32 colour; |
uint32 colour; |
1297 |
XColor *xcolours, *xentry; |
XColor *xcolours, *xentry; |
1298 |
Colormap map; |
Colormap map; |
1299 |
|
|
1300 |
xcolours = xmalloc(sizeof(XColor) * ncolours); |
xcolours = (XColor*)xmalloc(sizeof(XColor) * ncolours); |
1301 |
for (i = 0; i < ncolours; i++) |
for (i = 0; i < ncolours; i++) |
1302 |
{ |
{ |
1303 |
entry = &colours->colours[i]; |
entry = &colours->colours[i]; |
1327 |
ui_set_colourmap(HCOLOURMAP map) |
ui_set_colourmap(HCOLOURMAP map) |
1328 |
{ |
{ |
1329 |
if (!owncolmap) |
if (!owncolmap) |
1330 |
colmap = map; |
colmap = (uint32*)map; |
1331 |
else |
else |
1332 |
XSetWindowColormap(display, wnd, (Colormap) map); |
XSetWindowColormap(display, wnd, (Colormap) map); |
1333 |
} |
} |