From 7fbfd4e5ecb550ebe49ccd366bd268868ae682d0 Mon Sep 17 00:00:00 2001 From: Chris Coulson Date: Tue, 28 Jun 2011 17:40:16 +0100 Subject: When there are no removed properties in ItemsPropertiesUpdated, ensure the arguments have the correct signature so that they aren't rejected by the client (LP: #799878) --- libdbusmenu-glib/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index f81b3ed..c7057df 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -976,10 +976,10 @@ menuitem_property_idle (gpointer user_data) gotsomething = TRUE; } else { GError * error = NULL; - megadata[1] = g_variant_parse(G_VARIANT_TYPE("a(ia(s))"), "[ ]", NULL, NULL, &error); + megadata[1] = g_variant_parse(G_VARIANT_TYPE("a(ias)"), "[ ]", NULL, NULL, &error); if (error != NULL) { - g_warning("Unable to parse '[ ]' as a 'a(ia(s))': %s", error->message); + g_warning("Unable to parse '[ ]' as a 'a(ias)': %s", error->message); g_error_free(error); } } -- cgit v1.2.3 From 14bcf1b8a8ada10beee5f13a5bec9854d4e58a13 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Aug 2011 11:30:06 -0500 Subject: Adding a disposition property in to the header and defaults --- libdbusmenu-glib/defaults.c | 1 + libdbusmenu-glib/menuitem.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/defaults.c b/libdbusmenu-glib/defaults.c index aa479b1..a5caf0b 100644 --- a/libdbusmenu-glib/defaults.c +++ b/libdbusmenu-glib/defaults.c @@ -87,6 +87,7 @@ dbusmenu_defaults_init (DbusmenuDefaults *self) dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, G_VARIANT_TYPE_INT32, NULL); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL); dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL); + dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_DISPOSITION, G_VARIANT_TYPE_STRING, g_variant_new_string(DBUSMENU_MENUITEM_DISPOSITION_NORMAL)); /* Separator defaults */ dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_SEPARATOR, DBUSMENU_MENUITEM_PROP_VISIBLE, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE)); diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index afd1d4e..96a780e 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -184,6 +184,13 @@ G_BEGIN_DECLS * #DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU. Type: #G_VARIANT_TYPE_STRING */ #define DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY "children-display" +/** + * DBUSMENU_MENUITEM_PROP_DISPOSITION: + * + * #DbusmenuMenuitem property to tell what type of information that the + * menu item is displaying to the user. Type: #G_VARIANT_TYPE_STRING + */ +#define DBUSMENU_MENUITEM_PROP_DISPOSITION "disposition" /** * DBUSMENU_MENUITEM_TOGGLE_CHECK: @@ -267,6 +274,38 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU "submenu" +/** + * DBUSMENU_MENUITEM_DISPOSITION_NORMAL: + * + * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu + * item displayed in the normal manner. Default value. + */ +#define DBUSMENU_MENUITEM_DISPOSITION_NORMAL "normal" +/** + * DBUSMENU_MENUITEM_DISPOSITION_INFORMATION: + * + * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu + * item displayed in a way that conveys it's giving additional + * information to the user. + */ +#define DBUSMENU_MENUITEM_DISPOSITION_INFORMATION "information" +/** + * DBUSMENU_MENUITEM_DISPOSITION_WARNING: + * + * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu + * item displayed in a way that conveys it's giving a warning + * to the user. + */ +#define DBUSMENU_MENUITEM_DISPOSITION_WARNING "warning" +/** + * DBUSMENU_MENUITEM_DISPOSITION_ALERT: + * + * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu + * item displayed in a way that conveys it's giving an alert + * to the user. + */ +#define DBUSMENU_MENUITEM_DISPOSITION_ALERT "alert" + /** * DBUSMENU_MENUITEM_EVENT_ACTIVATED: * -- cgit v1.2.3 From 963f191abe4422b152cd048ace48172095dcb566 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Aug 2011 11:35:02 -0500 Subject: Updating the protocol spec --- libdbusmenu-glib/dbus-menu.xml | 13 +++++++++++++ libdbusmenu-glib/menuitem.h | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index a36c148..4b5a5d8 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -157,6 +157,19 @@ License version 3 and version 2.1 along with this program. If not, see "" + + disposition + string + + How the menuitem feels the information it's displaying to the + user should be presented. + - "normal" a standard menu item + - "informative" providing additional information to the user + - "warning" looking at potentially harmful results + - "alert" something bad could potentially happen + + "normal" + Vendor specific properties can be added by prefixing them with diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 96a780e..ea18b65 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -282,13 +282,13 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_DISPOSITION_NORMAL "normal" /** - * DBUSMENU_MENUITEM_DISPOSITION_INFORMATION: + * DBUSMENU_MENUITEM_DISPOSITION_INFORMATIVE: * * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu * item displayed in a way that conveys it's giving additional * information to the user. */ -#define DBUSMENU_MENUITEM_DISPOSITION_INFORMATION "information" +#define DBUSMENU_MENUITEM_DISPOSITION_INFORMATIVE "informative" /** * DBUSMENU_MENUITEM_DISPOSITION_WARNING: * -- cgit v1.2.3 From dd3f0434bf7dc121dd8b949e354c305181fd5b66 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Aug 2011 11:39:13 -0500 Subject: Putting in some headers to make this file easier to read --- libdbusmenu-glib/menuitem.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index ea18b65..985e1a3 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -41,7 +41,9 @@ G_BEGIN_DECLS #define DBUSMENU_IS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_TYPE_MENUITEM)) #define DBUSMENU_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_MENUITEM, DbusmenuMenuitemClass)) - +/* ***************************************** */ +/* ********* GLib Object Signals ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED: * @@ -103,6 +105,9 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_SIGNAL_EVENT "event" +/* ***************************************** */ +/* ********* Menuitem Properties ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_PROP_TYPE: * @@ -192,6 +197,9 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_PROP_DISPOSITION "disposition" +/* ***************************************** */ +/* ********* Toggle Values ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_TOGGLE_CHECK: * @@ -207,6 +215,9 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_TOGGLE_RADIO "radio" +/* ***************************************** */ +/* ********* Toggle States ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED: * @@ -229,6 +240,9 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN -1 +/* ***************************************** */ +/* ********* Icon specials ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_ICON_NAME_BLANK: * @@ -237,6 +251,9 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_ICON_NAME_BLANK "blank-icon" +/* ***************************************** */ +/* ********* Shortcut Modifiers ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_SHORTCUT_CONTROL: * @@ -266,6 +283,9 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_SHORTCUT_SUPER "Super" +/* ***************************************** */ +/* ********* Child Display Types ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU: * @@ -274,6 +294,9 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU "submenu" +/* ***************************************** */ +/* ********* Menuitem Dispositions ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_DISPOSITION_NORMAL: * @@ -306,6 +329,9 @@ G_BEGIN_DECLS */ #define DBUSMENU_MENUITEM_DISPOSITION_ALERT "alert" +/* ***************************************** */ +/* ********* Dbusmenu Events ********* */ +/* ***************************************** */ /** * DBUSMENU_MENUITEM_EVENT_ACTIVATED: * -- cgit v1.2.3