Merge branch 'bug551744-boxed-ctors'
authorColin Walters <walters@src.gnome.org>
Fri, 3 Oct 2008 19:30:12 +0000 (19:30 +0000)
committerColin Walters <walters@src.gnome.org>
Fri, 3 Oct 2008 19:30:12 +0000 (19:30 +0000)
svn path=/trunk/; revision=654

girepository/gtypelib.c
giscanner/glibtransformer.py
tests/scanner/foo-expected.gir

index 983c6954d958ae2240d0773ce77bc28fed92352f..9a2e73c56ad1df737b10c99fc497c4f8d8af89cb 100644 (file)
@@ -738,6 +738,8 @@ validate_function_blob (ValidateContext *ctx,
   switch (container_type)
     {
     case BLOB_TYPE_BOXED:
+    case BLOB_TYPE_STRUCT:
+    case BLOB_TYPE_UNION:
     case BLOB_TYPE_OBJECT:
     case BLOB_TYPE_INTERFACE:
       is_method = !(blob->constructor || blob->setter || blob->getter || blob->wraps_vfunc);
@@ -751,6 +753,8 @@ validate_function_blob (ValidateContext *ctx,
       switch (container_type)
        {
        case BLOB_TYPE_BOXED:
+       case BLOB_TYPE_STRUCT:
+       case BLOB_TYPE_UNION:
        case BLOB_TYPE_OBJECT:
        case BLOB_TYPE_INTERFACE:
          break;
index 1300c86aae768c8ef84ee423e98589db2f070830..7ba4acaa32ec7a42cb1d8faf9d9bb28c9242854b 100644 (file)
@@ -378,7 +378,7 @@ class GLibTransformer(object):
 
         if not is_method:
             # Interfaces can't have constructors, punt to global scope
-            if isinstance(klass, (GLibInterface, GLibBoxed)):
+            if isinstance(klass, GLibInterface):
                 #print "NOTE: Rejecting constructor for"+\
                 #    " interface type: %r" % (func.symbol, )
                 return None
@@ -386,7 +386,8 @@ class GLibTransformer(object):
             # class from the prefix
             # But for now, ensure that constructor returns are always
             # the most concrete class
-            func.retval.type = Type(klass.name, klass.ctype+'*')
+            func.retval.type = Type(klass.name,
+                                    self._transformer.ctype_of(klass)+'*')
 
         self._remove_attribute(func.name)
         # Strip namespace and object prefix: gtk_window_new -> new
index d2b4fbf7ad3beb33765ae15973aea919acb1d15c..6a1e49a7a4117a7ba67294b026cfa9d228b85c57 100644 (file)
             c:type="FooBoxed"
             glib:type-name="FooBoxed"
             glib:get-type="foo_boxed_get_type">
+      <constructor name="new" c:identifier="foo_boxed_new">
+        <return-value>
+          <type name="Boxed" c:type="FooBoxed*"/>
+        </return-value>
+      </constructor>
       <method name="method" c:identifier="foo_boxed_method">
         <return-value>
           <type name="none" c:type="void"/>
         </return-value>
       </method>
     </record>
-    <function name="boxed_new" c:identifier="foo_boxed_new">
-      <return-value>
-        <type name="Boxed" c:type="FooBoxed*"/>
-      </return-value>
-    </function>
     <record name="DBusData"
             c:type="FooDBusData"
             glib:type-name="FooDBusData"