diff options
Diffstat (limited to 'apps/menu.h')
-rw-r--r-- | apps/menu.h | 54 |
1 files changed, 22 insertions, 32 deletions
diff --git a/apps/menu.h b/apps/menu.h index fa5d7e5b93..eed15d2396 100644 --- a/apps/menu.h +++ b/apps/menu.h | |||
@@ -25,38 +25,6 @@ | |||
25 | #include "icons.h" | 25 | #include "icons.h" |
26 | 26 | ||
27 | 27 | ||
28 | struct menu_item { | ||
29 | unsigned char *desc; /* string or ID */ | ||
30 | bool (*function) (void); /* return true if USB was connected */ | ||
31 | }; | ||
32 | |||
33 | int menu_init(const struct menu_item* mitems, int count, | ||
34 | int (*callback)(int, int), | ||
35 | const char *button1, const char *button2, const char *button3); | ||
36 | void menu_exit(int menu); | ||
37 | |||
38 | void put_cursorxy(int x, int y, bool on); | ||
39 | |||
40 | /* Returns below define, or number of selected menu item*/ | ||
41 | int menu_show(int m); | ||
42 | #define MENU_ATTACHED_USB -1 | ||
43 | #define MENU_SELECTED_EXIT -2 | ||
44 | #define MENU_EXIT_ALL -3 | ||
45 | #define MENU_RETURN_TO_WPS -4 | ||
46 | |||
47 | bool menu_run(int menu); | ||
48 | int menu_cursor(int menu); | ||
49 | char* menu_description(int menu, int position); | ||
50 | void menu_delete(int menu, int position); | ||
51 | int menu_count(int menu); | ||
52 | bool menu_moveup(int menu); | ||
53 | bool menu_movedown(int menu); | ||
54 | void menu_draw(int menu); | ||
55 | void menu_insert(int menu, int position, char *desc, bool (*function) (void)); | ||
56 | void menu_set_cursor(int menu, int position); | ||
57 | void menu_talk_selected(int m); | ||
58 | |||
59 | |||
60 | enum menu_item_type { | 28 | enum menu_item_type { |
61 | MT_MENU = 0, | 29 | MT_MENU = 0, |
62 | MT_SETTING, | 30 | MT_SETTING, |
@@ -67,6 +35,8 @@ enum menu_item_type { | |||
67 | MT_FUNCTION_WITH_PARAM, | 35 | MT_FUNCTION_WITH_PARAM, |
68 | MT_RETURN_ID, /* returns the position of the selected item (starting at 0)*/ | 36 | MT_RETURN_ID, /* returns the position of the selected item (starting at 0)*/ |
69 | MT_RETURN_VALUE, /* returns a value associated with an item */ | 37 | MT_RETURN_VALUE, /* returns a value associated with an item */ |
38 | MT_OLD_MENU, /* used so we can wrap the old menu api | ||
39 | around the new api. Noone else should use this */ | ||
70 | }; | 40 | }; |
71 | 41 | ||
72 | typedef int (*menu_function)(void); | 42 | typedef int (*menu_function)(void); |
@@ -214,5 +184,25 @@ bool do_setting_from_menu(const struct menu_item_ex *temp); | |||
214 | { (void*)name##_},{.callback_and_desc = & name##__}}; | 184 | { (void*)name##_},{.callback_and_desc = & name##__}}; |
215 | 185 | ||
216 | 186 | ||
187 | /* OLD API - only use if you really have to.. Ideally this will be dropped */ | ||
188 | struct menu_item { | ||
189 | unsigned char *desc; /* string or ID */ | ||
190 | bool (*function) (void); /* return true if USB was connected */ | ||
191 | }; | ||
192 | |||
193 | int menu_init(const struct menu_item* mitems, int count, | ||
194 | int (*callback)(int, int), | ||
195 | const char *button1, const char *button2, const char *button3); | ||
196 | void menu_exit(int menu); | ||
197 | |||
198 | /* Returns below define, or number of selected menu item*/ | ||
199 | int menu_show(int m); | ||
200 | #define MENU_ATTACHED_USB -1 | ||
201 | #define MENU_SELECTED_EXIT -2 | ||
202 | #define MENU_EXIT_ALL -3 | ||
203 | #define MENU_RETURN_TO_WPS -4 | ||
204 | |||
205 | bool menu_run(int menu); | ||
206 | int menu_count(int menu); | ||
217 | 207 | ||
218 | #endif /* End __MENU_H__ */ | 208 | #endif /* End __MENU_H__ */ |