From 3827d4764b306f70a955dd39c9e96dd2c29debc8 Mon Sep 17 00:00:00 2001 From: Robert Hak Date: Mon, 24 Jun 2002 08:51:28 +0000 Subject: games and screensavers are now in submenus git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1142 a1c6a512-1295-4272-9138-f99709370657 --- apps/games_menu.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ apps/games_menu.h | 24 ++++++++++++++++++++++ apps/main_menu.c | 20 ++++++++----------- apps/screensavers_menu.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ apps/screensavers_menu.h | 25 +++++++++++++++++++++++ 5 files changed, 161 insertions(+), 12 deletions(-) create mode 100644 apps/games_menu.c create mode 100644 apps/games_menu.h create mode 100644 apps/screensavers_menu.c create mode 100644 apps/screensavers_menu.h diff --git a/apps/games_menu.c b/apps/games_menu.c new file mode 100644 index 0000000000..caee2b464c --- /dev/null +++ b/apps/games_menu.c @@ -0,0 +1,52 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 Robert Hak + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifdef HAVE_LCD_BITMAP + +#include "config.h" +#include +#include +#include "lcd.h" +#include "menu.h" +#include "games_menu.h" +#include "button.h" +#include "kernel.h" +#include "sprintf.h" + +#include "sokoban.h" +extern void tetris(void); + +enum { Tetris, Sokoban, numgames }; + +void games_menu(void) +{ + int m; + + struct menu_items items[] = { + { Tetris, "Tetris", tetris }, + { Sokoban, "Sokoban", sokoban }, + }; + + m=menu_init( items, sizeof items / sizeof(struct menu_items) ); + menu_run(m); + menu_exit(m); +} + +#endif + + diff --git a/apps/games_menu.h b/apps/games_menu.h new file mode 100644 index 0000000000..861c27bfac --- /dev/null +++ b/apps/games_menu.h @@ -0,0 +1,24 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 Robert Hak + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef _GAMES_MENU_H +#define _GAMES_MENU_H + +void games_menu(void); + +#endif diff --git a/apps/main_menu.c b/apps/main_menu.c index fb286eca98..4b150f0b08 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c @@ -32,12 +32,10 @@ #include "playlist.h" #ifdef HAVE_LCD_BITMAP +#include "games_menu.h" +#include "screensavers_menu.h" #include "bmp.h" #include "icons.h" -#include "boxes.h" -#include "sokoban.h" -extern void tetris(void); -extern void bounce(void); #endif int show_logo( void ) @@ -198,19 +196,17 @@ void main_menu(void) { int m; enum { - Tetris, Boxes, Bounce, Sokoban, Version, Sound, Scroll, Shuffle + Games, Screensavers, Version, Sound, Scroll, Shuffle }; /* main menu */ struct menu_items items[] = { - { Shuffle, "Shuffle", shuffle }, - { Sound, "Sound", sound_menu }, - { Scroll, "Scroll speed", scroll_speed }, + { Shuffle, "Shuffle", shuffle }, + { Sound, "Sound", sound_menu }, + { Scroll, "Scroll speed", scroll_speed }, #ifdef HAVE_LCD_BITMAP - { Tetris, "Tetris", tetris }, - { Boxes, "Boxes", boxes }, - { Bounce, "Bounce", bounce }, - { Sokoban, "Sokoban", sokoban }, + { Games, "Games", games_menu }, + { Screensavers, "Screensavers", screensavers_menu }, #endif { Version, "Version", show_credits }, }; diff --git a/apps/screensavers_menu.c b/apps/screensavers_menu.c new file mode 100644 index 0000000000..e7dc031e12 --- /dev/null +++ b/apps/screensavers_menu.c @@ -0,0 +1,52 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 Robert Hak + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifdef HAVE_LCD_BITMAP + +#include "config.h" +#include +#include +#include "lcd.h" +#include "menu.h" +#include "screensavers_menu.h" +#include "button.h" +#include "kernel.h" +#include "sprintf.h" + +#include "boxes.h" +extern void bounce(void); + +enum { Boxes, Bounce, numsavers }; + +void screensavers_menu(void) +{ + int m; + + struct menu_items items[] = { + { Boxes, "Boxes", boxes }, + { Bounce, "Bounce", bounce }, + }; + + m=menu_init( items, sizeof items / sizeof(struct menu_items) ); + menu_run(m); + menu_exit(m); +} + +#endif + + diff --git a/apps/screensavers_menu.h b/apps/screensavers_menu.h new file mode 100644 index 0000000000..42a40cf826 --- /dev/null +++ b/apps/screensavers_menu.h @@ -0,0 +1,25 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 Robert Hak + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef _SCREENSAVERS_MENU_H +#define _SCREENSAVERS_MENU_H + +void screensavers_menu(void); + +#endif + -- cgit v1.2.3