Mercurial > hg > xemacs-beta
comparison src/glyphs.c @ 361:7347b34c275b r21-1-10
Import from CVS: tag r21-1-10
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:58:40 +0200 |
parents | 03446687b7cc |
children | cc15677e0335 |
comparison
equal
deleted
inserted
replaced
360:0f00b38cfccb | 361:7347b34c275b |
---|---|
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" | |
41 | 43 |
42 #ifdef HAVE_XPM | 44 #ifdef HAVE_XPM |
43 #include <X11/xpm.h> | 45 #include <X11/xpm.h> |
44 #endif | 46 #endif |
45 | 47 |
3207 | 3209 |
3208 /***************************************************************************** | 3210 /***************************************************************************** |
3209 * display tables * | 3211 * display tables * |
3210 *****************************************************************************/ | 3212 *****************************************************************************/ |
3211 | 3213 |
3212 /* Get the display table for use currently on window W with face FACE. | 3214 /* Get the display tables for use currently on window W with face |
3213 Precedence: | 3215 FACE. #### This will have to be redone. */ |
3214 | 3216 |
3215 -- FACE's display table | 3217 void |
3216 -- W's display table (comes from specifier `current-display-table') | 3218 get_display_tables (struct window *w, face_index findex, |
3217 | 3219 Lisp_Object *face_table, Lisp_Object *window_table) |
3218 Ignore the specified tables if they are not valid; | |
3219 if no valid table is specified, return 0. */ | |
3220 | |
3221 struct Lisp_Vector * | |
3222 get_display_table (struct window *w, face_index findex) | |
3223 { | 3220 { |
3224 Lisp_Object tem; | 3221 Lisp_Object tem; |
3225 | |
3226 tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex); | 3222 tem = WINDOW_FACE_CACHEL_DISPLAY_TABLE (w, findex); |
3227 if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE) | 3223 if (UNBOUNDP (tem)) |
3228 return XVECTOR (tem); | 3224 tem = Qnil; |
3229 | 3225 if (!LISTP (tem)) |
3226 tem = noseeum_cons (tem, Qnil); | |
3227 *face_table = tem; | |
3230 tem = w->display_table; | 3228 tem = w->display_table; |
3231 if (VECTORP (tem) && XVECTOR_LENGTH (tem) == DISP_TABLE_SIZE) | 3229 if (UNBOUNDP (tem)) |
3232 return XVECTOR (tem); | 3230 tem = Qnil; |
3233 | 3231 if (!LISTP (tem)) |
3234 return 0; | 3232 tem = noseeum_cons (tem, Qnil); |
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 } | |
3235 } | 3290 } |
3236 | 3291 |
3237 | 3292 |
3238 /***************************************************************************** | 3293 /***************************************************************************** |
3239 * initialization * | 3294 * initialization * |