]> git.draconx.ca Git - gob-dx.git/blobdiff - src/main.c
Release 1.0.7
[gob-dx.git] / src / main.c
index 6b233d780ecb1de7b818f640c89b0aabb2df71c9..d94361a885aad4d5aec038557876ebc79178573f 100644 (file)
@@ -67,6 +67,7 @@ static int privates = 0; /* number of private data members */
 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
@@ -818,8 +819,8 @@ add_get_type(void)
                   "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"
@@ -2358,7 +2359,8 @@ print_class_block(Class *c)
 
        add_enums(c);
 
-       add_get_type();
+       if ( ! overrode_get_type)
+               add_get_type();
 
        if(any_method_to_alias(c)) {
                if( ! no_gnu) {
@@ -2773,6 +2775,7 @@ main(int argc, char *argv[])
        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);