X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/489e97ede850a8de01ca3bd653dce9c25dcd54a1..928c6b8da5a3677aaaf33976a7d921a1498a61df:/src/main.c diff --git a/src/main.c b/src/main.c index fce8cb0..7ece9fb 100644 --- a/src/main.c +++ b/src/main.c @@ -82,8 +82,8 @@ static gboolean made_aliases = FALSE; /* if we made any shorthand aliases static gboolean special_array[SPECIAL_LAST] = {0}; static gboolean any_special = FALSE; -static gboolean need_shutdown = FALSE; -static Method * shutdown_handler = NULL; +static gboolean need_dispose = FALSE; +static Method * dispose_handler = NULL; static gboolean need_finalize = FALSE; static Method * finalize_handler = NULL; @@ -636,30 +636,30 @@ make_inits(Class *cl) } static void -find_shutdown(Class *cl) +find_dispose(Class *cl) { GList *li; - shutdown_handler = NULL; + dispose_handler = NULL; for(li=cl->nodes;li;li=g_list_next(li)) { Node *n = li->data; if(n->type == METHOD_NODE) { Method *m = (Method *)n; if(m->method == OVERRIDE_METHOD && - strcmp(m->id, "shutdown")==0) { + strcmp(m->id, "dispose")==0) { if(strcmp(m->otype, "G:Object") != 0) { error_print(GOB_ERROR, m->line_no, - "shutdown method override " + "dispose method override " "of class other then " "G:Object"); } if(g_list_length(m->args) != 1) { error_print(GOB_ERROR, m->line_no, - "shutdown method override " + "dispose method override " "with more then one " "parameter"); } - shutdown_handler = m; + dispose_handler = m; break; } } @@ -1371,11 +1371,11 @@ set_def_handlers(Class *c, const char *oname) s = replace_sep (m->otype, '_'); g_strdown (s); - if (need_shutdown && - shutdown_handler != NULL && - strcmp (m->id, "shutdown") == 0) - out_printf (out, "\tg_object_class->shutdown " - "= ___shutdown;\n"); + if (need_dispose && + dispose_handler != NULL && + strcmp (m->id, "dispose") == 0) + out_printf (out, "\tg_object_class->dispose " + "= ___dispose;\n"); else if (need_finalize && finalize_handler && strcmp(m->id, "finalize") == 0) @@ -1995,13 +1995,13 @@ print_destructor (Variable *v) } static void -add_shutdown (Class *c) +add_dispose (Class *c) { out_printf(out, "\nstatic void\n" - "___shutdown (GObject *obj_self)\n" + "___dispose (GObject *obj_self)\n" "{\n"); out_printf(out, - "#define __GOB_FUNCTION__ \"%s::shutdown\"\n", + "#define __GOB_FUNCTION__ \"%s::dispose\"\n", c->otype); if (unreftors > 0) { @@ -2009,18 +2009,18 @@ add_shutdown (Class *c) typebase, macrobase); } - if (shutdown_handler != NULL) { + if (dispose_handler != NULL) { /* so we get possible bad argument warning */ - if (shutdown_handler->line_no > 0) - out_addline_infile (out, shutdown_handler->line_no); - out_printf (out, "\t___%x_%s_shutdown(obj_self);\n", - (guint)shutdown_handler->unique_id, funcbase); - if (shutdown_handler->line_no > 0) + if (dispose_handler->line_no > 0) + out_addline_infile (out, dispose_handler->line_no); + out_printf (out, "\t___%x_%s_dispose(obj_self);\n", + (guint)dispose_handler->unique_id, funcbase); + if (dispose_handler->line_no > 0) out_addline_outfile (out); } else { out_printf (out, - "\tif (G_OBJECT_CLASS (parent_class)->shutdown) \\\n" - "\t\t(* G_OBJECT_CLASS (parent_class)->shutdown) (obj_self);\n"); + "\tif (G_OBJECT_CLASS (parent_class)->dispose) \\\n" + "\t\t(* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);\n"); } if (unreftors > 0) { @@ -2194,7 +2194,7 @@ add_inits(Class *c) if (set_properties > 0 || get_properties > 0 || signals > 0 || - need_shutdown || + need_dispose || need_finalize) { out_printf(out, "\tGObjectClass *" @@ -2236,9 +2236,9 @@ add_inits(Class *c) /* if there are no handlers for these things, we * need to set them up here */ - if(need_shutdown && !shutdown_handler) - out_printf(out, "\tg_object_class->shutdown " - "= ___shutdown;\n"); + if(need_dispose && !dispose_handler) + out_printf(out, "\tg_object_class->dispose " + "= ___dispose;\n"); if(need_finalize && !finalize_handler) out_printf(out, "\tg_object_class->finalize = " "___finalize;\n"); @@ -3354,8 +3354,8 @@ print_class_block(Class *c) no_gnu ? "" : " G_GNUC_UNUSED", typebase, typebase, typebase, funcbase); - if (need_shutdown) - add_shutdown (c); + if (need_dispose) + add_dispose (c); if (need_finalize) add_finalize (c); @@ -4061,8 +4061,8 @@ main(int argc, char *argv[]) make_bases (); make_inits ((Class *)class); if(unreftors > 0) { - need_shutdown = TRUE; - find_shutdown ((Class *)class); + need_dispose = TRUE; + find_dispose ((Class *)class); } if (destructors > 0 || privates > 0) {