Mercurial > hg > xemacs-beta
comparison src/glyphs.c @ 5117:3742ea8250b5 ben-lisp-object ben-lisp-object-final-ws-year-2005
Checking in final CVS version of workspace 'ben-lisp-object'
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 00:20:27 -0600 |
parents | 1e7cc382eb16 |
children | e0db3c197671 |
comparison
equal
deleted
inserted
replaced
5116:e56f73345619 | 5117:3742ea8250b5 |
---|---|
1311 (XDEVICE (image_instance_device (obj)), | 1311 (XDEVICE (image_instance_device (obj)), |
1312 image_instance_hash, (i, depth), | 1312 image_instance_hash, (i, depth), |
1313 0)); | 1313 0)); |
1314 } | 1314 } |
1315 | 1315 |
1316 DEFINE_LRECORD_IMPLEMENTATION ("image-instance", image_instance, | 1316 DEFINE_NONDUMPABLE_LISP_OBJECT ("image-instance", image_instance, |
1317 0, /*dumpable-flag*/ | 1317 mark_image_instance, print_image_instance, |
1318 mark_image_instance, print_image_instance, | 1318 finalize_image_instance, image_instance_equal, |
1319 finalize_image_instance, image_instance_equal, | 1319 image_instance_hash, |
1320 image_instance_hash, | 1320 image_instance_description, |
1321 image_instance_description, | 1321 Lisp_Image_Instance); |
1322 Lisp_Image_Instance); | |
1323 | 1322 |
1324 static Lisp_Object | 1323 static Lisp_Object |
1325 allocate_image_instance (Lisp_Object governing_domain, Lisp_Object parent, | 1324 allocate_image_instance (Lisp_Object governing_domain, Lisp_Object parent, |
1326 Lisp_Object instantiator) | 1325 Lisp_Object instantiator) |
1327 { | 1326 { |
1328 Lisp_Image_Instance *lp = | 1327 Lisp_Object obj = ALLOC_LISP_OBJECT (image_instance); |
1329 ALLOC_LCRECORD_TYPE (Lisp_Image_Instance, &lrecord_image_instance); | 1328 Lisp_Image_Instance *lp = XIMAGE_INSTANCE (obj); |
1330 Lisp_Object val; | |
1331 | 1329 |
1332 /* It's not possible to simply keep a record of the domain in which | 1330 /* It's not possible to simply keep a record of the domain in which |
1333 the instance was instantiated. This is because caching may mean | 1331 the instance was instantiated. This is because caching may mean |
1334 that the domain becomes invalid but the instance remains | 1332 that the domain becomes invalid but the instance remains |
1335 valid. However, the only truly relevant domain is the domain in | 1333 valid. However, the only truly relevant domain is the domain in |
1348 lp->parent = parent; | 1346 lp->parent = parent; |
1349 lp->instantiator = instantiator; | 1347 lp->instantiator = instantiator; |
1350 /* So that layouts get done. */ | 1348 /* So that layouts get done. */ |
1351 lp->layout_changed = 1; | 1349 lp->layout_changed = 1; |
1352 | 1350 |
1353 val = wrap_image_instance (lp); | |
1354 MARK_GLYPHS_CHANGED; | 1351 MARK_GLYPHS_CHANGED; |
1355 | 1352 |
1356 return val; | 1353 return obj; |
1357 } | 1354 } |
1358 | 1355 |
1359 static enum image_instance_type | 1356 static enum image_instance_type |
1360 decode_image_instance_type (Lisp_Object type, Error_Behavior errb) | 1357 decode_image_instance_type (Lisp_Object type, Error_Behavior errb) |
1361 { | 1358 { |
3788 { XD_LISP_OBJECT, offsetof (Lisp_Glyph, face) }, | 3785 { XD_LISP_OBJECT, offsetof (Lisp_Glyph, face) }, |
3789 { XD_LISP_OBJECT, offsetof (Lisp_Glyph, plist) }, | 3786 { XD_LISP_OBJECT, offsetof (Lisp_Glyph, plist) }, |
3790 { XD_END } | 3787 { XD_END } |
3791 }; | 3788 }; |
3792 | 3789 |
3793 DEFINE_LRECORD_IMPLEMENTATION_WITH_PROPS ("glyph", glyph, | 3790 DEFINE_LISP_OBJECT_WITH_PROPS ("glyph", glyph, |
3794 1, /*dumpable-flag*/ | |
3795 mark_glyph, print_glyph, 0, | 3791 mark_glyph, print_glyph, 0, |
3796 glyph_equal, glyph_hash, | 3792 glyph_equal, glyph_hash, |
3797 glyph_description, | 3793 glyph_description, |
3798 glyph_getprop, glyph_putprop, | 3794 glyph_getprop, glyph_putprop, |
3799 glyph_remprop, glyph_plist, | 3795 glyph_remprop, glyph_plist, |
3803 allocate_glyph (enum glyph_type type, | 3799 allocate_glyph (enum glyph_type type, |
3804 void (*after_change) (Lisp_Object glyph, Lisp_Object property, | 3800 void (*after_change) (Lisp_Object glyph, Lisp_Object property, |
3805 Lisp_Object locale)) | 3801 Lisp_Object locale)) |
3806 { | 3802 { |
3807 /* This function can GC */ | 3803 /* This function can GC */ |
3808 Lisp_Object obj = Qnil; | 3804 Lisp_Object obj = ALLOC_LISP_OBJECT (glyph); |
3809 Lisp_Glyph *g = ALLOC_LCRECORD_TYPE (Lisp_Glyph, &lrecord_glyph); | 3805 Lisp_Glyph *g = XGLYPH (obj); |
3810 | 3806 |
3811 g->type = type; | 3807 g->type = type; |
3812 g->image = Fmake_specifier (Qimage); /* This function can GC */ | 3808 g->image = Fmake_specifier (Qimage); /* This function can GC */ |
3813 g->dirty = 0; | 3809 g->dirty = 0; |
3814 switch (g->type) | 3810 switch (g->type) |
3850 g->baseline = Fmake_specifier (Qgeneric); | 3846 g->baseline = Fmake_specifier (Qgeneric); |
3851 set_specifier_fallback (g->baseline, tem3); | 3847 set_specifier_fallback (g->baseline, tem3); |
3852 g->face = Qnil; | 3848 g->face = Qnil; |
3853 g->plist = Qnil; | 3849 g->plist = Qnil; |
3854 g->after_change = after_change; | 3850 g->after_change = after_change; |
3855 obj = wrap_glyph (g); | |
3856 | 3851 |
3857 set_image_attached_to (g->image, obj, Qimage); | 3852 set_image_attached_to (g->image, obj, Qimage); |
3858 UNGCPRO; | 3853 UNGCPRO; |
3859 } | 3854 } |
3860 | 3855 |
5121 *****************************************************************************/ | 5116 *****************************************************************************/ |
5122 | 5117 |
5123 void | 5118 void |
5124 syms_of_glyphs (void) | 5119 syms_of_glyphs (void) |
5125 { | 5120 { |
5126 INIT_LRECORD_IMPLEMENTATION (glyph); | 5121 INIT_LISP_OBJECT (glyph); |
5127 INIT_LRECORD_IMPLEMENTATION (image_instance); | 5122 INIT_LISP_OBJECT (image_instance); |
5128 | 5123 |
5129 /* image instantiators */ | 5124 /* image instantiators */ |
5130 | 5125 |
5131 DEFSUBR (Fimage_instantiator_format_list); | 5126 DEFSUBR (Fimage_instantiator_format_list); |
5132 DEFSUBR (Fvalid_image_instantiator_format_p); | 5127 DEFSUBR (Fvalid_image_instantiator_format_p); |