Automatically turn Gdk.Rectangle gtype into cairo.RectangleInt
authorPavel Holejsovsky <pavel.holejsovsky@gmail.com>
Tue, 2 Aug 2011 05:41:54 +0000 (07:41 +0200)
committerPavel Holejsovsky <pholejs@src.gnome.org>
Thu, 11 Aug 2011 14:26:14 +0000 (16:26 +0200)
Gdk.Rectangle is 'boxed alias', which is not currently weel supported
by g-i.  Work around by transforming Gdk.Rectangle gtype into
cairo.RectangleInt.

https://bugzilla.gnome.org/show_bug.cgi?id=655423

giscanner/ast.py

index 906051942a0d127d78a6ea969e3bec6e75157b87..d4780f9edd6aa0ddfdd61433bf199d271000cdc8 100644 (file)
@@ -99,6 +99,13 @@ in contrast to the other create_type() functions."""
             bare_utf8.ctype = None
             return Array(None, bare_utf8, ctype=None, gtype_name=gtype_name,
                          is_const=False)
+
+        # Workaround for Gdk.Rectangle being boxed alias for
+        # cairo.RectangleInt.  G-I does not support boxing of aliases.
+        # See https://bugzilla.gnome.org/show_bug.cgi?id=655423
+        if gtype_name == 'GdkRectangle':
+            gtype_name = 'CairoRectangleInt'
+
         return cls(gtype_name=gtype_name)
 
     def get_giname(self):