Re: defs spec



On 5 Jul 2001, Soeren Sandmann wrote:

> James Henstridge <james daa com au> writes:
>
> > methods defined with (define-method ...) are just C functions that take a
> > particular structure as their first argument.  If there is any
> > virtualisation for a particular function, it is done within gtk, so not
> > relevant to the definitions. (remember that this is a spec for describing
> > C interfaces that resemble gtk's API).
>
> A language binding could for each GSomeObject automatically generate a
> subclass GSomeObjectWrapped where all the virtual functions were
> mapped to virtual functions in the language.  Then it would be
> possible to subclass and override virtual functions with classes
> defined in the language.
>
> Ok, this is probably stretching the spec too far.

I think this sort of thing should be left up to the language binding.
Note that overriding methods like this is not going to be that simple.
If gtk+ (or some other bit of C code) calls the function/method on the
GObject, it isn't going to see your overriden method, so your code may
only get executed some of the time.

>
> > Non abstract classes without constructors would correspond to objects that
> > can only be instantiated with g_object_new().  Is there any objects that
> > fall into this category in gtk+?  How about gnome?
>
> I think I saw such objects in BSE a long time ago.  But perhaps this
> should simply be considered evil with respect to wrappable API.

Okay.  I suppose we may as well leave it in, but say that it is optional.
Anyone disagree with that?

James.

-- 
Email: james daa com au
WWW:   http://www.daa.com.au/~james/






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