summaryrefslogtreecommitdiff
path: root/giscanner/girwriter.py
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2010-05-04 16:57:51 +0200
committerTomeu Vizoso <tomeu@sugarlabs.org>2010-05-04 16:58:15 +0200
commitf84400b39b966289d6a98548f606b247b05fb6c1 (patch)
tree4d56b0cdee22ca172da53614ce68db1faa33cd25 /giscanner/girwriter.py
parent39f2997b9f32598fa2288cdac36f513fcab590b5 (diff)
downloadgobject-introspection-f84400b39b966289d6a98548f606b247b05fb6c1.tar.gz
Add support for GArrays: add g_type_info_get_array_type() and properly scan GArray args
Based on a previous patch by C. Scott Ananian <cscott@litl.com> https://bugzilla.gnome.org/show_bug.cgi?id=581687
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r--giscanner/girwriter.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index 8088628d..8d625c73 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -244,11 +244,15 @@ and/or use gtk-doc annotations. ''')
attrs.append(('zero-terminated', '0'))
if ntype.length_param_index >= 0:
attrs.append(('length', '%d' % (ntype.length_param_index, )))
+ if ntype.name in ['GLib.Array', 'GLib.PtrArray', 'GLib.ByteArray']:
+ attrs.append(('name', ntype.name))
attrs.append(('c:type', ntype.ctype))
if ntype.size is not None:
attrs.append(('fixed-size', ntype.size))
+
with self.tagcontext('array', attrs):
- self._write_type(ntype.element_type)
+ if ntype.element_type is not None:
+ self._write_type(ntype.element_type)
return
attrs = [('name', self._type_to_string(ntype))]
# FIXME: figure out if type references a basic type