diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-07-23 23:01:20 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-07-23 23:01:20 +0000 |
commit | b1403ee024f81ced657261441571ee5e8bab71ce (patch) | |
tree | 3a7e1651d37bd35e801a331416654760cb61a075 /apps/menu.h | |
parent | 15d04fdb00e7f94aef49cf9a70e73c5a46e21536 (diff) | |
download | rockbox-b1403ee024f81ced657261441571ee5e8bab71ce.tar.gz rockbox-b1403ee024f81ced657261441571ee5e8bab71ce.zip |
New way of defining menus and options allows to declare them static const, which saves the code to runtime-assemble them. Rockbox just got 6 KB smaller.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4931 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.h')
-rw-r--r-- | apps/menu.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/apps/menu.h b/apps/menu.h index 55c480aaab..d097f73a0f 100644 --- a/apps/menu.h +++ b/apps/menu.h | |||
@@ -23,12 +23,11 @@ | |||
23 | #include <stdbool.h> | 23 | #include <stdbool.h> |
24 | 24 | ||
25 | struct menu_item { | 25 | struct menu_item { |
26 | unsigned char *desc; /* string */ | 26 | unsigned char *desc; /* string or ID */ |
27 | int voice_id; /* the associated voice clip, -1 if none */ | ||
28 | bool (*function) (void); /* return true if USB was connected */ | 27 | bool (*function) (void); /* return true if USB was connected */ |
29 | }; | 28 | }; |
30 | 29 | ||
31 | int menu_init(struct menu_item* mitems, int count, int (*callback)(int, int), | 30 | int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int), |
32 | char *button1, char *button2, char *button3); | 31 | char *button1, char *button2, char *button3); |
33 | void menu_exit(int menu); | 32 | void menu_exit(int menu); |
34 | 33 | ||
@@ -47,7 +46,6 @@ int menu_count(int menu); | |||
47 | bool menu_moveup(int menu); | 46 | bool menu_moveup(int menu); |
48 | bool menu_movedown(int menu); | 47 | bool menu_movedown(int menu); |
49 | void menu_draw(int menu); | 48 | void menu_draw(int menu); |
50 | void menu_insert(int menu, int position, char *desc, int voice_id, | 49 | void menu_insert(int menu, int position, char *desc, bool (*function) (void)); |
51 | bool (*function) (void)); | ||
52 | 50 | ||
53 | #endif /* End __MENU_H__ */ | 51 | #endif /* End __MENU_H__ */ |