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.
<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>
<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">
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
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);
/**
+ * 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
*