gobject-introspection r350 - in trunk: . giscanner
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r350 - in trunk: . giscanner
- Date: Tue, 12 Aug 2008 18:36:33 +0000 (UTC)
Author: walters
Date: Tue Aug 12 18:36:33 2008
New Revision: 350
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=350&view=rev
Log:
2008-08-12 Colin Walters <walters verbum org>
* giscanner/glibtransformer.py: We need to do type
resolution in a second pass after we've seen all the
enums, records, etc.
Modified:
trunk/ChangeLog
trunk/giscanner/glibtransformer.py
Modified: trunk/giscanner/glibtransformer.py
==============================================================================
--- trunk/giscanner/glibtransformer.py (original)
+++ trunk/giscanner/glibtransformer.py Tue Aug 12 18:36:33 2008
@@ -20,6 +20,7 @@
import ctypes
import os
+import sys
from . import cgobject
from .odict import odict
@@ -60,6 +61,7 @@
# associate GtkButtonClass with GtkButton
if isinstance(node, Struct):
self._pair_class_struct(node)
+ self._resolve_node(node)
namespace = Namespace(namespace.name)
namespace.nodes = self._output_ns.values()
@@ -111,6 +113,15 @@
else:
print 'GOBJECT BUILDER: Unhandled node:', node
+ def _resolve_node(self, node):
+ if isinstance(node, Function):
+ self._resolve_function(node)
+ elif type(node) in (GLibObject, GLibBoxed):
+ for meth in node.methods:
+ self._resolve_function(meth)
+ for ctor in node.constructors:
+ self._resolve_function(ctor)
+
def _parse_enum(self, enum):
self._add_attribute(enum)
@@ -122,12 +133,13 @@
elif self._parse_method(func):
return
- self._parse_parameters(func.parameters)
- func.retval.type = self._resolve_param_type(func.retval.type)
-
self._add_attribute(func)
- def _parse_parameters(self, parameters):
+ def _resolve_function(self, func):
+ self._resolve_parameters(func.parameters)
+ func.retval.type = self._resolve_param_type(func.retval.type)
+
+ def _resolve_parameters(self, parameters):
for parameter in parameters:
parameter.type = self._resolve_param_type(parameter.type)
@@ -199,8 +211,6 @@
class_.methods.append(func)
else:
class_.constructors.append(func)
- self._parse_parameters(func.parameters)
- func.retval.type = self._resolve_param_type(func.retval.type)
return True
def _parse_struct(self, struct):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]