https://bitbucket.org/daniel_fort/magic-lantern
Raw File
Tip revision: 924034775047e063e1b169dc00efea6cd0ee1573 authored by Alex on 08 July 2016, 17:26:40 UTC
Close branch wifi_sd
Tip revision: 9240347
file_man.h
#ifndef _file_man_h_
#define _file_man_h_

/* the file handler should process a subset of these commands (0 or more) */
/* should return 0 if command was not processed, 1 on success, negative on error */
typedef int (*filetype_handler_func)( unsigned int cmd, char *filename, char *data );
#define FILETYPE_HANDLER(func) static int func ( unsigned int cmd, char *filename, char *data )

#define FILEMAN_CMD_INFO 0                  /* return a info string */
#define FILEMAN_CMD_VIEW_IN_MENU 1          /* for simple things, e.g. text, image */
#define FILEMAN_CMD_VIEW_OUTSIDE_MENU 2     /* for more complex things, e.g. playing a movie */

/* not yet implemented */
#define FILEMAN_CMD_VIEW_THUMBNAIL 3        /* small preview when hovering or selecting a file (not implemented yet) */
#define FILEMAN_CMD_OPEN 4                  /* open the file externally (e.g. edit a script, load a module) */

#ifndef _file_man_c_
extern WEAK_FUNC(ret_1) unsigned int fileman_register_type(char *ext, char *type, filetype_handler_func handler);
#endif

#endif
back to top