diff options
author | Johan Dahlin <johan@gnome.org> | 2008-08-17 16:52:46 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-08-17 16:52:46 +0000 |
commit | db4f839c2125e521b6d80f48f00b9e415048933d (patch) | |
tree | 9a92b62cf6c5896194499d846817c90335d382a9 /giscanner | |
parent | cbf6d45b7fc2bd29ff88cc7a8ed39c674fe9fb86 (diff) | |
download | gobject-introspection-db4f839c2125e521b6d80f48f00b9e415048933d.tar.gz |
Regenerate GObject & GType. Avoid warnings when generating
2008-08-17 Johan Dahlin <johan@gnome.org>
* gir/Makefile.am:
* gir/glib-2.0-good.gir:
* gir/gobject-2.0-good.gir:
* giscanner/cgobject.py:
* giscanner/glibtransformer.py:
Regenerate GObject & GType.
Avoid warnings when generating gobject-2.0.gir.
Introspect a little more, and skip *_get_type functions.
svn path=/trunk/; revision=391
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/cgobject.py | 5 | ||||
-rw-r--r-- | giscanner/glibtransformer.py | 19 |
2 files changed, 18 insertions, 6 deletions
diff --git a/giscanner/cgobject.py b/giscanner/cgobject.py index e3aec395..66ff6492 100644 --- a/giscanner/cgobject.py +++ b/giscanner/cgobject.py @@ -41,10 +41,10 @@ TYPE_INTERFACE = 8 TYPE_ENUM = 48 TYPE_FLAGS = 52 TYPE_STRING = 64 +TYPE_POINTER = 68 TYPE_BOXED = 72 TYPE_OBJECT = 80 - # Typedefs # FIXME - this is wrong on win64, where long == 32 but size_t == 64 @@ -253,3 +253,6 @@ def signal_list(type_id): info = GSignalInfo() signal_query(signal_ids[i], ctypes.byref(info)) yield info + +TYPE_GTYPE = type_from_name('GType') +TYPE_POINTER = type_from_name('gpointer') diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py index 82b19581..01e8fe7d 100644 --- a/giscanner/glibtransformer.py +++ b/giscanner/glibtransformer.py @@ -152,17 +152,18 @@ class GLibTransformer(object): symbol = func.symbol if not symbol.endswith('_get_type'): return False - if not self._libraries: - print "Warning: No libraries loaded, parsing _get_type function" - return False # GType *_get_type(void) - if func.retval.type.name != 'GObject.GType': + if func.retval.type.name not in ['GType', 'GObject.GType']: print ("Warning: *_get_type function returns '%r'" + \ ", not GObject.GType") % (func.retval.type.name, ) return False if func.parameters: return False + if not self._libraries: + print "Warning: No libraries loaded, cannot call %s" % (symbol, ) + return False + for library in self._libraries: try: func = getattr(library, symbol) @@ -288,8 +289,16 @@ class GLibTransformer(object): self._introspect_interface(type_id, symbol) elif fundamental_type_id == cgobject.TYPE_BOXED: self._introspect_boxed(type_id, symbol) + elif fundamental_type_id == cgobject.TYPE_BOXED: + self._introspect_boxed(type_id, symbol) + elif fundamental_type_id == cgobject.TYPE_POINTER: + # FIXME: Should we do something about these? + # GHashTable, GValue and a few other fundamentals are + # covered here + return else: - print 'unhandled GType: %s' % (cgobject.type_name(type_id), ) + print 'unhandled GType: %s(%d)' % (cgobject.type_name(type_id), + type_id) def _introspect_enum(self, ftype_id, type_id, symbol): type_class = cgobject.type_class_ref(type_id) |