comparison src/faces.h @ 3659:98af8a976fc3

[xemacs-hg @ 2006-11-05 22:31:31 by aidan] Support specifying fonts for particular character sets in Mule; support translation to ISO 10646-1 for Mule character sets without an otherwise matching font; move to a vector of X11-charset-X11-registry instead of a regex for the charset-registry property.
author aidan
date Sun, 05 Nov 2006 22:31:46 +0000
parents d674024a8674
children 3ef0aaf3dc34
comparison
equal deleted inserted replaced
3658:0db1aaedbbef 3659:98af8a976fc3
23 23
24 #ifndef INCLUDED_faces_h_ 24 #ifndef INCLUDED_faces_h_
25 #define INCLUDED_faces_h_ 25 #define INCLUDED_faces_h_
26 26
27 #include "charset.h" /* for NUM_LEADING_BYTES */ 27 #include "charset.h" /* for NUM_LEADING_BYTES */
28 #include "specifier.h"
28 29
29 /* a Lisp_Face is the C object corresponding to a face. There is one 30 /* a Lisp_Face is the C object corresponding to a face. There is one
30 of these per face. It basically contains all of the specifiers for 31 of these per face. It basically contains all of the specifiers for
31 the built-in face properties, plus the plist of user-specified 32 the built-in face properties, plus the plist of user-specified
32 properties. */ 33 properties. */
179 unsigned int blinking :1; 180 unsigned int blinking :1;
180 unsigned int reverse :1; 181 unsigned int reverse :1;
181 182
182 /* Used when merging to tell if the above field represents an actual 183 /* Used when merging to tell if the above field represents an actual
183 value of this face or a fallback value. */ 184 value of this face or a fallback value. */
184 /* #### Of course we should use a bit array or something. */ 185 DECLARE_INLINE_LISP_BIT_VECTOR(NUM_LEADING_BYTES) font_specified;
185 unsigned char font_specified[NUM_LEADING_BYTES]; 186
186 unsigned int foreground_specified :1; 187 unsigned int foreground_specified :1;
187 unsigned int background_specified :1; 188 unsigned int background_specified :1;
188 unsigned int display_table_specified :1; 189 unsigned int display_table_specified :1;
189 unsigned int background_pixmap_specified :1; 190 unsigned int background_pixmap_specified :1;
190 191
221 whole program will just crash. For the moment, this is 222 whole program will just crash. For the moment, this is
222 OK (for debugging purposes) but we should fix this by 223 OK (for debugging purposes) but we should fix this by
223 storing a "blank font" if the instantiation fails. */ 224 storing a "blank font" if the instantiation fails. */
224 unsigned int dirty :1; 225 unsigned int dirty :1;
225 unsigned int updated :1; 226 unsigned int updated :1;
226 /* #### Of course we should use a bit array or something. */ 227
227 unsigned char font_updated[NUM_LEADING_BYTES]; 228 DECLARE_INLINE_LISP_BIT_VECTOR(NUM_LEADING_BYTES) font_updated;
229
230 /* Whether the font for the charset in question was determined in the
231 "final stage"; that is, the last stage Lisp code could specify it,
232 after the initial stage and before the fallback. */
233 DECLARE_INLINE_LISP_BIT_VECTOR(NUM_LEADING_BYTES) font_final_stage;
228 }; 234 };
229 235
230 #ifdef NEW_GC 236 #ifdef NEW_GC
231 typedef struct face_cachel Lisp_Face_Cachel; 237 typedef struct face_cachel Lisp_Face_Cachel;
232 238
300 void default_face_height_and_width_1 (Lisp_Object domain, 306 void default_face_height_and_width_1 (Lisp_Object domain,
301 int *height, int *width); 307 int *height, int *width);
302 308
303 #define FACE_CACHEL_FONT(cachel, charset) \ 309 #define FACE_CACHEL_FONT(cachel, charset) \
304 (cachel->font[XCHARSET_LEADING_BYTE (charset) - MIN_LEADING_BYTE]) 310 (cachel->font[XCHARSET_LEADING_BYTE (charset) - MIN_LEADING_BYTE])
311
312 #define FACE_CACHEL_FONT_UPDATED(x) \
313 ((struct Lisp_Bit_Vector *)(&((x)->font_updated)))
314 #define FACE_CACHEL_FONT_SPECIFIED(x) \
315 ((struct Lisp_Bit_Vector *)(&((x)->font_specified)))
316 #define FACE_CACHEL_FONT_FINAL_STAGE(x) \
317 ((struct Lisp_Bit_Vector *)(&((x)->font_final_stage)))
305 318
306 #define WINDOW_FACE_CACHEL(window, index) \ 319 #define WINDOW_FACE_CACHEL(window, index) \
307 Dynarr_atp ((window)->face_cachels, index) 320 Dynarr_atp ((window)->face_cachels, index)
308 321
309 #define FACE_CACHEL_FINDEX_UNSAFE(cachel, offset) \ 322 #define FACE_CACHEL_FINDEX_UNSAFE(cachel, offset) \
350 363
351 #define FACE_PROPERTY_INSTANCE(face, property, domain, no_fallback, depth) \ 364 #define FACE_PROPERTY_INSTANCE(face, property, domain, no_fallback, depth) \
352 FACE_PROPERTY_INSTANCE_1 (face, property, domain, ERROR_ME_DEBUG_WARN, \ 365 FACE_PROPERTY_INSTANCE_1 (face, property, domain, ERROR_ME_DEBUG_WARN, \
353 no_fallback, depth) 366 no_fallback, depth)
354 367
355 Lisp_Object face_property_matching_instance (Lisp_Object face, 368 Lisp_Object face_property_matching_instance
356 Lisp_Object property, 369 (Lisp_Object face,
357 Lisp_Object charset, 370 Lisp_Object property,
358 Lisp_Object domain, 371 Lisp_Object charset,
359 Error_Behavior errb, 372 Lisp_Object domain,
360 int no_fallback, 373 Error_Behavior errb,
361 Lisp_Object depth); 374 int no_fallback,
375 Lisp_Object depth,
376 enum font_specifier_matchspec_stages stages);
362 377
363 #define FACE_PROPERTY_SPEC_LIST(face, property, locale) \ 378 #define FACE_PROPERTY_SPEC_LIST(face, property, locale) \
364 Fspecifier_spec_list (FACE_PROPERTY_SPECIFIER (face, property), \ 379 Fspecifier_spec_list (FACE_PROPERTY_SPECIFIER (face, property), \
365 locale, Qnil, Qnil) 380 locale, Qnil, Qnil)
366 #define SET_FACE_PROPERTY(face, property, value, locale, tag, how_to_add) \ 381 #define SET_FACE_PROPERTY(face, property, value, locale, tag, how_to_add) \
371 FACE_PROPERTY_INSTANCE (face, Qforeground, domain, 0, Qzero) 386 FACE_PROPERTY_INSTANCE (face, Qforeground, domain, 0, Qzero)
372 #define FACE_BACKGROUND(face, domain) \ 387 #define FACE_BACKGROUND(face, domain) \
373 FACE_PROPERTY_INSTANCE (face, Qbackground, domain, 0, Qzero) 388 FACE_PROPERTY_INSTANCE (face, Qbackground, domain, 0, Qzero)
374 #define FACE_FONT(face, domain, charset) \ 389 #define FACE_FONT(face, domain, charset) \
375 face_property_matching_instance (face, Qfont, charset, domain, \ 390 face_property_matching_instance (face, Qfont, charset, domain, \
376 ERROR_ME_DEBUG_WARN, 0, Qzero) 391 ERROR_ME_DEBUG_WARN, 0, Qzero, \
392 initial)
377 #define FACE_DISPLAY_TABLE(face, domain) \ 393 #define FACE_DISPLAY_TABLE(face, domain) \
378 FACE_PROPERTY_INSTANCE (face, Qdisplay_table, domain, 0, Qzero) 394 FACE_PROPERTY_INSTANCE (face, Qdisplay_table, domain, 0, Qzero)
379 #define FACE_BACKGROUND_PIXMAP(face, domain) \ 395 #define FACE_BACKGROUND_PIXMAP(face, domain) \
380 FACE_PROPERTY_INSTANCE (face, Qbackground_pixmap, domain, 0, Qzero) 396 FACE_PROPERTY_INSTANCE (face, Qbackground_pixmap, domain, 0, Qzero)
381 #define FACE_UNDERLINE_P(face, domain) \ 397 #define FACE_UNDERLINE_P(face, domain) \