From 467b4ff91ae623a5bdabfab0bda9317364bfe9dd Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 1 Feb 2012 23:09:35 +0100 Subject: [PATCH] Add 'running' property to ChimaraGlk Read-only property that does the same as chimara_glk_get_running(); properties work nicely in language bindings --- libchimara/chimara-glk.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index 925acd2..6a4c0d3 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -148,7 +148,8 @@ enum { PROP_SPACING, PROP_PROGRAM_NAME, PROP_PROGRAM_INFO, - PROP_STORY_NAME + PROP_STORY_NAME, + PROP_RUNNING }; enum { @@ -269,6 +270,9 @@ chimara_glk_get_property(GObject *object, guint prop_id, GValue *value, GParamSp case PROP_STORY_NAME: g_value_set_string(value, priv->story_name); break; + case PROP_RUNNING: + g_value_set_boolean(value, priv->running); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); } @@ -949,6 +953,17 @@ chimara_glk_class_init(ChimaraGlkClass *klass) NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS) ); + /** + * ChimaraGlk:running: + * + * Whether this Glk widget is currently running a game or not. + */ + g_object_class_install_property(object_class, PROP_RUNNING, + g_param_spec_boolean("running", _("Running"), + _("Whether there is a program currently running"), + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS) ); + /* Private data */ g_type_class_add_private(klass, sizeof(ChimaraGlkPrivate)); } -- 2.30.2