I just checked in a whole slew of changes that make the
foreign-function-interface pretty usable. I have converted gtkwidget.h,
gtkbutton.h, gtkcontainer.h, gtkhpaned.h, gtkvpaned.h, gtkpaned.h, and
gtkwindow.h to lisp, and implemented a whole slew of marshalling routines.
There is also an automated script in ..../lisp/ui/gtk-marshal.el that will
automatically generate the C code from a signature for you.
With the current CVS, this test program works:
(progn
(require 'gtk-ffi)
(require 'gtk-window)
(require 'gtk-container)
(require 'gtk-widget)
(require 'gtk-button)
(require 'gtk-vpaned))
(let ((win (gtk-window-new GTK_WINDOW_TOPLEVEL))
(pane (gtk-vpaned-new))
(button-1 (gtk-button-new-with-label "Testing widget..."))
(button-2 (gtk-button-new-with-label "Another test widget...")))
(gtk-container-add win pane)
(gtk-paned-add1 pane button-1)
(gtk-paned-add2 pane button-2)
(gtk-widget-show-all win))
There are certain things that I need to finish hacking out before you can
fully access some functions. The main one is dealing with 'boxed' types,
which are typed pointers for things like GdkEvent, GdkBar, etc. None of
these structures has accessor/settor functions that you can just import.
Lame. I have encapsulated these in their own lisp type (gtk-boxed), and
plan on making the 'put' and 'get' routines work on them (somehow).
Either
that or just write a bunch of accessor/settor functions in C that you can
import as normal.
Other work to finish includes converting 'GList' objects into lisp lists,
and dealing with 'GtkArg' attributes, which can be done by converting them
to a list as well.
All the widgets should be able to be imported by monday night (I think).
Then I go to work on the abstraction layer. Then menus and toolbars get
top priority. The upside to doing it this way is I should be able to
finish 2 milestones at once (getting from 50% of widgets imported to 90%
should take all of 3 hours), and the project can be finished that much
sooner. Being able to do the entire abstraction layer in lisp will kick
some serious ass. :)
I'm going to be gone most of the day - have to hit the bookstore and try to
convince liam to try his new bicycle without training wheels. :)
-Bill P.
Show replies by date