diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-29 06:16:00 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-29 06:16:00 +0000 |
commit | 21165a3f3db3c777f8522b14f16e570107b0405b (patch) | |
tree | a3e2766c1424ded8a2de37ba28f0a709ee3d4ded /apps/filetypes.h | |
parent | d71b531c25ad0e02f4124e6e8cb851f59e4bbc65 (diff) | |
download | rockbox-21165a3f3db3c777f8522b14f16e570107b0405b.tar.gz rockbox-21165a3f3db3c777f8522b14f16e570107b0405b.zip |
Recode filetypes.c to remove its need for a static string buffer.
Functional changes:
- filetypes.c handles the open with menu now instead of onplay.c
- automatic plugin registration no longer works (did anyone know about you could do this?)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12959 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/filetypes.h')
-rw-r--r-- | apps/filetypes.h | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/apps/filetypes.h b/apps/filetypes.h index 7416c93b00..d2556c1d95 100644 --- a/apps/filetypes.h +++ b/apps/filetypes.h | |||
@@ -22,32 +22,24 @@ | |||
22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
23 | #include <tree.h> | 23 | #include <tree.h> |
24 | #include <menu.h> | 24 | #include <menu.h> |
25 | 25 | /* init the filetypes structs. | |
26 | int filetype_get_attr(const char*); | 26 | uses audio buffer for storage, so call early in init... */ |
27 | #ifdef HAVE_LCD_BITMAP | ||
28 | const unsigned char* filetype_get_icon(int); | ||
29 | #else | ||
30 | int filetype_get_icon(int); | ||
31 | #endif | ||
32 | char* filetype_get_plugin(const struct entry*); | ||
33 | void filetype_init(void); | 27 | void filetype_init(void); |
34 | bool filetype_supported(int); | ||
35 | int filetype_load_menu(struct menu_item*, int); | ||
36 | int filetype_load_plugin(const char*, char*); | ||
37 | 28 | ||
38 | struct file_type { | 29 | /* Return the attribute (TREE_ATTR_*) of the file */ |
39 | #ifdef HAVE_LCD_BITMAP | 30 | int filetype_get_attr(const char* file); |
40 | const unsigned char* icon; /* the icon which shall be used for it, NULL if unknown */ | 31 | ICON filetype_get_icon(int attr); |
41 | #else | 32 | /* return the plugin filename associated with the file */ |
42 | int icon; /* the icon which shall be used for it, -1 if unknown */ | 33 | char* filetype_get_plugin(const struct entry* file); |
43 | #endif | 34 | |
44 | char* plugin; /* Which plugin to use, NULL if unknown */ | 35 | /* returns true if the attr is supported */ |
45 | bool no_extension; | 36 | bool filetype_supported(int attr); |
46 | }; | 37 | |
38 | /* List avialable viewers */ | ||
39 | int filetype_list_viewers(const char* current_file); | ||
40 | |||
41 | /* start a plugin with file as the argument (called from onplay.c) */ | ||
42 | int filetype_load_plugin(const char* plugin, char* file); | ||
47 | 43 | ||
48 | struct ext_type { | ||
49 | char* extension; /* extension for which the file type is recognized */ | ||
50 | struct file_type* type; | ||
51 | }; | ||
52 | 44 | ||
53 | #endif | 45 | #endif |