From 21165a3f3db3c777f8522b14f16e570107b0405b Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 29 Mar 2007 06:16:00 +0000 Subject: 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 --- apps/filetypes.h | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'apps/filetypes.h') 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 @@ #include #include #include - -int filetype_get_attr(const char*); -#ifdef HAVE_LCD_BITMAP -const unsigned char* filetype_get_icon(int); -#else -int filetype_get_icon(int); -#endif -char* filetype_get_plugin(const struct entry*); +/* init the filetypes structs. + uses audio buffer for storage, so call early in init... */ void filetype_init(void); -bool filetype_supported(int); -int filetype_load_menu(struct menu_item*, int); -int filetype_load_plugin(const char*, char*); -struct file_type { -#ifdef HAVE_LCD_BITMAP - const unsigned char* icon; /* the icon which shall be used for it, NULL if unknown */ -#else - int icon; /* the icon which shall be used for it, -1 if unknown */ -#endif - char* plugin; /* Which plugin to use, NULL if unknown */ - bool no_extension; -}; +/* Return the attribute (TREE_ATTR_*) of the file */ +int filetype_get_attr(const char* file); +ICON filetype_get_icon(int attr); +/* return the plugin filename associated with the file */ +char* filetype_get_plugin(const struct entry* file); + +/* returns true if the attr is supported */ +bool filetype_supported(int attr); + +/* List avialable viewers */ +int filetype_list_viewers(const char* current_file); + +/* start a plugin with file as the argument (called from onplay.c) */ +int filetype_load_plugin(const char* plugin, char* file); -struct ext_type { - char* extension; /* extension for which the file type is recognized */ - struct file_type* type; -}; #endif -- cgit