diff options
author | Johan Dahlin <johan@gnome.org> | 2008-04-27 23:13:24 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-04-27 23:13:24 +0000 |
commit | 65c706f0d9c2dd8ac34bcf9fe7b399eccea25fdc (patch) | |
tree | 28d4d4c0a2d54cec2209e03ba1fcdea70da8cab6 | |
parent | 7d53a2b46201731c8537bcb483a07af37a805e1b (diff) | |
download | gobject-introspection-65c706f0d9c2dd8ac34bcf9fe7b399eccea25fdc.tar.gz |
Add two new functions to check sequence return values. Also fixes a
2008-04-27 Johan Dahlin <johan@gnome.org>
* tests/parser/Foo-expected.gidl:
* tests/parser/foo-object.h:
* tests/parser/foo.c (foo_object_class_init),
(foo_object_get_strings), (foo_object_get_objects):
Add two new functions to check sequence return values.
Also fixes a compilation warning.
svn path=/trunk/; revision=232
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | tests/parser/Foo-expected.gidl | 14 | ||||
-rw-r--r-- | tests/parser/foo-object.h | 2 | ||||
-rw-r--r-- | tests/parser/foo.c | 38 |
4 files changed, 61 insertions, 2 deletions
@@ -1,5 +1,14 @@ 2008-04-27 Johan Dahlin <johan@gnome.org> + * tests/parser/Foo-expected.gidl: + * tests/parser/foo-object.h: + * tests/parser/foo.c (foo_object_class_init), + (foo_object_get_strings), (foo_object_get_objects): + Add two new functions to check sequence return values. + Also fixes a compilation warning. + +2008-04-27 Johan Dahlin <johan@gnome.org> + * giscanner/giscannermodule.c (]): Cast the getter, avoids a compilation warning. diff --git a/tests/parser/Foo-expected.gidl b/tests/parser/Foo-expected.gidl index 42592114..8e9547d3 100644 --- a/tests/parser/Foo-expected.gidl +++ b/tests/parser/Foo-expected.gidl @@ -72,6 +72,18 @@ <parameter name="object" type="FooObject*"/> </parameters> </method> + <method name="get_objects" symbol="foo_object_get_objects"> + <return-type type="GSList*"/> + <parameters> + <parameter name="object" type="FooObject*"/> + </parameters> + </method> + <method name="get_strings" symbol="foo_object_get_strings"> + <return-type type="GList*"/> + <parameters> + <parameter name="object" type="FooObject*"/> + </parameters> + </method> <method name="in" symbol="foo_object_in"> <return-type type="gint"/> <parameters> @@ -90,7 +102,7 @@ <return-type type="gint"/> <parameters> <parameter name="object" type="FooObject*"/> - <parameter name="inoutarg" type="int*" direction="in-out"/> + <parameter name="inoutarg" type="int*"/> </parameters> </method> <method name="inout3" symbol="foo_object_inout3"> diff --git a/tests/parser/foo-object.h b/tests/parser/foo-object.h index 8605f267..bc2984a7 100644 --- a/tests/parser/foo-object.h +++ b/tests/parser/foo-object.h @@ -57,6 +57,8 @@ gint foo_object_inout3 (FooObject *object, int *inou gint foo_object_in (FooObject *object, int *inarg); gint foo_object_calleeowns (FooObject *object, GObject *toown); gint foo_object_calleesowns (FooObject *object, GObject *toown1, GObject *toown2); +GList* foo_object_get_strings (FooObject *object); +GSList* foo_object_get_objects (FooObject *object); struct _FooSubobject diff --git a/tests/parser/foo.c b/tests/parser/foo.c index 6aba7cbe..dbdb07a3 100644 --- a/tests/parser/foo.c +++ b/tests/parser/foo.c @@ -102,7 +102,7 @@ foo_object_class_init (FooObjectClass *klass) g_signal_new ("signal", G_OBJECT_CLASS_TYPE (gobject_class), G_SIGNAL_RUN_LAST, - NULL, + 0, NULL, NULL, (GSignalCMarshaller)g_cclosure_marshal_STRING__OBJECT_POINTER, G_TYPE_STRING, 2, G_TYPE_OBJECT, G_TYPE_POINTER); @@ -244,6 +244,42 @@ foo_object_calleesowns (FooObject *object, GObject *toown1, GObject *toown2) /** + * foo_object_get_strings: + * @object: a #GObject + * + * This is a test for returning a list of strings + * + * Return value: (seq char* (callee-owns)) (caller-owns): list of strings + */ +GList* +foo_object_get_strings (FooObject *object) +{ + GList *list = NULL; + list = g_list_prepend (list, "foo"); + list = g_list_prepend (list, "bar"); + return list; +} + +/** + * foo_object_get_objects: + * @object: a #GObject + * + * This is a test for returning a list of objects. + * The list itself should be freed, but not the internal objects, + * intentionally similar example to gtk_container_get_children + * + * Return value: (seq FooObject* (callee-owns)) (caller-owns): a list + * of strings + */ +GSList* +foo_object_get_objects (FooObject *object) +{ + GSList *list = NULL; + list = g_slist_prepend (list, object); + return list; +} + +/** * foo_object_create_object: * @object: a #GObject * |