gobject-introspection r232 - in trunk: . tests/parser



Author: johan
Date: Sun Apr 27 23:13:24 2008
New Revision: 232
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=232&view=rev

Log:
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.



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

Modified: trunk/tests/parser/Foo-expected.gidl
==============================================================================
--- trunk/tests/parser/Foo-expected.gidl	(original)
+++ trunk/tests/parser/Foo-expected.gidl	Sun Apr 27 23:13:24 2008
@@ -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">

Modified: trunk/tests/parser/foo-object.h
==============================================================================
--- trunk/tests/parser/foo-object.h	(original)
+++ trunk/tests/parser/foo-object.h	Sun Apr 27 23:13:24 2008
@@ -57,6 +57,8 @@
 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

Modified: trunk/tests/parser/foo.c
==============================================================================
--- trunk/tests/parser/foo.c	(original)
+++ trunk/tests/parser/foo.c	Sun Apr 27 23:13:24 2008
@@ -102,7 +102,7 @@
     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_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
  *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]