84 lines
2.1 KiB
C
Raw Normal View History

2012-04-21 23:13:50 +02:00
/* RetroArch - A frontend for libretro.
2012-01-08 01:08:18 +01:00
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
2012-01-08 00:57:44 +01:00
*
2012-04-21 23:13:50 +02:00
* RetroArch is free software: you can redistribute it and/or modify it under the terms
2012-01-08 00:57:44 +01: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 23:13:50 +02:00
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
2012-01-08 00:57:44 +01: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 23:31:57 +02:00
* You should have received a copy of the GNU General Public License along with RetroArch.
2012-01-08 00:57:44 +01:00
* If not, see <http://www.gnu.org/licenses/>.
*/
2012-05-06 04:04:33 +02:00
#ifndef RGUI_H__
#define RGUI_H__
2012-01-08 00:57:44 +01:00
#include <stdint.h>
#include <stddef.h>
#ifndef __cplusplus
#include <stdbool.h>
#else
extern "C" {
#endif
typedef enum
{
2012-05-06 04:04:33 +02:00
RGUI_FILE_PLAIN,
RGUI_FILE_DIRECTORY,
2012-07-16 17:57:43 -04:00
RGUI_FILE_DEVICE,
// settings options are done here too
RGUI_SETTINGS_VIDEO_FILTER,
RGUI_SETTINGS_AUDIO_MUTE,
RGUI_SETTINGS_AUDIO_CONTROL_RATE
2012-05-06 04:04:33 +02:00
} rgui_file_type_t;
2012-01-08 00:57:44 +01:00
typedef enum
{
2012-05-06 04:04:33 +02:00
RGUI_ACTION_UP,
RGUI_ACTION_DOWN,
RGUI_ACTION_LEFT,
RGUI_ACTION_RIGHT,
RGUI_ACTION_OK,
RGUI_ACTION_CANCEL,
RGUI_ACTION_REFRESH,
2012-07-16 17:57:43 -04:00
RGUI_ACTION_SETTINGS,
RGUI_ACTION_START,
2012-05-06 04:04:33 +02:00
RGUI_ACTION_NOOP
} rgui_action_t;
2012-01-08 00:57:44 +01:00
2012-05-06 04:04:33 +02:00
typedef struct rgui_handle rgui_handle_t;
2012-01-08 00:57:44 +01:00
2012-07-16 17:57:43 -04:00
typedef enum
{
RGUI_FILEBROWSER = 0,
RGUI_SETTINGS
} rgui_mode_t;
typedef void (*rgui_file_enum_cb_t)(void *ctx,
const char *path, rgui_file_type_t file_type, size_t directory_ptr);
2012-05-06 04:04:33 +02:00
typedef bool (*rgui_folder_enum_cb_t)(const char *directory,
rgui_file_enum_cb_t file_cb, void *userdata, void *ctx);
2012-01-08 00:57:44 +01:00
2012-05-06 04:04:33 +02:00
#define RGUI_WIDTH 320
#define RGUI_HEIGHT 240
2012-01-08 00:57:44 +01:00
2012-05-06 04:04:33 +02:00
rgui_handle_t *rgui_init(const char *base_path,
2012-01-08 00:57:44 +01:00
uint16_t *framebuf, size_t framebuf_pitch,
const uint8_t *font_buf,
2012-05-06 04:04:33 +02:00
rgui_folder_enum_cb_t folder_cb, void *userdata);
2012-01-08 00:57:44 +01:00
2012-05-06 04:04:33 +02:00
const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action);
2012-01-08 00:57:44 +01:00
2012-05-06 04:04:33 +02:00
void rgui_free(rgui_handle_t *rgui);
2012-01-08 00:57:44 +01:00
#ifdef __cplusplus
}
#endif
#endif