- out_printf(outh,"#ifdef __cplusplus\n"
- "extern \"C\" {\n"
- "#endif /* __cplusplus */\n\n");
-
- out_printf(out,"#include \"%s.h\"\n\n",filebase);
-
- 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) {
- GList *l;
- Class *c = (Class *)class;
- char *otype,*ptype;
-
- signals = count_signals(c);
- arguments = count_arguments(c);
- overrides = count_overrides(c);
-
- out_printf(outh,"\n#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);
-
- otype = remove_sep(c->otype);
- ptype = remove_sep(c->ptype);
- out_printf(outh,"\ntypedef struct _%s %s;\n",otype,otype);
- out_printf(outh,"struct _%s {\n\t%s __parent__;\n",
- otype,ptype);
- for(l=c->nodes;l;l=g_list_next(l)) {
- Node *n = l->data;
- if(n->type == VARIABLE_NODE)
- put_variable((Variable *)n);
- }
- out_printf(outh,"};\n");
-
- out_printf(outh,"\ntypedef struct _%sClass %sClass;\n",
- otype,otype);
- out_printf(outh,
- "struct _%sClass {\n\t%sClass __parent__;\n",
- otype,ptype);
- 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");