diff options
author | Colin Walters <walters@src.gnome.org> | 2008-09-29 19:03:35 +0000 |
---|---|---|
committer | Colin Walters <walters@src.gnome.org> | 2008-09-29 19:03:35 +0000 |
commit | 3de4dd3835dd294dc76e186cf0d756356cfe281e (patch) | |
tree | e6a6bb74cacf52fbd152c34fee2ed7f82a84b1d4 /giscanner/glibtransformer.py | |
parent | 195b04e2c35d8bb3075ee846c77ae89bd3b8ab26 (diff) | |
download | gobject-introspection-3de4dd3835dd294dc76e186cf0d756356cfe281e.tar.gz |
Some work on arrays
svn path=/trunk/; revision=633
Diffstat (limited to 'giscanner/glibtransformer.py')
-rw-r--r-- | giscanner/glibtransformer.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py index 40608f87..bfd8213a 100644 --- a/giscanner/glibtransformer.py +++ b/giscanner/glibtransformer.py @@ -25,7 +25,7 @@ from ctypes.util import find_library from . import cgobject from .ast import (Callback, Enum, Function, Member, Namespace, Parameter, - Sequence, Property, Return, Struct, Type, Alias, + Property, Return, Struct, Type, Alias, Array, Union, type_name_from_ctype) from .transformer import Names from .glibast import (GLibBoxed, GLibEnum, GLibEnumMember, GLibFlags, @@ -167,6 +167,12 @@ class GLibTransformer(object): no_uscore_prefixed = (prefix + '_' + to_underscores(suffix)).lower() self._uscore_type_names[no_uscore_prefixed] = node + def type_is_list(self, ctype): + return ctype in ['GList*', 'GSList*'] + + def type_is_map(self, ctype): + return ctype in ['GHashTable*'] + # Helper functions def _type_from_gtype(self, type_id): @@ -630,9 +636,9 @@ class GLibTransformer(object): return False def _validate_type(self, ptype): - if isinstance(ptype, Sequence): + if isinstance(ptype, Array): etype = ptype.element_type - if isinstance(etype, Sequence): + if isinstance(etype, Array): return self._validate_type(etype) return self._validate_type_name(etype) return self._validate_type_name(ptype.name) |