James Henstridge and libglade

James is a long standing member of the GNOME community, contributing great software such as dia, gnorpm and the much-loved GNOME and GTK+ Python bindings. He has also been dispensing sagely advice on #gnome amongst all this hacking.

libglade is already being used in some of GNOME's core applications and major projects such as Evolution and Gnumeric.

Can you give a quick description of libglade for anyone who hasn't used or heard of it before?

Libglade is a library designed to dynamically load a user interface from an XML file on disk. These UI description files can be created using the Glade UI builder. It provides several options for connecting callbacks up to the interface including an `autoconnect' option that scans the program's symbol table for callback functions.

Libglade is quite nonintrusive. Once it has constructed the interface and connected up the callbacks it gets out of the way, so doesn't add any speed overhead. The cost of parsing the UI description file doesn't create any noticable startup delays.

Benefits of using libglade include:

Your recent release posts have been encouraging, how far along is the port to the new development platform?

Pretty far. Development tarballs can be found at ftp://ftp.gnome.org/pub/GNOME/earthquake/sources/libglade/

The current release builds and is fairly close to the final C API (I don't expect to break the public API).

Note that it won't load old glade files, as it uses a new (simpler) file format. There is a converter included, but it is unfinished.

There is no support for libgnomeui widgets yet, as that library is still changing.

With libglade, you're coding pretty close to the bare metal of GTK+ and GNOME 2.0, so you have a very close view of how the new development platform is shaping up. What do you think of the GNOME 2.0 platform as it stands?

Most of my work until recently has revolved around GTK+, and making sure it is usable by language bindings. This includes the runtime introspection capabilities of the GObject object system.

Ed: Check out the GObject documentation. You'll also find some of James' unfinished documentation in the language-bindings module in GNOME CVS.

Many of these runtime introspection APIs are used by libglade as well, and have helped reduce the amount of widget specific code in favour of generic code.

As for the gnome 2.0 platform, it is looking quite good, but still have a way to go. When we get closer to release, we could do with a package similar to the gtk-all package that gathers together the gnome libraries so they can be downloaded, built and installed in one step.

Are there any features that you have enjoyed working with in particular? Perhaps things you'd like to see fixed in the 2.0 / 2.2 timeframe?

GTK+ on its own has become a much better widget library. There are less instances of having a GTK version of a widget and a GNOME version of the widget. This will mean that plain GTK+ applications should fit in better than before.

With the addition of style properties, theme authors will have more control over the look of applications without the need to write a theme engine in C.

The use of Unicode and Pango should make internationalisation easier, which will hopefully make more applications get it right first go.

Has the new platform made libglade development easier?

The richer introspection interfaces have allowed me to reduce the code size of libglade. Less code makes things easier :)

Did you have any big goals for the GNOME 2.0 version of libglade, beyond porting? How close are you now to achieving those?

  1. Switching to the new file format. This is mostly done.
  2. Adding support for Accessibility Toolkit (ATK) properties. The XML parser reads these from the file, but libglade doesn't yet make use of them.
  3. I also removed a fair bit of code that wasn't needed anymore due to the mnemonics code in GTK+.

Perhaps some hired hands could help here. ;) Are there any areas that new hackers would be able to contribute to?

The libglade-convert script still needs some work. It gets the basic structure right, but it still needs some tuning for some widget types.

Glade2 is another project people might want to work on. If you are interested in it, you should join the glade-devel mailing list.

Have you had any new hackers already working on libglade? What contributions have they made?

I've had some patches from MCArkan (Xavier Ordoquy) and Michael Meeks, whilst Chema Celorio had some input on the new file format. Thanks!

What kind of enhancements are in store for developers using libglade with the GNOME 2.0 platform?

The new libglade uses a new file format. The new format uses fewer tag types, and even has a DTD.

The new libglade makes heavy use of widget properties, which greatly reduces the amount of code needed to support a new widget (often it will only require two or three extra lines of code).

For widgets that don't implement properties, we can't take advantage of the generic property handling. For people who are porting widget libraries over to the GTK+ 2.0 platform, I strongly recommend that you make sure your widgets implement properties, and containers implement child packing properties. This will ensure that glade/libglade can support your library with the minimum of work.

Support for additional widget libraries can by dynamically loaded, which means that there is no longer different init functions for glade, glade with gnome support, etc. The app is still responsible for initialising gnome if it is used (or whatever other library is loaded).

Ed: The GTK+ 2.0 documentation may help you understand some of these new features.

Thanks very much for your work on libglade and GNOME 2.0, James!

Documentation Included with libglade
Tarballs ftp://ftp.gnome.org/pub/GNOME/earthquake/sources/libglade/
CVS module libglade, GNOME CVS
Gnotices Thread http://news.gnome.org/998913983/index_html