2014-10-07 14:48:24 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2013-2014 - Jason Fetters
|
2015-01-07 16:46:50 +00:00
|
|
|
* Copyright (C) 2011-2015 - Daniel De Matteis
|
2014-10-07 14:48:24 +00:00
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SETTINGS_LIST_H
|
|
|
|
#define _SETTINGS_LIST_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
2014-10-21 03:05:52 +00:00
|
|
|
#include <boolean.h>
|
2014-10-07 14:48:24 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
enum setting_type
|
|
|
|
{
|
|
|
|
ST_NONE = 0,
|
2014-10-22 22:10:58 +00:00
|
|
|
ST_ACTION,
|
2014-10-07 14:48:24 +00:00
|
|
|
ST_BOOL,
|
|
|
|
ST_INT,
|
|
|
|
ST_UINT,
|
|
|
|
ST_FLOAT,
|
|
|
|
ST_PATH,
|
|
|
|
ST_DIR,
|
|
|
|
ST_STRING,
|
|
|
|
ST_HEX,
|
|
|
|
ST_BIND,
|
|
|
|
ST_GROUP,
|
|
|
|
ST_SUB_GROUP,
|
|
|
|
ST_END_GROUP,
|
|
|
|
ST_END_SUB_GROUP
|
|
|
|
};
|
|
|
|
|
|
|
|
enum setting_flags
|
|
|
|
{
|
|
|
|
SD_FLAG_PATH_DIR = (1 << 0),
|
|
|
|
SD_FLAG_PATH_FILE = (1 << 1),
|
|
|
|
SD_FLAG_ALLOW_EMPTY = (1 << 2),
|
|
|
|
SD_FLAG_VALUE_DESC = (1 << 3),
|
|
|
|
SD_FLAG_HAS_RANGE = (1 << 4),
|
|
|
|
SD_FLAG_ALLOW_INPUT = (1 << 5),
|
2014-10-28 06:07:07 +00:00
|
|
|
SD_FLAG_IS_DRIVER = (1 << 6),
|
|
|
|
SD_FLAG_EXIT = (1 << 7),
|
|
|
|
SD_FLAG_CMD_APPLY_AUTO = (1 << 8),
|
2014-10-28 17:19:40 +00:00
|
|
|
SD_FLAG_IS_DEFERRED = (1 << 9),
|
2015-01-07 00:38:06 +00:00
|
|
|
SD_FLAG_BROWSER_ACTION = (1 << 10),
|
2014-10-07 14:48:24 +00:00
|
|
|
};
|
|
|
|
|
2014-10-08 00:13:07 +00:00
|
|
|
enum setting_list_flags
|
|
|
|
{
|
2015-01-22 03:05:10 +00:00
|
|
|
SL_FLAG_MAIN_MENU = (1 << 0),
|
|
|
|
SL_FLAG_DRIVER_OPTIONS = (1 << 1),
|
|
|
|
SL_FLAG_GENERAL_OPTIONS = (1 << 2),
|
|
|
|
SL_FLAG_VIDEO_OPTIONS = (1 << 3),
|
|
|
|
SL_FLAG_SHADER_OPTIONS = (1 << 4),
|
|
|
|
SL_FLAG_FONT_OPTIONS = (1 << 5),
|
|
|
|
SL_FLAG_AUDIO_OPTIONS = (1 << 6),
|
|
|
|
SL_FLAG_INPUT_OPTIONS = (1 << 7),
|
|
|
|
SL_FLAG_OVERLAY_OPTIONS = (1 << 8),
|
|
|
|
SL_FLAG_MENU_OPTIONS = (1 << 9),
|
|
|
|
SL_FLAG_UI_OPTIONS = (1 << 10),
|
|
|
|
SL_FLAG_CORE_MANAGER_OPTIONS = (1 << 11),
|
|
|
|
SL_FLAG_NETPLAY_OPTIONS = (1 << 12),
|
|
|
|
SL_FLAG_USER_OPTIONS = (1 << 13),
|
|
|
|
SL_FLAG_PATH_OPTIONS = (1 << 14),
|
|
|
|
SL_FLAG_PRIVACY_OPTIONS = (1 << 15),
|
|
|
|
SL_FLAG_PLAYLIST_OPTIONS = (1 << 16),
|
|
|
|
SL_FLAG_ARCHIVE_OPTIONS = (1 << 17),
|
|
|
|
SL_FLAG_PATCH_OPTIONS = (1 << 18),
|
|
|
|
SL_FLAG_ALL = (1 << 19),
|
2014-10-08 00:13:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define SL_FLAG_ALL_SETTINGS (SL_FLAG_ALL - SL_FLAG_MAIN_MENU)
|
|
|
|
|
2014-10-22 23:53:24 +00:00
|
|
|
typedef void (*change_handler_t )(void *data);
|
|
|
|
typedef int (*action_toggle_handler_t )(void *data, unsigned action);
|
2015-01-22 22:52:02 +00:00
|
|
|
typedef int (*action_up_or_down_handler_t )(void *data, unsigned action);
|
2014-10-22 23:53:24 +00:00
|
|
|
typedef int (*action_start_handler_t )(void *data);
|
2015-01-09 02:49:14 +00:00
|
|
|
typedef int (*action_cancel_handler_t )(void *data, unsigned action);
|
2014-10-22 23:53:24 +00:00
|
|
|
typedef int (*action_ok_handler_t )(void *data, unsigned action);
|
|
|
|
typedef void (*get_string_representation_t )(void *data, char *buf, size_t sizeof_buf);
|
2014-10-07 14:48:24 +00:00
|
|
|
|
|
|
|
typedef struct rarch_setting_info
|
|
|
|
{
|
|
|
|
int index;
|
|
|
|
int size;
|
|
|
|
} rarch_setting_info_t;
|
|
|
|
|
|
|
|
typedef struct rarch_setting_group_info
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
} rarch_setting_group_info_t;
|
|
|
|
|
|
|
|
typedef struct rarch_setting
|
|
|
|
{
|
|
|
|
enum setting_type type;
|
|
|
|
|
|
|
|
const char *name;
|
|
|
|
uint32_t size;
|
|
|
|
|
|
|
|
const char* short_description;
|
|
|
|
const char* group;
|
|
|
|
const char* subgroup;
|
|
|
|
|
|
|
|
uint32_t index;
|
2014-10-17 06:14:17 +00:00
|
|
|
uint32_t index_offset;
|
2014-10-07 14:48:24 +00:00
|
|
|
|
|
|
|
double min;
|
|
|
|
double max;
|
|
|
|
|
|
|
|
const char* values;
|
|
|
|
uint64_t flags;
|
|
|
|
|
|
|
|
change_handler_t change_handler;
|
2014-10-09 10:09:36 +00:00
|
|
|
change_handler_t deferred_handler;
|
2014-10-07 14:48:24 +00:00
|
|
|
change_handler_t read_handler;
|
2014-10-16 00:53:35 +00:00
|
|
|
action_start_handler_t action_start;
|
2014-10-15 04:46:00 +00:00
|
|
|
action_toggle_handler_t action_toggle;
|
2015-01-22 22:52:02 +00:00
|
|
|
action_up_or_down_handler_t action_up_or_down;
|
2015-01-09 02:49:14 +00:00
|
|
|
action_cancel_handler_t action_cancel;
|
2014-10-14 20:02:27 +00:00
|
|
|
action_ok_handler_t action_ok;
|
2014-10-22 23:53:24 +00:00
|
|
|
get_string_representation_t get_string_representation;
|
2014-10-14 20:02:27 +00:00
|
|
|
|
2014-10-07 14:48:24 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
bool boolean;
|
|
|
|
int integer;
|
|
|
|
unsigned int unsigned_integer;
|
|
|
|
float fraction;
|
|
|
|
const char* string;
|
|
|
|
const struct retro_keybind* keybind;
|
|
|
|
} default_value;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
bool* boolean;
|
|
|
|
int* integer;
|
|
|
|
unsigned int* unsigned_integer;
|
|
|
|
float* fraction;
|
|
|
|
char* string;
|
|
|
|
struct retro_keybind* keybind;
|
|
|
|
} value;
|
|
|
|
|
2014-10-09 10:09:36 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
bool boolean;
|
|
|
|
int integer;
|
|
|
|
unsigned int unsigned_integer;
|
|
|
|
float fraction;
|
|
|
|
} original_value;
|
|
|
|
|
2014-10-07 14:48:24 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
const char *empty_path;
|
|
|
|
} dir;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned idx;
|
|
|
|
bool triggered;
|
|
|
|
} cmd_trigger;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
const char *off_label;
|
|
|
|
const char *on_label;
|
|
|
|
} boolean;
|
|
|
|
|
2014-10-17 05:11:51 +00:00
|
|
|
unsigned bind_type;
|
2015-01-10 04:25:37 +00:00
|
|
|
unsigned browser_selection_type;
|
2014-10-07 14:48:24 +00:00
|
|
|
float step;
|
|
|
|
const char *rounding_fraction;
|
|
|
|
bool enforce_minrange;
|
|
|
|
bool enforce_maxrange;
|
|
|
|
} rarch_setting_t;
|
|
|
|
|
|
|
|
|
|
|
|
bool settings_list_append(rarch_setting_t **list,
|
|
|
|
rarch_setting_info_t *list_info, rarch_setting_t value);
|
|
|
|
|
|
|
|
void settings_list_current_add_flags(
|
|
|
|
rarch_setting_t **list,
|
|
|
|
rarch_setting_info_t *list_info,
|
|
|
|
unsigned values);
|
|
|
|
|
2014-10-17 05:11:51 +00:00
|
|
|
void settings_list_current_add_bind_type(
|
|
|
|
rarch_setting_t **list,
|
|
|
|
rarch_setting_info_t *list_info,
|
|
|
|
unsigned type);
|
|
|
|
|
2014-10-07 14:48:24 +00:00
|
|
|
void settings_list_current_add_range(
|
|
|
|
rarch_setting_t **list,
|
|
|
|
rarch_setting_info_t *list_info,
|
|
|
|
float min, float max, float step,
|
|
|
|
bool enforce_minrange_enable, bool enforce_maxrange_enable);
|
|
|
|
|
|
|
|
void settings_list_current_add_values(
|
|
|
|
rarch_setting_t **list,
|
|
|
|
rarch_setting_info_t *list_info,
|
|
|
|
const char *values);
|
|
|
|
|
|
|
|
void settings_list_current_add_cmd(
|
|
|
|
rarch_setting_t **list,
|
|
|
|
rarch_setting_info_t *list_info,
|
|
|
|
unsigned values);
|
|
|
|
|
|
|
|
void settings_info_list_free(rarch_setting_info_t *list_info);
|
|
|
|
|
|
|
|
void settings_list_free(rarch_setting_t *list);
|
|
|
|
|
|
|
|
rarch_setting_info_t *settings_info_list_new(void);
|
|
|
|
|
|
|
|
rarch_setting_t *settings_list_new(unsigned size);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|