Re: bonobo_x_object



On Wed, May 02, 2001 at 12:15:33PM -0400, Michael Meeks wrote:
> On Sat, 21 Apr 2001, George wrote:
> >         BonoboX
> >         private void
> >         fooBar (PortableServer_Servant servant,
> >                 const CORBA_char *string,
> >                 CORBA_Environment *ev)
> >         {
> >                 Self *self = SELF (bonobo_object_from_servant (servant));
> 
>         I would reccommend using 'bonobo_x_object (servant)', since its a
> pretty fun routine. It detetects the pointer type by magic, so it should
> be possible to build it into the 'SELF' macro ie.
> 
>         Self *self = SELF (servant);
> 
>         Where SELF is:
> 
>         (OLD_SELF_MACRO (bonobo_x_object (o))
> 
>         Might help some people not have to understand the difference
> between a servant and the object itself.

Actually an even simpler way to do this (and in fact much nicer) would be:

        BonoboX
        private void
        fooBar (self,
                const CORBA_char *string,
                CORBA_Environment *ev)

So the self magic would be done automatically.  I'm thinking of doing this
in the next version since I already have another minor feature to add.  The
only issue here is that self is sort of a "macro" implemented in the parser,
but that's not such a huge issue though  I just have to use a different
macro for a BonoboX function, that's all.

George




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