diff options
author | Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com> | 2012-07-12 08:38:13 +0200 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2012-07-12 08:38:13 +0200 |
commit | bd09ba5f2e659c66c133977881358a810eb859b5 (patch) | |
tree | 359f5986d9c1239c816e47c26b1676037f63c50d /tests | |
parent | 2554bf149415820bec2d36d3906fdd4f7b66a07c (diff) | |
download | gobject-introspection-bd09ba5f2e659c66c133977881358a810eb859b5.tar.gz |
GIMarshallingTests: Add method taking array of variants
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gimarshallingtests.c | 32 | ||||
-rw-r--r-- | tests/gimarshallingtests.h | 24 |
2 files changed, 56 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 38c278ad..1820ff27 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -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: diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h index eea9bb63..7bcbffbd 100644 --- a/tests/gimarshallingtests.h +++ b/tests/gimarshallingtests.h @@ -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 */ |