ui/common/menu.h

branch
newapi
changeset 208
f632bc0589ab
parent 207
93b9f502cb88
child 229
a952760955b4
equal deleted inserted replaced
207:93b9f502cb88 208:f632bc0589ab
38 #endif 38 #endif
39 39
40 typedef struct UiMenuItemI UiMenuItemI; 40 typedef struct UiMenuItemI UiMenuItemI;
41 typedef struct UiMenu UiMenu; 41 typedef struct UiMenu UiMenu;
42 typedef struct UiMenuItem UiMenuItem; 42 typedef struct UiMenuItem UiMenuItem;
43 typedef struct UiStMenuItem UiStMenuItem; 43 typedef struct UiMenuCheckItem UiMenuCheckItem;
44 typedef struct UiCheckItem UiCheckItem; 44 typedef struct UiMenuRadioItem UiMenuRadioItem;
45 typedef struct UiCheckItemNV UiCheckItemNV;
46 typedef struct UiMenuItemList UiMenuItemList; 45 typedef struct UiMenuItemList UiMenuItemList;
47 typedef struct UiMenuItemListNV UiMenuItemListNV;
48 46
49 enum UiMenuItemType { 47 enum UiMenuItemType {
50 UI_MENU = 0, 48 UI_MENU = 0,
51 UI_MENU_SUBMENU,
52 UI_MENU_ITEM, 49 UI_MENU_ITEM,
53 UI_MENU_STOCK_ITEM,
54 UI_MENU_CHECK_ITEM, 50 UI_MENU_CHECK_ITEM,
55 UI_MENU_CHECK_ITEM_NV, 51 UI_MENU_RADIO_ITEM,
56 UI_MENU_ITEM_LIST, 52 UI_MENU_ITEM_LIST,
57 UI_MENU_ITEM_LIST_NV, 53 UI_MENU_CHECKITEM_LIST,
54 UI_MENU_RADIOITEM_LIST,
58 UI_MENU_SEPARATOR 55 UI_MENU_SEPARATOR
59 }; 56 };
60 57
61 typedef enum UiMenuItemType UiMenuItemType; 58 typedef enum UiMenuItemType UiMenuItemType;
62 59
76 }; 73 };
77 74
78 struct UiMenuItem { 75 struct UiMenuItem {
79 UiMenuItemI item; 76 UiMenuItemI item;
80 ui_callback callback; 77 ui_callback callback;
81 char *label; 78 const char *label;
79 const char *stockid;
80 const char *icon;
82 void *userdata; 81 void *userdata;
83 CxList *groups; 82 int *groups;
83 size_t ngroups;
84 }; 84 };
85 85
86 struct UiStMenuItem { 86 struct UiMenuCheckItem {
87 UiMenuItemI item; 87 UiMenuItemI item;
88 const char* label;
89 const char* stockid;
90 const char* icon;
91 const char* varname;
88 ui_callback callback; 92 ui_callback callback;
89 char *stockid;
90 void *userdata; 93 void *userdata;
91 CxList *groups; 94 int *groups;
95 size_t ngroups;
92 }; 96 };
93 97
94 struct UiCheckItem { 98 struct UiMenuRadioItem {
95 UiMenuItemI item; 99 UiMenuItemI item;
96 char *label; 100 const char* label;
101 const char* stockid;
102 const char* icon;
97 ui_callback callback; 103 ui_callback callback;
98 void *userdata; 104 void* userdata;
99 }; 105 int *groups;
100 106 size_t ngroups;
101 struct UiCheckItemNV {
102 UiMenuItemI item;
103 char *label;
104 char *varname;
105 }; 107 };
106 108
107 struct UiMenuItemList { 109 struct UiMenuItemList {
108 UiMenuItemI item; 110 UiMenuItemI item;
109 ui_callback callback; 111 ui_callback callback;
110 void *userdata; 112 void *userdata;
111 UiList *list; 113 const char* varname;
112 }; 114 };
113 115
114 struct UiMenuItemListNV {
115 UiMenuItemI item;
116 ui_callback callback;
117 void *userdata;
118 const char *varname;
119 };
120 116
121 UiMenu* uic_get_menu_list(void); 117 UiMenu* uic_get_menu_list(void);
122 118
123 void uic_add_menu_to_stack(UiMenu* menu); 119 void uic_add_menu_to_stack(UiMenu* menu);
124 120

mercurial