diff options
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/src/image.c b/src/image.c index 1271376bcab..e429830cc96 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -161,13 +161,13 @@ XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel) | |||
| 161 | int | 161 | int |
| 162 | x_bitmap_height (struct frame *f, ptrdiff_t id) | 162 | x_bitmap_height (struct frame *f, ptrdiff_t id) |
| 163 | { | 163 | { |
| 164 | return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].height; | 164 | return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].height; |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | int | 167 | int |
| 168 | x_bitmap_width (struct frame *f, ptrdiff_t id) | 168 | x_bitmap_width (struct frame *f, ptrdiff_t id) |
| 169 | { | 169 | { |
| 170 | return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].width; | 170 | return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].width; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | #if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) | 173 | #if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) |
| @@ -175,7 +175,7 @@ ptrdiff_t | |||
| 175 | x_bitmap_pixmap (struct frame *f, ptrdiff_t id) | 175 | x_bitmap_pixmap (struct frame *f, ptrdiff_t id) |
| 176 | { | 176 | { |
| 177 | /* HAVE_NTGUI needs the explicit cast here. */ | 177 | /* HAVE_NTGUI needs the explicit cast here. */ |
| 178 | return (ptrdiff_t) FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; | 178 | return (ptrdiff_t) FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; |
| 179 | } | 179 | } |
| 180 | #endif | 180 | #endif |
| 181 | 181 | ||
| @@ -183,7 +183,7 @@ x_bitmap_pixmap (struct frame *f, ptrdiff_t id) | |||
| 183 | int | 183 | int |
| 184 | x_bitmap_mask (struct frame *f, ptrdiff_t id) | 184 | x_bitmap_mask (struct frame *f, ptrdiff_t id) |
| 185 | { | 185 | { |
| 186 | return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].mask; | 186 | return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].mask; |
| 187 | } | 187 | } |
| 188 | #endif | 188 | #endif |
| 189 | 189 | ||
| @@ -192,7 +192,7 @@ x_bitmap_mask (struct frame *f, ptrdiff_t id) | |||
| 192 | static ptrdiff_t | 192 | static ptrdiff_t |
| 193 | x_allocate_bitmap_record (struct frame *f) | 193 | x_allocate_bitmap_record (struct frame *f) |
| 194 | { | 194 | { |
| 195 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 195 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 196 | ptrdiff_t i; | 196 | ptrdiff_t i; |
| 197 | 197 | ||
| 198 | if (dpyinfo->bitmaps_last < dpyinfo->bitmaps_size) | 198 | if (dpyinfo->bitmaps_last < dpyinfo->bitmaps_size) |
| @@ -213,7 +213,7 @@ x_allocate_bitmap_record (struct frame *f) | |||
| 213 | void | 213 | void |
| 214 | x_reference_bitmap (struct frame *f, ptrdiff_t id) | 214 | x_reference_bitmap (struct frame *f, ptrdiff_t id) |
| 215 | { | 215 | { |
| 216 | ++FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].refcount; | 216 | ++FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].refcount; |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | /* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */ | 219 | /* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */ |
| @@ -221,7 +221,7 @@ x_reference_bitmap (struct frame *f, ptrdiff_t id) | |||
| 221 | ptrdiff_t | 221 | ptrdiff_t |
| 222 | x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsigned int height) | 222 | x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsigned int height) |
| 223 | { | 223 | { |
| 224 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 224 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 225 | ptrdiff_t id; | 225 | ptrdiff_t id; |
| 226 | 226 | ||
| 227 | #ifdef HAVE_X_WINDOWS | 227 | #ifdef HAVE_X_WINDOWS |
| @@ -235,8 +235,8 @@ x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsi | |||
| 235 | #ifdef HAVE_NTGUI | 235 | #ifdef HAVE_NTGUI |
| 236 | Pixmap bitmap; | 236 | Pixmap bitmap; |
| 237 | bitmap = CreateBitmap (width, height, | 237 | bitmap = CreateBitmap (width, height, |
| 238 | FRAME_X_DISPLAY_INFO (XFRAME (frame))->n_planes, | 238 | FRAME_DISPLAY_INFO (XFRAME (frame))->n_planes, |
| 239 | FRAME_X_DISPLAY_INFO (XFRAME (frame))->n_cbits, | 239 | FRAME_DISPLAY_INFO (XFRAME (frame))->n_cbits, |
| 240 | bits); | 240 | bits); |
| 241 | if (! bitmap) | 241 | if (! bitmap) |
| 242 | return -1; | 242 | return -1; |
| @@ -280,7 +280,7 @@ x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsi | |||
| 280 | ptrdiff_t | 280 | ptrdiff_t |
| 281 | x_create_bitmap_from_file (struct frame *f, Lisp_Object file) | 281 | x_create_bitmap_from_file (struct frame *f, Lisp_Object file) |
| 282 | { | 282 | { |
| 283 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 283 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 284 | 284 | ||
| 285 | #ifdef HAVE_NTGUI | 285 | #ifdef HAVE_NTGUI |
| 286 | return -1; /* W32_TODO : bitmap support */ | 286 | return -1; /* W32_TODO : bitmap support */ |
| @@ -379,7 +379,7 @@ free_bitmap_record (Display_Info *dpyinfo, Bitmap_Record *bm) | |||
| 379 | void | 379 | void |
| 380 | x_destroy_bitmap (struct frame *f, ptrdiff_t id) | 380 | x_destroy_bitmap (struct frame *f, ptrdiff_t id) |
| 381 | { | 381 | { |
| 382 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 382 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 383 | 383 | ||
| 384 | if (id > 0) | 384 | if (id > 0) |
| 385 | { | 385 | { |
| @@ -454,7 +454,7 @@ x_create_bitmap_mask (struct frame *f, ptrdiff_t id) | |||
| 454 | unsigned long x, y, xp, xm, yp, ym; | 454 | unsigned long x, y, xp, xm, yp, ym; |
| 455 | GC gc; | 455 | GC gc; |
| 456 | 456 | ||
| 457 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 457 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 458 | 458 | ||
| 459 | if (!(id > 0)) | 459 | if (!(id > 0)) |
| 460 | return; | 460 | return; |
| @@ -3421,7 +3421,7 @@ xpm_image_p (Lisp_Object object) | |||
| 3421 | ptrdiff_t | 3421 | ptrdiff_t |
| 3422 | x_create_bitmap_from_xpm_data (struct frame *f, const char **bits) | 3422 | x_create_bitmap_from_xpm_data (struct frame *f, const char **bits) |
| 3423 | { | 3423 | { |
| 3424 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 3424 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 3425 | ptrdiff_t id; | 3425 | ptrdiff_t id; |
| 3426 | int rc; | 3426 | int rc; |
| 3427 | XpmAttributes attrs; | 3427 | XpmAttributes attrs; |
| @@ -4325,7 +4325,7 @@ lookup_rgb_color (struct frame *f, int r, int g, int b) | |||
| 4325 | two orders of magnitude. Freeing colors on TrueColor visuals is | 4325 | two orders of magnitude. Freeing colors on TrueColor visuals is |
| 4326 | a nop, and pixel colors specify RGB values directly. See also | 4326 | a nop, and pixel colors specify RGB values directly. See also |
| 4327 | the Xlib spec, chapter 3.1. */ | 4327 | the Xlib spec, chapter 3.1. */ |
| 4328 | dpyinfo = FRAME_X_DISPLAY_INFO (f); | 4328 | dpyinfo = FRAME_DISPLAY_INFO (f); |
| 4329 | if (dpyinfo->red_bits > 0) | 4329 | if (dpyinfo->red_bits > 0) |
| 4330 | { | 4330 | { |
| 4331 | unsigned long pr, pg, pb; | 4331 | unsigned long pr, pg, pb; |
| @@ -4820,7 +4820,7 @@ x_edge_detection (struct frame *f, struct image *img, Lisp_Object matrix, | |||
| 4820 | static void | 4820 | static void |
| 4821 | x_disable_image (struct frame *f, struct image *img) | 4821 | x_disable_image (struct frame *f, struct image *img) |
| 4822 | { | 4822 | { |
| 4823 | Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 4823 | Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); |
| 4824 | #ifdef HAVE_NTGUI | 4824 | #ifdef HAVE_NTGUI |
| 4825 | int n_planes = dpyinfo->n_planes * dpyinfo->n_cbits; | 4825 | int n_planes = dpyinfo->n_planes * dpyinfo->n_cbits; |
| 4826 | #else | 4826 | #else |
| @@ -7523,7 +7523,7 @@ gif_load (struct frame *f, struct image *img) | |||
| 7523 | { | 7523 | { |
| 7524 | while (subimg_height <= row) | 7524 | while (subimg_height <= row) |
| 7525 | { | 7525 | { |
| 7526 | lint_assume (pass < 3); | 7526 | assume (pass < 3); |
| 7527 | row = interlace_start[++pass]; | 7527 | row = interlace_start[++pass]; |
| 7528 | } | 7528 | } |
| 7529 | 7529 | ||
| @@ -8590,7 +8590,9 @@ DEF_IMGLIB_FN (int, gdk_pixbuf_get_n_channels, (const GdkPixbuf *)); | |||
| 8590 | DEF_IMGLIB_FN (gboolean, gdk_pixbuf_get_has_alpha, (const GdkPixbuf *)); | 8590 | DEF_IMGLIB_FN (gboolean, gdk_pixbuf_get_has_alpha, (const GdkPixbuf *)); |
| 8591 | DEF_IMGLIB_FN (int, gdk_pixbuf_get_bits_per_sample, (const GdkPixbuf *)); | 8591 | DEF_IMGLIB_FN (int, gdk_pixbuf_get_bits_per_sample, (const GdkPixbuf *)); |
| 8592 | 8592 | ||
| 8593 | #if ! GLIB_CHECK_VERSION (2, 36, 0) | ||
| 8593 | DEF_IMGLIB_FN (void, g_type_init, (void)); | 8594 | DEF_IMGLIB_FN (void, g_type_init, (void)); |
| 8595 | #endif | ||
| 8594 | DEF_IMGLIB_FN (void, g_object_unref, (gpointer)); | 8596 | DEF_IMGLIB_FN (void, g_object_unref, (gpointer)); |
| 8595 | DEF_IMGLIB_FN (void, g_error_free, (GError *)); | 8597 | DEF_IMGLIB_FN (void, g_error_free, (GError *)); |
| 8596 | 8598 | ||
| @@ -8622,7 +8624,9 @@ init_svg_functions (void) | |||
| 8622 | LOAD_IMGLIB_FN (gdklib, gdk_pixbuf_get_has_alpha); | 8624 | LOAD_IMGLIB_FN (gdklib, gdk_pixbuf_get_has_alpha); |
| 8623 | LOAD_IMGLIB_FN (gdklib, gdk_pixbuf_get_bits_per_sample); | 8625 | LOAD_IMGLIB_FN (gdklib, gdk_pixbuf_get_bits_per_sample); |
| 8624 | 8626 | ||
| 8627 | #if ! GLIB_CHECK_VERSION (2, 36, 0) | ||
| 8625 | LOAD_IMGLIB_FN (gobject, g_type_init); | 8628 | LOAD_IMGLIB_FN (gobject, g_type_init); |
| 8629 | #endif | ||
| 8626 | LOAD_IMGLIB_FN (gobject, g_object_unref); | 8630 | LOAD_IMGLIB_FN (gobject, g_object_unref); |
| 8627 | LOAD_IMGLIB_FN (glib, g_error_free); | 8631 | LOAD_IMGLIB_FN (glib, g_error_free); |
| 8628 | 8632 | ||
| @@ -8647,7 +8651,9 @@ init_svg_functions (void) | |||
| 8647 | #define fn_gdk_pixbuf_get_has_alpha gdk_pixbuf_get_has_alpha | 8651 | #define fn_gdk_pixbuf_get_has_alpha gdk_pixbuf_get_has_alpha |
| 8648 | #define fn_gdk_pixbuf_get_bits_per_sample gdk_pixbuf_get_bits_per_sample | 8652 | #define fn_gdk_pixbuf_get_bits_per_sample gdk_pixbuf_get_bits_per_sample |
| 8649 | 8653 | ||
| 8654 | #if ! GLIB_CHECK_VERSION (2, 36, 0) | ||
| 8650 | #define fn_g_type_init g_type_init | 8655 | #define fn_g_type_init g_type_init |
| 8656 | #endif | ||
| 8651 | #define fn_g_object_unref g_object_unref | 8657 | #define fn_g_object_unref g_object_unref |
| 8652 | #define fn_g_error_free g_error_free | 8658 | #define fn_g_error_free g_error_free |
| 8653 | #endif /* !WINDOWSNT */ | 8659 | #endif /* !WINDOWSNT */ |
| @@ -8732,9 +8738,12 @@ svg_load_image (struct frame *f, /* Pointer to emacs frame structure. * | |||
| 8732 | int x; | 8738 | int x; |
| 8733 | int y; | 8739 | int y; |
| 8734 | 8740 | ||
| 8735 | /* g_type_init is a glib function that must be called prior to using | 8741 | #if ! GLIB_CHECK_VERSION (2, 36, 0) |
| 8736 | gnome type library functions. */ | 8742 | /* g_type_init is a glib function that must be called prior to |
| 8743 | using gnome type library functions (obsolete since 2.36.0). */ | ||
| 8737 | fn_g_type_init (); | 8744 | fn_g_type_init (); |
| 8745 | #endif | ||
| 8746 | |||
| 8738 | /* Make a handle to a new rsvg object. */ | 8747 | /* Make a handle to a new rsvg object. */ |
| 8739 | rsvg_handle = fn_rsvg_handle_new (); | 8748 | rsvg_handle = fn_rsvg_handle_new (); |
| 8740 | 8749 | ||