diff options
author | Ted Gould <ted@gould.cx> | 2011-02-18 16:11:29 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-02-18 16:11:29 -0600 |
commit | 5ab75937ec4ba21f9542fbe71dbf8ceb5b28e2ef (patch) | |
tree | 3173e416718980a7dd2fd11b328257933bceebe9 /libdbusmenu-glib | |
parent | 0c9a1f185b2e95466741afd61feaf6b57e0740d3 (diff) | |
download | libdbusmenu-5ab75937ec4ba21f9542fbe71dbf8ceb5b28e2ef.tar.gz libdbusmenu-5ab75937ec4ba21f9542fbe71dbf8ceb5b28e2ef.tar.bz2 libdbusmenu-5ab75937ec4ba21f9542fbe71dbf8ceb5b28e2ef.zip |
Instead of defining a signal let's make this a property and use 'notify'
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 29 | ||||
-rw-r--r-- | libdbusmenu-glib/client.h | 4 |
2 files changed, 13 insertions, 20 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 5f967d0..828129a 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -49,7 +49,8 @@ License version 3 and version 2.1 along with this program. If not, see enum { PROP_0, PROP_DBUSOBJECT, - PROP_DBUSNAME + PROP_DBUSNAME, + PROP_TEXT_DIRECTION }; /* Signals */ @@ -59,7 +60,6 @@ enum { NEW_MENUITEM, ITEM_ACTIVATE, EVENT_RESULT, - TEXT_DIRECTION_CHANGED, LAST_SIGNAL }; @@ -250,21 +250,6 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass) _dbusmenu_client_marshal_VOID__OBJECT_UINT, G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_UINT); /** - DbusmenuClient::text-direction-changed: - @arg0: The #DbusmenuClient object - @arg1: The new text direction - - Signal sent to show that there was an error in sending the event - to the server. - */ - signals[TEXT_DIRECTION_CHANGED] = g_signal_new(DBUSMENU_CLIENT_SIGNAL_TEXT_DIRECTION_CHANGED, - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (DbusmenuClientClass, text_direction_changed), - NULL, NULL, - _dbusmenu_client_marshal_VOID__ENUM, - G_TYPE_NONE, 1, DBUSMENU_TYPE_TEXT_DIRECTION); - /** DbusmenuClient::event-error: @arg0: The #DbusmenuClient object @arg1: The #DbusmenuMenuitem sent an event @@ -294,6 +279,11 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass) "Name of the DBus client we're connecting to.", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (object_class, PROP_TEXT_DIRECTION, + g_param_spec_enum(DBUSMENU_CLIENT_PROP_TEXT_DIRECTION, "Direction text values have", + "Signals which direction the default text direction is for the menus", + DBUSMENU_TYPE_TEXT_DIRECTION, DBUSMENU_TEXT_DIRECTION_NONE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); if (dbusmenu_node_info == NULL) { GError * error = NULL; @@ -494,6 +484,9 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) case PROP_DBUSOBJECT: g_value_set_string(value, priv->dbus_object); break; + case PROP_TEXT_DIRECTION: + g_value_set_enum(value, priv->text_direction); + break; default: g_warning("Unknown property %d.", id); return; @@ -1072,7 +1065,7 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva } if (olddir != priv->text_direction) { - g_signal_emit(G_OBJECT(user_data), signals[TEXT_DIRECTION_CHANGED], 0, priv->text_direction, TRUE); + g_object_notify(G_OBJECT(user_data), DBUSMENU_CLIENT_PROP_TEXT_DIRECTION); } return; diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index 3bab503..c11a285 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -53,6 +53,7 @@ G_BEGIN_DECLS #define DBUSMENU_CLIENT_PROP_DBUS_NAME "dbus-name" #define DBUSMENU_CLIENT_PROP_DBUS_OBJECT "dbus-object" +#define DBUSMENU_CLIENT_PROP_TEXT_DIRECTION "text-direction" #define DBUSMENU_CLIENT_TYPES_DEFAULT "standard" #define DBUSMENU_CLIENT_TYPES_SEPARATOR "separator" @@ -67,7 +68,6 @@ typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate; @new_menuitem: Slot for #DbusmenuClient::new-menuitem. @item_activate: Slot for #DbusmenuClient::item-activate. @event_result: Slot for #DbusmenuClient::event-error. - @text_direction_changed: Slot for #DbusmenuClient::text-direction-changed. @reserved1: Reserved for future use. @reserved2: Reserved for future use. @reserved3: Reserved for future use. @@ -88,7 +88,6 @@ struct _DbusmenuClientClass { void (*new_menuitem) (DbusmenuMenuitem * newitem); void (*item_activate) (DbusmenuMenuitem * item, guint timestamp); void (*event_result) (DbusmenuMenuitem * item, gchar * event, GVariant * data, guint timestamp, GError * error); - void (*text_direction_changed) (DbusmenuTextDirection newdirection); /*< Private >*/ void (*reserved1) (void); @@ -96,6 +95,7 @@ struct _DbusmenuClientClass { void (*reserved3) (void); void (*reserved4) (void); void (*reserved5) (void); + void (*reserved6) (void); }; /** |