diff options
author | Andreas Rottmann <a.rottmann@gmx.at> | 2009-03-19 01:01:58 +0100 |
---|---|---|
committer | Andreas Rottmann <a.rottmann@gmx.at> | 2009-03-19 01:01:58 +0100 |
commit | 23e6fa6993c046de032598127ea48d4a7ee00935 (patch) | |
tree | 45cad6ff863aa10091f32c728f73f8b5e9ad87cf /tests | |
parent | 888566c41b4f0d73ec80307d0418ab1d44c7210c (diff) | |
download | gobject-introspection-23e6fa6993c046de032598127ea48d4a7ee00935.tar.gz |
Bug 556475 – support Shadows: annotation
Add support for the 'Rename To:' annotation for functions and methods.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scanner/annotation-1.0-expected.gir | 21 | ||||
-rw-r--r-- | tests/scanner/annotation-1.0-expected.tgir | 16 | ||||
-rw-r--r-- | tests/scanner/annotation.c | 35 | ||||
-rw-r--r-- | tests/scanner/annotation.h | 7 |
4 files changed, 79 insertions, 0 deletions
diff --git a/tests/scanner/annotation-1.0-expected.gir b/tests/scanner/annotation-1.0-expected.gir index 91fe5611..e82201e4 100644 --- a/tests/scanner/annotation-1.0-expected.gir +++ b/tests/scanner/annotation-1.0-expected.gir @@ -430,6 +430,27 @@ type."> <type name="GObject.Object" c:type="GObject*"/> </return-value> </method> + <method name="watch" + c:identifier="annotation_object_watch_full" + doc="Test overriding via the "Rename To" annotation."> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + <parameters> + <parameter name="func" + transfer-ownership="none" + closure="2" + destroy="3"> + <type name="ForeachFunc" c:type="AnnotationForeachFunc"/> + </parameter> + <parameter name="user_data" transfer-ownership="none"> + <type name="any" c:type="gpointer"/> + </parameter> + <parameter name="destroy" transfer-ownership="none"> + <type name="GLib.DestroyNotify" c:type="GDestroyNotify"/> + </parameter> + </parameters> + </method> <method name="extra_annos" c:identifier="annotation_object_extra_annos"> <attribute name="org.foobar" value="testvalue"/> <return-value transfer-ownership="none"> diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir index 3629d5ff..0d88c47b 100644 --- a/tests/scanner/annotation-1.0-expected.tgir +++ b/tests/scanner/annotation-1.0-expected.tgir @@ -324,6 +324,22 @@ <type name="GObject.Object"/> </return-value> </method> + <method name="watch" c:identifier="annotation_object_watch_full"> + <return-value transfer-ownership="none"> + <type name="none"/> + </return-value> + <parameters> + <parameter name="func" transfer-ownership="none" closure="2" destroy="3"> + <type name="ForeachFunc"/> + </parameter> + <parameter name="user_data" transfer-ownership="none"> + <type name="any"/> + </parameter> + <parameter name="destroy" transfer-ownership="none"> + <type name="GLib.DestroyNotify"/> + </parameter> + </parameters> + </method> <method name="extra_annos" c:identifier="annotation_object_extra_annos"> <attribute name="org.foobar" value="testvalue"/> <return-value transfer-ownership="none"> diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c index 3dcc6be7..7c25d9a2 100644 --- a/tests/scanner/annotation.c +++ b/tests/scanner/annotation.c @@ -513,6 +513,41 @@ annotation_object_do_not_use (AnnotationObject *object) } /** + * annotation_object_watch: + * @object: A #AnnotationObject + * @func: The callback + * @user_data: The callback data + * + * This is here just for the sake of being overriden by its + * annotation_object_watch_full(). + */ +void +annotation_object_watch (AnnotationObject *object, + AnnotationForeachFunc func, + gpointer user_data) +{ +} + +/** + * annotation_object_watch_full: + * @object: A #AnnotationObject + * @func: The callback + * @user_data: The callback data + * @destroy: Destroy notification + * + * Test overriding via the "Rename To" annotation. + * + * Rename to: annotation_object_watch + */ +void +annotation_object_watch_full (AnnotationObject *object, + AnnotationForeachFunc func, + gpointer user_data, + GDestroyNotify destroy) +{ +} + +/** * annotation_init: * @argc: (inout): The number of args. * @argv: (inout) (array length=argc): The arguments. diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h index 102b571a..e43e7ba6 100644 --- a/tests/scanner/annotation.h +++ b/tests/scanner/annotation.h @@ -105,6 +105,13 @@ void annotation_object_set_data3 (AnnotationObject *object, gsize length); GObject* annotation_object_do_not_use (AnnotationObject *object); +void annotation_object_watch (AnnotationObject *object, + AnnotationForeachFunc func, + gpointer user_data); +void annotation_object_watch_full (AnnotationObject *object, + AnnotationForeachFunc func, + gpointer user_data, + GDestroyNotify destroy); void annotation_init (int *argc, char ***argv); |