comparison src/glyphs.c @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 7347b34c275b
children 6240c7796c7a
comparison
equal deleted inserted replaced
370:bd866891f083 371:cc15677e0335
36 #include "insdel.h" 36 #include "insdel.h"
37 #include "glyphs.h" 37 #include "glyphs.h"
38 #include "objects.h" 38 #include "objects.h"
39 #include "redisplay.h" 39 #include "redisplay.h"
40 #include "window.h" 40 #include "window.h"
41 #include "chartab.h"
42 #include "rangetab.h"
43 41
44 #ifdef HAVE_XPM 42 #ifdef HAVE_XPM
45 #include <X11/xpm.h> 43 #include <X11/xpm.h>
46 #endif 44 #endif
47 45
466 static Lisp_Object 464 static Lisp_Object
467 normalize_image_instantiator (Lisp_Object instantiator, 465 normalize_image_instantiator (Lisp_Object instantiator,
468 Lisp_Object contype, 466 Lisp_Object contype,
469 Lisp_Object dest_mask) 467 Lisp_Object dest_mask)
470 { 468 {
471 struct gcpro gcpro1;
472
473 GCPRO1(instantiator);
474
475 if (IMAGE_INSTANCEP (instantiator)) 469 if (IMAGE_INSTANCEP (instantiator))
476 RETURN_UNGCPRO (instantiator); 470 return instantiator;
477 471
478 if (STRINGP (instantiator)) 472 if (STRINGP (instantiator))
479 instantiator = process_image_string_instantiator (instantiator, contype, 473 instantiator = process_image_string_instantiator (instantiator, contype,
480 XINT (dest_mask)); 474 XINT (dest_mask));
481 475
488 files). */ 482 files). */
489 { 483 {
490 struct image_instantiator_methods * meths = 484 struct image_instantiator_methods * meths =
491 decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0], 485 decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0],
492 ERROR_ME); 486 ERROR_ME);
493 RETURN_UNGCPRO (IIFORMAT_METH_OR_GIVEN (meths, normalize, 487 return IIFORMAT_METH_OR_GIVEN (meths, normalize,
494 (instantiator, contype), 488 (instantiator, contype),
495 instantiator)); 489 instantiator);
496 } 490 }
497 } 491 }
498 492
499 static Lisp_Object 493 static Lisp_Object
500 instantiate_image_instantiator (Lisp_Object device, Lisp_Object domain, 494 instantiate_image_instantiator (Lisp_Object device, Lisp_Object domain,
2370 (An X-Face bitmap, used to encode people's faces in e-mail messages; 2364 (An X-Face bitmap, used to encode people's faces in e-mail messages;
2371 only if X-Face support was compiled into this XEmacs. Can be 2365 only if X-Face support was compiled into this XEmacs. Can be
2372 instanced as `mono-pixmap', `color-pixmap', or `pointer'.) 2366 instanced as `mono-pixmap', `color-pixmap', or `pointer'.)
2373 'gif 2367 'gif
2374 (A GIF87 or GIF89 image; only if GIF support was compiled into this 2368 (A GIF87 or GIF89 image; only if GIF support was compiled into this
2375 XEmacs. NOTE: only the first frame of animated gifs will be displayed. 2369 XEmacs. Can be instanced as `color-pixmap'.)
2376 Can be instanced as `color-pixmap'.)
2377 'jpeg 2370 'jpeg
2378 (A JPEG image; only if JPEG support was compiled into this XEmacs. 2371 (A JPEG image; only if JPEG support was compiled into this XEmacs.
2379 Can be instanced as `color-pixmap'.) 2372 Can be instanced as `color-pixmap'.)
2380 'png 2373 'png
2381 (A PNG image; only if PNG support was compiled into this XEmacs. 2374 (A PNG/GIF24 image; only if PNG support was compiled into this XEmacs.
2382 Can be instanced as `color-pixmap'.) 2375 Can be instanced as `color-pixmap'.)
2383 'tiff 2376 'tiff
2384 (A TIFF image; only if TIFF support was compiled into this XEmacs. 2377 (A TIFF image; not currently implemented.)
2385 Can be instanced as `color-pixmap'.)
2386 'cursor-font 2378 'cursor-font
2387 (One of the standard cursor-font names, such as "watch" or 2379 (One of the standard cursor-font names, such as "watch" or
2388 "right_ptr" under X. Under X, this is, more specifically, any 2380 "right_ptr" under X. Under X, this is, more specifically, any
2389 of the standard cursor names from appendix B of the Xlib manual 2381 of the standard cursor names from appendix B of the Xlib manual
2390 [also known as the file <X11/cursorfont.h>] minus the XC_ prefix. 2382 [also known as the file <X11/cursorfont.h>] minus the XC_ prefix.
3209 3201
3210 /***************************************************************************** 3202 /*****************************************************************************
3211 * display tables * 3203 * display tables *
3212 *****************************************************************************/ 3204 *****************************************************************************/
3213 3205
3214 /* Get the display tables for use currently on window W with face 3206 /* Get the display table for use currently on window W with face FACE.
3215 FACE. #### This will have to be redone. */ 3207 Precedence:
3216 3208
3217 void 3209 -- FACE's display table
3218 get_display_tables (struct window *w, face_index findex, 3210 -- W's display table (comes from specifier `current-display-table')
3219 Lisp_Object *face_table, Lisp_Object *window_table) 3211
3212 Ignore the specified tables if they are not valid;
3213 if no valid table is specified, return 0. */
3214
3215 struct Lisp_Vector *
3216 get_display_table (struct window *w, face_index findex)
3220 { 3217 {
3221 Lisp_Object tem; 3218 Lisp_Object tem;
3219
3222 tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex); 3220 tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex);
3223 if (UNBOUNDP (tem)) 3221 if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE)
3224 tem = Qnil; 3222 return XVECTOR (tem);
3225 if (!LISTP (tem)) 3223
3226 tem = noseeum_cons (tem, Qnil);
3227 *face_table = tem;
3228 tem = w->display_table; 3224 tem = w->display_table;
3229 if (UNBOUNDP (tem)) 3225 if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE)
3230 tem = Qnil; 3226 return XVECTOR (tem);
3231 if (!LISTP (tem)) 3227
3232 tem = noseeum_cons (tem, Qnil); 3228 return 0;
3233 *window_table = tem;
3234 }
3235
3236 Lisp_Object
3237 display_table_entry (Emchar ch, Lisp_Object face_table,
3238 Lisp_Object window_table)
3239 {
3240 Lisp_Object tail;
3241
3242 /* Loop over FACE_TABLE, and then over WINDOW_TABLE. */
3243 for (tail = face_table; 1; tail = XCDR (tail))
3244 {
3245 Lisp_Object table;
3246 if (NILP (tail))
3247 {
3248 if (!NILP (window_table))
3249 {
3250 tail = window_table;
3251 window_table = Qnil;
3252 }
3253 else
3254 return Qnil;
3255 }
3256 table = XCAR (tail);
3257
3258 if (VECTORP (table))
3259 {
3260 if (ch < XVECTOR_LENGTH (table) && !NILP (XVECTOR_DATA (table)[ch]))
3261 return XVECTOR_DATA (table)[ch];
3262 else
3263 continue;
3264 }
3265 else if (CHAR_TABLEP (table)
3266 && XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_CHAR)
3267 {
3268 return get_char_table (ch, XCHAR_TABLE (table));
3269 }
3270 else if (CHAR_TABLEP (table)
3271 && XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_GENERIC)
3272 {
3273 Lisp_Object gotit = get_char_table (ch, XCHAR_TABLE (table));
3274 if (!NILP (gotit))
3275 return gotit;
3276 else
3277 continue;
3278 }
3279 else if (RANGE_TABLEP (table))
3280 {
3281 Lisp_Object gotit = Fget_range_table (make_char (ch), table, Qnil);
3282 if (!NILP (gotit))
3283 return gotit;
3284 else
3285 continue;
3286 }
3287 else
3288 abort ();
3289 }
3290 } 3229 }
3291 3230
3292 3231
3293 /***************************************************************************** 3232 /*****************************************************************************
3294 * initialization * 3233 * initialization *