comparison src/glyphs-x.c @ 38:1a767b41a199 r19-15b102

Import from CVS: tag r19-15b102
author cvs
date Mon, 13 Aug 2007 08:54:01 +0200
parents c53a95d3c46d
children 8d2a9b52c682
comparison
equal deleted inserted replaced
37:ad40ac360d14 38:1a767b41a199
56 #include "opaque.h" 56 #include "opaque.h"
57 57
58 #include "sysfile.h" 58 #include "sysfile.h"
59 59
60 #include <setjmp.h> 60 #include <setjmp.h>
61
62 /* Set to 1 if you wish to implement this feature */
63 # define HAVE_SUBWINDOWS 0
64 61
65 #define LISP_DEVICE_TO_X_SCREEN(dev) \ 62 #define LISP_DEVICE_TO_X_SCREEN(dev) \
66 XDefaultScreenOfDisplay (DEVICE_X_DISPLAY (XDEVICE (dev))) 63 XDefaultScreenOfDisplay (DEVICE_X_DISPLAY (XDEVICE (dev)))
67 64
68 DEFINE_IMAGE_INSTANTIATOR_FORMAT (xbm); 65 DEFINE_IMAGE_INSTANTIATOR_FORMAT (xbm);
1060 1057
1061 #include "jpeglib.h" 1058 #include "jpeglib.h"
1062 #include "jerror.h" 1059 #include "jerror.h"
1063 1060
1064 /* The in-core jpeg code doesn't work, so I'm avoiding it for now. -sb */ 1061 /* The in-core jpeg code doesn't work, so I'm avoiding it for now. -sb */
1065 #define USE_TEMP_FILES_FOR_JPEG_IMAGES 1 1062 /* Late-breaking update, we're going to give it a try, I think it's */
1063 /* fixed now -sb */
1064 /* #define USE_TEMP_FILES_FOR_JPEG_IMAGES 1 */
1066 1065
1067 static void 1066 static void
1068 jpeg_validate (Lisp_Object instantiator) 1067 jpeg_validate (Lisp_Object instantiator)
1069 { 1068 {
1070 file_or_data_must_be_present (instantiator); 1069 file_or_data_must_be_present (instantiator);
1181 METHODDEF(boolean) 1180 METHODDEF(boolean)
1182 #else 1181 #else
1183 METHODDEF boolean 1182 METHODDEF boolean
1184 #endif 1183 #endif
1185 our_fill_input_buffer (j_decompress_ptr cinfo) { 1184 our_fill_input_buffer (j_decompress_ptr cinfo) {
1186 ERREXIT(cinfo,JERR_INPUT_EOF); 1185 /* Insert a fake EOI marker */
1187 return FALSE; 1186 struct jpeg_source_mgr *src = (struct jpeg_source_mgr *) cinfo->src;
1187 static JOCTET buffer[2];
1188
1189 buffer[0] = (JOCTET) 0xFF;
1190 buffer[1] = (JOCTET) JPEG_EOI;
1191
1192 src->next_input_byte = buffer;
1193 src->bytes_in_buffer = 2;
1194 return TRUE;
1188 } 1195 }
1189 1196
1190 #if defined(JPEG_LIB_VERSION) && (JPEG_LIB_VERSION >= 61) 1197 #if defined(JPEG_LIB_VERSION) && (JPEG_LIB_VERSION >= 61)
1191 METHODDEF(void) 1198 METHODDEF(void)
1192 #else 1199 #else
1193 METHODDEF void 1200 METHODDEF void
1194 #endif 1201 #endif
1195 our_skip_input_data (j_decompress_ptr cinfo, long num_bytes) { 1202 our_skip_input_data (j_decompress_ptr cinfo, long num_bytes) {
1203 struct jpeg_source_mgr *src = NULL;
1204
1205 src = (struct jpeg_source_mgr *) cinfo->src;
1206
1207 if (!src) {
1208 return;
1209 } else if (num_bytes > src->bytes_in_buffer) {
1210 num_bytes = (long)src->bytes_in_buffer;
1211 }
1212
1213 src->bytes_in_buffer -= num_bytes;
1214 src->next_input_byte += num_bytes;
1196 } 1215 }
1197 1216
1198 #if defined(JPEG_LIB_VERSION) && (JPEG_LIB_VERSION >= 61) 1217 #if defined(JPEG_LIB_VERSION) && (JPEG_LIB_VERSION >= 61)
1199 METHODDEF(void) 1218 METHODDEF(void)
1200 #else 1219 #else