comparison src/faces.c @ 424:11054d720c21 r21-2-20

Import from CVS: tag r21-2-20
author cvs
date Mon, 13 Aug 2007 11:26:11 +0200
parents 41dbb7a9d5f2
children
comparison
equal deleted inserted replaced
423:28d9c139be4c 424:11054d720c21
71 Lisp_Object Vbuilt_in_face_specifiers; 71 Lisp_Object Vbuilt_in_face_specifiers;
72 72
73 73
74 74
75 static Lisp_Object 75 static Lisp_Object
76 mark_face (Lisp_Object obj, void (*markobj) (Lisp_Object)) 76 mark_face (Lisp_Object obj)
77 { 77 {
78 struct Lisp_Face *face = XFACE (obj); 78 struct Lisp_Face *face = XFACE (obj);
79 79
80 markobj (face->name); 80 mark_object (face->name);
81 markobj (face->doc_string); 81 mark_object (face->doc_string);
82 82
83 markobj (face->foreground); 83 mark_object (face->foreground);
84 markobj (face->background); 84 mark_object (face->background);
85 markobj (face->font); 85 mark_object (face->font);
86 markobj (face->display_table); 86 mark_object (face->display_table);
87 markobj (face->background_pixmap); 87 mark_object (face->background_pixmap);
88 markobj (face->underline); 88 mark_object (face->underline);
89 markobj (face->strikethru); 89 mark_object (face->strikethru);
90 markobj (face->highlight); 90 mark_object (face->highlight);
91 markobj (face->dim); 91 mark_object (face->dim);
92 markobj (face->blinking); 92 mark_object (face->blinking);
93 markobj (face->reverse); 93 mark_object (face->reverse);
94 94
95 markobj (face->charsets_warned_about); 95 mark_object (face->charsets_warned_about);
96 96
97 return face->plist; 97 return face->plist;
98 } 98 }
99 99
100 static void 100 static void
169 face_getprop (Lisp_Object obj, Lisp_Object prop) 169 face_getprop (Lisp_Object obj, Lisp_Object prop)
170 { 170 {
171 struct Lisp_Face *f = XFACE (obj); 171 struct Lisp_Face *f = XFACE (obj);
172 172
173 return 173 return
174 ((EQ (prop, Qforeground)) ? f->foreground : 174 (EQ (prop, Qforeground) ? f->foreground :
175 (EQ (prop, Qbackground)) ? f->background : 175 EQ (prop, Qbackground) ? f->background :
176 (EQ (prop, Qfont)) ? f->font : 176 EQ (prop, Qfont) ? f->font :
177 (EQ (prop, Qdisplay_table)) ? f->display_table : 177 EQ (prop, Qdisplay_table) ? f->display_table :
178 (EQ (prop, Qbackground_pixmap)) ? f->background_pixmap : 178 EQ (prop, Qbackground_pixmap) ? f->background_pixmap :
179 (EQ (prop, Qunderline)) ? f->underline : 179 EQ (prop, Qunderline) ? f->underline :
180 (EQ (prop, Qstrikethru)) ? f->strikethru : 180 EQ (prop, Qstrikethru) ? f->strikethru :
181 (EQ (prop, Qhighlight)) ? f->highlight : 181 EQ (prop, Qhighlight) ? f->highlight :
182 (EQ (prop, Qdim)) ? f->dim : 182 EQ (prop, Qdim) ? f->dim :
183 (EQ (prop, Qblinking)) ? f->blinking : 183 EQ (prop, Qblinking) ? f->blinking :
184 (EQ (prop, Qreverse)) ? f->reverse : 184 EQ (prop, Qreverse) ? f->reverse :
185 (EQ (prop, Qdoc_string)) ? f->doc_string : 185 EQ (prop, Qdoc_string) ? f->doc_string :
186 external_plist_get (&f->plist, prop, 0, ERROR_ME)); 186 external_plist_get (&f->plist, prop, 0, ERROR_ME));
187 } 187 }
188 188
189 static int 189 static int
190 face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value) 190 face_putprop (Lisp_Object obj, Lisp_Object prop, Lisp_Object value)
262 result = cons3 (Qforeground, face->foreground, result); 262 result = cons3 (Qforeground, face->foreground, result);
263 263
264 return result; 264 return result;
265 } 265 }
266 266
267 static const struct lrecord_description face_description[] = {
268 { XD_LISP_OBJECT, offsetof(struct Lisp_Face, name), 2 },
269 { XD_LISP_OBJECT, offsetof(struct Lisp_Face, foreground), 13 },
270 { XD_END }
271 };
272
267 DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, 273 DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face,
268 mark_face, print_face, 0, face_equal, 274 mark_face, print_face, 0, face_equal,
269 face_hash, 0, face_getprop, 275 face_hash, face_description, face_getprop,
270 face_putprop, face_remprop, 276 face_putprop, face_remprop,
271 face_plist, struct Lisp_Face); 277 face_plist, struct Lisp_Face);
272 278
273 /************************************************************************/ 279 /************************************************************************/
274 /* face read syntax */ 280 /* face read syntax */
979 */ 985 */
980 986
981 /* mark for GC a dynarr of face cachels. */ 987 /* mark for GC a dynarr of face cachels. */
982 988
983 void 989 void
984 mark_face_cachels (face_cachel_dynarr *elements, 990 mark_face_cachels (face_cachel_dynarr *elements)
985 void (*markobj) (Lisp_Object))
986 { 991 {
987 int elt; 992 int elt;
988 993
989 if (!elements) 994 if (!elements)
990 return; 995 return;
996 { 1001 {
997 int i; 1002 int i;
998 1003
999 for (i = 0; i < NUM_LEADING_BYTES; i++) 1004 for (i = 0; i < NUM_LEADING_BYTES; i++)
1000 if (!NILP (cachel->font[i]) && !UNBOUNDP (cachel->font[i])) 1005 if (!NILP (cachel->font[i]) && !UNBOUNDP (cachel->font[i]))
1001 markobj (cachel->font[i]); 1006 mark_object (cachel->font[i]);
1002 } 1007 }
1003 markobj (cachel->face); 1008 mark_object (cachel->face);
1004 markobj (cachel->foreground); 1009 mark_object (cachel->foreground);
1005 markobj (cachel->background); 1010 mark_object (cachel->background);
1006 markobj (cachel->display_table); 1011 mark_object (cachel->display_table);
1007 markobj (cachel->background_pixmap); 1012 mark_object (cachel->background_pixmap);
1008 } 1013 }
1009 } 1014 }
1010 1015
1011 /* ensure that the given cachel contains an updated font value for 1016 /* ensure that the given cachel contains an updated font value for
1012 the given charset. Return the updated font value. */ 1017 the given charset. Return the updated font value. */