RetroArch/managers/core_option_manager.h

115 lines
3.0 KiB
C
Raw Normal View History

2013-04-04 13:58:30 +02:00
/* RetroArch - A frontend for libretro.
2014-01-01 01:50:59 +01:00
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
2017-01-22 13:40:32 +01:00
* Copyright (C) 2011-2017 - Daniel De Matteis
*
2013-04-04 13:58:30 +02: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/>.
*/
2016-05-10 01:25:47 +02:00
#ifndef CORE_OPTION_MANAGER_H__
#define CORE_OPTION_MANAGER_H__
2013-04-04 13:58:30 +02:00
#include <stddef.h>
2016-02-04 20:56:22 +01:00
#include <boolean.h>
2016-06-03 05:49:46 +02:00
#include <retro_common_api.h>
#include <lists/string_list.h>
2013-04-04 13:58:30 +02:00
#include "../../retroarch.h"
2019-02-04 08:20:34 -08:00
2016-06-03 05:49:46 +02:00
RETRO_BEGIN_DECLS
2013-04-21 10:05:12 +02:00
struct core_option
{
char *desc;
char *info;
char *key;
struct string_list *vals;
struct string_list *val_labels;
size_t index;
};
struct core_option_manager
{
config_file_t *conf;
char conf_path[PATH_MAX_LENGTH];
struct core_option *opts;
size_t size;
bool updated;
};
2013-04-04 13:58:30 +02:00
typedef struct core_option_manager core_option_manager_t;
/**
* core_option_manager_set_default:
* @opt : pointer to core option manager object.
* @idx : index of core option to be reset to defaults.
2015-01-09 22:01:19 +01:00
*
* Reset core option specified by @idx and sets default value for option.
2015-01-09 22:01:19 +01:00
**/
void core_option_manager_set_default(core_option_manager_t *opt, size_t idx);
2013-04-04 13:58:30 +02:00
2015-01-09 22:01:19 +01:00
/**
2016-05-10 01:21:55 +02:00
* core_option_manager_get_desc:
2015-01-09 22:01:19 +01:00
* @opt : options manager handle
2015-01-15 22:05:07 +01:00
* @idx : idx identifier of the option
2015-01-09 22:01:19 +01:00
*
* Gets description for an option.
*
* Returns: Description for an option.
**/
const char *core_option_manager_get_desc(core_option_manager_t *opt,
2016-02-04 20:58:53 +01:00
size_t idx);
2014-09-07 05:47:18 +02:00
/**
* core_option_manager_get_info:
* @opt : options manager handle
* @idx : idx identifier of the option
*
* Gets information text for an option.
*
* Returns: Information text for an option.
**/
const char *core_option_manager_get_info(core_option_manager_t *opt,
size_t idx);
2015-01-09 22:01:19 +01:00
/**
2016-05-10 01:21:55 +02:00
* core_option_manager_get_val:
2015-01-09 22:01:19 +01:00
* @opt : options manager handle
2015-01-15 22:05:07 +01:00
* @idx : idx identifier of the option
2015-01-09 22:01:19 +01:00
*
* Gets value for an option.
*
* Returns: Value for an option.
**/
const char *core_option_manager_get_val(core_option_manager_t *opt,
2016-02-04 20:58:53 +01:00
size_t idx);
2013-04-04 13:58:30 +02:00
/**
* core_option_manager_get_val_label:
* @opt : options manager handle
* @idx : idx identifier of the option
*
* Gets value label for an option.
*
* Returns: Value label for an option.
**/
const char *core_option_manager_get_val_label(core_option_manager_t *opt,
size_t idx);
2016-05-10 01:21:55 +02:00
void core_option_manager_set_val(core_option_manager_t *opt,
2015-01-15 22:05:07 +01:00
size_t idx, size_t val_idx);
2016-06-03 05:49:46 +02:00
RETRO_END_DECLS
2013-04-21 10:05:12 +02:00
2013-04-04 13:58:30 +02:00
#endif