summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-09-13 15:31:49 -0400
committerColin Walters <walters@verbum.org>2010-09-13 15:31:49 -0400
commit9fffe0160d211f798b57ecbb13dd3a28c5a671cf (patch)
tree027717930511cdcd2276754c4c4a33221387b346
parent3236f2c4bb6e58f64f48b10f2b826b86c30aad16 (diff)
scanner: Add GType for GVariant
This needs a manual override since GVariant is a fundamental.
-rw-r--r--giscanner/gdumpparser.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index ea5794e..d23e93f 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -84,6 +84,7 @@ class GDumpParser(object):
for node in self._namespace.itervalues():
if isinstance(node, ast.Function):
self._initparse_function(node)
+
if self._namespace.name == 'GObject':
for node in self._namespace.itervalues():
if isinstance(node, ast.Record):
@@ -131,6 +132,13 @@ class GDumpParser(object):
for node in to_remove:
self._namespace.remove(node)
+ if self._namespace.name == 'GLib':
+ variant = self._namespace.get('Variant')
+ assert variant is not None
+ variant.add_gtype('GVariant', 'g_variant_get_gtype')
+ # Work around scanner bug
+ variant.disguised = False
+
# Helper functions
def _execute_binary_get_tree(self):
@@ -220,13 +228,10 @@ blob containing data gleaned from GObject's primitive introspection."""
def _initparse_gobject_record(self, record):
# Special handling for when we're parsing GObject
- internal_names = ("Object", 'InitiallyUnowned')
- if record.name in internal_names:
+ if record.name in ("Object", 'InitiallyUnowned'):
self._create_gobject(record)
- return
- if record.name == 'InitiallyUnownedClass':
+ elif record.name == 'InitiallyUnownedClass':
record.fields = self._namespace.get('ObjectClass').fields
- self._namespace.append(record, replace=True)
# Introspection over the data we get from the dynamic
# GObject/GType system out of the binary