[gobject-introspection: 4/5] gimarshallingtests: Add test readonly property
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection: 4/5] gimarshallingtests: Add test readonly property
- Date: Thu, 21 Jun 2018 01:41:41 +0000 (UTC)
commit ecf5b9ddb7a38b4bd44ce5c8678604145d906536
Author: Philip Chimento <philip chimento gmail com>
Date: Fri May 25 21:35:47 2018 -0700
gimarshallingtests: Add test readonly property
As far as I can tell there isn't one of these yet. It's a readonly int
property whose value is always 42.
tests/gimarshallingtests.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 92c181a4..0ddaed71 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -5356,6 +5356,7 @@ enum
SOME_FLAGS_PROPERTY,
SOME_ENUM_PROPERTY,
SOME_BYTE_ARRAY_PROPERTY,
+ SOME_READONLY_PROPERTY,
};
G_DEFINE_TYPE (GIMarshallingTestsPropertiesObject, gi_marshalling_tests_properties_object, G_TYPE_OBJECT);
@@ -5451,6 +5452,9 @@ gi_marshalling_tests_properties_object_get_property (GObject *object,
case SOME_BYTE_ARRAY_PROPERTY:
g_value_set_boxed (value, self->some_byte_array);
break;
+ case SOME_READONLY_PROPERTY:
+ g_value_set_int (value, 42);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -5698,6 +5702,13 @@ static void gi_marshalling_tests_properties_object_class_init (GIMarshallingTest
"some-byte-array",
G_TYPE_BYTE_ARRAY,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (object_class, SOME_READONLY_PROPERTY,
+ g_param_spec_int ("some-readonly",
+ "some-readonly",
+ "some-readonly",
+ G_MININT, G_MAXINT, 0,
+ G_PARAM_READABLE));
}
GIMarshallingTestsPropertiesObject *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]