comparison src/faces.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents b8cc9ab3f761
children 41dbb7a9d5f2
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
55 calling Ffind_face. */ 55 calling Ffind_face. */
56 Lisp_Object Vdefault_face, Vmodeline_face, Vgui_element_face; 56 Lisp_Object Vdefault_face, Vmodeline_face, Vgui_element_face;
57 Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face; 57 Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face;
58 Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face, Vwidget_face; 58 Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face, Vwidget_face;
59 59
60 /* Qdefault, Qhighlight, Qleft_margin, Qright_margin defined in general.c */ 60 /* Qdefault, Qhighlight defined in general.c */
61 Lisp_Object Qmodeline, Qgui_element, Qtext_cursor, Qvertical_divider; 61 Lisp_Object Qmodeline, Qgui_element, Qleft_margin, Qright_margin, Qtext_cursor;
62 Lisp_Object Qvertical_divider;
62 63
63 /* In the old implementation Vface_list was a list of the face names, 64 /* In the old implementation Vface_list was a list of the face names,
64 not the faces themselves. We now distinguish between permanent and 65 not the faces themselves. We now distinguish between permanent and
65 temporary faces. Permanent faces are kept in a regular hash table, 66 temporary faces. Permanent faces are kept in a regular hash table,
66 temporary faces in a weak hash table. */ 67 temporary faces in a weak hash table. */
70 Lisp_Object Vbuilt_in_face_specifiers; 71 Lisp_Object Vbuilt_in_face_specifiers;
71 72
72 73
73 74
74 static Lisp_Object 75 static Lisp_Object
75 mark_face (Lisp_Object obj) 76 mark_face (Lisp_Object obj, void (*markobj) (Lisp_Object))
76 { 77 {
77 Lisp_Face *face = XFACE (obj); 78 struct Lisp_Face *face = XFACE (obj);
78 79
79 mark_object (face->name); 80 markobj (face->name);
80 mark_object (face->doc_string); 81 markobj (face->doc_string);
81 82
82 mark_object (face->foreground); 83 markobj (face->foreground);
83 mark_object (face->background); 84 markobj (face->background);
84 mark_object (face->font); 85 markobj (face->font);
85 mark_object (face->display_table); 86 markobj (face->display_table);
86 mark_object (face->background_pixmap); 87 markobj (face->background_pixmap);
87 mark_object (face->underline); 88 markobj (face->underline);
88 mark_object (face->strikethru); 89 markobj (face->strikethru);
89 mark_object (face->highlight); 90 markobj (face->highlight);
90 mark_object (face->dim); 91 markobj (face->dim);
91 mark_object (face->blinking); 92 markobj (face->blinking);
92 mark_object (face->reverse); 93 markobj (face->reverse);
93 94
94 mark_object (face->charsets_warned_about); 95 markobj (face->charsets_warned_about);
95 96
96 return face->plist; 97 return face->plist;
97 } 98 }
98 99
99 static void 100 static void
100 print_face (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 101 print_face (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
101 { 102 {
102 Lisp_Face *face = XFACE (obj); 103 struct Lisp_Face *face = XFACE (obj);
103 104
104 if (print_readably) 105 if (print_readably)
105 { 106 {
106 write_c_string ("#s(face name ", printcharfun); 107 write_c_string ("#s(face name ", printcharfun);
107 print_internal (face->name, printcharfun, 1); 108 print_internal (face->name, printcharfun, 1);
127 This isn't concerned with "unspecified" attributes, that's what 128 This isn't concerned with "unspecified" attributes, that's what
128 #'face-differs-from-default-p is for. */ 129 #'face-differs-from-default-p is for. */
129 static int 130 static int
130 face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth) 131 face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
131 { 132 {
132 Lisp_Face *f1 = XFACE (obj1); 133 struct Lisp_Face *f1 = XFACE (obj1);
133 Lisp_Face *f2 = XFACE (obj2); 134 struct Lisp_Face *f2 = XFACE (obj2);
134 135
135 depth++; 136 depth++;
136 137
137 return 138 return
138 (internal_equal (f1->foreground, f2->foreground, depth) && 139 (internal_equal (f1->foreground, f2->foreground, depth) &&
151 } 152 }
152 153
153 static unsigned long 154 static unsigned long
154 face_hash (Lisp_Object obj, int depth) 155 face_hash (Lisp_Object obj, int depth)
155 { 156 {
156 Lisp_Face *f = XFACE (obj); 157 struct Lisp_Face *f = XFACE (obj);
157 158
158 depth++; 159 depth++;
159 160
160 /* No need to hash all of the elements; that would take too long. 161 /* No need to hash all of the elements; that would take too long.
161 Just hash the most common ones. */ 162 Just hash the most common ones. */
165 } 166 }
166 167
167 static Lisp_Object 168 static Lisp_Object
168 face_getprop (Lisp_Object obj, Lisp_Object prop) 169 face_getprop (Lisp_Object obj, Lisp_Object prop)
169 { 170 {
170 Lisp_Face *f = XFACE (obj); 171 struct Lisp_Face *f = XFACE (obj);
171 172
172 return 173 return
173 (EQ (prop, Qforeground) ? f->foreground : 174 ((EQ (prop, Qforeground)) ? f->foreground :
174 EQ (prop, Qbackground) ? f->background : 175 (EQ (prop, Qbackground)) ? f->background :
175 EQ (prop, Qfont) ? f->font : 176 (EQ (prop, Qfont)) ? f->font :
176 EQ (prop, Qdisplay_table) ? f->display_table : 177 (EQ (prop, Qdisplay_table)) ? f->display_table :
177 EQ (prop, Qbackground_pixmap) ? f->background_pixmap : 178 (EQ (prop, Qbackground_pixmap)) ? f->background_pixmap :
178 EQ (prop, Qunderline) ? f->underline : 179 (EQ (prop, Qunderline)) ? f->underline :
179 EQ (prop, Qstrikethru) ? f->strikethru : 180 (EQ (prop, Qstrikethru)) ? f->strikethru :
180 EQ (prop, Qhighlight) ? f->highlight : 181 (EQ (prop, Qhighlight)) ? f->highlight :
181 EQ (prop, Qdim) ? f->dim : 182 (EQ (prop, Qdim)) ? f->dim :
182 EQ (prop, Qblinking) ? f->blinking : 183 (EQ (prop, Qblinking)) ? f->blinking :
183 EQ (prop, Qreverse) ? f->reverse : 184 (EQ (prop, Qreverse)) ? f->reverse :
184 EQ (prop, Qdoc_string) ? f->doc_string : 185 (EQ (prop, Qdoc_string)) ? f->doc_string :
185 external_plist_get (&f->plist, prop, 0, ERROR_ME)); 186 external_plist_get (&f->plist, prop, 0, ERROR_ME));
186 } 187 }
187 188
188 static int 189 static int
189 face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value) 190 face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value)
190 { 191 {
191 Lisp_Face *f = XFACE (obj); 192 struct Lisp_Face *f = XFACE (obj);
192 193
193 if (EQ (prop, Qforeground) || 194 if (EQ (prop, Qforeground) ||
194 EQ (prop, Qbackground) || 195 EQ (prop, Qbackground) ||
195 EQ (prop, Qfont) || 196 EQ (prop, Qfont) ||
196 EQ (prop, Qdisplay_table) || 197 EQ (prop, Qdisplay_table) ||
216 } 217 }
217 218
218 static int 219 static int
219 face_remprop (Lisp_Object obj, Lisp_Object prop) 220 face_remprop (Lisp_Object obj, Lisp_Object prop)
220 { 221 {
221 Lisp_Face *f = XFACE (obj); 222 struct Lisp_Face *f = XFACE (obj);
222 223
223 if (EQ (prop, Qforeground) || 224 if (EQ (prop, Qforeground) ||
224 EQ (prop, Qbackground) || 225 EQ (prop, Qbackground) ||
225 EQ (prop, Qfont) || 226 EQ (prop, Qfont) ||
226 EQ (prop, Qdisplay_table) || 227 EQ (prop, Qdisplay_table) ||
243 } 244 }
244 245
245 static Lisp_Object 246 static Lisp_Object
246 face_plist (Lisp_Object obj) 247 face_plist (Lisp_Object obj)
247 { 248 {
248 Lisp_Face *face = XFACE (obj); 249 struct Lisp_Face *face = XFACE (obj);
249 Lisp_Object result = face->plist; 250 Lisp_Object result = face->plist;
250 251
251 result = cons3 (Qreverse, face->reverse, result); 252 result = cons3 (Qreverse, face->reverse, result);
252 result = cons3 (Qblinking, face->blinking, result); 253 result = cons3 (Qblinking, face->blinking, result);
253 result = cons3 (Qdim, face->dim, result); 254 result = cons3 (Qdim, face->dim, result);
261 result = cons3 (Qforeground, face->foreground, result); 262 result = cons3 (Qforeground, face->foreground, result);
262 263
263 return result; 264 return result;
264 } 265 }
265 266
266 static const struct lrecord_description face_description[] = {
267 { XD_LISP_OBJECT, offsetof (Lisp_Face, name) },
268 { XD_LISP_OBJECT, offsetof (Lisp_Face, doc_string) },
269 { XD_LISP_OBJECT, offsetof (Lisp_Face, foreground) },
270 { XD_LISP_OBJECT, offsetof (Lisp_Face, background) },
271 { XD_LISP_OBJECT, offsetof (Lisp_Face, font) },
272 { XD_LISP_OBJECT, offsetof (Lisp_Face, display_table) },
273 { XD_LISP_OBJECT, offsetof (Lisp_Face, background_pixmap) },
274 { XD_LISP_OBJECT, offsetof (Lisp_Face, underline) },
275 { XD_LISP_OBJECT, offsetof (Lisp_Face, strikethru) },
276 { XD_LISP_OBJECT, offsetof (Lisp_Face, highlight) },
277 { XD_LISP_OBJECT, offsetof (Lisp_Face, dim) },
278 { XD_LISP_OBJECT, offsetof (Lisp_Face, blinking) },
279 { XD_LISP_OBJECT, offsetof (Lisp_Face, reverse) },
280 { XD_LISP_OBJECT, offsetof (Lisp_Face, plist) },
281 { XD_LISP_OBJECT, offsetof (Lisp_Face, charsets_warned_about) },
282 { XD_END }
283 };
284
285 DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, 267 DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face,
286 mark_face, print_face, 0, face_equal, 268 mark_face, print_face, 0, face_equal,
287 face_hash, face_description, face_getprop, 269 face_hash, face_getprop,
288 face_putprop, face_remprop, 270 face_putprop, face_remprop,
289 face_plist, Lisp_Face); 271 face_plist, struct Lisp_Face);
290 272
291 /************************************************************************/ 273 /************************************************************************/
292 /* face read syntax */ 274 /* face read syntax */
293 /************************************************************************/ 275 /************************************************************************/
294 276
350 /**************************************************************************** 332 /****************************************************************************
351 * utility functions * 333 * utility functions *
352 ****************************************************************************/ 334 ****************************************************************************/
353 335
354 static void 336 static void
355 reset_face (Lisp_Face *f) 337 reset_face (struct Lisp_Face *f)
356 { 338 {
357 f->name = Qnil; 339 f->name = Qnil;
358 f->doc_string = Qnil; 340 f->doc_string = Qnil;
359 f->dirty = 0; 341 f->dirty = 0;
360 f->foreground = Qnil; 342 f->foreground = Qnil;
370 f->reverse = Qnil; 352 f->reverse = Qnil;
371 f->plist = Qnil; 353 f->plist = Qnil;
372 f->charsets_warned_about = Qnil; 354 f->charsets_warned_about = Qnil;
373 } 355 }
374 356
375 static Lisp_Face * 357 static struct Lisp_Face *
376 allocate_face (void) 358 allocate_face (void)
377 { 359 {
378 Lisp_Face *result = alloc_lcrecord_type (Lisp_Face, &lrecord_face); 360 struct Lisp_Face *result =
361 alloc_lcrecord_type (struct Lisp_Face, &lrecord_face);
379 362
380 reset_face (result); 363 reset_face (result);
381 return result; 364 return result;
382 } 365 }
383 366
494 477
495 UNGCPRO; 478 UNGCPRO;
496 } 479 }
497 480
498 static int 481 static int
499 update_face_inheritance_mapper (const void *hash_key, void *hash_contents, 482 update_face_inheritance_mapper (CONST void *hash_key, void *hash_contents,
500 void *face_inheritance_closure) 483 void *face_inheritance_closure)
501 { 484 {
502 Lisp_Object key, contents; 485 Lisp_Object key, contents;
503 struct face_inheritance_closure *fcl = 486 struct face_inheritance_closure *fcl =
504 (struct face_inheritance_closure *) face_inheritance_closure; 487 (struct face_inheritance_closure *) face_inheritance_closure;
768 If TEMPORARY is non-nil, this face will cease to exist if not in use. 751 If TEMPORARY is non-nil, this face will cease to exist if not in use.
769 */ 752 */
770 (name, doc_string, temporary)) 753 (name, doc_string, temporary))
771 { 754 {
772 /* This function can GC if initialized is non-zero */ 755 /* This function can GC if initialized is non-zero */
773 Lisp_Face *f; 756 struct Lisp_Face *f;
774 Lisp_Object face; 757 Lisp_Object face;
775 758
776 CHECK_SYMBOL (name); 759 CHECK_SYMBOL (name);
777 if (!NILP (doc_string)) 760 if (!NILP (doc_string))
778 CHECK_STRING (doc_string); 761 CHECK_STRING (doc_string);
996 */ 979 */
997 980
998 /* mark for GC a dynarr of face cachels. */ 981 /* mark for GC a dynarr of face cachels. */
999 982
1000 void 983 void
1001 mark_face_cachels (face_cachel_dynarr *elements) 984 mark_face_cachels (face_cachel_dynarr *elements,
985 void (*markobj) (Lisp_Object))
1002 { 986 {
1003 int elt; 987 int elt;
1004 988
1005 if (!elements) 989 if (!elements)
1006 return; 990 return;
1012 { 996 {
1013 int i; 997 int i;
1014 998
1015 for (i = 0; i < NUM_LEADING_BYTES; i++) 999 for (i = 0; i < NUM_LEADING_BYTES; i++)
1016 if (!NILP (cachel->font[i]) && !UNBOUNDP (cachel->font[i])) 1000 if (!NILP (cachel->font[i]) && !UNBOUNDP (cachel->font[i]))
1017 mark_object (cachel->font[i]); 1001 markobj (cachel->font[i]);
1018 } 1002 }
1019 mark_object (cachel->face); 1003 markobj (cachel->face);
1020 mark_object (cachel->foreground); 1004 markobj (cachel->foreground);
1021 mark_object (cachel->background); 1005 markobj (cachel->background);
1022 mark_object (cachel->display_table); 1006 markobj (cachel->display_table);
1023 mark_object (cachel->background_pixmap); 1007 markobj (cachel->background_pixmap);
1024 } 1008 }
1025 } 1009 }
1026 1010
1027 /* ensure that the given cachel contains an updated font value for 1011 /* ensure that the given cachel contains an updated font value for
1028 the given charset. Return the updated font value. */ 1012 the given charset. Return the updated font value. */
1136 { 1120 {
1137 if (charsets[i]) 1121 if (charsets[i])
1138 { 1122 {
1139 Lisp_Object charset = CHARSET_BY_LEADING_BYTE (i + MIN_LEADING_BYTE); 1123 Lisp_Object charset = CHARSET_BY_LEADING_BYTE (i + MIN_LEADING_BYTE);
1140 Lisp_Object font_instance = FACE_CACHEL_FONT (cachel, charset); 1124 Lisp_Object font_instance = FACE_CACHEL_FONT (cachel, charset);
1141 Lisp_Font_Instance *fi = XFONT_INSTANCE (font_instance); 1125 struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font_instance);
1142 1126
1143 assert (CHARSETP (charset)); 1127 assert (CHARSETP (charset));
1144 assert (FONT_INSTANCEP (font_instance)); 1128 assert (FONT_INSTANCEP (font_instance));
1145 1129
1146 if (fm->ascent < (int) fi->ascent) fm->ascent = (int) fi->ascent; 1130 if (fm->ascent < (int) fi->ascent) fm->ascent = (int) fi->ascent;
1688 or makes an already-existing face be exactly like another. 1672 or makes an already-existing face be exactly like another.
1689 LOCALE, TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'. 1673 LOCALE, TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'.
1690 */ 1674 */
1691 (old_face, new_name, locale, tag_set, exact_p, how_to_add)) 1675 (old_face, new_name, locale, tag_set, exact_p, how_to_add))
1692 { 1676 {
1693 Lisp_Face *fold, *fnew; 1677 struct Lisp_Face *fold, *fnew;
1694 Lisp_Object new_face = Qnil; 1678 Lisp_Object new_face = Qnil;
1695 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1679 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1696 1680
1697 old_face = Fget_face (old_face); 1681 old_face = Fget_face (old_face);
1698 1682
1750 1734
1751 1735
1752 void 1736 void
1753 syms_of_faces (void) 1737 syms_of_faces (void)
1754 { 1738 {
1755 INIT_LRECORD_IMPLEMENTATION (face); 1739 /* Qdefault & Qwidget defined in general.c */
1756
1757 /* Qdefault, Qwidget, Qleft_margin, Qright_margin defined in general.c */
1758 defsymbol (&Qmodeline, "modeline"); 1740 defsymbol (&Qmodeline, "modeline");
1759 defsymbol (&Qgui_element, "gui-element"); 1741 defsymbol (&Qgui_element, "gui-element");
1742 defsymbol (&Qleft_margin, "left-margin");
1743 defsymbol (&Qright_margin, "right-margin");
1760 defsymbol (&Qtext_cursor, "text-cursor"); 1744 defsymbol (&Qtext_cursor, "text-cursor");
1761 defsymbol (&Qvertical_divider, "vertical-divider"); 1745 defsymbol (&Qvertical_divider, "vertical-divider");
1762 1746
1763 DEFSUBR (Ffacep); 1747 DEFSUBR (Ffacep);
1764 DEFSUBR (Ffind_face); 1748 DEFSUBR (Ffind_face);
1876 #ifdef HAVE_TTY 1860 #ifdef HAVE_TTY
1877 fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb); 1861 fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb);
1878 bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb); 1862 bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb);
1879 #endif 1863 #endif
1880 #ifdef HAVE_MS_WINDOWS 1864 #ifdef HAVE_MS_WINDOWS
1881 fg_fb = acons (list1 (Qmsprinter), build_string ("black"), fg_fb);
1882 bg_fb = acons (list1 (Qmsprinter), build_string ("white"), bg_fb);
1883 fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb); 1865 fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb);
1884 bg_fb = acons (list1 (Qmswindows), build_string ("white"), bg_fb); 1866 bg_fb = acons (list1 (Qmswindows), build_string ("white"), bg_fb);
1885 #endif 1867 #endif
1886 set_specifier_fallback (Fget (Vdefault_face, Qforeground, Qnil), fg_fb); 1868 set_specifier_fallback (Fget (Vdefault_face, Qforeground, Qnil), fg_fb);
1887 set_specifier_fallback (Fget (Vdefault_face, Qbackground, Qnil), bg_fb); 1869 set_specifier_fallback (Fget (Vdefault_face, Qbackground, Qnil), bg_fb);
1894 #ifdef HAVE_X_WINDOWS 1876 #ifdef HAVE_X_WINDOWS
1895 /* The same gory list from x-faces.el. 1877 /* The same gory list from x-faces.el.
1896 (#### Perhaps we should remove the stuff from x-faces.el 1878 (#### Perhaps we should remove the stuff from x-faces.el
1897 and only depend on this stuff here? That should work.) 1879 and only depend on this stuff here? That should work.)
1898 */ 1880 */
1899 const char *fonts[] = 1881 CONST char *fonts[] =
1900 { 1882 {
1901 "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*", 1883 "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*",
1902 "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*", 1884 "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*",
1903 "-*-courier-*-r-*-*-*-120-*-*-*-*-iso8859-*", 1885 "-*-courier-*-r-*-*-*-120-*-*-*-*-iso8859-*",
1904 "-*-*-medium-r-*-*-*-120-*-*-m-*-iso8859-*", 1886 "-*-*-medium-r-*-*-*-120-*-*-m-*-iso8859-*",
1912 "-*-*-*-r-*-*-*-120-*-*-c-*-*-*", 1894 "-*-*-*-r-*-*-*-120-*-*-c-*-*-*",
1913 "-*-*-*-r-*-*-*-120-*-*-*-*-*-*", 1895 "-*-*-*-r-*-*-*-120-*-*-*-*-*-*",
1914 "-*-*-*-*-*-*-*-120-*-*-*-*-*-*", 1896 "-*-*-*-*-*-*-*-120-*-*-*-*-*-*",
1915 "*" 1897 "*"
1916 }; 1898 };
1917 const char **fontptr; 1899 CONST char **fontptr;
1918 1900
1919 for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--) 1901 for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--)
1920 inst_list = Fcons (Fcons (list1 (Qx), build_string (*fontptr)), 1902 inst_list = Fcons (Fcons (list1 (Qx), build_string (*fontptr)),
1921 inst_list); 1903 inst_list);
1922 #endif /* HAVE_X_WINDOWS */ 1904 #endif /* HAVE_X_WINDOWS */
1924 #ifdef HAVE_TTY 1906 #ifdef HAVE_TTY
1925 inst_list = Fcons (Fcons (list1 (Qtty), build_string ("normal")), 1907 inst_list = Fcons (Fcons (list1 (Qtty), build_string ("normal")),
1926 inst_list); 1908 inst_list);
1927 #endif /* HAVE_TTY */ 1909 #endif /* HAVE_TTY */
1928 #ifdef HAVE_MS_WINDOWS 1910 #ifdef HAVE_MS_WINDOWS
1929 /* Fixedsys does not exist for printers */
1930 inst_list = Fcons (Fcons (list1 (Qmsprinter),
1931 build_string ("Courier:Regular:10::Western")), inst_list);
1932 inst_list = Fcons (Fcons (list1 (Qmsprinter),
1933 build_string ("Courier New:Regular:10::Western")), inst_list);
1934
1935 inst_list = Fcons (Fcons (list1 (Qmswindows), 1911 inst_list = Fcons (Fcons (list1 (Qmswindows),
1936 build_string ("Fixedsys:Regular:9::Western")), inst_list); 1912 build_string ("Fixedsys:Regular:9::Western")), inst_list);
1937 inst_list = Fcons (Fcons (list1 (Qmswindows), 1913 inst_list = Fcons (Fcons (list1 (Qmswindows),
1938 build_string ("Courier:Regular:10::Western")), inst_list); 1914 build_string ("Courier:Regular:10::Western")), inst_list);
1939 inst_list = Fcons (Fcons (list1 (Qmswindows), 1915 inst_list = Fcons (Fcons (list1 (Qmswindows),
1973 #ifdef HAVE_TTY 1949 #ifdef HAVE_TTY
1974 fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb); 1950 fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb);
1975 bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb); 1951 bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb);
1976 #endif 1952 #endif
1977 #ifdef HAVE_MS_WINDOWS 1953 #ifdef HAVE_MS_WINDOWS
1978 fg_fb = acons (list1 (Qmsprinter), build_string ("black"), fg_fb);
1979 bg_fb = acons (list1 (Qmsprinter), build_string ("white"), bg_fb);
1980 fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb); 1954 fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb);
1981 bg_fb = acons (list1 (Qmswindows), build_string ("Gray75"), bg_fb); 1955 bg_fb = acons (list1 (Qmswindows), build_string ("Gray75"), bg_fb);
1982 #endif 1956 #endif
1983 set_specifier_fallback (Fget (Vgui_element_face, Qforeground, Qnil), fg_fb); 1957 set_specifier_fallback (Fget (Vgui_element_face, Qforeground, Qnil), fg_fb);
1984 set_specifier_fallback (Fget (Vgui_element_face, Qbackground, Qnil), bg_fb); 1958 set_specifier_fallback (Fget (Vgui_element_face, Qbackground, Qnil), bg_fb);
2028 2002
2029 /* widget is another gui element */ 2003 /* widget is another gui element */
2030 Vwidget_face = Fmake_face (Qwidget, 2004 Vwidget_face = Fmake_face (Qwidget,
2031 build_string ("widget face"), 2005 build_string ("widget face"),
2032 Qnil); 2006 Qnil);
2033 set_specifier_fallback (Fget (Vwidget_face, Qfont, Qunbound),
2034 Fget (Vgui_element_face, Qfont, Qunbound));
2035 set_specifier_fallback (Fget (Vwidget_face, Qforeground, Qunbound), 2007 set_specifier_fallback (Fget (Vwidget_face, Qforeground, Qunbound),
2036 Fget (Vgui_element_face, Qforeground, Qunbound)); 2008 Fget (Vgui_element_face, Qforeground, Qunbound));
2037 set_specifier_fallback (Fget (Vwidget_face, Qbackground, Qunbound), 2009 set_specifier_fallback (Fget (Vwidget_face, Qbackground, Qunbound),
2038 Fget (Vgui_element_face, Qbackground, Qunbound)); 2010 Fget (Vgui_element_face, Qbackground, Qunbound));
2039 /* We don't want widgets to have a default background pixmap. */ 2011 set_specifier_fallback (Fget (Vwidget_face, Qbackground_pixmap, Qnil),
2012 Fget (Vgui_element_face, Qbackground_pixmap,
2013 Qunbound));
2040 2014
2041 Vleft_margin_face = Fmake_face (Qleft_margin, 2015 Vleft_margin_face = Fmake_face (Qleft_margin,
2042 build_string ("left margin face"), 2016 build_string ("left margin face"),
2043 Qnil); 2017 Qnil);
2044 Vright_margin_face = Fmake_face (Qright_margin, 2018 Vright_margin_face = Fmake_face (Qright_margin,