+ char *s;
+
+ 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#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);
+
+ /* argument wrapping macros */
+ if(arguments>0 && !no_gnu) {
+ out_printf(outh,"\n#ifdef __GNUC__\n");
+ put_argument_gnu_wrappers(c);
+ out_printf(outh,"#else /* __GNUC__ */\n");
+ put_argument_nongnu_wrappers(c);
+ out_printf(outh,"#endif /* __GNUC__ */\n\n");
+ } else if(arguments>0 && no_gnu) {
+ put_argument_nongnu_wrappers(c);
+ }
+
+ if(privates>0)
+ out_printf(outh,"\ntypedef struct _%sPrivate %sPrivate;\n",typebase,typebase);
+
+ 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);
+ for(l=c->nodes;l;l=g_list_next(l)) {
+ Node *n = l->data;
+ Variable *v = (Variable *)n;
+ if(n->type == VARIABLE_NODE &&
+ v->scope == PUBLIC_SCOPE)
+ put_variable((Variable *)n,outh);
+ }
+ /* put protecteds always AFTER publics */
+ for(l=c->nodes;l;l=g_list_next(l)) {
+ Node *n = l->data;
+ Variable *v = (Variable *)n;
+ if(n->type == VARIABLE_NODE &&
+ v->scope == PROTECTED_SCOPE)
+ put_variable((Variable *)n,outh);
+ }
+ if(privates>0)
+ out_printf(outh,"\t%sPrivate *_priv;\n",typebase);
+ out_printf(outh,"};\n");
+
+ if(privates>0) {
+ FILE *outfp;
+
+ /* if we are to stick this into the private
+ header, if not stick it directly into the
+ C file */
+ if(outph)
+ outfp = outph;
+ else
+ outfp = out;
+
+ out_printf(outfp,"struct _%sPrivate {\n",
+ typebase);
+ for(l=c->nodes;l;l=l->next) {
+ Node *n = l->data;
+ Variable *v = (Variable *)n;
+ if(n->type == VARIABLE_NODE &&
+ v->scope == PRIVATE_SCOPE) {
+ out_addline_infile(outfp,v->line_no);
+ put_variable(v,outfp);
+ }
+ }
+ out_addline_outfile(outfp);
+ out_printf(outfp,"};\n");
+ }
+
+ out_printf(outh,"\ntypedef struct _%sClass %sClass;\n",
+ typebase,typebase);
+ out_printf(outh,
+ "struct _%sClass {\n\t%sClass __parent__;\n",
+ typebase,ptypebase);
+ for(l=c->nodes;l;l=g_list_next(l)) {
+ Node *n = l->data;
+ if(n->type == METHOD_NODE)
+ put_vs_method((Method *)n);
+ }
+ out_printf(outh,"};\n\n");
+
+ out_printf(outh,"guint\t%s_get_type\t(void);\n",funcbase);
+
+ out_printf(out,"/* here are local prototypes */\n");
+ if(!no_gnu) {
+ out_printf(out,"#ifdef __GNUC__\n"
+ "#define ___NO_UNUSED_WARNING "
+ "__attribute__ ((__unused__))\n"
+ "#else /* __GNUC__ */\n"
+ "#define ___NO_UNUSED_WARNING\n"
+ "#endif /* __GNUC__ */\n");
+ }
+ if(arguments>0) {
+ out_printf(out,"static void ___object_set_arg "
+ "(GtkObject *object, GtkArg *arg, "
+ "guint arg_id);\n"
+ "static void ___object_get_arg "
+ "(GtkObject *object, GtkArg *arg, "
+ "guint arg_id);\n");
+ }
+