Mercurial > hg > xemacs-beta
comparison src/faces.c @ 5178:97eb4942aec8
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 29 Mar 2010 21:28:13 -0500 |
parents | 8b2f75cecb89 1fae11d56ad2 |
children | 71ee43b8a74d |
comparison
equal
deleted
inserted
replaced
5177:b785049378e3 | 5178:97eb4942aec8 |
---|---|
1 /* "Face" primitives | 1 /* "Face" primitives |
2 Copyright (C) 1994 Free Software Foundation, Inc. | 2 Copyright (C) 1994 Free Software Foundation, Inc. |
3 Copyright (C) 1995 Board of Trustees, University of Illinois. | 3 Copyright (C) 1995 Board of Trustees, University of Illinois. |
4 Copyright (C) 1995, 1996, 2001, 2002, 2005, 2010 Ben Wing. | 4 Copyright (C) 1995, 1996, 2001, 2002, 2005, 2010 Ben Wing. |
5 Copyright (C) 1995 Sun Microsystems, Inc. | 5 Copyright (C) 1995 Sun Microsystems, Inc. |
6 Copyright (C) 2010 Didier Verna | |
6 | 7 |
7 This file is part of XEmacs. | 8 This file is part of XEmacs. |
8 | 9 |
9 XEmacs is free software; you can redistribute it and/or modify it | 10 XEmacs is free software; you can redistribute it and/or modify it |
10 under the terms of the GNU General Public License as published by the | 11 under the terms of the GNU General Public License as published by the |
40 #include "specifier.h" | 41 #include "specifier.h" |
41 #include "window.h" | 42 #include "window.h" |
42 | 43 |
43 Lisp_Object Qfacep; | 44 Lisp_Object Qfacep; |
44 Lisp_Object Qforeground, Qbackground, Qdisplay_table; | 45 Lisp_Object Qforeground, Qbackground, Qdisplay_table; |
45 Lisp_Object Qbackground_pixmap, Qunderline, Qdim; | 46 Lisp_Object Qbackground_pixmap, Qbackground_placement, Qunderline, Qdim; |
46 Lisp_Object Qblinking, Qstrikethru; | 47 Lisp_Object Qblinking, Qstrikethru; |
47 | 48 |
48 Lisp_Object Qinit_face_from_resources; | 49 Lisp_Object Qinit_face_from_resources; |
49 Lisp_Object Qinit_frame_faces; | 50 Lisp_Object Qinit_frame_faces; |
50 Lisp_Object Qinit_device_faces; | 51 Lisp_Object Qinit_device_faces; |
109 mark_object (face->foreground); | 110 mark_object (face->foreground); |
110 mark_object (face->background); | 111 mark_object (face->background); |
111 mark_object (face->font); | 112 mark_object (face->font); |
112 mark_object (face->display_table); | 113 mark_object (face->display_table); |
113 mark_object (face->background_pixmap); | 114 mark_object (face->background_pixmap); |
115 mark_object (face->background_placement); | |
114 mark_object (face->underline); | 116 mark_object (face->underline); |
115 mark_object (face->strikethru); | 117 mark_object (face->strikethru); |
116 mark_object (face->highlight); | 118 mark_object (face->highlight); |
117 mark_object (face->dim); | 119 mark_object (face->dim); |
118 mark_object (face->blinking); | 120 mark_object (face->blinking); |
160 (internal_equal (f1->foreground, f2->foreground, depth) && | 162 (internal_equal (f1->foreground, f2->foreground, depth) && |
161 internal_equal (f1->background, f2->background, depth) && | 163 internal_equal (f1->background, f2->background, depth) && |
162 internal_equal (f1->font, f2->font, depth) && | 164 internal_equal (f1->font, f2->font, depth) && |
163 internal_equal (f1->display_table, f2->display_table, depth) && | 165 internal_equal (f1->display_table, f2->display_table, depth) && |
164 internal_equal (f1->background_pixmap, f2->background_pixmap, depth) && | 166 internal_equal (f1->background_pixmap, f2->background_pixmap, depth) && |
167 internal_equal (f1->background_placement, | |
168 f2->background_placement, | |
169 depth) && | |
165 internal_equal (f1->underline, f2->underline, depth) && | 170 internal_equal (f1->underline, f2->underline, depth) && |
166 internal_equal (f1->strikethru, f2->strikethru, depth) && | 171 internal_equal (f1->strikethru, f2->strikethru, depth) && |
167 internal_equal (f1->highlight, f2->highlight, depth) && | 172 internal_equal (f1->highlight, f2->highlight, depth) && |
168 internal_equal (f1->dim, f2->dim, depth) && | 173 internal_equal (f1->dim, f2->dim, depth) && |
169 internal_equal (f1->blinking, f2->blinking, depth) && | 174 internal_equal (f1->blinking, f2->blinking, depth) && |
190 face_getprop (Lisp_Object obj, Lisp_Object prop) | 195 face_getprop (Lisp_Object obj, Lisp_Object prop) |
191 { | 196 { |
192 Lisp_Face *f = XFACE (obj); | 197 Lisp_Face *f = XFACE (obj); |
193 | 198 |
194 return | 199 return |
195 (EQ (prop, Qforeground) ? f->foreground : | 200 (EQ (prop, Qforeground) ? f->foreground : |
196 EQ (prop, Qbackground) ? f->background : | 201 EQ (prop, Qbackground) ? f->background : |
197 EQ (prop, Qfont) ? f->font : | 202 EQ (prop, Qfont) ? f->font : |
198 EQ (prop, Qdisplay_table) ? f->display_table : | 203 EQ (prop, Qdisplay_table) ? f->display_table : |
199 EQ (prop, Qbackground_pixmap) ? f->background_pixmap : | 204 EQ (prop, Qbackground_pixmap) ? f->background_pixmap : |
200 EQ (prop, Qunderline) ? f->underline : | 205 EQ (prop, Qbackground_placement) ? f->background_placement : |
201 EQ (prop, Qstrikethru) ? f->strikethru : | 206 EQ (prop, Qunderline) ? f->underline : |
202 EQ (prop, Qhighlight) ? f->highlight : | 207 EQ (prop, Qstrikethru) ? f->strikethru : |
203 EQ (prop, Qdim) ? f->dim : | 208 EQ (prop, Qhighlight) ? f->highlight : |
204 EQ (prop, Qblinking) ? f->blinking : | 209 EQ (prop, Qdim) ? f->dim : |
205 EQ (prop, Qreverse) ? f->reverse : | 210 EQ (prop, Qblinking) ? f->blinking : |
206 EQ (prop, Qdoc_string) ? f->doc_string : | 211 EQ (prop, Qreverse) ? f->reverse : |
212 EQ (prop, Qdoc_string) ? f->doc_string : | |
207 external_plist_get (&f->plist, prop, 0, ERROR_ME)); | 213 external_plist_get (&f->plist, prop, 0, ERROR_ME)); |
208 } | 214 } |
209 | 215 |
210 static int | 216 static int |
211 face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value) | 217 face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value) |
212 { | 218 { |
213 Lisp_Face *f = XFACE (obj); | 219 Lisp_Face *f = XFACE (obj); |
214 | 220 |
215 if (EQ (prop, Qforeground) || | 221 if (EQ (prop, Qforeground) || |
216 EQ (prop, Qbackground) || | 222 EQ (prop, Qbackground) || |
217 EQ (prop, Qfont) || | 223 EQ (prop, Qfont) || |
218 EQ (prop, Qdisplay_table) || | 224 EQ (prop, Qdisplay_table) || |
219 EQ (prop, Qbackground_pixmap) || | 225 EQ (prop, Qbackground_pixmap) || |
220 EQ (prop, Qunderline) || | 226 EQ (prop, Qbackground_placement) || |
221 EQ (prop, Qstrikethru) || | 227 EQ (prop, Qunderline) || |
222 EQ (prop, Qhighlight) || | 228 EQ (prop, Qstrikethru) || |
223 EQ (prop, Qdim) || | 229 EQ (prop, Qhighlight) || |
224 EQ (prop, Qblinking) || | 230 EQ (prop, Qdim) || |
231 EQ (prop, Qblinking) || | |
225 EQ (prop, Qreverse)) | 232 EQ (prop, Qreverse)) |
226 return 0; | 233 return 0; |
227 | 234 |
228 if (EQ (prop, Qdoc_string)) | 235 if (EQ (prop, Qdoc_string)) |
229 { | 236 { |
240 static int | 247 static int |
241 face_remprop (Lisp_Object obj, Lisp_Object prop) | 248 face_remprop (Lisp_Object obj, Lisp_Object prop) |
242 { | 249 { |
243 Lisp_Face *f = XFACE (obj); | 250 Lisp_Face *f = XFACE (obj); |
244 | 251 |
245 if (EQ (prop, Qforeground) || | 252 if (EQ (prop, Qforeground) || |
246 EQ (prop, Qbackground) || | 253 EQ (prop, Qbackground) || |
247 EQ (prop, Qfont) || | 254 EQ (prop, Qfont) || |
248 EQ (prop, Qdisplay_table) || | 255 EQ (prop, Qdisplay_table) || |
249 EQ (prop, Qbackground_pixmap) || | 256 EQ (prop, Qbackground_pixmap) || |
250 EQ (prop, Qunderline) || | 257 EQ (prop, Qbackground_placement) || |
251 EQ (prop, Qstrikethru) || | 258 EQ (prop, Qunderline) || |
252 EQ (prop, Qhighlight) || | 259 EQ (prop, Qstrikethru) || |
253 EQ (prop, Qdim) || | 260 EQ (prop, Qhighlight) || |
254 EQ (prop, Qblinking) || | 261 EQ (prop, Qdim) || |
262 EQ (prop, Qblinking) || | |
255 EQ (prop, Qreverse)) | 263 EQ (prop, Qreverse)) |
256 return -1; | 264 return -1; |
257 | 265 |
258 if (EQ (prop, Qdoc_string)) | 266 if (EQ (prop, Qdoc_string)) |
259 { | 267 { |
268 face_plist (Lisp_Object obj) | 276 face_plist (Lisp_Object obj) |
269 { | 277 { |
270 Lisp_Face *face = XFACE (obj); | 278 Lisp_Face *face = XFACE (obj); |
271 Lisp_Object result = face->plist; | 279 Lisp_Object result = face->plist; |
272 | 280 |
273 result = cons3 (Qreverse, face->reverse, result); | 281 result = cons3 (Qreverse, face->reverse, result); |
274 result = cons3 (Qblinking, face->blinking, result); | 282 result = cons3 (Qblinking, face->blinking, result); |
275 result = cons3 (Qdim, face->dim, result); | 283 result = cons3 (Qdim, face->dim, result); |
276 result = cons3 (Qhighlight, face->highlight, result); | 284 result = cons3 (Qhighlight, face->highlight, result); |
277 result = cons3 (Qstrikethru, face->strikethru, result); | 285 result = cons3 (Qstrikethru, face->strikethru, result); |
278 result = cons3 (Qunderline, face->underline, result); | 286 result = cons3 (Qunderline, face->underline, result); |
279 result = cons3 (Qbackground_pixmap, face->background_pixmap, result); | 287 result = cons3 (Qbackground_placement, face->background_placement, result); |
280 result = cons3 (Qdisplay_table, face->display_table, result); | 288 result = cons3 (Qbackground_pixmap, face->background_pixmap, result); |
281 result = cons3 (Qfont, face->font, result); | 289 result = cons3 (Qdisplay_table, face->display_table, result); |
282 result = cons3 (Qbackground, face->background, result); | 290 result = cons3 (Qfont, face->font, result); |
283 result = cons3 (Qforeground, face->foreground, result); | 291 result = cons3 (Qbackground, face->background, result); |
292 result = cons3 (Qforeground, face->foreground, result); | |
284 | 293 |
285 return result; | 294 return result; |
286 } | 295 } |
287 | 296 |
288 static const struct memory_description face_description[] = { | 297 static const struct memory_description face_description[] = { |
291 { XD_LISP_OBJECT, offsetof (Lisp_Face, foreground) }, | 300 { XD_LISP_OBJECT, offsetof (Lisp_Face, foreground) }, |
292 { XD_LISP_OBJECT, offsetof (Lisp_Face, background) }, | 301 { XD_LISP_OBJECT, offsetof (Lisp_Face, background) }, |
293 { XD_LISP_OBJECT, offsetof (Lisp_Face, font) }, | 302 { XD_LISP_OBJECT, offsetof (Lisp_Face, font) }, |
294 { XD_LISP_OBJECT, offsetof (Lisp_Face, display_table) }, | 303 { XD_LISP_OBJECT, offsetof (Lisp_Face, display_table) }, |
295 { XD_LISP_OBJECT, offsetof (Lisp_Face, background_pixmap) }, | 304 { XD_LISP_OBJECT, offsetof (Lisp_Face, background_pixmap) }, |
305 { XD_LISP_OBJECT, offsetof (Lisp_Face, background_placement) }, | |
296 { XD_LISP_OBJECT, offsetof (Lisp_Face, underline) }, | 306 { XD_LISP_OBJECT, offsetof (Lisp_Face, underline) }, |
297 { XD_LISP_OBJECT, offsetof (Lisp_Face, strikethru) }, | 307 { XD_LISP_OBJECT, offsetof (Lisp_Face, strikethru) }, |
298 { XD_LISP_OBJECT, offsetof (Lisp_Face, highlight) }, | 308 { XD_LISP_OBJECT, offsetof (Lisp_Face, highlight) }, |
299 { XD_LISP_OBJECT, offsetof (Lisp_Face, dim) }, | 309 { XD_LISP_OBJECT, offsetof (Lisp_Face, dim) }, |
300 { XD_LISP_OBJECT, offsetof (Lisp_Face, blinking) }, | 310 { XD_LISP_OBJECT, offsetof (Lisp_Face, blinking) }, |
302 { XD_LISP_OBJECT, offsetof (Lisp_Face, plist) }, | 312 { XD_LISP_OBJECT, offsetof (Lisp_Face, plist) }, |
303 { XD_LISP_OBJECT, offsetof (Lisp_Face, charsets_warned_about) }, | 313 { XD_LISP_OBJECT, offsetof (Lisp_Face, charsets_warned_about) }, |
304 { XD_END } | 314 { XD_END } |
305 }; | 315 }; |
306 | 316 |
307 DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, | 317 DEFINE_DUMPABLE_LISP_OBJECT ("face", face, |
308 1, /*dumpable-flag*/ | 318 mark_face, print_face, 0, face_equal, |
309 mark_face, print_face, 0, face_equal, | 319 face_hash, face_description, |
310 face_hash, face_description, | 320 Lisp_Face); |
311 face_getprop, | |
312 face_putprop, face_remprop, | |
313 face_plist, Lisp_Face); | |
314 | 321 |
315 /************************************************************************/ | 322 /************************************************************************/ |
316 /* face read syntax */ | 323 /* face read syntax */ |
317 /************************************************************************/ | 324 /************************************************************************/ |
318 | 325 |
384 f->foreground = Qnil; | 391 f->foreground = Qnil; |
385 f->background = Qnil; | 392 f->background = Qnil; |
386 f->font = Qnil; | 393 f->font = Qnil; |
387 f->display_table = Qnil; | 394 f->display_table = Qnil; |
388 f->background_pixmap = Qnil; | 395 f->background_pixmap = Qnil; |
396 f->background_placement = Qnil; | |
389 f->underline = Qnil; | 397 f->underline = Qnil; |
390 f->strikethru = Qnil; | 398 f->strikethru = Qnil; |
391 f->highlight = Qnil; | 399 f->highlight = Qnil; |
392 f->dim = Qnil; | 400 f->dim = Qnil; |
393 f->blinking = Qnil; | 401 f->blinking = Qnil; |
397 } | 405 } |
398 | 406 |
399 static Lisp_Face * | 407 static Lisp_Face * |
400 allocate_face (void) | 408 allocate_face (void) |
401 { | 409 { |
402 Lisp_Face *result = ALLOC_LCRECORD_TYPE (Lisp_Face, &lrecord_face); | 410 Lisp_Object obj = ALLOC_NORMAL_LISP_OBJECT (face); |
411 Lisp_Face *result = XFACE (obj); | |
403 | 412 |
404 reset_face (result); | 413 reset_face (result); |
405 return result; | 414 return result; |
406 } | 415 } |
407 | 416 |
843 set_color_attached_to (f->background, face, Qbackground); | 852 set_color_attached_to (f->background, face, Qbackground); |
844 f->font = Fmake_specifier (Qfont); | 853 f->font = Fmake_specifier (Qfont); |
845 set_font_attached_to (f->font, face, Qfont); | 854 set_font_attached_to (f->font, face, Qfont); |
846 f->background_pixmap = Fmake_specifier (Qimage); | 855 f->background_pixmap = Fmake_specifier (Qimage); |
847 set_image_attached_to (f->background_pixmap, face, Qbackground_pixmap); | 856 set_image_attached_to (f->background_pixmap, face, Qbackground_pixmap); |
857 f->background_placement = Fmake_specifier (Qface_background_placement); | |
858 set_face_background_placement_attached_to (f->background_placement, face); | |
848 f->display_table = Fmake_specifier (Qdisplay_table); | 859 f->display_table = Fmake_specifier (Qdisplay_table); |
849 f->underline = Fmake_specifier (Qface_boolean); | 860 f->underline = Fmake_specifier (Qface_boolean); |
850 set_face_boolean_attached_to (f->underline, face, Qunderline); | 861 set_face_boolean_attached_to (f->underline, face, Qunderline); |
851 f->strikethru = Fmake_specifier (Qface_boolean); | 862 f->strikethru = Fmake_specifier (Qface_boolean); |
852 set_face_boolean_attached_to (f->strikethru, face, Qstrikethru); | 863 set_face_boolean_attached_to (f->strikethru, face, Qstrikethru); |
871 set_specifier_fallback (f->font, | 882 set_specifier_fallback (f->font, |
872 Fget (Vdefault_face, Qfont, Qunbound)); | 883 Fget (Vdefault_face, Qfont, Qunbound)); |
873 set_specifier_fallback (f->background_pixmap, | 884 set_specifier_fallback (f->background_pixmap, |
874 Fget (Vdefault_face, Qbackground_pixmap, | 885 Fget (Vdefault_face, Qbackground_pixmap, |
875 Qunbound)); | 886 Qunbound)); |
887 set_specifier_fallback (f->background_placement, | |
888 Fget (Vdefault_face, Qbackground_placement, | |
889 Qunbound)); | |
876 set_specifier_fallback (f->display_table, | 890 set_specifier_fallback (f->display_table, |
877 Fget (Vdefault_face, Qdisplay_table, Qunbound)); | 891 Fget (Vdefault_face, Qdisplay_table, Qunbound)); |
878 set_specifier_fallback (f->underline, | 892 set_specifier_fallback (f->underline, |
879 Fget (Vdefault_face, Qunderline, Qunbound)); | 893 Fget (Vdefault_face, Qunderline, Qunbound)); |
880 set_specifier_fallback (f->strikethru, | 894 set_specifier_fallback (f->strikethru, |
1065 mark_object (cachel->face); | 1079 mark_object (cachel->face); |
1066 mark_object (cachel->foreground); | 1080 mark_object (cachel->foreground); |
1067 mark_object (cachel->background); | 1081 mark_object (cachel->background); |
1068 mark_object (cachel->display_table); | 1082 mark_object (cachel->display_table); |
1069 mark_object (cachel->background_pixmap); | 1083 mark_object (cachel->background_pixmap); |
1084 mark_object (cachel->background_placement); | |
1070 } | 1085 } |
1071 } | 1086 } |
1072 | 1087 |
1073 /* ensure that the given cachel contains an updated font value for | 1088 /* ensure that the given cachel contains an updated font value for |
1074 the given charset. Return the updated font value (which can be | 1089 the given charset. Return the updated font value (which can be |
1421 || WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain), DEFAULT_INDEX)) | 1436 || WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain), DEFAULT_INDEX)) |
1422 { | 1437 { |
1423 FROB (background_pixmap); | 1438 FROB (background_pixmap); |
1424 MAYBE_UNFROB_BACKGROUND_PIXMAP; | 1439 MAYBE_UNFROB_BACKGROUND_PIXMAP; |
1425 } | 1440 } |
1441 | |
1442 FROB (background_placement); | |
1443 | |
1426 #undef FROB | 1444 #undef FROB |
1427 #undef MAYBE_UNFROB_BACKGROUND_PIXMAP | 1445 #undef MAYBE_UNFROB_BACKGROUND_PIXMAP |
1428 | 1446 |
1429 ensure_face_cachel_contains_charset (cachel, domain, Vcharset_ascii); | 1447 ensure_face_cachel_contains_charset (cachel, domain, Vcharset_ascii); |
1430 | 1448 |
1484 | 1502 |
1485 FROB (foreground); | 1503 FROB (foreground); |
1486 FROB (background); | 1504 FROB (background); |
1487 FROB (display_table); | 1505 FROB (display_table); |
1488 FROB (background_pixmap); | 1506 FROB (background_pixmap); |
1507 FROB (background_placement); | |
1489 FROB (underline); | 1508 FROB (underline); |
1490 FROB (strikethru); | 1509 FROB (strikethru); |
1491 FROB (highlight); | 1510 FROB (highlight); |
1492 FROB (dim); | 1511 FROB (dim); |
1493 FROB (reverse); | 1512 FROB (reverse); |
1534 for (i = 0; i < NUM_LEADING_BYTES; i++) | 1553 for (i = 0; i < NUM_LEADING_BYTES; i++) |
1535 cachel->font[i] = Qunbound; | 1554 cachel->font[i] = Qunbound; |
1536 } | 1555 } |
1537 cachel->display_table = Qunbound; | 1556 cachel->display_table = Qunbound; |
1538 cachel->background_pixmap = Qunbound; | 1557 cachel->background_pixmap = Qunbound; |
1558 cachel->background_placement = Qunbound; | |
1539 FACE_CACHEL_FONT_SPECIFIED (cachel)->size = sizeof(cachel->font_specified); | 1559 FACE_CACHEL_FONT_SPECIFIED (cachel)->size = sizeof(cachel->font_specified); |
1540 FACE_CACHEL_FONT_UPDATED (cachel)->size = sizeof(cachel->font_updated); | 1560 FACE_CACHEL_FONT_UPDATED (cachel)->size = sizeof(cachel->font_updated); |
1541 } | 1561 } |
1542 | 1562 |
1543 /* Retrieve the index to a cachel for window W that corresponds to | 1563 /* Retrieve the index to a cachel for window W that corresponds to |
1627 | 1647 |
1628 #ifdef MEMORY_USAGE_STATS | 1648 #ifdef MEMORY_USAGE_STATS |
1629 | 1649 |
1630 int | 1650 int |
1631 compute_face_cachel_usage (face_cachel_dynarr *face_cachels, | 1651 compute_face_cachel_usage (face_cachel_dynarr *face_cachels, |
1632 struct overhead_stats *ovstats) | 1652 struct usage_stats *ustats) |
1633 { | 1653 { |
1634 int total = 0; | 1654 int total = 0; |
1635 | 1655 |
1636 if (face_cachels) | 1656 if (face_cachels) |
1637 { | 1657 { |
1638 int i; | 1658 int i; |
1639 | 1659 |
1640 total += Dynarr_memory_usage (face_cachels, ovstats); | 1660 total += Dynarr_memory_usage (face_cachels, ustats); |
1641 for (i = 0; i < Dynarr_length (face_cachels); i++) | 1661 for (i = 0; i < Dynarr_length (face_cachels); i++) |
1642 { | 1662 { |
1643 int_dynarr *merged = Dynarr_at (face_cachels, i).merged_faces; | 1663 int_dynarr *merged = Dynarr_at (face_cachels, i).merged_faces; |
1644 if (merged) | 1664 if (merged) |
1645 total += Dynarr_memory_usage (merged, ovstats); | 1665 total += Dynarr_memory_usage (merged, ustats); |
1646 } | 1666 } |
1647 } | 1667 } |
1648 | 1668 |
1649 return total; | 1669 return total; |
1650 } | 1670 } |
1899 int default_face = EQ (face, Vdefault_face); | 1919 int default_face = EQ (face, Vdefault_face); |
1900 | 1920 |
1901 /* If the locale could affect the frame value, then call | 1921 /* If the locale could affect the frame value, then call |
1902 update_EmacsFrames just in case. */ | 1922 update_EmacsFrames just in case. */ |
1903 if (default_face && | 1923 if (default_face && |
1904 (EQ (property, Qforeground) || | 1924 (EQ (property, Qforeground) || |
1905 EQ (property, Qbackground) || | 1925 EQ (property, Qbackground) || |
1906 EQ (property, Qfont))) | 1926 EQ (property, Qfont))) |
1907 update_EmacsFrames (locale, property); | 1927 update_EmacsFrames (locale, property); |
1908 | 1928 |
1909 if (WINDOWP (locale)) | 1929 if (WINDOWP (locale)) |
1910 { | 1930 { |
1994 COPY_PROPERTY (foreground); | 2014 COPY_PROPERTY (foreground); |
1995 COPY_PROPERTY (background); | 2015 COPY_PROPERTY (background); |
1996 COPY_PROPERTY (font); | 2016 COPY_PROPERTY (font); |
1997 COPY_PROPERTY (display_table); | 2017 COPY_PROPERTY (display_table); |
1998 COPY_PROPERTY (background_pixmap); | 2018 COPY_PROPERTY (background_pixmap); |
2019 COPY_PROPERTY (background_placement); | |
1999 COPY_PROPERTY (underline); | 2020 COPY_PROPERTY (underline); |
2000 COPY_PROPERTY (strikethru); | 2021 COPY_PROPERTY (strikethru); |
2001 COPY_PROPERTY (highlight); | 2022 COPY_PROPERTY (highlight); |
2002 COPY_PROPERTY (dim); | 2023 COPY_PROPERTY (dim); |
2003 COPY_PROPERTY (blinking); | 2024 COPY_PROPERTY (blinking); |
2086 | 2107 |
2087 #endif /* MULE */ | 2108 #endif /* MULE */ |
2088 | 2109 |
2089 | 2110 |
2090 void | 2111 void |
2112 face_objects_create (void) | |
2113 { | |
2114 OBJECT_HAS_METHOD (face, getprop); | |
2115 OBJECT_HAS_METHOD (face, putprop); | |
2116 OBJECT_HAS_METHOD (face, remprop); | |
2117 OBJECT_HAS_METHOD (face, plist); | |
2118 } | |
2119 | |
2120 void | |
2091 syms_of_faces (void) | 2121 syms_of_faces (void) |
2092 { | 2122 { |
2093 INIT_LRECORD_IMPLEMENTATION (face); | 2123 INIT_LISP_OBJECT (face); |
2094 | 2124 |
2095 /* Qdefault, Qwidget, Qleft_margin, Qright_margin defined in general.c */ | 2125 /* Qdefault, Qwidget, Qleft_margin, Qright_margin defined in general.c */ |
2096 DEFSYMBOL (Qmodeline); | 2126 DEFSYMBOL (Qmodeline); |
2097 DEFSYMBOL (Qgui_element); | 2127 DEFSYMBOL (Qgui_element); |
2098 DEFSYMBOL (Qtext_cursor); | 2128 DEFSYMBOL (Qtext_cursor); |
2124 DEFSYMBOL (Qforeground); | 2154 DEFSYMBOL (Qforeground); |
2125 DEFSYMBOL (Qbackground); | 2155 DEFSYMBOL (Qbackground); |
2126 /* Qfont defined in general.c */ | 2156 /* Qfont defined in general.c */ |
2127 DEFSYMBOL (Qdisplay_table); | 2157 DEFSYMBOL (Qdisplay_table); |
2128 DEFSYMBOL (Qbackground_pixmap); | 2158 DEFSYMBOL (Qbackground_pixmap); |
2159 DEFSYMBOL (Qbackground_placement); | |
2129 DEFSYMBOL (Qunderline); | 2160 DEFSYMBOL (Qunderline); |
2130 DEFSYMBOL (Qstrikethru); | 2161 DEFSYMBOL (Qstrikethru); |
2131 /* Qhighlight, Qreverse defined in general.c */ | 2162 /* Qhighlight, Qreverse defined in general.c */ |
2132 DEFSYMBOL (Qdim); | 2163 DEFSYMBOL (Qdim); |
2133 DEFSYMBOL (Qblinking); | 2164 DEFSYMBOL (Qblinking); |
2197 syms[n++] = Qforeground; | 2228 syms[n++] = Qforeground; |
2198 syms[n++] = Qbackground; | 2229 syms[n++] = Qbackground; |
2199 syms[n++] = Qfont; | 2230 syms[n++] = Qfont; |
2200 syms[n++] = Qdisplay_table; | 2231 syms[n++] = Qdisplay_table; |
2201 syms[n++] = Qbackground_pixmap; | 2232 syms[n++] = Qbackground_pixmap; |
2233 syms[n++] = Qbackground_placement; | |
2202 syms[n++] = Qunderline; | 2234 syms[n++] = Qunderline; |
2203 syms[n++] = Qstrikethru; | 2235 syms[n++] = Qstrikethru; |
2204 syms[n++] = Qhighlight; | 2236 syms[n++] = Qhighlight; |
2205 syms[n++] = Qdim; | 2237 syms[n++] = Qdim; |
2206 syms[n++] = Qblinking; | 2238 syms[n++] = Qblinking; |
2515 set_specifier_fallback (Fget (Vmodeline_face, Qbackground, Qunbound), | 2547 set_specifier_fallback (Fget (Vmodeline_face, Qbackground, Qunbound), |
2516 Fget (Vgui_element_face, Qbackground, Qunbound)); | 2548 Fget (Vgui_element_face, Qbackground, Qunbound)); |
2517 set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap, Qnil), | 2549 set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap, Qnil), |
2518 Fget (Vgui_element_face, Qbackground_pixmap, | 2550 Fget (Vgui_element_face, Qbackground_pixmap, |
2519 Qunbound)); | 2551 Qunbound)); |
2552 set_specifier_fallback (Fget (Vmodeline_face, Qbackground_placement, Qnil), | |
2553 Fget (Vgui_element_face, Qbackground_placement, | |
2554 Qunbound)); | |
2520 | 2555 |
2521 /* toolbar is another gui element */ | 2556 /* toolbar is another gui element */ |
2522 Vtoolbar_face = Fmake_face (Qtoolbar, | 2557 Vtoolbar_face = Fmake_face (Qtoolbar, |
2523 build_defer_string ("toolbar face"), | 2558 build_defer_string ("toolbar face"), |
2524 Qnil); | 2559 Qnil); |
2527 set_specifier_fallback (Fget (Vtoolbar_face, Qbackground, Qunbound), | 2562 set_specifier_fallback (Fget (Vtoolbar_face, Qbackground, Qunbound), |
2528 Fget (Vgui_element_face, Qbackground, Qunbound)); | 2563 Fget (Vgui_element_face, Qbackground, Qunbound)); |
2529 set_specifier_fallback (Fget (Vtoolbar_face, Qbackground_pixmap, Qnil), | 2564 set_specifier_fallback (Fget (Vtoolbar_face, Qbackground_pixmap, Qnil), |
2530 Fget (Vgui_element_face, Qbackground_pixmap, | 2565 Fget (Vgui_element_face, Qbackground_pixmap, |
2531 Qunbound)); | 2566 Qunbound)); |
2567 set_specifier_fallback (Fget (Vtoolbar_face, Qbackground_placement, Qnil), | |
2568 Fget (Vgui_element_face, Qbackground_placement, | |
2569 Qunbound)); | |
2532 | 2570 |
2533 /* vertical divider is another gui element */ | 2571 /* vertical divider is another gui element */ |
2534 Vvertical_divider_face = Fmake_face (Qvertical_divider, | 2572 Vvertical_divider_face = Fmake_face (Qvertical_divider, |
2535 build_defer_string ("vertical divider face"), | 2573 build_defer_string ("vertical divider face"), |
2536 Qnil); | 2574 Qnil); |
2540 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground, Qunbound), | 2578 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground, Qunbound), |
2541 Fget (Vgui_element_face, Qbackground, Qunbound)); | 2579 Fget (Vgui_element_face, Qbackground, Qunbound)); |
2542 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground_pixmap, | 2580 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground_pixmap, |
2543 Qunbound), | 2581 Qunbound), |
2544 Fget (Vgui_element_face, Qbackground_pixmap, | 2582 Fget (Vgui_element_face, Qbackground_pixmap, |
2583 Qunbound)); | |
2584 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground_placement, | |
2585 Qnil), | |
2586 Fget (Vgui_element_face, Qbackground_placement, | |
2545 Qunbound)); | 2587 Qunbound)); |
2546 | 2588 |
2547 /* widget is another gui element */ | 2589 /* widget is another gui element */ |
2548 Vwidget_face = Fmake_face (Qwidget, | 2590 Vwidget_face = Fmake_face (Qwidget, |
2549 build_defer_string ("widget face"), | 2591 build_defer_string ("widget face"), |