+ char *s;
+ gboolean printed_private = FALSE;
+
+ out_printf(out,"/* utility types we may need */\n");
+ out_printf(out,"typedef struct { "
+ "gpointer a; gpointer b; "
+ "} ___twopointertype;\n");
+ out_printf(out,"typedef struct { "
+ "gpointer a; gpointer b; "
+ "gpointer c; "
+ "} ___threepointertype;\n");
+
+ out_printf(outh, "\n/*\n"
+ " * Type checking and casting macros\n"
+ " */\n");
+ out_printf(outh,"#define %s\t"
+ "(%s_get_type())\n",
+ macrotype,funcbase);
+ out_printf(outh,"#define %s(obj)\t"
+ "GTK_CHECK_CAST((obj),%s_get_type(),%s)\n",
+ macrobase,funcbase,typebase);
+ out_printf(outh,"#define %s_CLASS(klass)\t"
+ "GTK_CHECK_CLASS_CAST((klass),%s_get_type(),%sClass)\n",
+ macrobase,funcbase,typebase);
+ out_printf(outh,"#define %s(obj)\t"
+ "GTK_CHECK_TYPE((obj), %s_get_type ())\n\n",
+ macrois,funcbase);
+
+ out_printf(out, "\n/* self casting macros */\n");
+ out_printf(out, "#define SELF(x) %s(x)\n", macrobase);
+ out_printf(out, "#define IS_SELF(x) %s(x)\n", macrois);
+ out_printf(out, "#define SELF_CLASS(x) %s_CLASS(x)\n\n", macrobase);
+
+ if(privates>0) {
+ out_printf(outh, "\n/* Private structure type */\n");
+ out_printf(outh,"typedef struct _%sPrivate %sPrivate;\n",
+ typebase,typebase);
+ }
+
+ out_printf(outh, "\n/*\n"
+ " * Main object structure\n"
+ " */\n");
+ s = replace_sep(c->otype,'_');
+ g_strup(s);
+ out_printf(outh,"#ifndef __TYPEDEF_%s__\n"
+ "#define __TYPEDEF_%s__\n",s,s);
+ g_free(s);
+ out_printf(outh,"typedef struct _%s %s;\n"
+ "#endif\n",typebase,typebase);
+ out_printf(outh,"struct _%s {\n\t%s __parent__;\n",
+ typebase,ptypebase);