diff options
Diffstat (limited to 'apps/menu.h')
-rw-r--r-- | apps/menu.h | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/apps/menu.h b/apps/menu.h index 4cb7446ae1..f5bc2dd179 100644 --- a/apps/menu.h +++ b/apps/menu.h | |||
@@ -100,9 +100,7 @@ struct menu_item_ex { | |||
100 | int (*menu_callback)(int action, | 100 | int (*menu_callback)(int action, |
101 | const struct menu_item_ex *this_item); | 101 | const struct menu_item_ex *this_item); |
102 | unsigned char *desc; /* string or ID */ | 102 | unsigned char *desc; /* string or ID */ |
103 | #ifdef HAVE_LCD_BITMAP | 103 | int icon_id; /* from icons_6x8 in icons.h */ |
104 | ICON icon; /* Icon to display */ | ||
105 | #endif | ||
106 | } *callback_and_desc; | 104 | } *callback_and_desc; |
107 | /* For when the item text is dynamic */ | 105 | /* For when the item text is dynamic */ |
108 | const struct menu_get_name_and_icon { | 106 | const struct menu_get_name_and_icon { |
@@ -110,9 +108,7 @@ struct menu_item_ex { | |||
110 | const struct menu_item_ex *this_item); | 108 | const struct menu_item_ex *this_item); |
111 | char *(*list_get_name)(int selected_item, void * data, char *buffer); | 109 | char *(*list_get_name)(int selected_item, void * data, char *buffer); |
112 | void *list_get_name_data; | 110 | void *list_get_name_data; |
113 | #ifdef HAVE_LCD_BITMAP | 111 | int icon_id; |
114 | ICON icon; /* Icon to display */ | ||
115 | #endif | ||
116 | } *menu_get_name_and_icon; | 112 | } *menu_get_name_and_icon; |
117 | }; | 113 | }; |
118 | }; | 114 | }; |
@@ -143,13 +139,12 @@ bool do_setting_from_menu(const struct menu_item_ex *temp); | |||
143 | and its return value will be the index of the chosen item */ | 139 | and its return value will be the index of the chosen item */ |
144 | #define MENUITEM_STRINGLIST(name, str, callback, ... ) \ | 140 | #define MENUITEM_STRINGLIST(name, str, callback, ... ) \ |
145 | static const char *name##_[] = {__VA_ARGS__}; \ | 141 | static const char *name##_[] = {__VA_ARGS__}; \ |
146 | static const struct menu_callback_with_desc name##__ = {callback,str, NOICON};\ | 142 | static const struct menu_callback_with_desc name##__ = {callback,str, Icon_NOICON};\ |
147 | static const struct menu_item_ex name = \ | 143 | static const struct menu_item_ex name = \ |
148 | {MT_RETURN_ID|MENU_HAS_DESC| \ | 144 | {MT_RETURN_ID|MENU_HAS_DESC| \ |
149 | MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \ | 145 | MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \ |
150 | { .submenus = name##_},{.callback_and_desc = & name##__}}; | 146 | { .submenus = name##_},{.callback_and_desc = & name##__}}; |
151 | 147 | ||
152 | #ifdef HAVE_LCD_BITMAP /* Kill the player port already.... PLEASE!! */ | ||
153 | 148 | ||
154 | /* returns a value associated with the item */ | 149 | /* returns a value associated with the item */ |
155 | #define MENUITEM_RETURNVALUE(name, str, val, cb, icon) \ | 150 | #define MENUITEM_RETURNVALUE(name, str, val, cb, icon) \ |
@@ -208,38 +203,5 @@ bool do_setting_from_menu(const struct menu_item_ex *temp); | |||
208 | { (void*)name##_},{.callback_and_desc = & name##__}}; | 203 | { (void*)name##_},{.callback_and_desc = & name##__}}; |
209 | 204 | ||
210 | 205 | ||
211 | #else /* HAVE_LCD_BITMAP */ | 206 | |
212 | #define MENUITEM_RETURNVALUE(name, str, val, cb, icon) \ | ||
213 | static const struct menu_callback_with_desc name##_ = {cb,str}; \ | ||
214 | static const struct menu_item_ex name = \ | ||
215 | { MT_RETURN_VALUE|MENU_HAS_DESC, { .value = val}, \ | ||
216 | {.callback_and_desc = & name##_}}; | ||
217 | #define MENUITEM_RETURNVALUE_DYNTEXT(name, val, cb, text_callback, text_cb_data, icon) \ | ||
218 | static const struct menu_get_name_and_icon name##_ \ | ||
219 | = {cb,text_callback,text_cb_data}; \ | ||
220 | static const struct menu_item_ex name = \ | ||
221 | { MT_RETURN_VALUE|MENU_DYNAMIC_DESC, { .value = val}, \ | ||
222 | {.menu_get_name_and_icon = & name##_}}; | ||
223 | #define MENUITEM_FUNCTION(name, str, func, callback, icon) \ | ||
224 | static const struct menu_callback_with_desc name##_ = {callback,str}; \ | ||
225 | const struct menu_item_ex name = \ | ||
226 | { MT_FUNCTION_CALL|MENU_HAS_DESC, { .function = func}, \ | ||
227 | {.callback_and_desc = & name##_}}; | ||
228 | #define MENUITEM_FUNCTION_WPARAM(name, str, func, param, callback, icon) \ | ||
229 | static const struct menu_callback_with_desc name##_ = {callback,str}; \ | ||
230 | static const struct menu_func_with_param name##__ = {func, param}; \ | ||
231 | static const struct menu_item_ex name = \ | ||
232 | { MT_FUNCTION_WITH_PARAM|MENU_HAS_DESC, \ | ||
233 | { .func_with_param = &name##__}, \ | ||
234 | {.callback_and_desc = & name##_}}; | ||
235 | #define MAKE_MENU( name, str, callback, icon, ... ) \ | ||
236 | static const struct menu_item_ex *name##_[] = {__VA_ARGS__}; \ | ||
237 | static const struct menu_callback_with_desc name##__ = {callback,str};\ | ||
238 | const struct menu_item_ex name = \ | ||
239 | {MT_MENU|MENU_HAS_DESC| \ | ||
240 | MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \ | ||
241 | { (void*)name##_},{.callback_and_desc = & name##__}}; | ||
242 | |||
243 | #endif /* HAVE_LCD_BITMAP */ | ||
244 | |||
245 | #endif /* End __MENU_H__ */ | 207 | #endif /* End __MENU_H__ */ |