#ifdef HAVE_NS
/* Use with images created by ns_image_for_XPM. */
static unsigned long
-XGetPixel (XImagePtr ximage, int x, int y)
+XGetPixel (Emacs_Pix_Container image, int x, int y)
{
- return ns_get_pixel (ximage, x, y);
+ return ns_get_pixel (image, x, y);
}
/* Use with images created by ns_image_for_XPM; alpha set to 1;
pixel is assumed to be in RGB form. */
static void
-XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel)
+XPutPixel (Emacs_Pix_Container image, int x, int y, unsigned long pixel)
{
- ns_put_pixel (ximage, x, y, pixel);
+ ns_put_pixel (image, x, y, pixel);
}
#endif /* HAVE_NS */
#endif
static bool image_create_x_image_and_pixmap_1 (struct frame *, int, int, int,
- XImagePtr *, Emacs_Pixmap *,
- Picture *);
-static void image_destroy_x_image (XImagePtr ximg);
+ Emacs_Pix_Container *,
+ Emacs_Pixmap *, Picture *);
+static void image_destroy_x_image (Emacs_Pix_Container);
#ifdef HAVE_NTGUI
-static XImagePtr_or_DC image_get_x_image_or_dc (struct frame *, struct image *,
- bool, HGDIOBJ *);
-static void image_unget_x_image_or_dc (struct image *, bool, XImagePtr_or_DC,
- HGDIOBJ);
+static HDC image_get_x_image_or_dc (struct frame *, struct image *,
+ bool, HGDIOBJ *);
+static void image_unget_x_image_or_dc (struct image *, bool,
+ HDC, HGDIOBJ);
#else
-static XImagePtr image_get_x_image (struct frame *, struct image *, bool);
-static void image_unget_x_image (struct image *, bool, XImagePtr);
+static Emacs_Pix_Container image_get_x_image (struct frame *, struct image *,
+ bool);
+static void image_unget_x_image (struct image *, bool, Emacs_Pix_Container);
#define image_get_x_image_or_dc(f, img, mask_p, dummy) \
image_get_x_image (f, img, mask_p)
#define image_unget_x_image_or_dc(img, mask_p, ximg, dummy) \
/* Useful functions defined in the section
`Image type independent image structures' below. */
-static unsigned long four_corners_best (XImagePtr ximg,
+static unsigned long four_corners_best (XImage *ximg,
int *corners,
unsigned long width,
unsigned long height);
x_create_bitmap_mask (struct frame *f, ptrdiff_t id)
{
Pixmap pixmap, mask;
- XImagePtr ximg, mask_img;
+ XImage *ximg, *mask_img;
unsigned long width, height;
bool result;
unsigned long bg;
/* Image background colors. */
/* Find the "best" corner color of a bitmap.
- On W32, XIMG is assumed to a device context with the bitmap selected. */
+ On W32, PIMG is assumed to a device context with the bitmap selected. */
static RGB_PIXEL_COLOR
-four_corners_best (XImagePtr_or_DC ximg, int *corners,
+four_corners_best (Emacs_Pix_Context pimg, int *corners,
unsigned long width, unsigned long height)
{
RGB_PIXEL_COLOR corner_pixels[4];
if (corners && corners[BOT_CORNER] >= 0)
{
- /* Get the colors at the corner_pixels of ximg. */
- corner_pixels[0] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[TOP_CORNER]);
- corner_pixels[1] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[TOP_CORNER]);
- corner_pixels[2] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[BOT_CORNER] - 1);
- corner_pixels[3] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[BOT_CORNER] - 1);
+ /* Get the colors at the corner_pixels of pimg. */
+ corner_pixels[0] = GET_PIXEL (pimg, corners[LEFT_CORNER], corners[TOP_CORNER]);
+ corner_pixels[1] = GET_PIXEL (pimg, corners[RIGHT_CORNER] - 1, corners[TOP_CORNER]);
+ corner_pixels[2] = GET_PIXEL (pimg, corners[RIGHT_CORNER] - 1, corners[BOT_CORNER] - 1);
+ corner_pixels[3] = GET_PIXEL (pimg, corners[LEFT_CORNER], corners[BOT_CORNER] - 1);
}
else
{
- /* Get the colors at the corner_pixels of ximg. */
- corner_pixels[0] = GET_PIXEL (ximg, 0, 0);
- corner_pixels[1] = GET_PIXEL (ximg, width - 1, 0);
- corner_pixels[2] = GET_PIXEL (ximg, width - 1, height - 1);
- corner_pixels[3] = GET_PIXEL (ximg, 0, height - 1);
+ /* Get the colors at the corner_pixels of pimg. */
+ corner_pixels[0] = GET_PIXEL (pimg, 0, 0);
+ corner_pixels[1] = GET_PIXEL (pimg, width - 1, 0);
+ corner_pixels[2] = GET_PIXEL (pimg, width - 1, height - 1);
+ corner_pixels[3] = GET_PIXEL (pimg, 0, height - 1);
}
/* Choose the most frequently found color as background. */
for (i = best_count = 0; i < 4; ++i)
/* Return the `background' field of IMG. If IMG doesn't have one yet,
it is guessed heuristically. If non-zero, XIMG is an existing
- XImage object (or device context with the image selected on W32) to
- use for the heuristic. */
+ Emacs_Pix_Context object (device context with the image selected on
+ W32) to use for the heuristic. */
RGB_PIXEL_COLOR
-image_background (struct image *img, struct frame *f, XImagePtr_or_DC ximg)
+image_background (struct image *img, struct frame *f, Emacs_Pix_Context pimg)
{
if (! img->background_valid)
/* IMG doesn't have a background yet, try to guess a reasonable value. */
{
- bool free_ximg = !ximg;
+ bool free_pimg = !pimg;
#ifdef HAVE_NTGUI
HGDIOBJ prev;
#endif /* HAVE_NTGUI */
- if (free_ximg)
- ximg = image_get_x_image_or_dc (f, img, 0, &prev);
+ if (free_pimg)
+ pimg = image_get_x_image_or_dc (f, img, 0, &prev);
- img->background = four_corners_best (ximg, img->corners, img->width, img->height);
+ img->background = four_corners_best (pimg, img->corners, img->width, img->height);
- if (free_ximg)
- image_unget_x_image_or_dc (img, 0, ximg, prev);
+ if (free_pimg)
+ image_unget_x_image_or_dc (img, 0, pimg, prev);
img->background_valid = 1;
}
/* Return the `background_transparent' field of IMG. If IMG doesn't
have one yet, it is guessed heuristically. If non-zero, MASK is an
- existing XImage object to use for the heuristic. */
+ existing Emacs_Pix_Context (XImage* on X) object to use for the
+ heuristic. */
int
-image_background_transparent (struct image *img, struct frame *f, XImagePtr_or_DC mask)
+image_background_transparent (struct image *img, struct frame *f,
+ Emacs_Pix_Context mask)
{
if (! img->background_transparent_valid)
/* IMG doesn't have a background yet, try to guess a reasonable value. */
WIDTH and HEIGHT must both be positive.
If XIMG is null, assume it is a bitmap. */
static bool
-image_check_image_size (XImagePtr ximg, int width, int height)
+image_check_image_size (Emacs_Pix_Container ximg, int width, int height)
{
#ifdef HAVE_X_WINDOWS
/* Respect Xlib's limits: it cannot deal with images that have more
#endif
}
-/* Create an XImage and a pixmap of size WIDTH x HEIGHT for use on
- frame F. Set *XIMG and *PIXMAP to the XImage and Emacs_Pixmap
- created. Set (*XIMG)->data to a raster of WIDTH x HEIGHT pixels
- allocated via xmalloc. Print error messages via image_error if an
- error occurs. Value is true if successful.
+/* Create an Emacs_Pix_Container and a pixmap of size WIDTH x
+ HEIGHT for use on frame F. Set *PIMG and *PIXMAP to the
+ Emacs_Pix_Container and Emacs_Pixmap created. Set (*PIMG)->data
+ to a raster of WIDTH x HEIGHT pixels allocated via xmalloc. Print
+ error messages via image_error if an error occurs. Value is true
+ if successful.
On W32, a DEPTH of zero signifies a 24 bit image, otherwise DEPTH
should indicate the bit depth of the image. */
static bool
image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int depth,
- XImagePtr *ximg, Emacs_Pixmap *pixmap,
- Picture *picture)
+ Emacs_Pix_Container *pimg,
+ Emacs_Pixmap *pixmap, Picture *picture)
{
#ifdef HAVE_X_WINDOWS
Display *display = FRAME_X_DISPLAY (f);
if (depth <= 0)
depth = DefaultDepthOfScreen (screen);
- *ximg = XCreateImage (display, DefaultVisualOfScreen (screen),
+ *pimg = XCreateImage (display, DefaultVisualOfScreen (screen),
depth, ZPixmap, 0, NULL, width, height,
depth > 16 ? 32 : depth > 8 ? 16 : 8, 0);
- if (*ximg == NULL)
+ if (*pimg == NULL)
{
image_error ("Unable to allocate X image");
return 0;
}
- if (! image_check_image_size (*ximg, width, height))
+ if (! image_check_image_size (*pimg, width, height))
{
- image_destroy_x_image (*ximg);
- *ximg = NULL;
+ image_destroy_x_image (*pimg);
+ *pimg = NULL;
image_error ("Image too large (%dx%d)",
make_fixnum (width), make_fixnum (height));
return 0;
}
/* Allocate image raster. */
- (*ximg)->data = xmalloc ((*ximg)->bytes_per_line * height);
+ (*pimg)->data = xmalloc ((*pimg)->bytes_per_line * height);
/* Allocate a pixmap of the same size. */
*pixmap = XCreatePixmap (display, drawable, width, height, depth);
if (*pixmap == NO_PIXMAP)
{
- image_destroy_x_image (*ximg);
- *ximg = NULL;
+ image_destroy_x_image (*pimg);
+ *pimg = NULL;
image_error ("Unable to create X pixmap");
return 0;
}
if (depth < 16)
palette_colors = 1 << (depth - 1);
- *ximg = xmalloc (sizeof (XImage) + palette_colors * sizeof (RGBQUAD));
+ *pimg = xmalloc (sizeof (XImage) + palette_colors * sizeof (RGBQUAD));
- header = &(*ximg)->info.bmiHeader;
- memset (&(*ximg)->info, 0, sizeof (BITMAPINFO));
+ header = &(*pimg)->info.bmiHeader;
+ memset (&(*pimg)->info, 0, sizeof (BITMAPINFO));
header->biSize = sizeof (*header);
header->biWidth = width;
header->biHeight = -height; /* negative indicates a top-down bitmap. */
/* TODO: fill in palette. */
if (depth == 1)
{
- (*ximg)->info.bmiColors[0].rgbBlue = 0;
- (*ximg)->info.bmiColors[0].rgbGreen = 0;
- (*ximg)->info.bmiColors[0].rgbRed = 0;
- (*ximg)->info.bmiColors[0].rgbReserved = 0;
+ (*pimg)->info.bmiColors[0].rgbBlue = 0;
+ (*pimg)->info.bmiColors[0].rgbGreen = 0;
+ (*pimg)->info.bmiColors[0].rgbRed = 0;
+ (*pimg)->info.bmiColors[0].rgbReserved = 0;
/* bmiColors is a variable-length array declared by w32api
headers as bmiColors[1], which triggers a warning under
-Warray-bounds; shut that up. */
# pragma GCC push_options
# pragma GCC diagnostic ignored "-Warray-bounds"
# endif
- (*ximg)->info.bmiColors[1].rgbBlue = 255;
- (*ximg)->info.bmiColors[1].rgbGreen = 255;
- (*ximg)->info.bmiColors[1].rgbRed = 255;
- (*ximg)->info.bmiColors[1].rgbReserved = 0;
+ (*pimg)->info.bmiColors[1].rgbBlue = 255;
+ (*pimg)->info.bmiColors[1].rgbGreen = 255;
+ (*pimg)->info.bmiColors[1].rgbRed = 255;
+ (*pimg)->info.bmiColors[1].rgbReserved = 0;
# if GNUC_PREREQ (4, 4, 0)
# pragma GCC pop_options
# endif
/* Create a DIBSection and raster array for the bitmap,
and store its handle in *pixmap. */
- *pixmap = CreateDIBSection (hdc, &((*ximg)->info),
+ *pixmap = CreateDIBSection (hdc, &((*pimg)->info),
(depth < 16) ? DIB_PAL_COLORS : DIB_RGB_COLORS,
/* casting avoids a GCC warning */
- (void **)&((*ximg)->data), NULL, 0);
+ (void **)&((*pimg)->data), NULL, 0);
/* Realize display palette and garbage all frames. */
release_frame_dc (f, hdc);
/* All system errors are < 10000, so the following is safe. */
XSETINT (errcode, err);
image_error ("Unable to create bitmap, error code %d", errcode);
- image_destroy_x_image (*ximg);
- *ximg = NULL;
+ image_destroy_x_image (*pimg);
+ *pimg = NULL;
return 0;
}
*pixmap = ns_image_for_XPM (width, height, depth);
if (*pixmap == 0)
{
- *ximg = NULL;
+ *pimg = NULL;
image_error ("Unable to allocate NSImage for XPM pixmap");
return 0;
}
- *ximg = *pixmap;
+ *pimg = *pixmap;
return 1;
#endif
}
-/* Destroy XImage XIMG. Free XIMG->data. */
+/* Destroy Emacs_Pix_Container PIMG. Free data associated with PIMG. */
static void
-image_destroy_x_image (XImagePtr ximg)
+image_destroy_x_image (Emacs_Pix_Container pimg)
{
eassert (input_blocked_p ());
- if (ximg)
+ if (pimg)
{
#ifdef HAVE_X_WINDOWS
- xfree (ximg->data);
- ximg->data = NULL;
- XDestroyImage (ximg);
+ xfree (pimg->data);
+ pimg->data = NULL;
+ XDestroyImage (pimg);
#endif /* HAVE_X_WINDOWS */
#ifdef HAVE_NTGUI
/* Data will be freed by DestroyObject. */
- ximg->data = NULL;
- xfree (ximg);
+ pimg->data = NULL;
+ xfree (pimg);
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
- ns_release_object (ximg);
+ ns_release_object (pimg);
#endif /* HAVE_NS */
}
}
-/* Put XImage XIMG into pixmap PIXMAP on frame F. WIDTH and HEIGHT
- are width and height of both the image and pixmap. */
+/* Put Emacs_Pix_Container PIMG into pixmap PIXMAP on frame F.
+ WIDTH and HEIGHT are width and height of both the image and
+ pixmap. */
static void
-gui_put_x_image (struct frame *f, XImagePtr ximg, Emacs_Pixmap pixmap,
- int width, int height)
+gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg,
+ Emacs_Pixmap pixmap, int width, int height)
{
#ifdef HAVE_X_WINDOWS
GC gc;
eassert (input_blocked_p ());
gc = XCreateGC (FRAME_X_DISPLAY (f), pixmap, 0, NULL);
- XPutImage (FRAME_X_DISPLAY (f), pixmap, gc, ximg, 0, 0, 0, 0,
- ximg->width, ximg->height);
+ XPutImage (FRAME_X_DISPLAY (f), pixmap, gc, pimg, 0, 0, 0, 0,
+ pimg->width, pimg->height);
XFreeGC (FRAME_X_DISPLAY (f), gc);
#endif /* HAVE_X_WINDOWS */
#ifdef HAVE_NTGUI
#if 0 /* I don't think this is necessary looking at where it is used. */
HDC hdc = get_frame_dc (f);
- SetDIBits (hdc, pixmap, 0, height, ximg->data, &(ximg->info), DIB_RGB_COLORS);
+ SetDIBits (hdc, pixmap, 0, height, pimg->data, &(pimg->info), DIB_RGB_COLORS);
release_frame_dc (f, hdc);
#endif
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
- eassert (ximg == pixmap);
- ns_retain_object (ximg);
+ eassert (pimg == pixmap);
+ ns_retain_object (pimg);
#endif
}
static bool
image_create_x_image_and_pixmap (struct frame *f, struct image *img,
int width, int height, int depth,
- XImagePtr *ximg, bool mask_p)
+ Emacs_Pix_Container *ximg, bool mask_p)
{
eassert ((!mask_p ? img->pixmap : img->mask) == NO_PIXMAP);
picture);
}
-/* Put X image XIMG into image IMG on frame F, as a mask if and only
- if MASK_P. On X, this simply records XIMG on a member of IMG, so
+/* Put pixel image PIMG into image IMG on frame F, as a mask if and only
+ if MASK_P. On X, this simply records PIMG on a member of IMG, so
it can be put into the pixmap afterwards via image_sync_to_pixmaps.
- On the other platforms, it puts XIMG into the pixmap, then frees
- the X image and its buffer. */
+ On the other platforms, it puts PIMG into the pixmap, then frees
+ the pixel image and its buffer. */
static void
-image_put_x_image (struct frame *f, struct image *img, XImagePtr ximg,
+image_put_x_image (struct frame *f, struct image *img, Emacs_Pix_Container ximg,
bool mask_p)
{
#ifdef HAVE_X_WINDOWS
currently selected GDI object into *PREV for future restoration by
image_unget_x_image_or_dc. */
-static XImagePtr_or_DC
+static HDC
image_get_x_image_or_dc (struct frame *f, struct image *img, bool mask_p,
HGDIOBJ *prev)
{
HDC frame_dc = get_frame_dc (f);
- XImagePtr_or_DC ximg = CreateCompatibleDC (frame_dc);
+ HDC ximg = CreateCompatibleDC (frame_dc);
release_frame_dc (f, frame_dc);
*prev = SelectObject (ximg, !mask_p ? img->pixmap : img->mask);
static void
image_unget_x_image_or_dc (struct image *img, bool mask_p,
- XImagePtr_or_DC ximg, HGDIOBJ prev)
+ HDC ximg, HGDIOBJ prev)
{
SelectObject (ximg, prev);
DeleteDC (ximg);
/* Get the X image for IMG on frame F. The resulting X image data
should be treated as read-only at least on X. */
-static XImagePtr
+static Emacs_Pix_Container
image_get_x_image (struct frame *f, struct image *img, bool mask_p)
{
#ifdef HAVE_X_WINDOWS
- XImagePtr ximg_in_img = !mask_p ? img->ximg : img->mask_img;
+ XImage *ximg_in_img = !mask_p ? img->ximg : img->mask_img;
if (ximg_in_img)
return ximg_in_img;
return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
0, 0, img->width, img->height, ~0, ZPixmap);
#elif defined (HAVE_NS)
- XImagePtr pixmap = !mask_p ? img->pixmap : img->mask;
+ Emacs_Pix_Container pixmap = !mask_p ? img->pixmap : img->mask;
ns_retain_object (pixmap);
return pixmap;
}
static void
-image_unget_x_image (struct image *img, bool mask_p, XImagePtr ximg)
+image_unget_x_image (struct image *img, bool mask_p, Emacs_Pix_Container ximg)
{
#ifdef HAVE_X_WINDOWS
- XImagePtr ximg_in_img = !mask_p ? img->ximg : img->mask_img;
+ XImage *ximg_in_img = !mask_p ? img->ximg : img->mask_img;
if (ximg_in_img)
eassert (ximg == ximg_in_img);
#ifndef HAVE_NS
bool have_mask = false;
#endif
- XImagePtr ximg = NULL, mask_img = NULL;
+ Emacs_Pix_Container ximg = NULL, mask_img = NULL;
#define match() \
LA1 = xpm_scan (&s, end, &beg, &len)
{
int x, y;
Emacs_Color *colors, *p;
- XImagePtr_or_DC ximg;
+ Emacs_Pix_Context ximg;
ptrdiff_t nbytes;
#ifdef HAVE_NTGUI
HGDIOBJ prev;
stored in ximg->data. */
static void
-XPutPixel (XImagePtr ximg, int x, int y, COLORREF color)
+XPutPixel (XImage *ximg, int x, int y, COLORREF color)
{
int width = ximg->info.bmiHeader.biWidth;
unsigned char * pixel;
image_from_emacs_colors (struct frame *f, struct image *img, Emacs_Color *colors)
{
int x, y;
- XImagePtr oimg = NULL;
+ Emacs_Pix_Container oimg = NULL;
Emacs_Color *p;
init_color_table ();
image_build_heuristic_mask (struct frame *f, struct image *img,
Lisp_Object how)
{
- XImagePtr_or_DC ximg;
+ Emacs_Pix_Context ximg;
#ifdef HAVE_NTGUI
HGDIOBJ prev;
char *mask_img;
int row_width;
#elif !defined HAVE_NS
- XImagePtr mask_img;
+ Emacs_Pix_Container mask_img;
#endif
int x, y;
bool use_img_background;
char *contents = NULL;
char *end, *p;
#ifndef USE_CAIRO
- XImagePtr ximg;
+ Emacs_Pix_Container ximg;
#endif
specified_file = image_spec_value (img->spec, QCfile, NULL);
#else
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
/* Casting avoids a GCC warning. */
- IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
+ IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg);
/* Put ximg into the image. */
image_put_x_image (f, img, ximg, 0);
cairo_surface_t *surface;
uint32_t *dataptr;
#else
- XImagePtr ximg, mask_img = NULL;
+ Emacs_Pix_Container ximg, mask_img = NULL;
#endif
/* Find out what file to load. */
#else
/* Maybe fill in the background field while we have ximg handy.
Casting avoids a GCC warning. */
- IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
+ IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg);
/* Put ximg into the image. */
image_put_x_image (f, img, ximg, 0);
{
/* Fill in the background_transparent field while we have the
mask handy. Casting avoids a GCC warning. */
- image_background_transparent (img, f, (XImagePtr_or_DC)mask_img);
+ image_background_transparent (img, f, (Emacs_Pix_Context)mask_img);
image_put_x_image (f, img, mask_img, 1);
}
int i, ir, ig, ib;
#ifndef USE_CAIRO
unsigned long *colors;
- XImagePtr ximg = NULL;
+ Emacs_Pix_Container ximg = NULL;
#endif
/* Open the JPEG file. */
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
/* Casting avoids a GCC warning. */
- IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
+ IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg);
/* Put ximg into the image. */
image_put_x_image (f, img, ximg, 0);
int width, height, x, y, count;
uint32 *buf;
int rc;
- XImagePtr ximg;
+ Emacs_Pix_Container ximg;
tiff_memory_source memsrc;
Lisp_Object image;
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
/* Casting avoids a GCC warning on W32. */
- IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
+ IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg);
/* Put ximg into the image. */
image_put_x_image (f, img, ximg, 0);
}
#else
/* Create the X image and pixmap. */
- XImagePtr ximg;
+ Emacs_Pix_Container ximg;
if (!image_create_x_image_and_pixmap (f, img, width, height, 0, &ximg, 0))
{
gif_close (gif, NULL);
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
/* Casting avoids a GCC warning. */
- IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
+ IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg);
/* Put ximg into the image. */
image_put_x_image (f, img, ximg, 0);
size_t image_width, image_height;
MagickBooleanType status;
#ifndef USE_CAIRO
- XImagePtr ximg;
+ Emacs_Pix_Container ximg;
#endif
int x, y;
MagickWand *image_wand;
g_object_unref (pixbuf);
#else
/* Try to create a x pixmap to hold the svg pixmap. */
- XImagePtr ximg;
+ Emacs_Pix_Container ximg;
if (!image_create_x_image_and_pixmap (f, img, width, height, 0, &ximg, 0))
{
g_object_unref (pixbuf);
/* Maybe fill in the background field while we have ximg handy.
Casting avoids a GCC warning. */
- IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
+ IMAGE_BACKGROUND (img, f, (Emacs_Pix_Context)ximg);
/* Put ximg into the image. */
image_put_x_image (f, img, ximg, 0);
img->pixmap. */
if (x_mutable_colormap (FRAME_X_VISUAL (f)))
{
- XImagePtr ximg;
+ XImage *ximg;
block_input ();