Lines 123-132
Link Here
|
123 |
XFreePixmap (dpy, mask); |
123 |
XFreePixmap (dpy, mask); |
124 |
} |
124 |
} |
125 |
|
125 |
|
126 |
if (watch_cursor == NULL) |
126 |
if (watch_cursor == 0) |
127 |
watch_cursor = circle_cursor; |
127 |
watch_cursor = circle_cursor; |
128 |
|
128 |
|
129 |
if (left_ptr_cursor == NULL) |
129 |
if (left_ptr_cursor == 0) |
130 |
left_ptr_cursor = circle_cursor; |
130 |
left_ptr_cursor = circle_cursor; |
131 |
} |
131 |
} |
132 |
|
132 |
|
Lines 147-153
Link Here
|
147 |
(img->binary_img ? 1 : img->dpy_depth), |
147 |
(img->binary_img ? 1 : img->dpy_depth), |
148 |
(img->binary_img ? XYBitmap : ZPixmap), |
148 |
(img->binary_img ? XYBitmap : ZPixmap), |
149 |
NULL, &img->shm_img, width, height ); |
149 |
NULL, &img->shm_img, width, height ); |
150 |
if ( image != NULL ) |
150 |
if ( image != 0 ) |
151 |
{ |
151 |
{ |
152 |
/* Allocate shared segment. */ |
152 |
/* Allocate shared segment. */ |
153 |
img->shm_img.shmid = |
153 |
img->shm_img.shmid = |
Lines 521-527
Link Here
|
521 |
{ |
521 |
{ |
522 |
img->colormap = XCreateColormap (dpy, root_window, |
522 |
img->colormap = XCreateColormap (dpy, root_window, |
523 |
img->dpy_visual, AllocNone ); |
523 |
img->dpy_visual, AllocNone ); |
524 |
if (img->colormap == NULL) |
524 |
if (img->colormap == 0) |
525 |
fprintf(stderr, "getx11: Could not create color map for visual\n"); |
525 |
fprintf(stderr, "getx11: Could not create color map for visual\n"); |
526 |
else { |
526 |
else { |
527 |
VPRINTF(stderr, "created colormap for visual type %s\n", |
527 |
VPRINTF(stderr, "created colormap for visual type %s\n", |
Lines 543-556
Link Here
|
543 |
specified_screen = atoi( dotp+1 ); |
543 |
specified_screen = atoi( dotp+1 ); |
544 |
} |
544 |
} |
545 |
|
545 |
|
546 |
if (display_name == NULL || *display_name == '\0') |
546 |
if (display_name == 0 || *display_name == '\0') |
547 |
display_name = getenv("DISPLAY"); |
547 |
display_name = getenv("DISPLAY"); |
548 |
|
548 |
|
549 |
dpy = XOpenDisplay(display_name); |
549 |
dpy = XOpenDisplay(display_name); |
550 |
|
550 |
|
551 |
if (dpy == NULL) { |
551 |
if (dpy == 0) { |
552 |
fprintf(stderr, "%s: Cant open display %s\n", progname, |
552 |
fprintf(stderr, "%s: Cant open display %s\n", progname, |
553 |
(display_name == NULL) ? "" : display_name); |
553 |
(display_name == 0) ? "" : display_name); |
554 |
exit(1); |
554 |
exit(1); |
555 |
} |
555 |
} |
556 |
|
556 |
|
Lines 608-615
Link Here
|
608 |
* Now, make the window. |
608 |
* Now, make the window. |
609 |
*/ |
609 |
*/ |
610 |
|
610 |
|
611 |
new_window = (img->window == NULL && img->icn_window == NULL); |
611 |
new_window = (img->window == 0 && img->icn_window == 0); |
612 |
new_pixmaps = ((img->pixmap == NULL || img->icn_pixmap == NULL) && |
612 |
new_pixmaps = ((img->pixmap == 0 || img->icn_pixmap == 0) && |
613 |
!img->pixmap_failed && !stingy_flag); |
613 |
!img->pixmap_failed && !stingy_flag); |
614 |
|
614 |
|
615 |
if ( !img->window ) |
615 |
if ( !img->window ) |
Lines 1279-1285
Link Here
|
1279 |
nunique = (p - pixels) + 1; |
1279 |
nunique = (p - pixels) + 1; |
1280 |
|
1280 |
|
1281 |
DPRINTF(stderr, "In free_unique_pixels \n\nPixels: "); |
1281 |
DPRINTF(stderr, "In free_unique_pixels \n\nPixels: "); |
1282 |
for (i=0;i<nunique;i++) DPRINTF(stderr, " %d ",pixels[i]); |
1282 |
for (i=0;i<nunique;i++) DPRINTF(stderr, " %zu ",pixels[i]); |
1283 |
DPRINTF(stderr, "\n"); |
1283 |
DPRINTF(stderr, "\n"); |
1284 |
} |
1284 |
} |
1285 |
else |
1285 |
else |
Lines 1340-1352
Link Here
|
1340 |
/* try to get a color map entry for each color. */ |
1340 |
/* try to get a color map entry for each color. */ |
1341 |
red_index = green_index = blue_index = 0; |
1341 |
red_index = green_index = blue_index = 0; |
1342 |
|
1342 |
|
1343 |
#ifdef XLIBINT_H_NOT_AVAILABLE |
1343 |
#ifndef XLIBINT_H_NOT_AVAILABLE |
1344 |
for ( i = 0; i < total_levels; i++ ) { |
1344 |
for ( i = 0; i < total_levels; i++ ) { |
1345 |
color_def.red = map[red_index] << 8; |
1345 |
color_defs->red = map[red_index] << 8; |
1346 |
color_def.green = map[green_index] << 8; |
1346 |
color_defs->green = map[green_index] << 8; |
1347 |
color_def.blue = map[blue_index] << 8; |
1347 |
color_defs->blue = map[blue_index] << 8; |
1348 |
|
1348 |
|
1349 |
if ( XAllocColor (dpy, img->colormap, &color_def ) == 0 ) { |
1349 |
if ( XAllocColor (dpy, img->colormap, color_defs ) == 0 ) { |
1350 |
break; |
1350 |
break; |
1351 |
} |
1351 |
} |
1352 |
|
1352 |
|
Lines 1357-1363
Link Here
|
1357 |
red_index = 0; |
1357 |
red_index = 0; |
1358 |
} |
1358 |
} |
1359 |
|
1359 |
|
1360 |
img->pixel_table[i] = color_def.pixel; |
1360 |
img->pixel_table[i] = color_defs->pixel; |
1361 |
} |
1361 |
} |
1362 |
|
1362 |
|
1363 |
/* Check if the colors are available */ |
1363 |
/* Check if the colors are available */ |
Lines 1592-1613
Link Here
|
1592 |
|
1592 |
|
1593 |
/* try to get a color map entry for each color. */ |
1593 |
/* try to get a color map entry for each color. */ |
1594 |
|
1594 |
|
1595 |
#ifdef XLIBINT_H_NOT_AVAILABLE |
1595 |
#ifndef XLIBINT_H_NOT_AVAILABLE |
1596 |
for ( i = 0; i < num_lvls; i++ ) { |
1596 |
for ( i = 0; i < num_lvls; i++ ) { |
1597 |
if ( img->mono_color ) { |
1597 |
if ( img->mono_color ) { |
1598 |
color_def.red = img->in_cmap[RLE_RED][i] << 8; |
1598 |
color_defs->red = img->in_cmap[RLE_RED][i] << 8; |
1599 |
color_def.green = img->in_cmap[RLE_GREEN][i] << 8; |
1599 |
color_defs->green = img->in_cmap[RLE_GREEN][i] << 8; |
1600 |
color_def.blue = img->in_cmap[RLE_BLUE][i] << 8; |
1600 |
color_defs->blue = img->in_cmap[RLE_BLUE][i] << 8; |
1601 |
} else { |
1601 |
} else { |
1602 |
color_def.red = map[i] << 8; |
1602 |
color_defs->red = map[i] << 8; |
1603 |
color_def.green = map[i] << 8; |
1603 |
color_defs->green = map[i] << 8; |
1604 |
color_def.blue = map[i] << 8; |
1604 |
color_defs->blue = map[i] << 8; |
1605 |
} |
1605 |
} |
1606 |
|
1606 |
|
1607 |
if ( XAllocColor (dpy, img->colormap, &color_def ) == 0 ){ |
1607 |
if ( XAllocColor (dpy, img->colormap, color_defs ) == 0 ){ |
1608 |
break; |
1608 |
break; |
1609 |
} |
1609 |
} |
1610 |
img->pixel_table[i] = color_def.pixel; |
1610 |
img->pixel_table[i] = color_defs->pixel; |
1611 |
} |
1611 |
} |
1612 |
|
1612 |
|
1613 |
/* Check if the colors are available */ |
1613 |
/* Check if the colors are available */ |
Lines 1981-1987
Link Here
|
1981 |
font_height = pixel_font_info->ascent + pixel_font_info->descent + 4; |
1981 |
font_height = pixel_font_info->ascent + pixel_font_info->descent + 4; |
1982 |
y = (use_top ? 0 : (h - font_height)); |
1982 |
y = (use_top ? 0 : (h - font_height)); |
1983 |
|
1983 |
|
1984 |
if ( img->pix_info_window == NULL ) { |
1984 |
if ( img->pix_info_window == 0 ) { |
1985 |
XSetFont (dpy, img->gc, pixel_font_info->fid ); |
1985 |
XSetFont (dpy, img->gc, pixel_font_info->fid ); |
1986 |
img->pix_info_window = XCreateSimpleWindow( |
1986 |
img->pix_info_window = XCreateSimpleWindow( |
1987 |
dpy, img->window, 0, y, w, font_height, 0, None, |
1987 |
dpy, img->window, 0, y, w, font_height, 0, None, |