comparison src/glyphs-x.c @ 74:54cc21c15cbb r20-0b32

Import from CVS: tag r20-0b32
author cvs
date Mon, 13 Aug 2007 09:04:33 +0200
parents 131b0175ea99
children 1ce6082ce73f
comparison
equal deleted inserted replaced
73:e2d7a37b7c8d 74:54cc21c15cbb
982 abort (); 982 abort ();
983 } 983 }
984 } 984 }
985 985
986 static int 986 static int
987 xbm_possible_dest_types () 987 xbm_possible_dest_types (void)
988 { 988 {
989 return IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK | 989 return
990 IMAGE_MONO_PIXMAP_MASK |
991 IMAGE_COLOR_PIXMAP_MASK |
990 IMAGE_POINTER_MASK; 992 IMAGE_POINTER_MASK;
991 } 993 }
992 994
993 static void 995 static void
994 xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator, 996 xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
1048 **********************************************************************/ 1050 **********************************************************************/
1049 1051
1050 #include "jpeglib.h" 1052 #include "jpeglib.h"
1051 #include "jerror.h" 1053 #include "jerror.h"
1052 1054
1055 /* The in-core jpeg code doesn't work, so I'm avoiding it for now. -sb */
1056 #define USE_TEMP_FILES_FOR_JPEG_IMAGES 1
1057
1053 static void 1058 static void
1054 jpeg_validate (Lisp_Object instantiator) 1059 jpeg_validate (Lisp_Object instantiator)
1055 { 1060 {
1056 file_or_data_must_be_present (instantiator); 1061 file_or_data_must_be_present (instantiator);
1057 } 1062 }
1061 { 1066 {
1062 return simple_image_type_normalize (inst, console_type, Qjpeg); 1067 return simple_image_type_normalize (inst, console_type, Qjpeg);
1063 } 1068 }
1064 1069
1065 static int 1070 static int
1066 jpeg_possible_dest_types () 1071 jpeg_possible_dest_types (void)
1067 { 1072 {
1068 return IMAGE_COLOR_PIXMAP_MASK; 1073 return IMAGE_COLOR_PIXMAP_MASK;
1069 } 1074 }
1070 1075
1071 /* To survive the otherwise baffling complexity of making sure 1076 /* To survive the otherwise baffling complexity of making sure
1267 1272
1268 memset (&unwind, 0, sizeof (unwind)); 1273 memset (&unwind, 0, sizeof (unwind));
1269 unwind.dpy = dpy; 1274 unwind.dpy = dpy;
1270 record_unwind_protect (jpeg_instantiate_unwind, make_opaque_ptr (&unwind)); 1275 record_unwind_protect (jpeg_instantiate_unwind, make_opaque_ptr (&unwind));
1271 1276
1272 #ifdef USE_TEMP_FILES_FOR_IMAGES 1277 #ifdef USE_TEMP_FILES_FOR_JPEG_IMAGES
1273 /* Step 0: Write out to a temp file. 1278 /* Step 0: Write out to a temp file.
1274 1279
1275 The JPEG routines require you to read from a file unless 1280 The JPEG routines require you to read from a file unless
1276 you provide your own special input handlers, which I don't 1281 you provide your own special input handlers, which I don't
1277 feel like doing. */ 1282 feel like doing. */
1323 jpeg_create_decompress (&cinfo); 1328 jpeg_create_decompress (&cinfo);
1324 unwind.cinfo_ptr = &cinfo; 1329 unwind.cinfo_ptr = &cinfo;
1325 1330
1326 /* Step 2: specify data source (eg, a file) */ 1331 /* Step 2: specify data source (eg, a file) */
1327 1332
1328 #ifdef USE_FILEIO_FOR_IMAGES 1333 #ifdef USE_TEMP_FILES_FOR_JPEG_IMAGES
1329 jpeg_stdio_src (&cinfo, unwind.instream); 1334 jpeg_stdio_src (&cinfo, unwind.instream);
1330 #else 1335 #else
1331 { 1336 {
1332 Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); 1337 Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
1333 Extbyte *bytes; 1338 Extbyte *bytes;
1542 { 1547 {
1543 return simple_image_type_normalize (inst, console_type, Qgif); 1548 return simple_image_type_normalize (inst, console_type, Qgif);
1544 } 1549 }
1545 1550
1546 static int 1551 static int
1547 gif_possible_dest_types () 1552 gif_possible_dest_types (void)
1548 { 1553 {
1549 return IMAGE_COLOR_PIXMAP_MASK; 1554 return IMAGE_COLOR_PIXMAP_MASK;
1550 } 1555 }
1551 1556
1552 /* To survive the otherwise baffling complexity of making sure 1557 /* To survive the otherwise baffling complexity of making sure
1863 { 1868 {
1864 return simple_image_type_normalize (inst, console_type, Qpng); 1869 return simple_image_type_normalize (inst, console_type, Qpng);
1865 } 1870 }
1866 1871
1867 static int 1872 static int
1868 png_possible_dest_types () 1873 png_possible_dest_types (void)
1869 { 1874 {
1870 return IMAGE_COLOR_PIXMAP_MASK; 1875 return IMAGE_COLOR_PIXMAP_MASK;
1871 } 1876 }
1872 1877
1873 #if !defined (USE_TEMP_FILES_FOR_IMAGES) && (PNG_LIBPNG_VER >= 87) 1878 #if !defined (USE_TEMP_FILES_FOR_IMAGES) && (PNG_LIBPNG_VER >= 87)
2458 RETURN_UNGCPRO (result); 2463 RETURN_UNGCPRO (result);
2459 } 2464 }
2460 } 2465 }
2461 2466
2462 static int 2467 static int
2463 xpm_possible_dest_types () 2468 xpm_possible_dest_types (void)
2464 { 2469 {
2465 return IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK | 2470 return
2471 IMAGE_MONO_PIXMAP_MASK |
2472 IMAGE_COLOR_PIXMAP_MASK |
2466 IMAGE_POINTER_MASK; 2473 IMAGE_POINTER_MASK;
2467 } 2474 }
2468 2475
2469 /* xpm 3.2g and better has XpmCreatePixmapFromBuffer()... 2476 /* xpm 3.2g and better has XpmCreatePixmapFromBuffer()...
2470 There was no version number in xpm.h before 3.3, but this should do. 2477 There was no version number in xpm.h before 3.3, but this should do.
2946 RETURN_UNGCPRO (result); 2953 RETURN_UNGCPRO (result);
2947 } 2954 }
2948 } 2955 }
2949 2956
2950 static int 2957 static int
2951 xface_possible_dest_types () 2958 xface_possible_dest_types (void)
2952 { 2959 {
2953 return IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK | 2960 return
2961 IMAGE_MONO_PIXMAP_MASK |
2962 IMAGE_COLOR_PIXMAP_MASK |
2954 IMAGE_POINTER_MASK; 2963 IMAGE_POINTER_MASK;
2955 } 2964 }
2956 2965
2957 #if defined(EXTERN) 2966 #if defined(EXTERN)
2958 /* This is about to get redefined! */ 2967 /* This is about to get redefined! */
3122 RETURN_UNGCPRO (result); 3131 RETURN_UNGCPRO (result);
3123 } 3132 }
3124 } 3133 }
3125 3134
3126 static int 3135 static int
3127 autodetect_possible_dest_types () 3136 autodetect_possible_dest_types (void)
3128 { 3137 {
3129 return IMAGE_MONO_PIXMAP_MASK | IMAGE_COLOR_PIXMAP_MASK | 3138 return
3130 IMAGE_POINTER_MASK | IMAGE_TEXT_MASK; 3139 IMAGE_MONO_PIXMAP_MASK |
3140 IMAGE_COLOR_PIXMAP_MASK |
3141 IMAGE_POINTER_MASK |
3142 IMAGE_TEXT_MASK;
3131 } 3143 }
3132 3144
3133 static void 3145 static void
3134 autodetect_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 3146 autodetect_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
3135 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 3147 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
3220 if (XLoadFont_got_error) return 0; 3232 if (XLoadFont_got_error) return 0;
3221 return font; 3233 return font;
3222 } 3234 }
3223 3235
3224 static int 3236 static int
3225 font_possible_dest_types () 3237 font_possible_dest_types (void)
3226 { 3238 {
3227 return IMAGE_POINTER_MASK; 3239 return IMAGE_POINTER_MASK;
3228 } 3240 }
3229 3241
3230 static void 3242 static void
3318 { 3330 {
3319 data_must_be_present (instantiator); 3331 data_must_be_present (instantiator);
3320 } 3332 }
3321 3333
3322 static int 3334 static int
3323 cursor_font_possible_dest_types () 3335 cursor_font_possible_dest_types (void)
3324 { 3336 {
3325 return IMAGE_POINTER_MASK; 3337 return IMAGE_POINTER_MASK;
3326 } 3338 }
3327 3339
3328 static void 3340 static void
3923 Qglobal, Qx, Qnil) 3935 Qglobal, Qx, Qnil)
3924 3936
3925 BUILD_GLYPH_INST (Vtruncation_glyph, truncator); 3937 BUILD_GLYPH_INST (Vtruncation_glyph, truncator);
3926 BUILD_GLYPH_INST (Vcontinuation_glyph, continuer); 3938 BUILD_GLYPH_INST (Vcontinuation_glyph, continuer);
3927 BUILD_GLYPH_INST (Vxemacs_logo, xemacs); 3939 BUILD_GLYPH_INST (Vxemacs_logo, xemacs);
3940 BUILD_GLYPH_INST (Vhscroll_glyph, hscroll);
3928 3941
3929 #undef BUILD_GLYPH_INST 3942 #undef BUILD_GLYPH_INST
3930 } 3943 }