[Gtk-sharp-list] New Year / New Direction

Mike Kestner mkestner@speakeasy.net
04 Jan 2002 01:36:28 -0600


It is incredible how long it's been since any visible progress has
occurred on Gtk#.  Tonight, I committed a huge patch which amounts to a
new direction in the binding.  

I was growing increasingly frustrated with the progress I was making in
the first weeks of December.  Most of this frustration stemmed directly
from the state of the available defs files. I found myself using home
grown scripts to generate defs which I then had to turn around and parse
out of the defs format in order to generate C#.  After posting some
messages to the language-bindings list, I came to the realization that
these issues with the defs files are apparently only impacting Gtk# and
not the other bindings which use defs.  

So I decided that if I was going to have to parse the api anyway in
order to generate defs, I'd rather parse it into something that would be
better suited to my needs.  Over the holidays when I could scratch
together an hour or two, I restructured my source parsing routines to
generate XML.  

Tonight, in about an hour using System.XML, I was able to write an XML
parser and code generation to produce cleanly compiled enums for Pango,
Gdk, and Gtk. This is the way this should work. I'm also pleased that I
can now write the code generator in C#.  The code is actually readable,
as opposed to just an evil obfuscation of regex's trying in vain to
extract information from scheme expressions.

I fully expect to get burned at the stake for this reinvention of the
wheel, but I'm comfortable with the decision.  Not only have I had the
chance to explore the wonders of CPAN module XML::LibXML, but I finally
feel like the binding is back on track, and that I have some hope of
actually delivering it in reasonable amount of time.

My Todo list also includes the integration of some Nant build files
which were submitted by Rupesh Kumar.  Initially, I'll probably leave
the makefiles in place as well, for those who prefer make to nant.

Mike