X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Ffaces.c;h=c1a50a59577a340a9cea17804b4fa3f82a57f3f9;hb=59ca45fb82208b9758b0eb17b9ba670e5e53c240;hp=732c0188ac7434ac79306b7e445d56ccee6d4c8f;hpb=a71e0987b7080176e0046b0b0ed72a9a70e2571d;p=chise%2Fxemacs-chise.git- diff --git a/src/faces.c b/src/faces.c index 732c018..c1a50a5 100644 --- a/src/faces.c +++ b/src/faces.c @@ -73,26 +73,26 @@ Lisp_Object Vbuilt_in_face_specifiers; static Lisp_Object -mark_face (Lisp_Object obj, void (*markobj) (Lisp_Object)) +mark_face (Lisp_Object obj) { struct Lisp_Face *face = XFACE (obj); - markobj (face->name); - markobj (face->doc_string); + mark_object (face->name); + mark_object (face->doc_string); - markobj (face->foreground); - markobj (face->background); - markobj (face->font); - markobj (face->display_table); - markobj (face->background_pixmap); - markobj (face->underline); - markobj (face->strikethru); - markobj (face->highlight); - markobj (face->dim); - markobj (face->blinking); - markobj (face->reverse); + mark_object (face->foreground); + mark_object (face->background); + mark_object (face->font); + mark_object (face->display_table); + mark_object (face->background_pixmap); + mark_object (face->underline); + mark_object (face->strikethru); + mark_object (face->highlight); + mark_object (face->dim); + mark_object (face->blinking); + mark_object (face->reverse); - markobj (face->charsets_warned_about); + mark_object (face->charsets_warned_about); return face->plist; } @@ -171,18 +171,18 @@ face_getprop (Lisp_Object obj, Lisp_Object prop) struct Lisp_Face *f = XFACE (obj); return - ((EQ (prop, Qforeground)) ? f->foreground : - (EQ (prop, Qbackground)) ? f->background : - (EQ (prop, Qfont)) ? f->font : - (EQ (prop, Qdisplay_table)) ? f->display_table : - (EQ (prop, Qbackground_pixmap)) ? f->background_pixmap : - (EQ (prop, Qunderline)) ? f->underline : - (EQ (prop, Qstrikethru)) ? f->strikethru : - (EQ (prop, Qhighlight)) ? f->highlight : - (EQ (prop, Qdim)) ? f->dim : - (EQ (prop, Qblinking)) ? f->blinking : - (EQ (prop, Qreverse)) ? f->reverse : - (EQ (prop, Qdoc_string)) ? f->doc_string : + (EQ (prop, Qforeground) ? f->foreground : + EQ (prop, Qbackground) ? f->background : + EQ (prop, Qfont) ? f->font : + EQ (prop, Qdisplay_table) ? f->display_table : + EQ (prop, Qbackground_pixmap) ? f->background_pixmap : + EQ (prop, Qunderline) ? f->underline : + EQ (prop, Qstrikethru) ? f->strikethru : + EQ (prop, Qhighlight) ? f->highlight : + EQ (prop, Qdim) ? f->dim : + EQ (prop, Qblinking) ? f->blinking : + EQ (prop, Qreverse) ? f->reverse : + EQ (prop, Qdoc_string) ? f->doc_string : external_plist_get (&f->plist, prop, 0, ERROR_ME)); } @@ -264,9 +264,15 @@ face_plist (Lisp_Object obj) return result; } +static const struct lrecord_description face_description[] = { + { XD_LISP_OBJECT, offsetof(struct Lisp_Face, name), 2 }, + { XD_LISP_OBJECT, offsetof(struct Lisp_Face, foreground), 13 }, + { XD_END } +}; + DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("face", face, mark_face, print_face, 0, face_equal, - face_hash, 0, face_getprop, + face_hash, face_description, face_getprop, face_putprop, face_remprop, face_plist, struct Lisp_Face); @@ -981,8 +987,7 @@ Here's an approach that should keep things clean and unconfused: /* mark for GC a dynarr of face cachels. */ void -mark_face_cachels (face_cachel_dynarr *elements, - void (*markobj) (Lisp_Object)) +mark_face_cachels (face_cachel_dynarr *elements) { int elt; @@ -998,13 +1003,13 @@ mark_face_cachels (face_cachel_dynarr *elements, for (i = 0; i < NUM_LEADING_BYTES; i++) if (!NILP (cachel->font[i]) && !UNBOUNDP (cachel->font[i])) - markobj (cachel->font[i]); + mark_object (cachel->font[i]); } - markobj (cachel->face); - markobj (cachel->foreground); - markobj (cachel->background); - markobj (cachel->display_table); - markobj (cachel->background_pixmap); + mark_object (cachel->face); + mark_object (cachel->foreground); + mark_object (cachel->background); + mark_object (cachel->display_table); + mark_object (cachel->background_pixmap); } } @@ -1091,7 +1096,7 @@ ensure_face_cachel_contains_charset (struct face_cachel *cachel, void ensure_face_cachel_complete (struct face_cachel *cachel, - Lisp_Object domain, unsigned char *charsets) + Lisp_Object domain, Charset_ID *charsets) { int i; @@ -1106,7 +1111,7 @@ ensure_face_cachel_complete (struct face_cachel *cachel, void face_cachel_charset_font_metric_info (struct face_cachel *cachel, - unsigned char *charsets, + Charset_ID *charsets, struct font_metric_info *fm) { int i;