gobject-introspection r250 - in trunk: . giscanner tests/parser
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r250 - in trunk: . giscanner tests/parser
- Date: Mon, 28 Apr 2008 20:24:12 +0100 (BST)
Author: johan
Date: Mon Apr 28 19:24:11 2008
New Revision: 250
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=250&view=rev
Log:
2008-04-28 Johan Dahlin <jdahlin async com br>
* giscanner/ast.py:
* giscanner/girwriter.py:
* giscanner/glibtransformer.py:
* tests/parser/Foo-expected.gidl:
* tests/parser/Makefile.am:
Move c:identifier from return-value to subchild type,
as per JÃrgs suggestion
Modified:
trunk/ChangeLog
trunk/giscanner/ast.py
trunk/giscanner/girwriter.py
trunk/giscanner/glibtransformer.py
trunk/tests/parser/Foo-expected.gir
trunk/tests/parser/Makefile.am
Modified: trunk/giscanner/ast.py
==============================================================================
--- trunk/giscanner/ast.py (original)
+++ trunk/giscanner/ast.py Mon Apr 28 19:24:11 2008
@@ -44,6 +44,7 @@
class Type(Node):
def __init__(self, name):
Node.__init__(self, name)
+ self.cidentifier = name
def __repr__(self):
return 'Type(%r)' % (self.name,)
@@ -92,7 +93,6 @@
Node.__init__(self)
self.type = Type(type_name)
self.transfer = 'none'
- self.ctype = self.type
def __repr__(self):
return 'Return(%r)' % (self.type,)
Modified: trunk/giscanner/girwriter.py
==============================================================================
--- trunk/giscanner/girwriter.py (original)
+++ trunk/giscanner/girwriter.py Mon Apr 28 19:24:11 2008
@@ -76,8 +76,7 @@
def _write_return_type(self, return_):
if not return_:
return
- attrs = [('c:identifer', return_.type.name)]
- with self.tagcontext('return-value', attrs):
+ with self.tagcontext('return-value'):
if isinstance(return_.type, Sequence):
self._write_sequence(return_.type)
else:
@@ -100,7 +99,9 @@
self._write_type(parameter.type)
def _write_type(self, type):
- self.write_tag('type', [('name', type.name)])
+ attrs = [('name', type.name),
+ ('c:identifier', type.cidentifier)]
+ self.write_tag('type', attrs)
def _write_sequence(self, sequence):
attrs = [('c:owner', sequence.cowner)]
Modified: trunk/giscanner/glibtransformer.py
==============================================================================
--- trunk/giscanner/glibtransformer.py (original)
+++ trunk/giscanner/glibtransformer.py Mon Apr 28 19:24:11 2008
@@ -341,8 +341,8 @@
def _introspect_signals(self, node, type_id):
for signal_info in cgobject.signal_list(type_id):
- retval = Return(cgobject.type_name(signal_info.return_type))
- signal = GLibSignal(signal_info.signal_name, retval)
+ return_ = Return(cgobject.type_name(signal_info.return_type))
+ signal = GLibSignal(signal_info.signal_name, return_)
for i, parameter in enumerate(signal_info.get_params()):
if i == 0:
name = 'object'
Modified: trunk/tests/parser/Foo-expected.gir
==============================================================================
--- trunk/tests/parser/Foo-expected.gir (original)
+++ trunk/tests/parser/Foo-expected.gir Mon Apr 28 19:24:11 2008
@@ -8,8 +8,8 @@
glib:get-type="foo_interface_get_type">
</interface>
<function name="init" c:identifier="foo_init">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
</function>
<class name="Object"
@@ -17,160 +17,160 @@
glib:type-name="FooObject"
glib:get-type="foo_object_get_type">
<constructor name="new" c:identifier="foo_object_new">
- <return-value c:identifer="Object*">
- <type name="Object*"/>
+ <return-value>
+ <type name="Object*" c:identifier="FooObject*"/>
</return-value>
</constructor>
<method name="method" c:identifier="foo_object_method">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
</parameters>
</method>
<method name="external_type" c:identifier="foo_object_external_type">
- <return-value c:identifer="utility.Object*">
- <type name="utility.Object*"/>
+ <return-value>
+ <type name="utility.Object*" c:identifier="UtilityObject*"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
</parameters>
</method>
<method name="out" c:identifier="foo_object_out">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
<parameter name="outarg" direction="out">
- <type name="int*"/>
+ <type name="int*" c:identifier="int*"/>
</parameter>
</parameters>
</method>
<method name="create_object" c:identifier="foo_object_create_object">
- <return-value c:identifer="GLib.Object*">
- <type name="GLib.Object*"/>
+ <return-value>
+ <type name="GLib.Object*" c:identifier="GObject*"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
</parameters>
</method>
<method name="inout" c:identifier="foo_object_inout">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
<parameter name="inoutarg" direction="inout">
- <type name="int*"/>
+ <type name="int*" c:identifier="int*"/>
</parameter>
</parameters>
</method>
<method name="inout2" c:identifier="foo_object_inout2">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
<parameter name="inoutarg">
- <type name="int*"/>
+ <type name="int*" c:identifier="int*"/>
</parameter>
</parameters>
</method>
<method name="inout3" c:identifier="foo_object_inout3">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
<parameter name="inoutarg" direction="inout">
- <type name="int*"/>
+ <type name="int*" c:identifier="int*"/>
</parameter>
</parameters>
</method>
<method name="in" c:identifier="foo_object_in">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
<parameter name="inarg">
- <type name="int*"/>
+ <type name="int*" c:identifier="int*"/>
</parameter>
</parameters>
</method>
<method name="calleeowns" c:identifier="foo_object_calleeowns">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
<parameter name="toown" transfer="full">
- <type name="GLib.Object*"/>
+ <type name="GLib.Object*" c:identifier="GObject*"/>
</parameter>
</parameters>
</method>
<method name="calleesowns" c:identifier="foo_object_calleesowns">
- <return-value c:identifer="gint">
- <type name="gint"/>
+ <return-value>
+ <type name="gint" c:identifier="gint"/>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
<parameter name="toown1" transfer="full">
- <type name="GLib.Object*"/>
+ <type name="GLib.Object*" c:identifier="GObject*"/>
</parameter>
<parameter name="toown2" transfer="full">
- <type name="GLib.Object*"/>
+ <type name="GLib.Object*" c:identifier="GObject*"/>
</parameter>
</parameters>
</method>
<method name="get_strings" c:identifier="foo_object_get_strings">
- <return-value c:identifer="GList*">
+ <return-value>
<sequence c:owner="caller">
<element-type c:identifier="char*"/>
</sequence>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
</parameters>
</method>
<method name="get_objects" c:identifier="foo_object_get_objects">
- <return-value c:identifer="GSList*">
+ <return-value>
<sequence c:owner="caller">
<element-type c:identifier="FooObject*"/>
</sequence>
</return-value>
<parameters>
<parameter name="object">
- <type name="Object*"/>
+ <type name="Object*" c:identifier="FooObject*"/>
</parameter>
</parameters>
</method>
<property name="string">
- <type name="gchararray"/>
+ <type name="gchararray" c:identifier="gchararray"/>
</property>
</class>
<class name="Subobject"
@@ -178,8 +178,8 @@
glib:type-name="FooSubobject"
glib:get-type="foo_subobject_get_type">
<constructor name="new" c:identifier="foo_subobject_new">
- <return-value c:identifer="Subobject*">
- <type name="Subobject*"/>
+ <return-value>
+ <type name="Subobject*" c:identifier="FooSubobject*"/>
</return-value>
</constructor>
</class>
@@ -191,12 +191,12 @@
<member name="FOO_ENUM_DELTA" value="2" glib:nick="delta"/>
</enumeration>
<function name="enum_type_method" c:identifier="foo_enum_type_method">
- <return-value c:identifer="int">
- <type name="int"/>
+ <return-value>
+ <type name="int" c:identifier="int"/>
</return-value>
<parameters>
<parameter name="foo_enum">
- <type name="EnumType"/>
+ <type name="EnumType" c:identifier="FooEnumType"/>
</parameter>
</parameters>
</function>
@@ -216,34 +216,34 @@
glib:type-name="FooBoxed"
glib:get-type="foo_boxed_get_type">
<constructor name="new" c:identifier="foo_boxed_new">
- <return-value c:identifer="Boxed*">
- <type name="Boxed*"/>
+ <return-value>
+ <type name="Boxed*" c:identifier="FooBoxed*"/>
</return-value>
</constructor>
<method name="method" c:identifier="foo_boxed_method">
- <return-value c:identifer="void">
- <type name="void"/>
+ <return-value>
+ <type name="void" c:identifier="void"/>
</return-value>
<parameters>
<parameter name="boxed">
- <type name="Boxed*"/>
+ <type name="Boxed*" c:identifier="FooBoxed*"/>
</parameter>
</parameters>
</method>
</glib:boxed>
<callback name="FooCallback">
- <return-value c:identifer="gboolean">
- <type name="gboolean"/>
+ <return-value>
+ <type name="gboolean" c:identifier="gboolean"/>
</return-value>
<parameters>
<parameter name="foo">
- <type name="FooObject*"/>
+ <type name="FooObject*" c:identifier="FooObject*"/>
</parameter>
<parameter name="b">
- <type name="gboolean"/>
+ <type name="gboolean" c:identifier="gboolean"/>
</parameter>
<parameter name="data">
- <type name="gpointer"/>
+ <type name="gpointer" c:identifier="gpointer"/>
</parameter>
</parameters>
</callback>
Modified: trunk/tests/parser/Makefile.am
==============================================================================
--- trunk/tests/parser/Makefile.am (original)
+++ trunk/tests/parser/Makefile.am Mon Apr 28 19:24:11 2008
@@ -31,7 +31,7 @@
Foo.gir: libfoo.la foo-object.h $(SCANNER)
@PYTHONPATH=$(top_builddir) $(SCANNER) -v \
--include=$(top_srcdir)/gir/gobject-2.0.gir \
- --include=$(builddir)/utility.gir \
+ --include=$(top_builddir)/tests/parser/utility.gir \
--library=libfoo.la \
--namespace=Foo \
--pkg gobject-2.0 \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]