- for(li=nodes;li;li=g_list_next(li)) {
- Node *node = li->data;
- if(node->type == CCODE_NODE) {
- CCode *cc = (CCode *)node;
- FILE *fp;
- if(cc->header) {
- fp = outh;
- out_printf(fp,"\n");
- } else {
- fp = out;
- out_printf(fp,"\n");
- out_addline_infile(fp,cc->line_no);
- }
- out_printf(fp,"%s\n",cc->cbuf->str);
- if(!cc->header)
- out_addline_outfile(fp);
- } else if(node->type == CLASS_NODE) {
- Class *c = (Class *)class;
- GList *l;
-
- 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);
-
- if(privates>0)
- out_printf(outh,"\ntypedef struct _%sPrivate %sPrivate;\n",typebase,typebase);
-
- out_printf(outh,"\ntypedef struct _%s %s;\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);
- }
- 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, otherwise 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);
-
- 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");
- }
-
- for(l=c->nodes;l;l=g_list_next(l)) {
- Node *n = l->data;
- if(n->type == METHOD_NODE) {
- put_pub_method((Method *)n);
- put_priv_method_prot((Method *)n);
- }
- }
-
- if(signals>0) {
- for(l=c->nodes;l;l=g_list_next(l)) {
- Node *n = l->data;
- if(n->type == METHOD_NODE) {
- add_signal_prots((Method *)n);
- }
- }
- }
-
- add_enums(c);
-
- add_get_type();
-
- make_method_pointers(c);
-
- out_printf(out,"#define GET_NEW (gtk_type_new(%s_get_type()))\n",
- funcbase);
-
- add_inits(c);
-
- if(arguments>0) {
- add_getset_arg(c, TRUE);
- add_getset_arg(c, FALSE);
- }
-
- for(l=c->nodes;l;l=g_list_next(l)) {
- Node *n = l->data;
- if(n->type == METHOD_NODE) {
- put_method((Method *)n);
- }
- }