Re: defs spec



Soeren Sandmann <sandmann daimi au dk> writes:

> 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.

Having language bindings that do subclassing being able to
generate the code to implement virtual methods from the
.defs files is probably interesting, at least eventually.

Note, however, that in the GTK+ model, the virtual function
(say GtkWidget->event), is always a "protected" function
which is distinct from the wrapper function, if any.
(gtk_widget_event()) They may have different signatures,
and the wrapper may perform significant tasks.

So, if you were going to handle this, you'd have to:

 a) Define the virtual functions separately
 b) Have a consistent renaming scheme for them 
    (say, GtkWidget::do_event, or GtkWidget::on_event)

Regards,
                                        Owen




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