/* If not found, create a new image and cache it. */
if (img == NULL)
{
+ BLOCK_INPUT;
img = make_image (spec, hash);
cache_image (f, img);
img->load_failed_p = img->type->load (f, img) == 0;
- xassert (!interrupt_input_blocked);
/* If we can't load the image, and we don't have a width and
height, use some arbitrary width and height so that we can
}
else if (NILP (mask) && found_p && img->mask)
{
- BLOCK_INPUT;
XFreePixmap (FRAME_X_DISPLAY (f), img->mask);
img->mask = 0;
- UNBLOCK_INPUT;
}
}
}
}
}
+
+ UNBLOCK_INPUT;
+ xassert (!interrupt_input_blocked);
}
/* We're using IMG, so set its timestamp to `now'. */
if (!NILP (value))
background = x_alloc_image_color (f, img, value, background);
- BLOCK_INPUT;
img->pixmap
= XCreatePixmapFromBitmapData (FRAME_X_DISPLAY (f),
FRAME_X_WINDOW (f),
}
else
success_p = 1;
-
- UNBLOCK_INPUT;
}
else
image_error ("Error loading XBM image `%s'", img->spec, Qnil);
xassert (img->width > 0 && img->height > 0);
}
- BLOCK_INPUT;
-
/* Get foreground and background colors, maybe allocate colors. */
if (fmt[XBM_FOREGROUND].count)
foreground = x_alloc_image_color (f, img, fmt[XBM_FOREGROUND].value,
x_clear_image (f, img);
}
}
-
- UNBLOCK_INPUT;
}
return success_p;
/* Create a pixmap for the image, either from a file, or from a
string buffer containing data in the same format as an XPM file. */
- BLOCK_INPUT;
-
#ifdef ALLOC_XPM_COLORS
xpm_init_color_cache ();
#endif
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", specified_file, Qnil);
- UNBLOCK_INPUT;
return 0;
}
&img->pixmap, &img->mask,
&attrs);
}
- UNBLOCK_INPUT;
if (rc == XpmSuccess)
{
xassert (img->width > 0 && img->height > 0);
/* The call to XpmFreeAttributes below frees attrs.alloc_pixels. */
- BLOCK_INPUT;
XpmFreeAttributes (&attrs);
- UNBLOCK_INPUT;
}
else
{
color.green = g;
color.blue = b;
- BLOCK_INPUT;
cmap = FRAME_X_COLORMAP (f);
rc = x_alloc_nearest_color (f, cmap, &color);
- UNBLOCK_INPUT;
if (rc)
{
Colormap cmap;
int rc;
- BLOCK_INPUT;
-
cmap = FRAME_X_COLORMAP (f);
color.pixel = pixel;
XQueryColor (FRAME_X_DISPLAY (f), cmap, &color);
rc = x_alloc_nearest_color (f, cmap, &color);
- UNBLOCK_INPUT;
if (rc)
{
XColor *colors, *p;
XImage *ximg;
- BLOCK_INPUT;
-
colors = (XColor *) xmalloc (img->width * img->height * sizeof *colors);
/* Get the X image IMG->pixmap. */
}
XDestroyImage (ximg);
-
- UNBLOCK_INPUT;
return colors;
}
Pixmap pixmap;
XColor *p;
- BLOCK_INPUT;
init_color_table ();
x_create_x_image_and_pixmap (f, img->width, img->height, 0,
img->pixmap = pixmap;
img->colors = colors_in_color_table (&img->ncolors);
free_color_table ();
- UNBLOCK_INPUT;
}
Display *dpy = FRAME_X_DISPLAY (f);
GC gc;
- BLOCK_INPUT;
gc = XCreateGC (dpy, img->pixmap, 0, NULL);
XSetForeground (dpy, gc, BLACK_PIX_DEFAULT (f));
XDrawLine (dpy, img->pixmap, gc, 0, 0,
img->width - 1, 0);
XFreeGC (dpy, gc);
}
-
- UNBLOCK_INPUT;
}
}
int x, y, rc, look_at_corners_p;
unsigned long bg = 0;
- BLOCK_INPUT;
-
if (img->mask)
{
XFreePixmap (FRAME_X_DISPLAY (f), img->mask);
rc = x_create_x_image_and_pixmap (f, img->width, img->height, 1,
&mask_img, &img->mask);
if (!rc)
- {
- UNBLOCK_INPUT;
- return 0;
- }
+ return 0;
/* Get the X image of IMG->pixmap. */
ximg = XGetImage (dpy, img->pixmap, 0, 0, img->width, img->height,
x_destroy_x_image (mask_img);
XDestroyImage (ximg);
- UNBLOCK_INPUT;
return 1;
}
|| (type != PBM_MONO && max_color_idx < 0))
goto error;
- BLOCK_INPUT;
if (!x_create_x_image_and_pixmap (f, width, height, 0,
&ximg, &img->pixmap))
- {
- UNBLOCK_INPUT;
- goto error;
- }
+ goto error;
/* Initialize the color hash table. */
init_color_table ();
xfree (ximg->data);
ximg->data = NULL;
XDestroyImage (ximg);
- UNBLOCK_INPUT;
image_error ("Invalid pixel value in image `%s'",
img->spec, Qnil);
goto error;
/* Put the image into a pixmap. */
x_put_x_image (f, ximg, img->pixmap, width, height);
x_destroy_x_image (ximg);
- UNBLOCK_INPUT;
img->width = width;
img->height = height;
Colormap cmap;
png_color_16 frame_background;
- BLOCK_INPUT;
cmap = FRAME_X_COLORMAP (f);
color.pixel = FRAME_BACKGROUND_PIXEL (f);
XQueryColor (FRAME_X_DISPLAY (f), cmap, &color);
- UNBLOCK_INPUT;
bzero (&frame_background, sizeof frame_background);
frame_background.red = color.red;
fp = NULL;
}
- BLOCK_INPUT;
-
/* Create the X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg,
&img->pixmap))
- {
- UNBLOCK_INPUT;
- goto error;
- }
+ goto error;
/* Create an image and pixmap serving as mask if the PNG image
contains an alpha channel. */
x_destroy_x_image (ximg);
XFreePixmap (FRAME_X_DISPLAY (f), img->pixmap);
img->pixmap = 0;
- UNBLOCK_INPUT;
goto error;
}
x_destroy_x_image (mask_img);
}
- UNBLOCK_INPUT;
UNGCPRO;
return 1;
}
fclose ((FILE *) fp);
jpeg_destroy_decompress (&cinfo);
- BLOCK_INPUT;
-
/* If we already have an XImage, free that. */
x_destroy_x_image (ximg);
/* Free pixmap and colors. */
x_clear_image (f, img);
- UNBLOCK_INPUT;
UNGCPRO;
return 0;
}
width = img->width = cinfo.output_width;
height = img->height = cinfo.output_height;
- BLOCK_INPUT;
-
/* Create X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
- {
- UNBLOCK_INPUT;
- longjmp (mgr.setjmp_buffer, 2);
- }
+ longjmp (mgr.setjmp_buffer, 2);
/* Allocate colors. When color quantization is used,
cinfo.actual_number_of_colors has been set with the number of
/* Put the image into the pixmap. */
x_put_x_image (f, ximg, img->pixmap, width, height);
x_destroy_x_image (ximg);
- UNBLOCK_INPUT;
UNGCPRO;
return 1;
}
return 0;
}
- BLOCK_INPUT;
-
/* Create the X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
{
- UNBLOCK_INPUT;
xfree (buf);
UNGCPRO;
return 0;
x_put_x_image (f, ximg, img->pixmap, width, height);
x_destroy_x_image (ximg);
xfree (buf);
- UNBLOCK_INPUT;
img->width = width;
img->height = height;
width = img->width = gif->SWidth;
height = img->height = gif->SHeight;
- BLOCK_INPUT;
-
/* Create the X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
{
- UNBLOCK_INPUT;
DGifCloseFile (gif);
UNGCPRO;
return 0;
/* Put the image into the pixmap, then free the X image and its buffer. */
x_put_x_image (f, ximg, img->pixmap, width, height);
x_destroy_x_image (ximg);
- UNBLOCK_INPUT;
UNGCPRO;
return 1;
img->height = in_height * FRAME_X_DISPLAY_INFO (f)->resy;
/* Create the pixmap. */
- BLOCK_INPUT;
xassert (img->pixmap == 0);
img->pixmap = XCreatePixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
img->width, img->height,
DefaultDepthOfScreen (FRAME_X_SCREEN (f)));
- UNBLOCK_INPUT;
if (!img->pixmap)
{