I recently had to create many classes and as everybody knows, writing classes with GObject is quite annoying.. it involves a lot of copy/paste and a lot of search&replace. So I’ve searched and I (actually my colleague, Olivier) found these GObject class helpers : http://www.emacswiki.org/emacs/GObjectClassHelpers
Those are some helpers functions for Emacs that automatically create the .c and .h files for you with all the GObject boilerplate. They were written by Gustavo Sverzut Barbieri and they do the job quite fine.
However, they are missing a few things, so I took the liberty of modifying the script to make them more complete and make them suit my needs.
Here is the changelog :
- Added the option to include a Private structure to the class
- Added a dummy property and the get/set functions
- Added a dummy signal
- Added a ‘constructed’ method
- Added LGPL license header to generated .c and .h files
- Reindent the whole files to match the user’s settings.
These additions (private structure, property, signals) are optional and the script asks you if you want them or not when it generates the code.
I thought that these changes would be useful to some people so I decided to share my script with the world. you can grab it here.