Add two new functions to check sequence return values. Also fixes a
authorJohan Dahlin <johan@gnome.org>
Sun, 27 Apr 2008 23:13:24 +0000 (23:13 +0000)
committerJohan Dahlin <johan@src.gnome.org>
Sun, 27 Apr 2008 23:13:24 +0000 (23:13 +0000)
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

ChangeLog
tests/parser/Foo-expected.gidl
tests/parser/foo-object.h
tests/parser/foo.c

index 0b6d19d..e681e6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
 
index 4259211..8e9547d 100644 (file)
                                        <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">
index 8605f26..bc2984a 100644 (file)
@@ -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
index 6aba7cb..dbdb07a 100644 (file)
@@ -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
  *