spuug - a tool to generate GObjects

spuug is a little tool that generates the boilerplate code for GObjects. If you don't know what they are, then probably this tool is not for you...

spuug can be used for 'plain' GObjects, but also for GTK+-widgets etc., and tries to be a bit smart with the code in spits out. I've been using it myself for a while, and it has been very helpful. However, a code generator is no more than that -- you still need to understand GObjects/GtkWidgets to use it. So, I would recommend writing a couple 'by hand' before using a tool like this one.

If you find any problems or you have improvements, please report them to meĀ·

Update: 2010-11-13: version 0.4 is now available, which simplifies the output a bit (use G_DEFINE_TYPE) and make thing faster in some cases (by putting at 'priv'-pointer in the public struct).

Update: 2008-12-24: a new version 0.3 is available, mostly due to a patch from Viktor Nagy -- thanks!


$ spuug --help
spuug version 0.4
Copyright (c) 2006-2010 Dirk-Jan C. Binnema .
spuug is free software covered by the GNU GPL v3+

spuug is a script to generate GObject boilerplate code
usage: spuug [OPTIONS]
where options are:
	--class=,-c         : the classname (e.g. MyFooBar)
	--interface=,-i     : the interface name (e.g. MyFooBarIFace)
	--parent=,-p : the parent classname (e.g. Bar)
	--namespace=,-n     : the namespace (e.g. My)
	--test,-t                      : generate test code as well
	--force,-f                     : overwrite existing files
	--help,-h                      : show this help text

	$ spuug --class=FunkyFooBar --namespace=Funky --parent=GtkWidget
will generate funky-foobar.c and funky-foobar.h with the boilerplate code

	$ spuug --class=CuteThing --namespace=Cute --parent=GObject --test
will generate cute-thing.c and cute-thing.h with the boilerplate code,
and test-cute-thing.c and Makefile for testing


spuug is written in ruby, and you'll need that if you want to use it.


spuug is available under the terms of the GNU General Public License version 3. However, that license does not apply to the generated code. The generated code is your own, and you are free to do whatever you want with it, including using it for proprietary code.


spuug was written by me, Dirk-Jan C. Binnema. You can reach me at djcb at djcbsoftware dot nl, or alternatively through IM (XMPP) at djcb@jabber.org. I maintain some blogs; my Dutch ChangeLog-blog and Emacs-Fu with Emacs-tips.


spuug 0.4 (November 2010) can be downloaded here; there is also a git-repository available.