I polished my own little tool (edit: muppet gave me a much improved version, which is committed) for creating types in tinymail. I removed its requirement that your type names start with Tny. What it will do is outputting the .c file that implements all the GTypeInterfaces that you gave it on stdin, using stub implementations.
It detects to-implement methods, interface names, converts CamelCaseStyle to g_object_style / GObjectStyle / G_OBJECT_STYLE and it supports implementing multiple such interfaces. It expects the .h files of the GTypeInterfaces catted together to the stdin of the tool.
for example:
cd tinymail/trunk/tool IFACES="../libtinymailui/tny-mime-part-view.h" IFACES="$IFACES ../libtinymailui/tny-mime-part-saver.h" ./gtypeinterface-h-files-to-c-file.pl MyMimePartComponent $IFACES
Feel free to send me patches that fix the regular expressions that detect a method and a type in such a way that they would work with all possible GTypeInterfaces. This perl script at this moment only works with my personal style for GTypeInterface’s (tinymail’s style). I always add _func to each method’s function pointer in the interface’s struct (this isn’t like how Gtk+ developers do it) and my interface struct names end with Iface (this is like how Gtk+ developers do it).
It doesn’t yet differentiate between signals and methods (the virtual table). I might add something that reads the comments inside of the struct for detecting this soon (tinymail has, just like what gtk+ developers do, comments that indicate whether or not the function pointers are for signals or for methods). This is also a problem for the scanvirtuals.pl script of the Python bindings. Maybe we should, as a GObject writing community, define a standard /* comment */ for this?
My other idea for tinymail was to let the function pointer end on _method for methods and on _signal for signals.
The idea of the tool is to aid developers who will use tinymail for building an E-mail application with implementing the framework‘s interfaces. It being free software, however, means that you can use it freely for your own purposes.
A .h file generator for the GObject is of course very easy and something you can do with a little bit of search and replacing yourself. But feel free to send me a perl script that does that trivial thingy too. I’ll put it in the repository.