summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-08-06 13:42:52 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-08-06 13:42:52 +0000
commitfda7d720c05b4a756f045e0c0f4afe9630edb5c5 (patch)
tree35bb19611d47bcb05a49529a73ccc5d66a50476e /apps/plugins
parent5b76936a44de3c7ecd568300f26b5e6421901285 (diff)
downloadrockbox-fda7d720c05b4a756f045e0c0f4afe9630edb5c5.zip
rockbox-fda7d720c05b4a756f045e0c0f4afe9630edb5c5.tar.gz
rockbox-fda7d720c05b4a756f045e0c0f4afe9630edb5c5.tar.bz2
rockbox-fda7d720c05b4a756f045e0c0f4afe9630edb5c5.tar.xz
Accept FS#5464 - organise the rocks directory.
If any plugins or "open with" optoins dont work please let me know... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14214 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/CATEGORIES91
-rw-r--r--apps/plugins/blackjack.c4
-rw-r--r--apps/plugins/bubbles.c4
-rw-r--r--apps/plugins/chessbox.c2
-rw-r--r--apps/plugins/chessbox/chessbox.c2
-rw-r--r--apps/plugins/clock/clock_settings.h2
-rw-r--r--apps/plugins/invadrox.c2
-rw-r--r--apps/plugins/jewels.c4
-rw-r--r--apps/plugins/lib/configfile.c21
-rw-r--r--apps/plugins/reversi/reversi-gui.h2
-rw-r--r--apps/plugins/rockblox.c2
-rw-r--r--apps/plugins/rockboy.c2
-rw-r--r--apps/plugins/rockpaint.c2
-rw-r--r--apps/plugins/snake2.c4
-rw-r--r--apps/plugins/sokoban.c4
-rw-r--r--apps/plugins/spacerocks.c2
-rw-r--r--apps/plugins/sudoku/sudoku.h2
-rw-r--r--apps/plugins/viewer.c4
-rw-r--r--apps/plugins/viewers.config16
-rw-r--r--apps/plugins/vu_meter.c4
-rw-r--r--apps/plugins/zxbox.c2
21 files changed, 143 insertions, 35 deletions
diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES
new file mode 100644
index 0000000..cb24f5a
--- /dev/null
+++ b/apps/plugins/CATEGORIES
@@ -0,0 +1,91 @@
+alpine_cdc,apps
+battery_bench,apps
+blackjack,games
+bounce,demos
+brickmania,games
+bubbles,games
+calculator,apps
+calendar,apps
+chessbox,games
+chessclock,apps
+chip8,viewers
+chopper,games
+clock,apps
+credits,viewers
+cube,demos
+demystify,demos
+dice,games
+dict,apps
+doom,games
+disktidy,apps
+euroconverter,apps
+fire,demos
+fireworks,demos
+firmware_flash,apps
+flipit,games
+grayscale,demos
+helloworld,demos
+invadrox,games
+iriver_flash,apps
+iriverify,viewers
+jackpot,games
+jewels,games
+jpeg,viewers
+logo,demos
+mandelbrot,games
+maze,games
+mazezam,games
+mem_mon,apps
+metronome,apps
+midi2wav,viewers
+midiplay,viewers
+minesweeper,games
+mosaique,demos
+mp3_encoder,apps
+mpegplayer,viewers
+nim,games
+oscilloscope,demos
+pacbox,games
+plasma,demos
+pong,games
+properties,viewers
+random_folder_advance_config,apps
+reversi,games
+rockblox,games
+rockbox_flash,viewers
+rockboy,viewers
+rocklife,games
+rockpaint,apps
+search,viewers
+searchengine,viewers
+shortcuts,viewers
+sliding_puzzle,games
+snake2,games
+snake,games
+snow,demos
+sokoban,games
+solitaire,games
+sort,viewers
+spacerocks,games
+splitedit,apps
+star,games
+starfield,demos
+stats,apps
+stopwatch,apps
+test_codec,viewers
+test_disk,test
+test_fps,test
+test_sampr,test
+test_scanrate,test
+text_editor,apps
+vbrfix,viewers
+video,viewers
+viewer,viewers
+vu_meter,demos
+wav2wv,viewers
+wavplay,viewers
+wavrecord,apps
+wavview,viewers
+wormlet,games
+xobox,games
+zxbox,viewers
diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c
index f587ecc..c4b4241 100644
--- a/apps/plugins/blackjack.c
+++ b/apps/plugins/blackjack.c
@@ -24,8 +24,8 @@
PLUGIN_HEADER
/* save files */
-#define SCORE_FILE PLUGIN_DIR "/blackjack.score"
-#define SAVE_FILE PLUGIN_DIR "/blackjack.save"
+#define SCORE_FILE PLUGIN_GAMES_DIR "/blackjack.score"
+#define SAVE_FILE PLUGIN_GAMES_DIR "/blackjack.save"
#define NUM_SCORES LCD_HEIGHT/8-2
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index 25fd4f3..4d49c3f 100644
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -30,8 +30,8 @@
PLUGIN_HEADER
/* files */
-#define SCORE_FILE PLUGIN_DIR "/bubbles.score"
-#define SAVE_FILE PLUGIN_DIR "/bubbles.save"
+#define SCORE_FILE PLUGIN_GAMES_DIR "/bubbles.score"
+#define SAVE_FILE PLUGIN_GAMES_DIR "/bubbles.save"
/* final game return status */
#define BB_NONE 5
diff --git a/apps/plugins/chessbox.c b/apps/plugins/chessbox.c
index c146066..fc3b703 100644
--- a/apps/plugins/chessbox.c
+++ b/apps/plugins/chessbox.c
@@ -29,6 +29,6 @@ PLUGIN_HEADER
/* this is the plugin entry point */
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
- return run_overlay(api, parameter, "/.rockbox/rocks/chessbox.ovl", "ChessBox");
+ return run_overlay(api, parameter, PLUGIN_GAMES_DIR "/chessbox.ovl", "ChessBox");
}
#endif
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index aedb9f8..ab75765 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -241,7 +241,7 @@ PLUGIN_HEADER
#define YOFS ((LCD_HEIGHT-8*TILE_HEIGHT)/2)
/* save files */
-#define SAVE_FILE PLUGIN_DIR "/chessbox.save"
+#define SAVE_FILE PLUGIN_GAMES_DIR "/chessbox.save"
/* commands enum */
#define COMMAND_NOP 0
diff --git a/apps/plugins/clock/clock_settings.h b/apps/plugins/clock/clock_settings.h
index fadf3d5..a786ddd 100644
--- a/apps/plugins/clock/clock_settings.h
+++ b/apps/plugins/clock/clock_settings.h
@@ -78,7 +78,7 @@ struct clock_settings{
extern struct clock_settings clock_settings;
/* settings are saved to this location */
-#define settings_filename "/.rockbox/rocks/.clock_settings"
+#define settings_filename PLUGIN_GAMES_DIR "/.clock_settings"
void clock_settings_skin_next(struct clock_settings* settings);
void clock_settings_skin_previous(struct clock_settings* settings);
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index 62a1c3e..aa2cf0d 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -559,7 +559,7 @@ unsigned char fire_sprite[FIRE_HEIGHT] = {
#define TARGET_BOTTOM 3
#define TARGET_UFO 4
-#define HISCOREFILE "/.rockbox/rocks/invadrox.high"
+#define HISCOREFILE PLUGIN_GAMES_DIR "/invadrox.high"
/* The time (in ms) for one iteration through the game loop - decrease this
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index b74bf24..cb4ab88 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -178,8 +178,8 @@ PLUGIN_HEADER
#endif
/* save files */
-#define SCORE_FILE PLUGIN_DIR "/jewels.score"
-#define SAVE_FILE PLUGIN_DIR "/jewels.save"
+#define SCORE_FILE PLUGIN_GAMES_DIR "/jewels.score"
+#define SAVE_FILE PLUGIN_GAMES_DIR "/jewels.save"
/* final game return status */
#define BJ_QUIT_FROM_GAME 4
diff --git a/apps/plugins/lib/configfile.c b/apps/plugins/lib/configfile.c
index 3ca3805..54c067c 100644
--- a/apps/plugins/lib/configfile.c
+++ b/apps/plugins/lib/configfile.c
@@ -26,6 +26,23 @@ void configfile_init(struct plugin_api* newrb)
cfg_rb = newrb;
}
+void get_cfg_filename(char* buf, int buf_len, const char* filename)
+{
+ char *s;
+ cfg_rb->strcpy(buf, cfg_rb->plugin_get_current_filename());
+ s = cfg_rb->strrchr(buf, '/');
+ if (!s) /* should never happen */
+ {
+ cfg_rb->snprintf(buf, buf_len, "/.rockbox/rocks/%s", filename);
+ }
+ else
+ {
+ s++;
+ *s = '\0';
+ cfg_rb->strcat(s, filename);
+ }
+}
+
int configfile_save(const char *filename, struct configdata *cfg,
int num_items, int version)
{
@@ -33,7 +50,7 @@ int configfile_save(const char *filename, struct configdata *cfg,
int i;
char buf[MAX_PATH];
- cfg_rb->snprintf(buf, MAX_PATH, "/.rockbox/rocks/%s", filename);
+ get_cfg_filename(buf, MAX_PATH, filename);
fd = cfg_rb->creat(buf);
if(fd < 0)
return fd*10 - 1;
@@ -78,7 +95,7 @@ int configfile_load(const char *filename, struct configdata *cfg,
int file_version = -1;
int tmp;
- cfg_rb->snprintf(buf, MAX_PATH, "/.rockbox/rocks/%s", filename);
+ get_cfg_filename(buf, MAX_PATH, filename);
fd = cfg_rb->open(buf, O_RDONLY);
if(fd < 0)
return fd*10 - 1;
diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h
index 43dab46..b82e40d 100644
--- a/apps/plugins/reversi/reversi-gui.h
+++ b/apps/plugins/reversi/reversi-gui.h
@@ -22,7 +22,7 @@
#include "plugin.h"
-#define GAME_FILE PLUGIN_DIR "/reversi.rev"
+#define GAME_FILE PLUGIN_GAMES_DIR "/reversi.rev"
/* variable button definitions */
#if CONFIG_KEYPAD == RECORDER_PAD
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index e66d242..1aafe5f 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -477,7 +477,7 @@ figures[BLOCKS_NUM] = {
};
/* Rockbox File System only supports full filenames inc dir */
-#define HIGH_SCORE "/.rockbox/rocks/rockblox.score"
+#define HIGH_SCORE PLUGIN_GAMES_DIR "/rockblox.score"
#define MAX_HIGH_SCORES 5
/* Default High Scores... */
struct highscore Highest[MAX_HIGH_SCORES];
diff --git a/apps/plugins/rockboy.c b/apps/plugins/rockboy.c
index 9ff176c..67f1004 100644
--- a/apps/plugins/rockboy.c
+++ b/apps/plugins/rockboy.c
@@ -29,6 +29,6 @@ PLUGIN_HEADER
/* this is the plugin entry point */
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
- return run_overlay(api, parameter, "/.rockbox/viewers/rockboy.ovl", "RockBoy");
+ return run_overlay(api, parameter, PLUGIN_GAMES_DIR "/rockboy.ovl", "RockBoy");
}
#endif
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index ae4517d..3038a06 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -130,7 +130,7 @@ PLUGIN_HEADER
#define COLOR_BROWN LCD_RGBPACK(128,64,0)
#define COLOR_LIGHTBROWN LCD_RGBPACK(255,128,64)
-#define SPLASH_SCREEN PLUGIN_DIR "/rockpaint/splash.bmp"
+#define SPLASH_SCREEN PLUGIN_APPS_DIR "/rockpaint/splash.bmp"
#define ROCKPAINT_TITLE_FONT 2
/***********************************************************************
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c
index 8b49a7c..dbefef6 100644
--- a/apps/plugins/snake2.c
+++ b/apps/plugins/snake2.c
@@ -321,8 +321,8 @@ extern const unsigned char snake2_bottom[];
#define SOUTH_EAST 2048
#define SOUTH_WEST 4096
-#define LEVELS_FILE PLUGIN_DIR "/snake2.levels"
-#define HISCORE_FILE PLUGIN_DIR "/snake2.hs"
+#define LEVELS_FILE PLUGIN_GAMES_DIR "/snake2.levels"
+#define HISCORE_FILE PLUGIN_GAMES_DIR "/snake2.hs"
int load_all_levels(void)
{
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index 004494f..e031f60 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -33,8 +33,8 @@ extern const fb_data sokoban_tiles[];
#define SOKOBAN_TITLE "Sokoban"
-#define SOKOBAN_LEVELS_FILE PLUGIN_DIR "/sokoban.levels"
-#define SOKOBAN_SAVE_FILE PLUGIN_DIR "/sokoban.save"
+#define SOKOBAN_LEVELS_FILE PLUGIN_GAMES_DIR "/sokoban.levels"
+#define SOKOBAN_SAVE_FILE PLUGIN_GAMES_DIR "/sokoban.save"
#define SOKOBAN_SAVE_FOLDER "/games"
/* Magnify is the number of pixels for each block.
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index f4208f0..075f335 100644
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -162,7 +162,7 @@ static struct plugin_api* rb; /* global api struct pointer */
#define WRAP_GAP 12
#define EXPLOSION_LENGTH 20
#define SHOW_COL 0
-#define HISCORE_FILE PLUGIN_DIR "/astrorocks.hs"
+#define HISCORE_FILE PLUGIN_GAMES_DIR "/astrorocks.hs"
#define POINT_SIZE 2
#define MAX_NUM_ASTEROIDS 25
#define MAX_NUM_MISSILES 6
diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h
index 20e7c43..d41c0b8 100644
--- a/apps/plugins/sudoku/sudoku.h
+++ b/apps/plugins/sudoku/sudoku.h
@@ -22,7 +22,7 @@
#include "plugin.h"
-#define GAME_FILE PLUGIN_DIR "/sudoku.ss"
+#define GAME_FILE PLUGIN_GAMES_DIR "/sudoku.ss"
/* variable button definitions */
#if CONFIG_KEYPAD == RECORDER_PAD
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 615ed41..897b7c8 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -24,8 +24,8 @@
PLUGIN_HEADER
-#define SETTINGS_FILE "/.rockbox/viewers/viewer.dat" /* binary file, so dont use .cfg */
-#define BOOKMARKS_FILE "/.rockbox/viewers/viewer_bookmarks.dat"
+#define SETTINGS_FILE PLUGIN_APPS_DIR "/viewer.dat" /* binary file, so dont use .cfg */
+#define BOOKMARKS_FILE PLUGIN_APPS_DIR "/viewer_bookmarks.dat"
#define WRAP_TRIM 44 /* Max number of spaces to trim (arbitrary) */
#define MAX_COLUMNS 64 /* Max displayable string len (over-estimate) */
diff --git a/apps/plugins/viewers.config b/apps/plugins/viewers.config
index 80ebe43..57bb5b4 100644
--- a/apps/plugins/viewers.config
+++ b/apps/plugins/viewers.config
@@ -1,7 +1,7 @@
ch8,viewers/chip8,0
txt,viewers/viewer,1
nfo,viewers/viewer,1
-txt,rocks/text_editor,2
+txt,apps/text_editor,2
jpg,viewers/jpeg,2
jpe,viewers/jpeg,2
jpeg,viewers/jpeg,2
@@ -17,15 +17,15 @@ m3u,viewers/iriverify,-
mid,viewers/midiplay,7
rmi,viewers/midiplay,7
rsp,viewers/searchengine,8
-sok,rocks/sokoban,1
-pgn,rocks/chessbox,1
-ss,rocks/sudoku,1
+sok,games/sokoban,1
+pgn,games/chessbox,1
+ss,games/sudoku,1
wav,viewers/wav2wv,-
wav,viewers/mp3_encoder,-
wav,viewers/wavplay,10
wav,viewers/wavview,10
wav,viewers/test_codec,-
-bmp,rocks/rockpaint,11
+bmp,apps/rockpaint,11
mpg,viewers/mpegplayer,4
mpeg,viewers/mpegplayer,4
iriver,viewers/iriver_flash,3
@@ -34,6 +34,6 @@ sna,viewers/zxbox,12
tzx,viewers/zxbox,12
z80,viewers/zxbox,12
zzz,viewers/properties,-
-colours,rocks/text_editor,11
-ssg,rocks/superdom,-
-link,rocks/shortcuts,-
+colours,apps/text_editor,11
+ssg,games/superdom,-
+link,viewers/shortcuts,-
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index a03f38f..f054a59 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -236,7 +236,7 @@ void calc_scales(void)
}
void load_settings(void) {
- int fp = rb->open("/.rockbox/rocks/.vu_meter", O_RDONLY);
+ int fp = rb->open(PLUGIN_DEMOS_DIR "/.vu_meter", O_RDONLY);
if(fp>=0) {
rb->read(fp, &vumeter_settings, sizeof(struct saved_settings));
rb->close(fp);
@@ -252,7 +252,7 @@ void load_settings(void) {
}
void save_settings(void) {
- int fp = rb->creat("/.rockbox/rocks/.vu_meter");
+ int fp = rb->creat(PLUGIN_DEMOS_DIR "/.vu_meter");
if(fp >= 0) {
rb->write (fp, &vumeter_settings, sizeof(struct saved_settings));
rb->close(fp);
diff --git a/apps/plugins/zxbox.c b/apps/plugins/zxbox.c
index 2f3ce97..61d9eea 100644
--- a/apps/plugins/zxbox.c
+++ b/apps/plugins/zxbox.c
@@ -26,6 +26,6 @@ PLUGIN_HEADER
/* this is the plugin entry point */
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
- return run_overlay(api, parameter, "/.rockbox/viewers/zxbox.ovl", "ZXBox");
+ return run_overlay(api, parameter, PLUGIN_APPS_DIR "/zxbox.ovl", "ZXBox");
}
#endif