summaryrefslogtreecommitdiff
path: root/apps/menu.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-23 12:32:52 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-23 12:32:52 +0000
commitb285076925fed906d95573b64115cb3f6bdafe65 (patch)
tree6d959f585fc210acf39e667991038d21aef48d13 /apps/menu.h
parentad4a92eb87eb98ff316f54f06650f1c5e1dcd7ca (diff)
Remade the menu system slightly. All functions invoked from menus now use
the Menu typedef as return type, and *ALL* menus that intercept USB connect can then return MENU_REFRESH_DIR so that the parent (any parent really) that do file or dir-accesses knows that and can do the refresh. If no refresh is needed by the parent, MENU_OK is returned. Somewhat biggish commit this close to 1.3, but we need to sort out this refresh-after-usb-connected business. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1948 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.h')
-rw-r--r--apps/menu.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/menu.h b/apps/menu.h
index 0871e502c8..fc962c79aa 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -22,15 +22,23 @@
#include <stdbool.h>
+typedef enum {
+ MENU_OK,
+ MENU_REFRESH_DIR, /* any file/directory contents need to be re-read */
+ MENU_LAST /* don't use as return code, only for number of return codes
+ available */
+} Menu;
+
struct menu_items {
char *desc;
- void (*function) (void);
+ Menu (*function) (void);
};
int menu_init(struct menu_items* items, int count);
void menu_exit(int menu);
-void menu_run(int menu);
void put_cursorxy(int x, int y, bool on);
+Menu menu_run(int menu);
+
#endif /* End __MENU_H__ */