diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2002-05-23 14:11:42 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2002-05-23 14:11:42 +0000 |
| commit | 1c21296a5ac58fbbca279656c7744b691c6f16b3 (patch) | |
| tree | c1d4ac238b13e7db13941b7cf2e360d5258d127d | |
| parent | bea081f5ecd19fb48188e27c794a0e798e61649d (diff) | |
| download | rockbox-1c21296a5ac58fbbca279656c7744b691c6f16b3.zip rockbox-1c21296a5ac58fbbca279656c7744b691c6f16b3.tar.gz rockbox-1c21296a5ac58fbbca279656c7744b691c6f16b3.tar.bz2 rockbox-1c21296a5ac58fbbca279656c7744b691c6f16b3.tar.xz | |
Cut away some single-use functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@673 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/menu.c | 55 |
1 files changed, 10 insertions, 45 deletions
diff --git a/apps/menu.c b/apps/menu.c index 0455ecd..36cb615 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -34,50 +34,15 @@ static int itemcount; * Move the cursor to a particular id, * target: where you want it to be */ -void put_cursor(int target) +static void put_cursor(int target) { lcd_puts(0, cursor, " "); cursor = target; lcd_puts(0, cursor, "-"); } -int is_cursor_menu_top(void) -{ - return ((cursor == menu_top) ? 1 : 0); -} - -int is_cursor_menu_bottom(void) -{ - return ((cursor == menu_bottom) ? 1 : 0); -} - -void put_cursor_menu_top(void) -{ - put_cursor(menu_top); -} - -void put_cursor_menu_bottom(void) -{ - put_cursor(menu_bottom); -} - -void move_cursor_up(void) -{ - put_cursor(cursor-1); -} - -void move_cursor_down(void) -{ - put_cursor(cursor+1); -} - -void redraw_cursor(void) -{ - lcd_puts(0, cursor, "-"); -} - /* We call the function pointer related to the current cursor position */ -void execute_menu_item(void) +static void execute_menu_item(void) { /* call the proper function for this line */ items[cursor].function(); @@ -92,7 +57,7 @@ void menu_init(struct menu_items* mitems, int count) cursor = menu_top; } -void menu_draw(void) +static void menu_draw(void) { int i = 0; @@ -109,7 +74,7 @@ void menu_draw(void) menu_bottom = i; } - redraw_cursor(); + lcd_puts(0, cursor, "-"); lcd_update(); } @@ -132,12 +97,12 @@ void menu_run(void) #else case BUTTON_LEFT: #endif - if(is_cursor_menu_top()){ + if (cursor == menu_top) { /* wrap around to menu bottom */ - put_cursor_menu_bottom(); + put_cursor(menu_bottom); } else { /* move up */ - move_cursor_up(); + put_cursor(cursor-1); } break; @@ -146,12 +111,12 @@ void menu_run(void) #else case BUTTON_RIGHT: #endif - if(is_cursor_menu_bottom() ){ + if (cursor == menu_bottom) { /* wrap around to menu top */ - put_cursor_menu_top(); + put_cursor(menu_top); } else { /* move down */ - move_cursor_down(); + put_cursor(cursor+1); } break; |