ui/common/menu.h

branch
newapi
changeset 208
f632bc0589ab
parent 207
93b9f502cb88
child 229
a952760955b4
--- a/ui/common/menu.h	Wed Oct 11 19:11:38 2023 +0200
+++ b/ui/common/menu.h	Wed Oct 11 22:59:42 2023 +0200
@@ -40,21 +40,18 @@
 typedef struct UiMenuItemI      UiMenuItemI;
 typedef struct UiMenu           UiMenu;
 typedef struct UiMenuItem       UiMenuItem;
-typedef struct UiStMenuItem     UiStMenuItem;
-typedef struct UiCheckItem      UiCheckItem;
-typedef struct UiCheckItemNV    UiCheckItemNV;
+typedef struct UiMenuCheckItem  UiMenuCheckItem;
+typedef struct UiMenuRadioItem  UiMenuRadioItem;
 typedef struct UiMenuItemList   UiMenuItemList;
-typedef struct UiMenuItemListNV UiMenuItemListNV;
     
 enum UiMenuItemType {
     UI_MENU = 0,
-    UI_MENU_SUBMENU,
     UI_MENU_ITEM,
-    UI_MENU_STOCK_ITEM,
     UI_MENU_CHECK_ITEM,
-    UI_MENU_CHECK_ITEM_NV,
+    UI_MENU_RADIO_ITEM,
     UI_MENU_ITEM_LIST,
-    UI_MENU_ITEM_LIST_NV,
+    UI_MENU_CHECKITEM_LIST,
+    UI_MENU_RADIOITEM_LIST,
     UI_MENU_SEPARATOR
 };
 
@@ -78,45 +75,44 @@
 struct UiMenuItem {
     UiMenuItemI    item;
     ui_callback    callback;
-    char           *label;
+    const char     *label;
+    const char     *stockid;
+    const char     *icon;
     void           *userdata;
-    CxList         *groups;
+    int            *groups;
+    size_t         ngroups;
 };
 
-struct UiStMenuItem {
+struct UiMenuCheckItem {
     UiMenuItemI    item;
+    const char* label;
+    const char* stockid;
+    const char* icon;
+    const char* varname;
     ui_callback    callback;
-    char           *stockid;
     void           *userdata;
-    CxList         *groups;
+    int            *groups;
+    size_t         ngroups;
 };
 
-struct UiCheckItem {
+struct UiMenuRadioItem {
     UiMenuItemI    item;
-    char           *label;
+    const char* label;
+    const char* stockid;
+    const char* icon;
     ui_callback    callback;
-    void           *userdata;
-};
-
-struct UiCheckItemNV {
-    UiMenuItemI    item;
-    char           *label;
-    char           *varname;
+    void* userdata;
+    int            *groups;
+    size_t         ngroups;
 };
 
 struct UiMenuItemList {
     UiMenuItemI    item;
     ui_callback    callback;
     void           *userdata;
-    UiList         *list;
+    const char* varname;
 };
 
-struct UiMenuItemListNV {
-    UiMenuItemI    item;
-    ui_callback    callback;
-    void           *userdata;
-    const char     *varname;
-};
 
 UiMenu* uic_get_menu_list(void);
 

mercurial