diff options
author | Luke Yelavich <luke.yelavich@canonical.com> | 2011-12-13 10:56:56 +1100 |
---|---|---|
committer | Luke Yelavich <luke.yelavich@canonical.com> | 2011-12-13 10:56:56 +1100 |
commit | 144708e6667818d48e3bbd9403e447079e8a5c56 (patch) | |
tree | a6e98b5093a60d4f6c75dd17e633fba28aadc41d /libdbusmenu-glib | |
parent | 685b2fa7a1895809d767c00eca7f9745632106e4 (diff) | |
download | libdbusmenu-144708e6667818d48e3bbd9403e447079e8a5c56.tar.gz libdbusmenu-144708e6667818d48e3bbd9403e447079e8a5c56.tar.bz2 libdbusmenu-144708e6667818d48e3bbd9403e447079e8a5c56.zip |
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.
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 3 | ||||
-rw-r--r-- | libdbusmenu-glib/defaults.c | 1 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.h | 12 |
3 files changed, 15 insertions, 1 deletions
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 @@ -154,6 +154,18 @@ G_BEGIN_DECLS */ #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: * * #DbusmenuMenuitem property that says what type of toggle entry should |