[gobject-introspection/wip/transformer] [major] Some fixes for (destroy) processing; a few more annotation updates
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/wip/transformer] [major] Some fixes for (destroy) processing; a few more annotation updates
- Date: Mon, 16 Aug 2010 23:11:13 +0000 (UTC)
commit 9079cd1e306e529243b5b839018caca751018ff1
Author: Colin Walters <walters verbum org>
Date: Mon Aug 16 19:10:04 2010 -0400
[major] Some fixes for (destroy) processing; a few more annotation updates
giscanner/primarytransformer.py | 10 +++++++++-
tests/scanner/Annotation-1.0-expected.gir | 11 ++++++++---
tests/scanner/annotation.c | 2 +-
tests/scanner/foo.c | 29 +++++++++++++++++++++++++++++
tests/scanner/utility.c | 7 +++++++
5 files changed, 54 insertions(+), 5 deletions(-)
---
diff --git a/giscanner/primarytransformer.py b/giscanner/primarytransformer.py
index 213ffba..23d6ebc 100644
--- a/giscanner/primarytransformer.py
+++ b/giscanner/primarytransformer.py
@@ -482,9 +482,17 @@ class PrimaryTransformer(object):
destroy = options.get(OPT_DESTROY)
if destroy:
+ destroy_name = destroy.one()
param.destroy_index = self._get_parameter_index(parent,
- destroy.one(),
+ destroy_name,
param)
+ param.scope = PARAM_SCOPE_NOTIFIED
+ if param.destroy_index >= 0:
+ destroy_param = parent.parameters[param.destroy_index]
+ # This is technically bogus; we're setting the scope on the destroy
+ # itself. But this helps avoid tripping a warning from finaltransformer,
+ # since we don't have a way right now to flag this callback a destroy.
+ destroy_param.scope = PARAM_SCOPE_NOTIFIED
self._fixup_param_destroy(parent, param)
closure = options.get(OPT_CLOSURE)
if closure:
diff --git a/tests/scanner/Annotation-1.0-expected.gir b/tests/scanner/Annotation-1.0-expected.gir
index 3afde08..7854cfe 100644
--- a/tests/scanner/Annotation-1.0-expected.gir
+++ b/tests/scanner/Annotation-1.0-expected.gir
@@ -455,7 +455,8 @@ type.</doc>
</method>
<method name="watch"
c:identifier="annotation_object_watch"
- shadows="annotation_object_watch_full">
+ shadows="annotation_object_watch_full"
+ introspectable="0">
<doc xml:whitespace="preserve">This is here just for the sake of being overriden by its
annotation_object_watch_full().</doc>
<return-value transfer-ownership="none">
@@ -529,7 +530,7 @@ annotation_object_watch_full().</doc>
</field>
<glib:signal name="attribute-signal">
<doc xml:whitespace="preserve">This signal tests a signal with attributes.</doc>
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="full">
<attribute name="some.annotation.foo3" value="val3"/>
<doc xml:whitespace="preserve">the return value</doc>
<type name="utf8"/>
@@ -634,12 +635,16 @@ detection, and fixing it via annotations.</doc>
<parameters>
<parameter name="callback"
transfer-ownership="none"
+ scope="notified"
closure="2"
destroy="1">
<doc xml:whitespace="preserve">Destroy notification</doc>
<type name="Callback" c:type="AnnotationCallback"/>
</parameter>
- <parameter name="destroy" transfer-ownership="none" closure="2">
+ <parameter name="destroy"
+ transfer-ownership="none"
+ scope="notified"
+ closure="2">
<type name="NotifyFunc" c:type="AnnotationNotifyFunc"/>
</parameter>
<parameter name="data" transfer-ownership="none">
diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c
index 77f5a46..40df086 100644
--- a/tests/scanner/annotation.c
+++ b/tests/scanner/annotation.c
@@ -579,7 +579,7 @@ annotation_object_do_not_use (AnnotationObject *object)
}
/**
- * annotation_object_watch:
+ * annotation_object_watch: (skip)
* @object: A #AnnotationObject
* @func: The callback
* @user_data: The callback data
diff --git a/tests/scanner/foo.c b/tests/scanner/foo.c
index d664d43..d1dde32 100644
--- a/tests/scanner/foo.c
+++ b/tests/scanner/foo.c
@@ -632,3 +632,32 @@ foo_skip_me (FooSkippable fs)
* FooForeignStruct: (foreign)
*
*/
+
+/**
+ * foo_test_varargs_callback: (skip)
+ *
+ */
+void
+foo_test_varargs_callback (gint i, FooVarargsCallback callback)
+{
+}
+
+/**
+ * foo_test_varargs_callback2: (skip)
+ *
+ */
+void
+foo_test_varargs_callback2 (FooVarargsCallback callback)
+{
+}
+
+/**
+ * foo_test_varargs_callback3: (skip)
+ *
+ */
+void
+foo_test_varargs_callback3 (FooVarargsCallback callback,
+ FooVarargsCallback callback2)
+{
+}
+
diff --git a/tests/scanner/utility.c b/tests/scanner/utility.c
index 8ebd3f8..8884b89 100644
--- a/tests/scanner/utility.c
+++ b/tests/scanner/utility.c
@@ -34,6 +34,13 @@ utility_object_watch_dir (UtilityObject *object,
}
+/**
+ * utility_dir_foreach:
+ * @path::
+ * @func: (scope call):
+ * @user_data::
+ *
+ */
void
utility_dir_foreach (const char *path, UtilityFileFunc func, gpointer user_data)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]