diff options
author | Tomeu Vizoso <tomeu@sugarlabs.org> | 2010-04-27 10:22:33 +0200 |
---|---|---|
committer | Tomeu Vizoso <tomeu@sugarlabs.org> | 2010-04-27 10:22:33 +0200 |
commit | 9d7fc78264ce85de3fd021dd4a12313749afa582 (patch) | |
tree | d5607dc962772e25ee37f8f67fec64575c172715 /gir | |
parent | b76aba706cd4ab3bb539c98e860d73f4c0ee2369 (diff) | |
download | gobject-introspection-9d7fc78264ce85de3fd021dd4a12313749afa582.tar.gz |
Add test for virtual method with a default implementation
Diffstat (limited to 'gir')
-rw-r--r-- | gir/gimarshallingtests.c | 24 | ||||
-rw-r--r-- | gir/gimarshallingtests.h | 7 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gir/gimarshallingtests.c b/gir/gimarshallingtests.c index 47209507..839b7b3e 100644 --- a/gir/gimarshallingtests.c +++ b/gir/gimarshallingtests.c @@ -2621,6 +2621,9 @@ enum PROP_INT_ }; +static void g_i_marshalling_tests_object_real_method_with_default_implementation ( + GIMarshallingTestsObject *self, gint8 in); + G_DEFINE_TYPE (GIMarshallingTestsObject, g_i_marshalling_tests_object, G_TYPE_OBJECT); static void @@ -2679,6 +2682,8 @@ g_i_marshalling_tests_object_class_init (GIMarshallingTestsObjectClass *klass) g_object_class_install_property (object_class, PROP_INT_, g_param_spec_int ("int", "Integer", "An integer", G_MININT, G_MAXINT, 0, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + klass->method_with_default_implementation = g_i_marshalling_tests_object_real_method_with_default_implementation; } @@ -2777,6 +2782,25 @@ g_i_marshalling_tests_object_method_int8_in (GIMarshallingTestsObject *self, gin G_I_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->method_int8_in (self, in); } +/** + * g_i_marshalling_tests_object_method_with_default_implementation: + * @in: (in): + */ +void +g_i_marshalling_tests_object_method_with_default_implementation (GIMarshallingTestsObject *self, gint8 in) +{ + G_I_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->method_with_default_implementation (self, in); +} + +static void +g_i_marshalling_tests_object_real_method_with_default_implementation (GIMarshallingTestsObject *self, gint8 in) +{ + GValue val; + g_value_init (&val, G_TYPE_INT); + g_value_set_int (&val, in); + g_object_set_property (G_OBJECT (self), "int", &val); +} + /** * g_i_marshalling_tests__object_none_return: diff --git a/gir/gimarshallingtests.h b/gir/gimarshallingtests.h index acdbbbaf..298f5443 100644 --- a/gir/gimarshallingtests.h +++ b/gir/gimarshallingtests.h @@ -536,6 +536,12 @@ struct _GIMarshallingTestsObjectClass * @in: (in): */ void (* method_int8_in) (GIMarshallingTestsObject *self, gint8 in); + + /** + * GIMarshallingTestsObjectClass::method_with_default_implementation: + * @in: (in): + */ + void (* method_with_default_implementation) (GIMarshallingTestsObject *self, gint8 in); }; struct _GIMarshallingTestsObject @@ -557,6 +563,7 @@ void g_i_marshalling_tests_object_method_array_inout (GIMarshallingTestsObject * const gint *g_i_marshalling_tests_object_method_array_return (GIMarshallingTestsObject *object, gint *length); void g_i_marshalling_tests_object_method_int8_in (GIMarshallingTestsObject *object, gint8 in); +void g_i_marshalling_tests_object_method_with_default_implementation (GIMarshallingTestsObject *object, gint8 in); GIMarshallingTestsObject *g_i_marshalling_tests__object_none_return (void); |