Re: [gtk-list] A description format for Gtk features
- From: Federico Mena <federico nuclecu unam mx>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] A description format for Gtk features
- Date: Thu, 4 Sep 1997 13:35:02 -0500
> Therefore I'd like to know how much extra burden you would tolerate
> for the sake of robust high-level bindings.
I think using a description file is fine. If the thing can be made to
generate C code from the description file automatically, it would
rock.
> Would you maintain such a description file? Even if you don't use a
> high-level language yourself?
Definitely. "I'd rather write programs to write programs than write
programs" (Dick Sites) :-)
> A typical function description could look like:
[example snipped]
I have slowly (read, *slowly*) been working on a C boilerplate code
generator for creating new Gtk classes, in Scheme. I have been going
slowly because string processing in Scheme is not that nice, and I
have done some things the hard way just to practice my Scheme :-)
The idea is to automatically generate most of the `standard' code
required to make a new Gtk class (header file, class initialization
code, signal marshallers, etc.). My current definition file syntax
looks like this:
(class-from 'GtkHBox
'GtkToolbar
(overrides-signal "add")
(new-signal "foo"
'(GTK-RUN-FIRST GTK-RUN-NO-RECURSE)
'(GTK-ARG-NONE "void")
'((GTK-ARG-POINTER "GtkButton *" "button")))
(new-signal "bar"
'(GTK-RUN-LAST)
'(GTK-ARG-INT "gint")
'((GTK-ARG-POINTER "GtkButton *" "button")
(GTK-ARG-LONG "glong" "squish"))))
I'm not yet finished with the code generator, so it's likely that some
of that syntax will change. But the point is that it *is* convenient
to generate C code from the description file. I think this thingy
could be nicely integrated with your own idea, and a lot of the grunt
work of making Gtk classes and language bindings would simply go away.
> What do you think?
Great idea! :-)
Quartic
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]