- out_printf(out,
- "static GType %s_type_id;\n\n"
- "GType\n"
- "%s_get_type (void)\n"
- "{\n"
- "\treturn %s_type_id;\n"
- "}\n\n",
- funcbase, funcbase, funcbase);
-
- out_printf(out,
- "void\n"
- "%s_register_type (GTypeModule *type_module)\n"
- "{\n"
- "\tstatic const GTypeInfo info = {\n"
- "\t\tsizeof (%sClass),\n"
- "\t\t(GBaseInitFunc) NULL,\n"
- "\t\t(GBaseFinalizeFunc) NULL,\n"
- "\t\t(GClassInitFunc) %s_class_init,\n"
- "\t\t(GClassFinalizeFunc) NULL,\n"
- "\t\tNULL /* class_data */,\n"
- "\t\tsizeof (%s),\n"
- "\t\t%d /* n_preallocs */,\n"
- "\t\t(GInstanceInitFunc) %s_init,\n"
- "\t\tNULL\n"
- "\t};\n\n",
- funcbase, typebase, funcbase, typebase, prealloc, funcbase);
-
- add_interface_infos();
-
- out_printf(out,
- "\t%s_type_id = g_type_module_register_type(\n"
- "\t\ttype_module,\n"
- "\t\t%s,\n"
- "\t\t\"%s\",\n"
- "\t\t&info,\n"
- "\t\t(GTypeFlags)%s\n"
- "\t);\n\n"
- "\t{\n",
- funcbase, pmacrotype, typebase,
- ((Class *)class)->abstract ? "G_TYPE_FLAG_ABSTRACT" : "0");
-
- add_dynamic_interfaces();
+ Class *c = (Class *)class;
+
+ define_dynamic_add_interfaces(c);
+
+ out_printf(out, "static GType %s_type_id;\n\n"
+ "GType %s_get_type(void)\n"
+ "{\n"
+ "\treturn %s_type_id;\n"
+ "}\n\n",
+ funcbase, funcbase, funcbase);
+
+ out_printf(out, "void %s_register_type(GTypeModule *type_module)\n"
+ "{\n",
+ funcbase);
+
+ add_type_info();
+
+ out_printf(out, "\t%s_type_id = g_type_module_register_type\n"
+ "\t\t( type_module\n"
+ "\t\t, %s\n"
+ "\t\t, \"%s\"\n"
+ "\t\t, &info\n"
+ "\t\t, (GTypeFlags)%s\n"
+ "\t\t);\n",
+ funcbase, pmacrotype, typebase,
+ c->abstract ? "G_TYPE_FLAG_ABSTRACT" : "0");
+
+ if (c->interfaces) {
+ out_printf(out, "\t___add_interfaces"
+ "(type_module, %s_type_id);\n",
+ funcbase);
+ }