From: Philip Chimento Date: Wed, 1 Feb 2012 22:09:35 +0000 (+0100) Subject: Add 'running' property to ChimaraGlk X-Git-Tag: v0.9~41 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=467b4ff91ae623a5bdabfab0bda9317364bfe9dd;p=projects%2Fchimara%2Fchimara.git Add 'running' property to ChimaraGlk Read-only property that does the same as chimara_glk_get_running(); properties work nicely in language bindings --- 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)); }