[glibmm/glibmm-2-66] Add new enum values to Gio::MenuAttribute



commit 69dbe6302ab4597299bd640ddae4f10257414e26
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Tue Jan 12 10:32:45 2021 +0100

    Add new enum values to Gio::MenuAttribute
    
    See issue #78

 gio/src/menumodel.ccg |  2 +-
 gio/src/menumodel.hg  | 31 ++++++++++++++++++++++++++-----
 2 files changed, 27 insertions(+), 6 deletions(-)
---
diff --git a/gio/src/menumodel.ccg b/gio/src/menumodel.ccg
index 9adbe29e..6985afa4 100644
--- a/gio/src/menumodel.ccg
+++ b/gio/src/menumodel.ccg
@@ -23,7 +23,7 @@ namespace Gio
 
 // Make sure the order here is the same order as in Gio::MenuAttribute.
 static const char* const _attribute_strings[] = { G_MENU_ATTRIBUTE_ACTION, G_MENU_ATTRIBUTE_LABEL,
-  G_MENU_ATTRIBUTE_TARGET };
+  G_MENU_ATTRIBUTE_TARGET, G_MENU_ATTRIBUTE_ACTION_NAMESPACE, G_MENU_ATTRIBUTE_ICON };
 
 const char*
 giomm_get_menu_attribute(MenuAttribute attribute)
diff --git a/gio/src/menumodel.hg b/gio/src/menumodel.hg
index e64932dc..84e6160a 100644
--- a/gio/src/menumodel.hg
+++ b/gio/src/menumodel.hg
@@ -51,7 +51,30 @@ enum MenuAttribute
    * The menu item attribute which holds the target with which the item's action
    * will be activated.
    */
-  MENU_ATTRIBUTE_TARGET
+  MENU_ATTRIBUTE_TARGET,
+
+  /** The "action-namespace" menu attribute.
+   *
+   * The menu item attribute that holds the namespace for all action names in
+   * menus that are linked from this item.
+   *
+   * @newin{2,66}
+   */
+  MENU_ATTRIBUTE_ACTION_NAMESPACE,
+
+  /** The "icon" menu attribute.
+   *
+   * The menu item attribute which holds the icon of the item.
+   *
+   * The icon is stored in the format returned by Gio::Icon::serialize().
+   *
+   * This attribute is intended only to represent 'noun' icons such as
+   * favicons for a webpage, or application icons.  It should not be used
+   * for 'verbs' (ie: stock icons).
+   *
+   * @newin{2,66}
+   */
+  MENU_ATTRIBUTE_ICON
 };
 
 // Keep the enum values in sync with giomm_get_menu_link() in menumodel.ccg.
@@ -106,10 +129,8 @@ class GIOMM_API MenuLinkIter;
  *
  * The API of MenuModel is very generic, with iterators for the attributes and
  * links of an item, see iterate_item_attributes() and iterate_item_links().
- * The 'standard' attributes and link types have predefined names:
- * Gio::MENU_ATTRIBUTE_LABEL, Gio::MENU_ATTRIBUTE_ACTION,
- * Gio::MENU_ATTRIBUTE_TARGET, Gio::MENU_LINK_SECTION and
- * Gio::MENU_LINK_SUBMENU.
+ * The 'standard' attributes and link types have predefined names,
+ * listed in the enums Gio::MenuAttribute and Gio::MenuLink.
  *
  * Items in a MenuModel represent active controls if they refer to an action
  * that can get activated when the user interacts with the menu item. The


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]