static int protecteds = 0; /* number of protected methods */
static int destructors = 0; /* number of variable destructors */
static int initializers = 0; /* number of variable initializers */
+static gboolean overrode_get_type = FALSE; /* provided your won _get_type */
static gboolean made_aliases = FALSE; /* if we made any shorthand aliases
and need the REALLY UGLY HACK to
"\t(*rfunc)((%s *)object", s, s, typebase);
} else {
const char *retcast = get_cast(m->gtktypes->data, FALSE);
+ gboolean is_none = (strcmp(m->gtktypes->next->data, "NONE")==0);
out_printf(out,
"\t___%s rfunc;\n\t"
"%s *retval;\n\n"
"\trfunc = (___%s)func;\n\n"
"\tretval = GTK_RETLOC_%s(args[%d]);\n\n"
"\t*retval = (*rfunc)((%s *)object",
- s, retcast, s, (char *)m->gtktypes->data,
- g_list_length(m->gtktypes)-1, typebase);
+ s, retcast, s,
+ (char *)m->gtktypes->data,
+ g_list_length(m->gtktypes) - (is_none ? 2 : 1),
+ typebase);
}
print_signal_marsal_args(m);
"GtkType\n"
"%s_get_type (void)\n"
"{\n"
- "\tstatic guint type = 0;\n\n"
- "\tif ( ! type) {\n"
+ "\tstatic GtkType type = 0;\n\n"
+ "\tif (type == 0) {\n"
"\t\tstatic const GtkTypeInfo info = {\n"
"\t\t\t\"%s\",\n"
"\t\t\tsizeof (%s),\n"
add_enums(c);
- add_get_type();
+ if ( ! overrode_get_type)
+ add_get_type();
if(any_method_to_alias(c)) {
if( ! no_gnu) {
protecteds = count_protecteds((Class *)class);
destructors = count_destructors((Class *)class);
initializers = count_initializers((Class *)class);
+ overrode_get_type = find_get_type((Class *)class);
make_bases();
make_inits((Class *)class);