From 21e51026d74bca48b814ace73eb588e6542a27cd Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 10 Apr 2014 23:45:41 +0100 Subject: tests: add implementation of an interface The implementation as a method returning itself as its implemented interface type. https://bugzilla.gnome.org/show_bug.cgi?id=727824 --- tests/gimarshallingtests.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tests/gimarshallingtests.h') diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h index 5568a6f9..aa2c2228 100644 --- a/tests/gimarshallingtests.h +++ b/tests/gimarshallingtests.h @@ -1003,6 +1003,35 @@ void gi_marshalling_tests_interface_test_int8_in (GIMarshallingTestsInterface *s void gi_marshalling_tests_test_interface_test_int8_in (GIMarshallingTestsInterface *test_iface, gint8 in); +/* GIMarshallingTestsInterfaceImpl is a class that implements + GIMarshallingTestsInterface */ + +#define GI_MARSHALLING_TESTS_TYPE_INTERFACE_IMPL (gi_marshalling_tests_interface_impl_get_type ()) +#define GI_MARSHALLING_TESTS_INTERFACE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GI_MARSHALLING_TESTS_TYPE_INTERFACE_IMPL, GIMarshallingTestsInterfaceImpl)) +#define GI_MARSHALLING_TESTS_INTERFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GI_MARSHALLING_TESTS_TYPE_INTERFACE_IMPL, GIMarshallingTestsInterfaceImplClass)) +#define GI_MARSHALLING_TESTS_IS_INTERFACE_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GI_MARSHALLING_TESTS_TYPE_INTERFACE_IMPL)) +#define GI_MARSHALLING_TESTS_IS_INTERFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GI_MARSHALLING_TESTS_TYPE_INTERFACE_IMPL)) +#define GI_MARSHALLING_TESTS_INTERFACE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GI_MARSHALLING_TESTS_TYPE_INTERFACE_IMPL, GIMarshallingTestsInterfaceImplClass)) + + +typedef struct _GIMarshallingTestsInterfaceImplClass GIMarshallingTestsInterfaceImplClass; +typedef struct _GIMarshallingTestsInterfaceImpl GIMarshallingTestsInterfaceImpl; + +struct _GIMarshallingTestsInterfaceImplClass +{ + GObjectClass parent_class; +}; + +struct _GIMarshallingTestsInterfaceImpl +{ + GObject parent_instance; + + gint int_; +}; + +GType gi_marshalling_tests_interface_impl_get_type (void) G_GNUC_CONST; +GIMarshallingTestsInterface *gi_marshalling_tests_interface_impl_get_as_interface (GIMarshallingTestsInterfaceImpl *self); + /* GIMarshallingTestsInterface2 allows us testing vfunc clashes when a class' vfunc implementation ambiguously relates to its prototype */ -- cgit v1.2.1