Re: Using standard type macro names in bonobo-object



Er, sorry, that was a sort of incoherent ill-formed message. (comes of
writing things late at night).

Can I check in the below patch that adds BONOBO_TYPE_OBJECT as an
equivalent of BONOBO_OBJECT_TYPE ? It helps programs like gob which
expect a particular structure to the type macro.

-seth

On Sat, 2001-10-27 at 01:59, Seth Nickell wrote:
> Michael,
> 
> BonoboObject uses the type macro BONOBO_OBJECT_TYPE(). I don't know if
> there's an official standard for this or not, but almost everywhere in
> GNOME (bonobo included) the convention seems to be dictate
> PACKAGE_TYPE_.... (so e.g. BONOBO_TYPE_OBJECT). As far as I can tell
> this is the only place in Bonobo where this convention is used.
> 
> It would be great if we could change to using BONOBO_TYPE_OBJECT()
> everywhere, or, probably safer at the current stage, add
> BONOBO_TYPE_OBJECT as an alternate form (probably deprecating
> BONOBO_OBJECT_TYPE but leaving it defined for now).
> 
> This doesn't really cause an problems for a human, but it is pretty
> annoying for things like GOB which rely on naming conventions to be able
> to sensibly parse pre-processor. Previously GOB used the get_type()
> functions but for GOB2 has switched to using the macros (which I think
> are the "official" type method, not the type functions).
> 
> I've attached a patch which fixes the problem one possible way, dunno
> how you'd prefer it done, but it'd be great to get this fixed (the patch
> is for Bonobo2).
> 
> cheers,
> 
> -Seth
> ----
> 

> ? bonobo_patch
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/libbonobo/ChangeLog,v
> retrieving revision 1.219
> diff -u -p -r1.219 ChangeLog
> --- ChangeLog	2001/10/27 08:19:23	1.219
> +++ ChangeLog	2001/10/27 08:55:58
> @@ -1,3 +1,12 @@
> +2001-10-27  Seth Nickell  <snickell stanford edu>
> +
> +	* bonobo/bonobo-object.h:
> +
> +	Add BONOBO_TYPE_OBJECT() and turn BONOBO_OBJECT_TYPE()
> +	just be a wrapper for it (fixes gob problems, and
> +	makes the naming convention more consistent with the
> +	rest of GNOME).
> +
>  2001-10-27 Dirk-Jan C. Binnema <djcb djcbsoftware nl>
>  
>  	* bonobo/bonobo-moniker.c (bonobo_moniker_default_equal):
> Index: bonobo/bonobo-object.h
> ===================================================================
> RCS file: /cvs/gnome/libbonobo/bonobo/bonobo-object.h,v
> retrieving revision 1.71
> diff -u -p -r1.71 bonobo-object.h
> --- bonobo/bonobo-object.h	2001/10/25 01:01:36	1.71
> +++ bonobo/bonobo-object.h	2001/10/27 08:55:58
> @@ -21,7 +21,8 @@ G_BEGIN_DECLS
>  
>  #undef BONOBO_OBJECT_DEBUG
>   
> -#define BONOBO_OBJECT_TYPE        (bonobo_object_get_type ())
> +#define BONOBO_TYPE_OBJECT        (bonobo_object_get_type ())
> +#define BONOBO_OBJECT_TYPE        BONOBO_TYPE_OBJECT
>  #define BONOBO_OBJECT(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), BONOBO_OBJECT_TYPE, BonoboObject))
>  #define BONOBO_OBJECT_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), BONOBO_OBJECT_TYPE, BonoboObjectClass))
>  #define BONOBO_IS_OBJECT(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), BONOBO_OBJECT_TYPE))





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]