aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/src/image.c b/src/image.c
index f2778165ece..3e021677e09 100644
--- a/src/image.c
+++ b/src/image.c
@@ -50,11 +50,19 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50#include "termhooks.h" 50#include "termhooks.h"
51#include "font.h" 51#include "font.h"
52 52
53#ifdef HAVE_X_WINDOWS 53#ifdef HAVE_SYS_STAT_H
54#include "xterm.h"
55#include <sys/types.h>
56#include <sys/stat.h> 54#include <sys/stat.h>
55#endif /* HAVE_SYS_STAT_H */
56
57#ifdef HAVE_SYS_TYPES_H
58#include <sys/types.h>
59#endif /* HAVE_SYS_TYPES_H */
60
61#ifdef HAVE_WINDOW_SYSTEM
62#include TERM_HEADER
63#endif /* HAVE_WINDOW_SYSTEM */
57 64
65#ifdef HAVE_X_WINDOWS
58#define COLOR_TABLE_SUPPORT 1 66#define COLOR_TABLE_SUPPORT 1
59 67
60typedef struct x_bitmap_record Bitmap_Record; 68typedef struct x_bitmap_record Bitmap_Record;
@@ -67,11 +75,8 @@ typedef struct x_bitmap_record Bitmap_Record;
67#define PIX_MASK_DRAW 1 75#define PIX_MASK_DRAW 1
68#endif /* HAVE_X_WINDOWS */ 76#endif /* HAVE_X_WINDOWS */
69 77
70
71#ifdef HAVE_NTGUI 78#ifdef HAVE_NTGUI
72#include "w32.h" 79#include "w32.h"
73#include "w32term.h"
74
75/* W32_TODO : Color tables on W32. */ 80/* W32_TODO : Color tables on W32. */
76#undef COLOR_TABLE_SUPPORT 81#undef COLOR_TABLE_SUPPORT
77 82
@@ -84,15 +89,9 @@ typedef struct w32_bitmap_record Bitmap_Record;
84#define PIX_MASK_RETAIN 0 89#define PIX_MASK_RETAIN 0
85#define PIX_MASK_DRAW 1 90#define PIX_MASK_DRAW 1
86 91
87#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual
88#define x_defined_color w32_defined_color 92#define x_defined_color w32_defined_color
89#define DefaultDepthOfScreen(screen) (one_w32_display_info.n_cbits) 93#define DefaultDepthOfScreen(screen) (one_w32_display_info.n_cbits)
90 94
91/* Functions from w32term.c that depend on XColor (so can't go in w32term.h
92 without modifying lots of files). */
93extern void x_query_colors (struct frame *f, XColor *colors, int ncolors);
94extern void x_query_color (struct frame *f, XColor *color);
95
96/* Version of libpng that we were compiled with, or -1 if no PNG 95/* Version of libpng that we were compiled with, or -1 if no PNG
97 support was compiled in. This is tested by w32-win.el to correctly 96 support was compiled in. This is tested by w32-win.el to correctly
98 set up the alist used to search for PNG libraries. */ 97 set up the alist used to search for PNG libraries. */
@@ -100,10 +99,6 @@ Lisp_Object Qlibpng_version;
100#endif /* HAVE_NTGUI */ 99#endif /* HAVE_NTGUI */
101 100
102#ifdef HAVE_NS 101#ifdef HAVE_NS
103#include "nsterm.h"
104#include <sys/types.h>
105#include <sys/stat.h>
106
107#undef COLOR_TABLE_SUPPORT 102#undef COLOR_TABLE_SUPPORT
108 103
109typedef struct ns_bitmap_record Bitmap_Record; 104typedef struct ns_bitmap_record Bitmap_Record;
@@ -117,10 +112,8 @@ typedef struct ns_bitmap_record Bitmap_Record;
117#define PIX_MASK_RETAIN 0 112#define PIX_MASK_RETAIN 0
118#define PIX_MASK_DRAW 1 113#define PIX_MASK_DRAW 1
119 114
120#define FRAME_X_VISUAL FRAME_NS_DISPLAY_INFO (f)->visual
121#define x_defined_color(f, name, color_def, alloc) \ 115#define x_defined_color(f, name, color_def, alloc) \
122 ns_defined_color (f, name, color_def, alloc, 0) 116 ns_defined_color (f, name, color_def, alloc, 0)
123#define FRAME_X_SCREEN(f) 0
124#define DefaultDepthOfScreen(screen) x_display_list->n_planes 117#define DefaultDepthOfScreen(screen) x_display_list->n_planes
125#endif /* HAVE_NS */ 118#endif /* HAVE_NS */
126 119
@@ -5524,13 +5517,13 @@ init_png_functions (Lisp_Object libraries)
5524 5517
5525 5518
5526#if (PNG_LIBPNG_VER < 10500) 5519#if (PNG_LIBPNG_VER < 10500)
5527#define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1)) 5520#define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1))
5528#define PNG_JMPBUF(ptr) ((ptr)->jmpbuf) 5521#define PNG_JMPBUF(ptr) ((ptr)->jmpbuf)
5529#else 5522#else
5530/* In libpng version 1.5, the jmpbuf member is hidden. (Bug#7908) */ 5523/* In libpng version 1.5, the jmpbuf member is hidden. (Bug#7908) */
5531#define PNG_LONGJMP(ptr) (fn_png_longjmp ((ptr), 1)) 5524#define PNG_LONGJMP(ptr) (fn_png_longjmp ((ptr), 1))
5532#define PNG_JMPBUF(ptr) \ 5525#define PNG_JMPBUF(ptr) \
5533 (*fn_png_set_longjmp_fn ((ptr), longjmp, sizeof (jmp_buf))) 5526 (*fn_png_set_longjmp_fn ((ptr), _longjmp, sizeof (jmp_buf)))
5534#endif 5527#endif
5535 5528
5536/* Error and warning handlers installed when the PNG library 5529/* Error and warning handlers installed when the PNG library
@@ -5703,7 +5696,7 @@ png_load (struct frame *f, struct image *img)
5703 5696
5704 /* Set error jump-back. We come back here when the PNG library 5697 /* Set error jump-back. We come back here when the PNG library
5705 detects an error. */ 5698 detects an error. */
5706 if (setjmp (PNG_JMPBUF (png_ptr))) 5699 if (_setjmp (PNG_JMPBUF (png_ptr)))
5707 { 5700 {
5708 error: 5701 error:
5709 if (png_ptr) 5702 if (png_ptr)
@@ -6121,7 +6114,7 @@ static _Noreturn void
6121my_error_exit (j_common_ptr cinfo) 6114my_error_exit (j_common_ptr cinfo)
6122{ 6115{
6123 struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err; 6116 struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err;
6124 longjmp (mgr->setjmp_buffer, 1); 6117 _longjmp (mgr->setjmp_buffer, 1);
6125} 6118}
6126 6119
6127 6120
@@ -6372,7 +6365,7 @@ jpeg_load (struct frame *f, struct image *img)
6372 cinfo.err = fn_jpeg_std_error (&mgr.pub); 6365 cinfo.err = fn_jpeg_std_error (&mgr.pub);
6373 mgr.pub.error_exit = my_error_exit; 6366 mgr.pub.error_exit = my_error_exit;
6374 6367
6375 if ((rc = setjmp (mgr.setjmp_buffer)) != 0) 6368 if ((rc = _setjmp (mgr.setjmp_buffer)) != 0)
6376 { 6369 {
6377 if (rc == 1) 6370 if (rc == 1)
6378 { 6371 {
@@ -6418,12 +6411,12 @@ jpeg_load (struct frame *f, struct image *img)
6418 if (!check_image_size (f, width, height)) 6411 if (!check_image_size (f, width, height))
6419 { 6412 {
6420 image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); 6413 image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
6421 longjmp (mgr.setjmp_buffer, 2); 6414 _longjmp (mgr.setjmp_buffer, 2);
6422 } 6415 }
6423 6416
6424 /* Create X image and pixmap. */ 6417 /* Create X image and pixmap. */
6425 if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) 6418 if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
6426 longjmp (mgr.setjmp_buffer, 2); 6419 _longjmp (mgr.setjmp_buffer, 2);
6427 6420
6428 /* Allocate colors. When color quantization is used, 6421 /* Allocate colors. When color quantization is used,
6429 cinfo.actual_number_of_colors has been set with the number of 6422 cinfo.actual_number_of_colors has been set with the number of