comparison src/glyphs.c @ 3017:1e7cc382eb16

[xemacs-hg @ 2005-10-24 10:07:26 by ben] refactor mc-alloc dependencies next-error.el, occur.el: Fix some byte-compile warnings. alloc.c, buffer.c, buffer.h, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, console-impl.h, console-msw-impl.h, console.c, data.c, database.c, device-impl.h, device-msw.c, device.c, dialog-msw.c, elhash.c, events.h, extents-impl.h, extents.c, faces.c, faces.h, file-coding.c, file-coding.h, frame-impl.h, frame.c, glyphs.c, glyphs.h, gui.c, gui.h, keymap.c, lisp.h, lrecord.h, lstream.c, lstream.h, mule-charset.c, objects-impl.h, objects.c, opaque.c, opaque.h, print.c, process.c, procimpl.h, rangetab.c, rangetab.h, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, specifier.c, specifier.h, symbols.c, symeval.h, toolbar.c, toolbar.h, tooltalk.c, ui-gtk.c, ui-gtk.h, unicode.c, window-impl.h, window.c: Eliminate the majority of #ifdef MC_ALLOC occurrences through macros LCRECORD_HEADER, ALLOC_LCRECORD_TYPE, MALLOCED_STORAGE_SIZE, etc. (defined in lrecord.h).
author ben
date Mon, 24 Oct 2005 10:07:42 +0000
parents 4eb2a8c07cb3
children 141c2920ea48 3742ea8250b5
comparison
equal deleted inserted replaced
3016:f252275fb013 3017:1e7cc382eb16
1324 static Lisp_Object 1324 static Lisp_Object
1325 allocate_image_instance (Lisp_Object governing_domain, Lisp_Object parent, 1325 allocate_image_instance (Lisp_Object governing_domain, Lisp_Object parent,
1326 Lisp_Object instantiator) 1326 Lisp_Object instantiator)
1327 { 1327 {
1328 Lisp_Image_Instance *lp = 1328 Lisp_Image_Instance *lp =
1329 #ifdef MC_ALLOC 1329 ALLOC_LCRECORD_TYPE (Lisp_Image_Instance, &lrecord_image_instance);
1330 alloc_lrecord_type (Lisp_Image_Instance, &lrecord_image_instance);
1331 #else /* not MC_ALLOC */
1332 alloc_lcrecord_type (Lisp_Image_Instance, &lrecord_image_instance);
1333 #endif /* not MC_ALLOC */
1334 Lisp_Object val; 1330 Lisp_Object val;
1335 1331
1336 /* It's not possible to simply keep a record of the domain in which 1332 /* It's not possible to simply keep a record of the domain in which
1337 the instance was instantiated. This is because caching may mean 1333 the instance was instantiated. This is because caching may mean
1338 that the domain becomes invalid but the instance remains 1334 that the domain becomes invalid but the instance remains
1995 1991
1996 /* #### There should be a copy_image_instance(), which calls a 1992 /* #### There should be a copy_image_instance(), which calls a
1997 device-specific method to copy the window-system subobject. */ 1993 device-specific method to copy the window-system subobject. */
1998 new_ = allocate_image_instance (XIMAGE_INSTANCE_DOMAIN (image_instance), 1994 new_ = allocate_image_instance (XIMAGE_INSTANCE_DOMAIN (image_instance),
1999 Qnil, Qnil); 1995 Qnil, Qnil);
2000 #ifdef MC_ALLOC 1996 COPY_LCRECORD (XIMAGE_INSTANCE (new_), XIMAGE_INSTANCE (image_instance));
2001 copy_lrecord (XIMAGE_INSTANCE (new_), XIMAGE_INSTANCE (image_instance));
2002 #else /* not MC_ALLOC */
2003 copy_lcrecord (XIMAGE_INSTANCE (new_), XIMAGE_INSTANCE (image_instance));
2004 #endif /* not MC_ALLOC */
2005 /* note that if this method returns non-zero, this method MUST 1997 /* note that if this method returns non-zero, this method MUST
2006 copy any window-system resources, so that when one image instance is 1998 copy any window-system resources, so that when one image instance is
2007 freed, the other one is not hosed. */ 1999 freed, the other one is not hosed. */
2008 if (!DEVMETH (XDEVICE (device), colorize_image_instance, (new_, foreground, 2000 if (!DEVMETH (XDEVICE (device), colorize_image_instance, (new_, foreground,
2009 background))) 2001 background)))
3812 void (*after_change) (Lisp_Object glyph, Lisp_Object property, 3804 void (*after_change) (Lisp_Object glyph, Lisp_Object property,
3813 Lisp_Object locale)) 3805 Lisp_Object locale))
3814 { 3806 {
3815 /* This function can GC */ 3807 /* This function can GC */
3816 Lisp_Object obj = Qnil; 3808 Lisp_Object obj = Qnil;
3817 #ifdef MC_ALLOC 3809 Lisp_Glyph *g = ALLOC_LCRECORD_TYPE (Lisp_Glyph, &lrecord_glyph);
3818 Lisp_Glyph *g = alloc_lrecord_type (Lisp_Glyph, &lrecord_glyph);
3819 #else /* not MC_ALLOC */
3820 Lisp_Glyph *g = alloc_lcrecord_type (Lisp_Glyph, &lrecord_glyph);
3821 #endif /* not MC_ALLOC */
3822 3810
3823 g->type = type; 3811 g->type = type;
3824 g->image = Fmake_specifier (Qimage); /* This function can GC */ 3812 g->image = Fmake_specifier (Qimage); /* This function can GC */
3825 g->dirty = 0; 3813 g->dirty = 0;
3826 switch (g->type) 3814 switch (g->type)