2012-04-21 21:13:50 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2012-01-10 22:33:44 +00:00
|
|
|
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
|
|
|
* Copyright (C) 2011-2012 - Daniel De Matteis
|
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2012-01-10 22:33:44 +00:00
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2012-01-10 22:33:44 +00:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 21:31:57 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2012-01-10 22:33:44 +00:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FILEBROWSER_H_
|
|
|
|
#define FILEBROWSER_H_
|
|
|
|
|
2012-06-09 23:30:53 +00:00
|
|
|
#define MAX_DIR_STACK 25
|
2012-01-10 22:33:44 +00:00
|
|
|
|
2012-03-29 14:09:43 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2012-01-10 22:33:44 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-03-26 13:14:25 +00:00
|
|
|
uint32_t directory_stack_size;
|
2012-06-18 18:44:21 +00:00
|
|
|
char dir[MAX_DIR_STACK][512];
|
2012-06-18 00:07:19 +00:00
|
|
|
struct {
|
2012-06-18 03:31:43 +00:00
|
|
|
char **elems;
|
2012-06-18 00:07:19 +00:00
|
|
|
size_t size;
|
|
|
|
size_t ptr;
|
|
|
|
} current_dir;
|
2012-06-19 01:44:17 +00:00
|
|
|
char root_dir[PATH_MAX];
|
2012-06-18 18:44:21 +00:00
|
|
|
char extensions[PATH_MAX];
|
2012-01-10 22:33:44 +00:00
|
|
|
} filebrowser_t;
|
|
|
|
|
2012-06-19 01:44:17 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
FILEBROWSER_ACTION_UP,
|
|
|
|
FILEBROWSER_ACTION_DOWN,
|
|
|
|
FILEBROWSER_ACTION_LEFT,
|
|
|
|
FILEBROWSER_ACTION_RIGHT,
|
|
|
|
FILEBROWSER_ACTION_OK,
|
|
|
|
FILEBROWSER_ACTION_CANCEL,
|
|
|
|
FILEBROWSER_ACTION_SCROLL_UP,
|
|
|
|
FILEBROWSER_ACTION_SCROLL_UP_SMOOTH,
|
|
|
|
FILEBROWSER_ACTION_SCROLL_DOWN,
|
|
|
|
FILEBROWSER_ACTION_SCROLL_DOWN_SMOOTH,
|
|
|
|
FILEBROWSER_ACTION_RESET,
|
|
|
|
FILEBROWSER_ACTION_NOOP
|
|
|
|
} filebrowser_action_t;
|
|
|
|
|
2012-06-18 23:48:46 +00:00
|
|
|
const char * filebrowser_get_current_dir (filebrowser_t *filebrowser);
|
|
|
|
const char * filebrowser_get_current_path (filebrowser_t *filebrowser);
|
|
|
|
size_t filebrowser_get_current_index (filebrowser_t *filebrowser);
|
2012-06-19 01:44:17 +00:00
|
|
|
void filebrowser_set_root(filebrowser_t *filebrowser, const char *root_dir);
|
|
|
|
void filebrowser_free(filebrowser_t *filebrowser);
|
2012-06-18 23:48:46 +00:00
|
|
|
void filebrowser_set_current_at (filebrowser_t *filebrowser, size_t pos);
|
2012-06-19 01:44:17 +00:00
|
|
|
void filebrowser_iterate(filebrowser_t *filebrowser, filebrowser_action_t action);
|
2012-01-10 22:33:44 +00:00
|
|
|
|
|
|
|
#endif /* FILEBROWSER_H_ */
|