Commit bb4d86b4 authored by Chong Yidong's avatar Chong Yidong

Refactor image-type loading.

* src/dispextern.h (struct image_type): Add new slot, storing a type
initialization function.

* src/image.c (define_image_type): Call the image initializer function
if it is defined.  Arguments and return value changed.
(valid_image_p, make_image): Callers changed.
(xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
(gif_type, imagemagick_type, svg_type, gs_type): Add
initialization functions.
(Finit_image_library): Call lookup_image_type.
(CHECK_LIB_AVAILABLE): Macro deleted.
(lookup_image_type): Call define_image_type here, rather than via
Finit_image_library, and without using CHECK_LIB_AVAILABLE.
(syms_of_image): Move define_image_type calls for xbm_type and
pbm_type to lookup_image_type.
parent 287d7455
2012-09-22 Chong Yidong <cyd@gnu.org>
* dispextern.h (struct image_type): Add new slot, storing a type
initialization function.
* image.c (define_image_type): Call the image initializer function
if it is defined. Arguments and return value changed.
(valid_image_p, make_image): Callers changed.
(xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
(gif_type, imagemagick_type, svg_type, gs_type): Add
initialization functions.
(Finit_image_library): Call lookup_image_type.
(CHECK_LIB_AVAILABLE): Macro deleted.
(lookup_image_type): Call define_image_type here, rather than via
Finit_image_library, and without using CHECK_LIB_AVAILABLE.
(syms_of_image): Move define_image_type calls for xbm_type and
pbm_type to lookup_image_type.
2012-09-22 Eli Zaretskii <eliz@gnu.org>
* keyboard.c (timer_check_2): Move calculation of 'timers' and
......
......@@ -2767,6 +2767,10 @@ struct image_type
/* Free resources of image IMG which is used on frame F. */
void (* free) (struct frame *f, struct image *img);
/* Initialization function (used for dynamic loading of image
libraries on Windows), or NULL if none. */
int (* init) (Lisp_Object);
/* Next in list of all supported image types. */
struct image_type *next;
};
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment