2013-07-11 22:59:17 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2013-2014 - Jason Fetters
|
2013-07-11 22:59:17 +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/>.
|
|
|
|
*/
|
|
|
|
|
2014-05-03 16:38:29 +00:00
|
|
|
#ifndef __RARCH_SETTINGS_DATA_H__
|
|
|
|
#define __RARCH_SETTINGS_DATA_H__
|
2013-07-11 22:59:17 +00:00
|
|
|
|
2014-08-08 05:58:07 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include "conf/config_file.h"
|
2014-10-21 06:39:37 +00:00
|
|
|
#include <retro_miscellaneous.h>
|
2014-10-07 14:48:24 +00:00
|
|
|
#include "settings_list.h"
|
2013-07-11 22:59:17 +00:00
|
|
|
|
2014-08-17 18:42:35 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-08-26 23:30:18 +00:00
|
|
|
#define BINDFOR(s) (*(&(s))->value.keybind)
|
2014-07-08 16:56:12 +00:00
|
|
|
|
2014-09-14 21:44:14 +00:00
|
|
|
void setting_data_reset_setting(rarch_setting_t* setting);
|
|
|
|
void setting_data_reset(rarch_setting_t* settings);
|
2013-07-11 22:59:17 +00:00
|
|
|
|
2014-09-14 21:44:14 +00:00
|
|
|
bool setting_data_load_config_path(rarch_setting_t* settings,
|
2014-08-27 19:14:36 +00:00
|
|
|
const char* path);
|
2014-09-14 21:44:14 +00:00
|
|
|
bool setting_data_save_config(rarch_setting_t* settings,
|
2014-08-27 19:14:36 +00:00
|
|
|
config_file_t* config);
|
2013-07-11 22:59:17 +00:00
|
|
|
|
2014-08-27 19:14:36 +00:00
|
|
|
rarch_setting_t* setting_data_find_setting(rarch_setting_t* settings,
|
|
|
|
const char* name);
|
2013-07-11 22:59:17 +00:00
|
|
|
|
2014-08-27 19:14:36 +00:00
|
|
|
void setting_data_set_with_string_representation(
|
2014-09-14 21:44:14 +00:00
|
|
|
rarch_setting_t* setting, const char* value);
|
2014-09-10 01:06:38 +00:00
|
|
|
void setting_data_get_string_representation(rarch_setting_t* setting,
|
2014-08-27 19:14:36 +00:00
|
|
|
char* buf, size_t sizeof_buf);
|
2013-07-11 22:59:17 +00:00
|
|
|
|
2014-09-09 17:45:15 +00:00
|
|
|
/* List building helper functions. */
|
2014-08-27 19:14:36 +00:00
|
|
|
rarch_setting_t setting_data_group_setting(enum setting_type type,
|
|
|
|
const char* name);
|
|
|
|
|
2014-09-09 17:45:15 +00:00
|
|
|
rarch_setting_t setting_data_subgroup_setting(enum setting_type type,
|
|
|
|
const char* name, const char *parent_name);
|
|
|
|
|
2014-08-27 19:14:36 +00:00
|
|
|
rarch_setting_t setting_data_bool_setting(const char* name,
|
|
|
|
const char* description, bool* target, bool default_value,
|
|
|
|
const char *off, const char *on, const char * group,
|
|
|
|
const char *subgroup, change_handler_t change_handler,
|
|
|
|
change_handler_t read_handler);
|
|
|
|
|
|
|
|
rarch_setting_t setting_data_int_setting(const char* name,
|
|
|
|
const char* description, int* target, int default_value,
|
|
|
|
const char *group, const char *subgroup,
|
|
|
|
change_handler_t change_handler, change_handler_t read_handler);
|
|
|
|
|
|
|
|
rarch_setting_t setting_data_uint_setting(const char* name,
|
|
|
|
const char* description, unsigned int* target,
|
|
|
|
unsigned int default_value, const char *group,
|
|
|
|
const char *subgroup, change_handler_t change_handler,
|
|
|
|
change_handler_t read_handler);
|
|
|
|
|
|
|
|
rarch_setting_t setting_data_float_setting(const char* name,
|
|
|
|
const char* description, float* target, float default_value,
|
|
|
|
const char *rounding, const char *group, const char *subgroup,
|
|
|
|
change_handler_t change_handler, change_handler_t read_handler);
|
|
|
|
|
|
|
|
rarch_setting_t setting_data_string_setting(enum setting_type type,
|
|
|
|
const char* name, const char* description, char* target,
|
|
|
|
unsigned size, const char* default_value, const char *empty,
|
|
|
|
const char *group, const char *subgroup,
|
|
|
|
change_handler_t change_handler, change_handler_t read_handler);
|
|
|
|
|
|
|
|
rarch_setting_t setting_data_bind_setting(const char* name,
|
2014-10-20 17:22:33 +00:00
|
|
|
const char* description, struct retro_keybind* target, uint32_t idx,
|
|
|
|
uint32_t idx_offset,
|
2014-08-27 19:14:36 +00:00
|
|
|
const struct retro_keybind* default_value, const char *group,
|
|
|
|
const char *subgroup);
|
|
|
|
|
2014-09-05 02:21:46 +00:00
|
|
|
int setting_data_get_description(const char *label, char *msg,
|
2014-08-27 19:14:36 +00:00
|
|
|
size_t msg_sizeof);
|
|
|
|
|
2014-09-28 16:01:59 +00:00
|
|
|
#ifdef HAVE_MENU
|
2014-09-07 04:00:41 +00:00
|
|
|
void setting_data_get_label(char *type_str,
|
|
|
|
size_t type_str_size, unsigned *w, unsigned type,
|
2014-10-20 17:22:33 +00:00
|
|
|
const char *menu_label, const char *label, unsigned idx);
|
2014-08-27 21:17:32 +00:00
|
|
|
#endif
|
2014-10-11 02:59:03 +00:00
|
|
|
|
|
|
|
rarch_setting_t* setting_data_new(unsigned mask);
|
2013-08-27 02:12:22 +00:00
|
|
|
|
2014-08-17 18:42:35 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-22 14:30:02 +00:00
|
|
|
#endif
|