Re: ... arguments
- From: Tom Tromey <tromey cygnus com>
- To: Andreas Kostyrka <andreas ag or at>
- Cc: Tom Tromey <tromey cygnus com>, tom gerbil org, gnome-list gnome org
- Subject: Re: ... arguments
- Date: 10 Jun 1998 01:39:31 -0600
>> On some systems you can probably use `libffi' to provide a wrapping.
Andreas> Where can I find this beast?
http://www.cygnus.com/~green/libffi.html
>> 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
Andreas> Yeah, I noticed that some functions already have v-versions
Andreas> (v probably for vector?).
I imagine so. It's definitely a better way to go if you can control
the source. I'm sure the Gnome developers (me, anyway) will listen
with a sympathetic ear. Probably the best approach is to submit the
changes you want as patches (with ChangeLog entries). Second best is
to list the functions which are hard to deal with.
>> Does your wrapper use the `.defs' files that are in the gnome-guile
Andreas> No. Reasons:
Andreas> -) My Lisp knowledge is at best in the range of knowing that
Andreas> setq is a special form to shorten (set (quote ;)
You don't actually need to use or understand Lisp to parse the .defs
files. Of course, it is probably easier if you do, but it really
isn't required. The files follow a fairly simple syntax.
Andreas> -) As far as I got it, the .defs files describe functions,
Andreas> that are then mapped to C wrapping code, right?
Yes, the .defs files describe data types and functions.
Andreas> -) The problem is, that it seems to be a non-OO approach:
I disagree. Instead, the .defs files describe the underlying Gdk/Gtk
libraries. How you handle mapping these libraries onto the language
for which you're generating bindings is up to you. I believe that the
.defs files provide enough information to make a truly OO wrapper
(though I confess I have not tried it myself).
Here is the plan I think you could take:
* If a function `gtk-foo-bar' takes a `GtkFoo' (yes, `foo' and `Foo'
are related here -- the naming conventions are strictly followed as
far as I can tell (and anyway your reader could spit out an error if
not)), then generate a method `bar' for the class FooWrapper.
* Use the inheritence information from the `define-object' specs
to generate your own inheritence tree.
The example you gave in your message basically does this same thing.
Is there something wrong with this approach?
Andreas> The problem is, that the Gtk lowlevel bindings depend upon
Andreas> using a GtkClass to TomClass 1:1 mapping, as they use the
Andreas> class string of Gtk to get the right class to generate a
Andreas> proxy for a widget not yet seen by TOM.
I don't understand this, sorry.
Tom
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]