1 #include "{{HEADER_FILE_NAME}}"
3 static void {{FUNCTION_PREFIX}}_class_init({{BASE_CLASS}}Class *klass);
4 static void {{FUNCTION_PREFIX}}_init({{BASE_CLASS}} *sp);
5 static void {{FUNCTION_PREFIX}}_finalize(GObject *object);
7 struct _{{BASE_CLASS}}Private {
8 /* Place Private Members Here */
11 typedef struct _{{BASE_CLASS}}Signal {{BASE_CLASS}}Signal;
12 typedef enum _{{BASE_CLASS}}SignalType {{BASE_CLASS}}SignalType;
14 enum _{{BASE_CLASS}}SignalType {
15 /* Place Signal Types Here */
20 struct _{{BASE_CLASS}}Signal {
21 {{BASE_CLASS}} *object;
24 static guint {{FUNCTION_PREFIX}}_signals[LAST_SIGNAL] = { 0 };
25 static {{PARENT_CLASS}}Class *parent_class = NULL;
28 {{FUNCTION_PREFIX}}_get_type()
30 static GType type = 0;
33 static const GTypeInfo our_info = {
34 sizeof ({{BASE_CLASS}}Class),
37 (GClassInitFunc){{FUNCTION_PREFIX}}_class_init,
40 sizeof ({{BASE_CLASS}}),
42 (GInstanceInitFunc){{FUNCTION_PREFIX}}_init,
45 type = g_type_register_static(G_TYPE_OBJECT,
46 "{{BASE_CLASS}}", &our_info, 0);
53 {{FUNCTION_PREFIX}}_class_init({{BASE_CLASS}}Class *klass)
55 GObjectClass *object_class = G_OBJECT_CLASS(klass);
57 parent_class = g_type_class_peek_parent(klass);
58 object_class->finalize = {{FUNCTION_PREFIX}}_finalize;
60 /* Create signals here:
61 {{FUNCTION_PREFIX}}_signals[SIGNAL_TYPE_EXAMPLE] = g_signal_new(...)
66 {{FUNCTION_PREFIX}}_init({{BASE_CLASS}} *obj)
68 obj->priv = g_new0({{BASE_CLASS}}Private, 1);
69 /* Initialize private members, etc. */
73 {{FUNCTION_PREFIX}}_finalize(GObject *object)
76 cobj = {{GTYPE_PREFIX}}_{{GTYPE_NAME}}(object);
78 /* Free private members, etc. */
81 G_OBJECT_CLASS(parent_class)->finalize(object);
85 {{FUNCTION_PREFIX}}_new()
89 obj = {{GTYPE_PREFIX}}_{{GTYPE_NAME}}(g_object_new({{GTYPE_PREFIX}}_TYPE_{{GTYPE_NAME}}, NULL));