gobject-introspection r1000 - in trunk: . giscanner tests/scanner
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r1000 - in trunk: . giscanner tests/scanner
- Date: Sat, 3 Jan 2009 14:36:59 +0000 (UTC)
Author: johan
Date: Sat Jan 3 14:36:59 2009
New Revision: 1000
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=1000&view=rev
Log:
2009-01-03 Andreas Rottmann <a rottmann gmx at>
Bug 563469 â Arrays not treated correctly in struct offset calculation
* tests/scanner/foo.h (FooObject): Added field `some_int'.
* tests/scanner/foo-1.0-expected.gir,
* tests/scanner/foo-1.0-expected.tgir: Adapted.
* giscanner/glibtransformer.py (GLibTransformer._create_gobject):
carry over object fields from original (struct) node.
(GLibTransformer._pair_class_struct): Don't add fields of the
class struct to to the node for the class, they should go under a
nested <record> element (see also Bug 551738). This is needed as
otherwise offset calculation would not work, as the instance
fields are mingled with the class fields without a way to
distinguish them.
Modified:
trunk/ChangeLog
trunk/giscanner/glibtransformer.py
trunk/tests/scanner/foo-1.0-expected.gir
trunk/tests/scanner/foo-1.0-expected.tgir
trunk/tests/scanner/foo.h
Modified: trunk/giscanner/glibtransformer.py
==============================================================================
--- trunk/giscanner/glibtransformer.py (original)
+++ trunk/giscanner/glibtransformer.py Sat Jan 3 14:36:59 2009
@@ -248,9 +248,10 @@
parent_type_name = 'GObject'
parent_gitype = self._resolve_gtypename(parent_type_name)
symbol = 'g_initially_unowned_get_type'
- node = GLibObject(node.name, parent_gitype, type_name, symbol, True)
- self._add_attribute(node)
- self._register_internal_type(type_name, node)
+ gnode = GLibObject(node.name, parent_gitype, type_name, symbol, True)
+ gnode.fields.extend(node.fields)
+ self._add_attribute(gnode)
+ self._register_internal_type(type_name, gnode)
# Parser
def _parse_node(self, node):
@@ -499,8 +500,7 @@
name = self._resolve_type_name(name)
resolved = self._transformer.remove_prefix(name)
pair_class = self._get_attribute(resolved)
- if pair_class and isinstance(pair_class,
- (GLibObject, GLibInterface)):
+ if pair_class and isinstance(pair_class, GLibInterface):
for field in maybe_class.fields[1:]:
pair_class.fields.append(field)
return
Modified: trunk/tests/scanner/foo-1.0-expected.gir
==============================================================================
--- trunk/tests/scanner/foo-1.0-expected.gir (original)
+++ trunk/tests/scanner/foo-1.0-expected.gir Sat Jan 3 14:36:59 2009
@@ -180,19 +180,9 @@
<field name="parent_instance">
<type name="GObject.Object" c:type="GObject"/>
</field>
- <callback name="virtual_method" c:type="virtual_method">
- <return-value transfer-ownership="none">
- <type name="boolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="object" transfer-ownership="none">
- <type name="Object" c:type="FooObject*"/>
- </parameter>
- <parameter name="first_param" transfer-ownership="none">
- <type name="int" c:type="int"/>
- </parameter>
- </parameters>
- </callback>
+ <field name="some_int">
+ <type name="int" c:type="int"/>
+ </field>
<glib:signal name="signal">
<return-value transfer-ownership="full">
<type name="utf8" c:type="gchararray"/>
Modified: trunk/tests/scanner/foo-1.0-expected.tgir
==============================================================================
--- trunk/tests/scanner/foo-1.0-expected.tgir (original)
+++ trunk/tests/scanner/foo-1.0-expected.tgir Sat Jan 3 14:36:59 2009
@@ -31,6 +31,9 @@
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
+ <field name="some_int">
+ <type name="int"/>
+ </field>
<constructor name="new" c:identifier="foo_object_new">
<return-value transfer-ownership="full">
<type name="Object"/>
Modified: trunk/tests/scanner/foo.h
==============================================================================
--- trunk/tests/scanner/foo.h (original)
+++ trunk/tests/scanner/foo.h Sat Jan 3 14:36:59 2009
@@ -55,6 +55,8 @@
struct _FooObject
{
GObject parent_instance;
+
+ int some_int;
};
struct _FooObjectClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]