summaryrefslogtreecommitdiffstats
path: root/apps/recorder
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/recorder
parentad4a92eb87eb98ff316f54f06650f1c5e1dcd7ca (diff)
downloadrockbox-b285076925fed906d95573b64115cb3f6bdafe65.tar.gz
rockbox-b285076925fed906d95573b64115cb3f6bdafe65.tar.bz2
rockbox-b285076925fed906d95573b64115cb3f6bdafe65.zip
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/recorder')
-rw-r--r--apps/recorder/blank.c16
-rw-r--r--apps/recorder/bounce.c5
-rw-r--r--apps/recorder/boxes.c5
-rw-r--r--apps/recorder/boxes.h4
-rw-r--r--apps/recorder/sokoban.c5
-rw-r--r--apps/recorder/sokoban.h4
-rw-r--r--apps/recorder/tetris.c5
7 files changed, 31 insertions, 13 deletions
diff --git a/apps/recorder/blank.c b/apps/recorder/blank.c
index 835420f63b..2c59ec66bc 100644
--- a/apps/recorder/blank.c
+++ b/apps/recorder/blank.c
@@ -24,6 +24,7 @@
#include "lcd.h"
#include "button.h"
#include "kernel.h"
+#include "menu.h"
#ifdef SIMULATOR
#include <stdio.h>
@@ -33,7 +34,7 @@
#define SS_TITLE "Blank"
#define SS_TITLE_FONT 2
-void blank(void)
+Menu blank(void)
{
int w, h;
char *off = "[Off] to stop";
@@ -76,15 +77,16 @@ void blank(void)
lcd_update();
sleep(HZ);
- lcd_clear_display();
+ lcd_clear_display();
lcd_update();
- while(1) {
- if(button_get(false))
- return;
+ while(1) {
+ if(button_get(false))
+ return MENU_OK;
sleep(HZ/10);
- }
-
+ }
+
+ return MENU_OK;
}
#endif
diff --git a/apps/recorder/bounce.c b/apps/recorder/bounce.c
index 6b500964f0..cb080a0d00 100644
--- a/apps/recorder/bounce.c
+++ b/apps/recorder/bounce.c
@@ -24,6 +24,7 @@
#include "lcd.h"
#include "button.h"
#include "kernel.h"
+#include "menu.h"
#ifdef SIMULATOR
#include <stdio.h>
@@ -83,7 +84,7 @@ static void loopit(void)
}
-void bounce(void)
+Menu bounce(void)
{
int w, h;
char *off = "[Off] to stop";
@@ -126,6 +127,8 @@ void bounce(void)
lcd_update();
sleep(HZ);
loopit();
+
+ return MENU_OK;
}
#endif
diff --git a/apps/recorder/boxes.c b/apps/recorder/boxes.c
index 6b6d0065c9..60fdef6f9b 100644
--- a/apps/recorder/boxes.c
+++ b/apps/recorder/boxes.c
@@ -25,6 +25,7 @@
#include "lcd.h"
#include "button.h"
#include "kernel.h"
+#include "menu.h"
#ifdef SIMULATOR
#include <stdio.h>
@@ -82,7 +83,7 @@ static void ss_loop(void)
}
}
-void boxes(void)
+Menu boxes(void)
{
int w, h;
char *off = "[Off] to stop";
@@ -125,6 +126,8 @@ void boxes(void)
lcd_update();
sleep(HZ/2);
ss_loop();
+
+ return MENU_OK;
}
#endif
diff --git a/apps/recorder/boxes.h b/apps/recorder/boxes.h
index bf3e095a65..2defb0bbfc 100644
--- a/apps/recorder/boxes.h
+++ b/apps/recorder/boxes.h
@@ -20,7 +20,9 @@
#ifndef __BOXES_H__
#define __BOXES_H__
-void boxes(void);
+#include "menu.h"
+
+Menu boxes(void);
#endif /* __BOXES_H__ */
diff --git a/apps/recorder/sokoban.c b/apps/recorder/sokoban.c
index 2795d745e6..6ce19e6a41 100644
--- a/apps/recorder/sokoban.c
+++ b/apps/recorder/sokoban.c
@@ -23,6 +23,7 @@
#include "lcd.h"
#include "button.h"
#include "kernel.h"
+#include "menu.h"
#ifdef SIMULATOR
#include <stdio.h>
@@ -1334,7 +1335,7 @@ void sokoban_loop(void) {
}
-void sokoban(void)
+Menu sokoban(void)
{
int w, h;
int len = strlen(SOKOBAN_TITLE);
@@ -1371,4 +1372,6 @@ void sokoban(void)
sleep(HZ*2);
lcd_clear_display();
sokoban_loop();
+
+ return MENU_OK;
}
diff --git a/apps/recorder/sokoban.h b/apps/recorder/sokoban.h
index 8e6c54c43e..ee1398c011 100644
--- a/apps/recorder/sokoban.h
+++ b/apps/recorder/sokoban.h
@@ -20,10 +20,12 @@
#ifndef __SOKOBAN__
#define __SOKOBAN__
+#include "menu.h"
+
void load_level(int);
void update_screen(void);
void sokoban_loop(void);
-void sokoban(void);
+Menu sokoban(void);
#endif /*__SOKOBAN__ */
diff --git a/apps/recorder/tetris.c b/apps/recorder/tetris.c
index 76d1940889..910374920f 100644
--- a/apps/recorder/tetris.c
+++ b/apps/recorder/tetris.c
@@ -27,6 +27,7 @@
#include "button.h"
#include "kernel.h"
#include <string.h>
+#include "menu.h"
#ifdef SIMULATOR
#include <stdio.h>
@@ -388,7 +389,7 @@ void init_tetris(void)
next_f = 0;
}
-void tetris(void)
+Menu tetris(void)
{
init_tetris();
@@ -400,6 +401,8 @@ void tetris(void)
next_f = t_rand(block_frames[next_b]);
new_block();
game_loop();
+
+ return MENU_OK;
}
#endif