Re: ... arguments



On 9 Jun 1998, Tom Tromey wrote:

> Andreas> But how can I build up a vaarg list portably in a wrapping?
> Andreas> If not, then how these gnome functions are intended to be
> Andreas> used by language wrappings?
> 
> The short answer is: you can't.
Thought so. Just wanted to be sure that I didn't miss the one clever
portable thing ;)
> 
> On some systems you can probably use `libffi' to provide a wrapping.
Where can I find this beast?
> 
> However, since Gnome is free software, you can probably lobby to get
> it changed to be more friendly.  For instance, you could have a new
> interface added which implements the same functionality in a more
Yeah, I noticed that some functions already have v-versions (v probably
for vector?).
> wrapper-friendly way.  This will benefit every language binding
> implementor.
And language bindings are assumed to be one reason for Gnome compared to
KDE ;)
> 
> Does your wrapper use the `.defs' files that are in the gnome-guile
No. Reasons:
-) My Lisp knowledge is at best in the range of knowing that setq is
   a special form to shorten (set (quote ;)
-) As far as I got it, the .defs files describe functions, that are then
   mapped to C wrapping code, right?
-) The problem is, that it seems to be a non-OO approach:

(define-object GnomeApp (GtkWindow))

(define-func gnome_app_new
  GtkWidget
  ((string appname)
   (string title)))

That would become in my wrapping:
implementation class
GnomeApp: GtkWindow

GtkWidget
  new (String, String) (appname, title)
...

> module?  That would be my preferred approach, if possible.  My reason
The problem is, that the Gtk lowlevel bindings depend upon using a
GtkClass to TomClass 1:1 mapping, as they use the class string of Gtk to
get the right class to generate a proxy for a widget not yet seen by TOM.

> is that any improvements to the .defs file would benefit other
> implementors.
I see that. I just don't see how I can generate OO style wrappers with the
given .defs files. (I'm the first one to cry: ``I want .defs files, that
solves all my problems, ...'')

Andreas




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