summaryrefslogtreecommitdiffstats
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.tar.bz2
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 @@
#include "icons.h"
-struct menu_item {
- unsigned char *desc; /* string or ID */
- bool (*function) (void); /* return true if USB was connected */
-};
-
-int menu_init(const struct menu_item* mitems, int count,
- int (*callback)(int, int),
- const char *button1, const char *button2, const char *button3);
-void menu_exit(int menu);
-
-void put_cursorxy(int x, int y, bool on);
-
- /* Returns below define, or number of selected menu item*/
-int menu_show(int m);
-#define MENU_ATTACHED_USB -1
-#define MENU_SELECTED_EXIT -2
-#define MENU_EXIT_ALL -3
-#define MENU_RETURN_TO_WPS -4
-
-bool menu_run(int menu);
-int menu_cursor(int menu);
-char* menu_description(int menu, int position);
-void menu_delete(int menu, int position);
-int menu_count(int menu);
-bool menu_moveup(int menu);
-bool menu_movedown(int menu);
-void menu_draw(int menu);
-void menu_insert(int menu, int position, char *desc, bool (*function) (void));
-void menu_set_cursor(int menu, int position);
-void menu_talk_selected(int m);
-
-
enum menu_item_type {
MT_MENU = 0,
MT_SETTING,
@@ -67,6 +35,8 @@ enum menu_item_type {
MT_FUNCTION_WITH_PARAM,
MT_RETURN_ID, /* returns the position of the selected item (starting at 0)*/
MT_RETURN_VALUE, /* returns a value associated with an item */
+ MT_OLD_MENU, /* used so we can wrap the old menu api
+ around the new api. Noone else should use this */
};
typedef int (*menu_function)(void);
@@ -214,5 +184,25 @@ bool do_setting_from_menu(const struct menu_item_ex *temp);
{ (void*)name##_},{.callback_and_desc = & name##__}};
+/* OLD API - only use if you really have to.. Ideally this will be dropped */
+struct menu_item {
+ unsigned char *desc; /* string or ID */
+ bool (*function) (void); /* return true if USB was connected */
+};
+
+int menu_init(const struct menu_item* mitems, int count,
+ int (*callback)(int, int),
+ const char *button1, const char *button2, const char *button3);
+void menu_exit(int menu);
+
+ /* Returns below define, or number of selected menu item*/
+int menu_show(int m);
+#define MENU_ATTACHED_USB -1
+#define MENU_SELECTED_EXIT -2
+#define MENU_EXIT_ALL -3
+#define MENU_RETURN_TO_WPS -4
+
+bool menu_run(int menu);
+int menu_count(int menu);
#endif /* End __MENU_H__ */