summaryrefslogtreecommitdiff
path: root/apps/menu.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-03-07 13:00:46 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-03-07 13:00:46 +0000
commit3452146217cbb8bac3c836aa8033160a1f5a5da8 (patch)
tree416935e8b2cc5d51a70eb411ce7f0c402b290ff5 /apps/menu.h
parentc70d51398329c56754899cc4be483f4478a93aa8 (diff)
downloadrockbox-3452146217cbb8bac3c836aa8033160a1f5a5da8.tar.gz
rockbox-3452146217cbb8bac3c836aa8033160a1f5a5da8.zip
Make the old menu aPI use the new API. Both are avialable to core and
rocks, but use the new API unless you absolutly have to use the old one (and file a FS bug if you do) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12670 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.h')
-rw-r--r--apps/menu.h54
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
28struct menu_item {
29 unsigned char *desc; /* string or ID */
30 bool (*function) (void); /* return true if USB was connected */
31};
32
33int menu_init(const struct menu_item* mitems, int count,
34 int (*callback)(int, int),
35 const char *button1, const char *button2, const char *button3);
36void menu_exit(int menu);
37
38void put_cursorxy(int x, int y, bool on);
39
40 /* Returns below define, or number of selected menu item*/
41int 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
47bool menu_run(int menu);
48int menu_cursor(int menu);
49char* menu_description(int menu, int position);
50void menu_delete(int menu, int position);
51int menu_count(int menu);
52bool menu_moveup(int menu);
53bool menu_movedown(int menu);
54void menu_draw(int menu);
55void menu_insert(int menu, int position, char *desc, bool (*function) (void));
56void menu_set_cursor(int menu, int position);
57void menu_talk_selected(int m);
58
59
60enum menu_item_type { 28enum 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
72typedef int (*menu_function)(void); 42typedef 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 */
188struct menu_item {
189 unsigned char *desc; /* string or ID */
190 bool (*function) (void); /* return true if USB was connected */
191};
192
193int menu_init(const struct menu_item* mitems, int count,
194 int (*callback)(int, int),
195 const char *button1, const char *button2, const char *button3);
196void menu_exit(int menu);
197
198 /* Returns below define, or number of selected menu item*/
199int 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
205bool menu_run(int menu);
206int menu_count(int menu);
217 207
218#endif /* End __MENU_H__ */ 208#endif /* End __MENU_H__ */