135 lines
3.5 KiB
C
Raw Normal View History

2012-04-21 23:13:50 +02:00
/* RetroArch - A frontend for libretro.
2013-01-01 01:37:37 +01:00
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
2013-03-11 07:13:11 +01:00
* Copyright (C) 2011-2013 - Daniel De Matteis
* Copyright (C) 2012-2013 - Michael Lelli
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,
RGUI_SETTINGS,
2012-07-16 17:57:43 -04:00
// settings options are done here too
RGUI_SETTINGS_OPEN_FILEBROWSER,
2013-01-18 15:22:03 +01:00
RGUI_SETTINGS_REWIND_ENABLE,
RGUI_SETTINGS_REWIND_GRANULARITY,
2012-08-12 03:38:23 -04:00
RGUI_SETTINGS_SAVESTATE_SAVE,
RGUI_SETTINGS_SAVESTATE_LOAD,
2013-03-10 17:54:46 -04:00
#ifdef HAVE_SCREENSHOTS
RGUI_SETTINGS_SCREENSHOT,
2013-03-10 17:54:46 -04:00
#endif
RGUI_SETTINGS_RESTART_GAME,
RGUI_SETTINGS_VIDEO_FILTER,
RGUI_SETTINGS_VIDEO_SOFT_FILTER,
#ifdef GEKKO
RGUI_SETTINGS_VIDEO_RESOLUTION,
#endif
RGUI_SETTINGS_VIDEO_GAMMA,
RGUI_SETTINGS_VIDEO_ASPECT_RATIO,
2012-08-20 21:56:07 -04:00
RGUI_SETTINGS_CUSTOM_VIEWPORT,
RGUI_SETTINGS_CUSTOM_VIEWPORT_2,
RGUI_SETTINGS_VIDEO_OVERSCAN,
RGUI_SETTINGS_VIDEO_ROTATION,
RGUI_SETTINGS_AUDIO_MUTE,
2012-07-27 20:39:49 -04:00
RGUI_SETTINGS_AUDIO_CONTROL_RATE,
2013-02-08 18:36:47 +01:00
RGUI_SETTINGS_RESAMPLER_TYPE,
RGUI_SETTINGS_ZIP_EXTRACT,
RGUI_SETTINGS_SRAM_DIR,
RGUI_SETTINGS_STATE_DIR,
2012-07-30 23:00:20 -04:00
RGUI_SETTINGS_CORE,
RGUI_SETTINGS_CONTROLLER_1,
RGUI_SETTINGS_CONTROLLER_2,
RGUI_SETTINGS_CONTROLLER_3,
RGUI_SETTINGS_CONTROLLER_4,
2012-08-27 16:09:53 -04:00
RGUI_SETTINGS_DEBUG_TEXT,
RGUI_SETTINGS_RESTART_EMULATOR,
RGUI_SETTINGS_QUIT_EMULATOR,
RGUI_SETTINGS_BIND_DEVICE,
RGUI_SETTINGS_BIND_DPAD_EMULATION,
RGUI_SETTINGS_BIND_UP,
RGUI_SETTINGS_BIND_DOWN,
RGUI_SETTINGS_BIND_LEFT,
RGUI_SETTINGS_BIND_RIGHT,
RGUI_SETTINGS_BIND_A,
RGUI_SETTINGS_BIND_B,
RGUI_SETTINGS_BIND_X,
RGUI_SETTINGS_BIND_Y,
RGUI_SETTINGS_BIND_START,
RGUI_SETTINGS_BIND_SELECT,
RGUI_SETTINGS_BIND_L,
RGUI_SETTINGS_BIND_R,
RGUI_SETTINGS_BIND_L2,
RGUI_SETTINGS_BIND_R2,
RGUI_SETTINGS_BIND_L3,
RGUI_SETTINGS_BIND_R3,
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,
RGUI_ACTION_MESSAGE,
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
typedef void (*rgui_file_enum_cb_t)(void *ctx,
const char *path, unsigned 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
extern unsigned RGUI_WIDTH;
extern unsigned RGUI_HEIGHT;
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-08-24 21:29:05 -04:00
uint16_t *framebuf, size_t framebuf_pitch,
2013-03-11 04:57:17 +01:00
const uint8_t *font_bmp_buf, const uint8_t *font_bin_buf);
2012-01-08 00:57:44 +01:00
2013-01-11 04:36:40 +01:00
int 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
void menu_init(void);
bool menu_iterate(void);
void menu_free(void);
2012-01-08 00:57:44 +01:00
#ifdef __cplusplus
}
#endif
#endif