[gobject-introspection] Regress: Add signal returning a GArray



commit eff011ce1d274e9add73fbf71fb8617ba37fb9f8
Author: Martin Pitt <martinpitt gnome org>
Date:   Fri Jan 4 09:32:45 2013 +0100

    Regress: Add signal returning a GArray
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690514

 tests/scanner/Regress-1.0-expected.gir |   13 +++++++++++++
 tests/scanner/regress.c                |   20 ++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 7aee641..f3f9a03 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -1307,6 +1307,19 @@ the introspection client langage.</doc>
           </parameter>
         </parameters>
       </glib:signal>
+      <glib:signal name="sig-with-intarray-ret" when="last">
+        <return-value transfer-ownership="full">
+          <array name="GLib.Array">
+            <type name="gint"/>
+          </array>
+        </return-value>
+        <parameters>
+          <parameter name="i" transfer-ownership="none">
+            <doc xml:whitespace="preserve">an integer</doc>
+            <type name="gint"/>
+          </parameter>
+        </parameters>
+      </glib:signal>
       <glib:signal name="sig-with-obj" when="last">
         <doc xml:whitespace="preserve">Test transfer none GObject as a param (tests refcounting).
 Use with regress_test_obj_emit_sig_with_obj</doc>
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index b7526bf..06089c3 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -2181,6 +2181,7 @@ enum {
   REGRESS_TEST_OBJ_SIGNAL_ALL,
   REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_INT64_PROP,
   REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_UINT64_PROP,
+  REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_INTARRAY_RET,
   N_REGRESS_TEST_OBJ_SIGNALS
 };
 
@@ -2387,6 +2388,25 @@ regress_test_obj_class_init (RegressTestObjClass *klass)
 		  1,
 		  G_TYPE_UINT64);
 
+  /**
+   * RegressTestObj::sig-with-intarray-ret:
+   * @self: an object
+   * @i: an integer
+   *
+   * Returns: (array zero-terminated=1) (element-type gint) (transfer full):
+   */
+  regress_test_obj_signals[REGRESS_TEST_OBJ_SIGNAL_SIG_WITH_INTARRAY_RET] =
+    g_signal_new ("sig-with-intarray-ret",
+		  G_TYPE_FROM_CLASS (gobject_class),
+		  G_SIGNAL_RUN_LAST,
+		  0,
+		  NULL,
+		  NULL,
+		  g_cclosure_marshal_VOID__BOXED,
+		  G_TYPE_ARRAY,
+		  1,
+		  G_TYPE_INT);
+
   gobject_class->set_property = regress_test_obj_set_property;
   gobject_class->get_property = regress_test_obj_get_property;
   gobject_class->dispose = regress_test_obj_dispose;



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