summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-01-14 08:48:03 +0100
committerMartin Pitt <martinpitt@gnome.org>2013-01-14 08:48:03 +0100
commitd94aa67674261cf921f5a29565c21ebe1ad42a31 (patch)
tree23da6c87b7aae02569f69ad6b7dd856e005e9b13
parent63c9759e17ef5ac71c50d5ac91289714db19b587 (diff)
downloadgobject-introspection-d94aa67674261cf921f5a29565c21ebe1ad42a31.tar.gz
gimarshallingtests: Add boxed GList property
https://bugzilla.gnome.org/show_bug.cgi?id=684059
-rw-r--r--tests/gimarshallingtests.c33
-rw-r--r--tests/gimarshallingtests.h1
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index f12ea05e..e8559812 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -3673,6 +3673,20 @@ gi_marshalling_tests_boxed_struct_get_type (void)
return type;
}
+static GType
+gi_marshalling_tests_boxed_glist_get_type (void)
+{
+ static GType type = 0;
+
+ if (type == 0) {
+ type = g_boxed_type_register_static ("GIMarshallingTestsBoxedGList",
+ (GBoxedCopyFunc) g_list_copy,
+ (GBoxedFreeFunc) g_list_free);
+ }
+
+ return type;
+}
+
GIMarshallingTestsBoxedStruct *
gi_marshalling_tests_boxed_struct_new (void)
{
@@ -4722,6 +4736,7 @@ enum {
SOME_STRV_PROPERTY,
SOME_BOXED_STRUCT_PROPERTY,
SOME_VARIANT_PROPERTY,
+ SOME_BOXED_GLIST_PROPERTY,
};
G_DEFINE_TYPE (GIMarshallingTestsPropertiesObject, gi_marshalling_tests_properties_object, G_TYPE_OBJECT);
@@ -4782,6 +4797,9 @@ gi_marshalling_tests_properties_object_get_property (GObject * object, guint pro
case SOME_BOXED_STRUCT_PROPERTY:
g_value_set_boxed (value, self->some_boxed_struct);
break;
+ case SOME_BOXED_GLIST_PROPERTY:
+ g_value_set_boxed (value, self->some_boxed_glist);
+ break;
case SOME_VARIANT_PROPERTY:
g_value_set_variant (value, self->some_variant);
break;
@@ -4838,6 +4856,10 @@ gi_marshalling_tests_properties_object_set_property (GObject * object, guint pro
gi_marshalling_tests_boxed_struct_free (self->some_boxed_struct);
self->some_boxed_struct = gi_marshalling_tests_boxed_struct_copy (g_value_get_boxed (value));
break;
+ case SOME_BOXED_GLIST_PROPERTY:
+ g_list_free (self->some_boxed_glist);
+ self->some_boxed_glist = g_list_copy (g_value_get_boxed (value));
+ break;
case SOME_VARIANT_PROPERTY:
if (self->some_variant != NULL)
g_variant_unref (self->some_variant);
@@ -4913,6 +4935,17 @@ gi_marshalling_tests_properties_object_class_init (GIMarshallingTestsPropertiesO
gi_marshalling_tests_boxed_struct_get_type(),
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
+ /**
+ * GIMarshallingTestsPropertiesObject:some-boxed-glist:
+ *
+ * Type: GLib.List(gint)
+ * Transfer: none
+ */
+ g_object_class_install_property (object_class, SOME_BOXED_GLIST_PROPERTY,
+ g_param_spec_boxed ("some-boxed-glist", "some-boxed-glist", "some-boxed-glist",
+ gi_marshalling_tests_boxed_glist_get_type(),
+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
+
g_object_class_install_property (object_class, SOME_VARIANT_PROPERTY,
g_param_spec_variant ("some-variant", "some-variant", "some-variant",
G_VARIANT_TYPE_ANY, NULL,
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index 6ac212e7..74090f05 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -1082,6 +1082,7 @@ struct _GIMarshallingTestsPropertiesObject {
gdouble some_double;
gchar **some_strv;
GIMarshallingTestsBoxedStruct* some_boxed_struct;
+ GList* some_boxed_glist;
GVariant *some_variant;
};