GIMarshallingTests: Add method taking array of variants
authorMikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
Thu, 12 Jul 2012 06:38:13 +0000 (08:38 +0200)
committerMartin Pitt <martinpitt@gnome.org>
Thu, 12 Jul 2012 06:38:13 +0000 (08:38 +0200)
Add a new interface GIMarshallingTestsInterface3 with a method that takes an
array of variants as argument. This can be used for testing the passing of
array of variants from C to introspection clients, which is not otherwise
covered in the tests for arrays of variants.

https://bugzilla.gnome.org/show_bug.cgi?id=667244

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
tests/gimarshallingtests.c
tests/gimarshallingtests.h

index 38c278a..1820ff2 100644 (file)
@@ -4193,6 +4193,38 @@ gi_marshalling_tests_interface2_get_type(void)
     return type;
 }
 
+static void
+gi_marshalling_tests_interface3_class_init(void *g_iface)
+{
+}
+
+GType
+gi_marshalling_tests_interface3_get_type(void)
+{
+    static GType type = 0;
+    if (type == 0) {
+        type = g_type_register_static_simple (G_TYPE_INTERFACE,
+                                              "GIMarshallingTestsInterface3",
+                                              sizeof (GIMarshallingTestsInterface3Iface),
+                                              (GClassInitFunc) gi_marshalling_tests_interface3_class_init,
+                                              0, NULL, 0);
+    }
+
+    return type;
+}
+
+/**
+ * gi_marshalling_tests_interface3_test_variant_array_in:
+ * @in: (array length=n_in):
+ * @n_in:
+ */
+void
+gi_marshalling_tests_interface3_test_variant_array_in (GIMarshallingTestsInterface3 *self,
+                                                       GVariant **in,
+                                                       gsize n_in)
+{
+  GI_MARSHALLING_TESTS_INTERFACE3_GET_IFACE (self)->test_variant_array_in (self, in, n_in);
+}
 
 /**
  * gi_marshalling_tests_int_out_out:
index eea9bb6..7bcbffb 100644 (file)
@@ -782,6 +782,7 @@ const gint *gi_marshalling_tests_object_method_array_return (GIMarshallingTestsO
 void gi_marshalling_tests_object_method_int8_in (GIMarshallingTestsObject *object, gint8 in);
 void gi_marshalling_tests_object_method_int8_out (GIMarshallingTestsObject *object, gint8 *out);
 void gi_marshalling_tests_object_method_with_default_implementation (GIMarshallingTestsObject *object, gint8 in);
+void gi_marshalling_tests_object_method_variant_array_in (GIMarshallingTestsObject *object, GVariant **in, gsize n_in);
 
 glong gi_marshalling_tests_object_vfunc_return_value_only (GIMarshallingTestsObject *self);
 void gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObject *self, gfloat *a);
@@ -908,6 +909,29 @@ struct _GIMarshallingTestsInterface2Iface {
 
 GType gi_marshalling_tests_interface2_get_type (void) G_GNUC_CONST;
 
+/* GIMarshallingTestsInterface3 tests passing arrays of variants from C to @lang */
+
+#define GI_MARSHALLING_TESTS_TYPE_INTERFACE3              (gi_marshalling_tests_interface3_get_type ())
+#define GI_MARSHALLING_TESTS_INTERFACE3(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GI_MARSHALLING_TESTS_TYPE_INTERFACE3, GIMarshallingTestsInterface3))
+#define GI_MARSHALLING_TESTS_IS_INTERFACE3(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GI_MARSHALLING_TESTS_TYPE_INTERFACE3))
+#define GI_MARSHALLING_TESTS_INTERFACE3_GET_IFACE(obj)    (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GI_MARSHALLING_TESTS_TYPE_INTERFACE3, GIMarshallingTestsInterface3Iface))
+
+typedef struct _GIMarshallingTestsInterface3 GIMarshallingTestsInterface3;
+typedef struct _GIMarshallingTestsInterface3Iface GIMarshallingTestsInterface3Iface;
+
+struct _GIMarshallingTestsInterface3Iface {
+    GTypeInterface base_iface;
+    /**
+     * GIMarshallingTestsInterface3::test_variant_array_in:
+     * @in: (in) (array length=n_in):
+     */
+    void (* test_variant_array_in) (GIMarshallingTestsInterface3 *self, GVariant **in, gsize n_in);
+};
+
+GType gi_marshalling_tests_interface3_get_type (void) G_GNUC_CONST;
+
+void gi_marshalling_tests_interface3_test_variant_array_in (GIMarshallingTestsInterface3 *self, GVariant **in, gsize n_in);
 
 /* Multiple output arguments */