#ifndef FILEBROWSER_H_
#define FILEBROWSER_H_

#include "modal.h"

struct nk_context;

#define FB_ENTRY_DIR    1
#define FB_ENTRY_FILE   2
/* Not a filesystem entry: activating it runs an action rather than navigating.
 * Used for the Android "grant storage access" row in the roots list. */
#define FB_ENTRY_ACTION 3

struct fb_dir_entries {
    char *dir;
    char **entries;
    int count;
    int *entry_type;
    /* Optional, NULL for ordinary directory listings.  When set, entry_path[i]
     * is the full path for entry i instead of dir + "/" + entries[i], so a row
     * can carry a friendly label ("SD Card") that is not its own path. */
    char **entry_path;
    int fb_type;
};

void filebrowser_init(struct modal_config *cfg);
void filebrowser_exit(void);
void filebrowser_show(struct nk_context *ctx,
                          int screen_w, int screen_h);
char * filebrowser_result(void);
int filebrowser_get_mapping(void);

#endif
