diff options
author | Ted Gould <ted@gould.cx> | 2011-02-18 15:31:58 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-02-18 15:31:58 -0600 |
commit | 84f77e8815f2747b4f76818d6f168cdd3e2f67c5 (patch) | |
tree | 90ee308c712311286b2da326569b9902fd57e419 /libdbusmenu-glib | |
parent | 6401d13aa0455b609b9f3b8c67c1d985c4c0fd8d (diff) | |
download | libdbusmenu-84f77e8815f2747b4f76818d6f168cdd3e2f67c5.tar.gz libdbusmenu-84f77e8815f2747b4f76818d6f168cdd3e2f67c5.tar.bz2 libdbusmenu-84f77e8815f2747b4f76818d6f168cdd3e2f67c5.zip |
Fleshing out the getter and setter
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/server.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 57e4c79..3515896 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1618,8 +1618,16 @@ dbusmenu_server_set_text_direction (DbusmenuServer * server, DbusmenuTextDirecti DbusmenuStatus dbusmenu_server_get_status (DbusmenuServer * server) { + g_return_val_if_fail(DBUSMENU_IS_SERVER(server), DBUSMENU_STATUS_NORMAL); - return DBUSMENU_STATUS_NORMAL; + GValue val = {0}; + g_value_init(&val, DBUSMENU_TYPE_STATUS); + g_object_get_property(G_OBJECT(server), DBUSMENU_SERVER_PROP_STATUS, &val); + + DbusmenuStatus retval = g_value_get_enum(&val); + g_value_unset(&val); + + return retval; } /** @@ -1631,6 +1639,13 @@ dbusmenu_server_get_status (DbusmenuServer * server) void dbusmenu_server_set_status (DbusmenuServer * server, DbusmenuStatus status) { + g_return_if_fail(DBUSMENU_IS_SERVER(server)); + + GValue val = {0}; + g_value_init(&val, DBUSMENU_TYPE_STATUS); + g_value_set_enum(&val, status); + g_object_set_property(G_OBJECT(server), DBUSMENU_SERVER_PROP_STATUS, &val); + g_value_unset(&val); return; } |