From 144708e6667818d48e3bbd9403e447079e8a5c56 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Tue, 13 Dec 2011 10:56:56 +1100 Subject: Add a new property DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC, to set an alternative label for a menu item. This alternative label is only used for assistive technologies such as Orca. It is particularly useful for menu items where an icon is used to present further information to the user, in which case this property can be used to give a textual description of the icon. --- libdbusmenu-glib/client.c | 3 ++- libdbusmenu-glib/defaults.c | 1 + libdbusmenu-glib/menuitem.h | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 9129db5..a2330d1 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -331,7 +331,7 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass) return; } -#define LAYOUT_PROPS_COUNT 5 +#define LAYOUT_PROPS_COUNT 6 static void dbusmenu_client_init (DbusmenuClient *self) @@ -359,6 +359,7 @@ dbusmenu_client_init (DbusmenuClient *self) layout_props[2] = DBUSMENU_MENUITEM_PROP_VISIBLE; layout_props[3] = DBUSMENU_MENUITEM_PROP_ENABLED; layout_props[4] = DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY; + layout_props[5] = DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC; layout_props[LAYOUT_PROPS_COUNT] = NULL; priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, LAYOUT_PROPS_COUNT); g_variant_ref_sink(priv->layout_props); diff --git a/libdbusmenu-glib/defaults.c b/libdbusmenu-glib/defaults.c index a5caf0b..10a9115 100644 --- a/libdbusmenu-glib/defaults.c +++ b/libdbusmenu-glib/defaults.c @@ -88,6 +88,7 @@ dbusmenu_defaults_init (DbusmenuDefaults *self) 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)); + dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC,G_VARIANT_TYPE_STRING, NULL); /* 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 985e1a3..ea455ac 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -153,6 +153,18 @@ G_BEGIN_DECLS * libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_image() */ #define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data" +/** + * DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC: + * + * #DbusmenuMenuitem property used to provide a textual description of any + * information that the icon may convey. The contents of this property are + * passed through to assistive technologies such as the Orca screen reader. + * The contents of this property will not be visible in the menu item. If + * this property is set, Orca will use this property instead of the label + * property. + * Type: #G_VARIANT_TYPE_STRING + */ +#define DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC "accessible-desc" /** * DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE: * -- cgit v1.2.3