gobject-introspection r389 - in trunk: . girepository giscanner
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r389 - in trunk: . girepository giscanner
- Date: Sat, 16 Aug 2008 22:26:55 +0000 (UTC)
Author: johan
Date: Sat Aug 16 22:26:55 2008
New Revision: 389
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=389&view=rev
Log:
2008-08-17 Johan Dahlin <johan gnome org>
* girepository/gtypelib.c (validate_enum_blob):
* giscanner/glibtransformer.py:
* giscanner/transformer.py:
Remove resolve_possible_typedefs, it was unused.
Allow multiple enum values of the sample value in an enum,
since it's actually pretty common.
Register enums so they can be resolved too.
Modified:
trunk/ChangeLog
trunk/girepository/gtypelib.c
trunk/giscanner/glibtransformer.py
trunk/giscanner/transformer.py
Modified: trunk/girepository/gtypelib.c
==============================================================================
--- trunk/girepository/gtypelib.c (original)
+++ trunk/girepository/gtypelib.c Sat Aug 16 22:26:55 2008
@@ -1199,6 +1199,7 @@
error))
return FALSE;
+#if 0
v1 = (ValueBlob *)&typelib->data[offset + sizeof (EnumBlob) +
i * sizeof (ValueBlob)];
for (j = 0; j < i; j++)
@@ -1208,6 +1209,7 @@
if (v1->value == v2->value)
{
+
/* FIXME should this be an error ? */
g_set_error (error,
G_TYPELIB_ERROR,
@@ -1216,6 +1218,7 @@
return FALSE;
}
}
+#endif
}
return TRUE;
Modified: trunk/giscanner/glibtransformer.py
==============================================================================
--- trunk/giscanner/glibtransformer.py (original)
+++ trunk/giscanner/glibtransformer.py Sat Aug 16 22:26:55 2008
@@ -182,7 +182,8 @@
def _name_is_internal_gtype(self, giname):
try:
node = self._internal_types[giname]
- return isinstance(node, (GLibObject, GLibInterface, GLibBoxed))
+ return isinstance(node, (GLibObject, GLibInterface, GLibBoxed,
+ GLibEnum, GLibFlags))
except KeyError, e:
return False
@@ -399,7 +400,6 @@
def _resolve_param_type(self, ptype):
ptype.name = ptype.name.replace('*', '')
type_name = ptype.name
- type_name = self._transformer.resolve_possible_typedef(type_name)
possible_node = self._internal_types.get(type_name)
if possible_node:
ptype.name = possible_node.name
Modified: trunk/giscanner/transformer.py
==============================================================================
--- trunk/giscanner/transformer.py (original)
+++ trunk/giscanner/transformer.py Sat Aug 16 22:26:55 2008
@@ -48,7 +48,6 @@
self._ctype_names = {} # Maps from CType -> (namespace, node)
self._typedefs_ns = {}
self._strip_prefix = ''
- self._typedefs = {}
def get_type_names(self):
return self._type_names
@@ -59,9 +58,6 @@
def set_strip_prefix(self, strip_prefix):
self._strip_prefix = strip_prefix
- def resolve_possible_typedef(self, tname):
- return self._typedefs.get(tname, tname)
-
def parse(self):
nodes = []
for symbol in self.generator.get_symbols():
@@ -161,7 +157,9 @@
enum_name = self.strip_namespace_object(symbol.ident)
enum_name = symbol.ident[-len(enum_name):]
- return Enum(enum_name, symbol.ident, members)
+ enum = Enum(enum_name, symbol.ident, members)
+ self._type_names[symbol.ident] = (None, enum)
+ return enum
def _create_object(self, symbol):
return Member(symbol.ident, symbol.base_type.name,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]