If you do write GObject derivated classes often you may know it’s a boring and error prone task.
Lisp:gobject-class.el is a set of 3 functions to help you define the header, the code skeleton and to create files following GObject and Gtk naming schemas. All it ask you is 2 parameters: the class name and the parent class name, the last one may be omited and defaults to GObject.
Functions are:
G_TYPE_OBJECT), typedef and struct declarations and define the _get_type() function. These contents are enclosed in G_BEGIN_DECLS and G_END_DECLS.G_DEFINE_TYPE call, and skeleton for _class_init(), _init(), _finalize() and dispose().Class names are expected to have a namespace like gtk_button is really the class button in the namespace gtk, g_object is object in g.
;;; create the definitions for GtkButton, which derives from GtkBin (gobject-class-header "gtk_button" "gtk_bin")
;;; create the implementation for GtkButton
(gobject-class-code "gtk_button" "gtk_bin") ;;; create files with header and code: gtk-button.h and gtk-button.c
(gobject-class-generate "gtk_button" "gtk_bin")