VitaShell/settings.h

84 lines
1.8 KiB
C
Raw Normal View History

2016-10-31 18:35:25 +00:00
/*
VitaShell
2017-01-12 16:45:52 +00:00
Copyright (C) 2015-2017, TheFloW
2016-10-31 18:35:25 +00:00
This program 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 Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SETTINGS_H__
#define __SETTINGS_H__
2017-03-13 20:45:04 +00:00
#define MAX_THEMES 64
#define MAX_THEME_LENGTH 64
2016-11-01 15:34:15 +00:00
enum SettingsAgreement {
SETTINGS_AGREEMENT_NONE,
SETTINGS_AGREEMENT_AGREE,
SETTINGS_AGREEMENT_DISAGREE,
};
2016-10-31 18:35:25 +00:00
enum SettingsOptionType {
SETTINGS_OPTION_TYPE_BOOLEAN,
SETTINGS_OPTION_TYPE_INTEGER,
SETTINGS_OPTION_TYPE_STRING,
2016-11-01 15:49:27 +00:00
SETTINGS_OPTION_TYPE_CALLBACK,
2017-01-12 16:45:52 +00:00
SETTINGS_OPTION_TYPE_OPTIONS,
2016-10-31 18:35:25 +00:00
};
enum SettingsMenuStatus {
2016-10-31 18:38:16 +00:00
SETTINGS_MENU_CLOSED,
SETTINGS_MENU_CLOSING,
SETTINGS_MENU_OPENED,
SETTINGS_MENU_OPENING,
2016-10-31 18:35:25 +00:00
};
2016-10-31 19:31:44 +00:00
typedef struct {
int status;
float cur_pos;
int entry_sel;
int option_sel;
int n_options;
} SettingsMenu;
typedef struct {
int name;
int type;
2016-11-01 17:25:42 +00:00
int (* callback)();
2016-10-31 19:31:44 +00:00
char *string;
int size_string;
2017-01-12 16:45:52 +00:00
char **options;
int n_options;
2016-10-31 19:31:44 +00:00
int *value;
} SettingsMenuOption;
typedef struct {
int name;
SettingsMenuOption *options;
int n_options;
} SettingsMenuEntry;
2016-11-02 18:54:40 +00:00
void loadSettingsConfig();
void saveSettingsConfig();
2016-10-31 18:35:25 +00:00
void initSettingsMenu();
void openSettingsMenu();
2016-11-01 17:25:42 +00:00
void closeSettingsMenu();
2016-10-31 18:35:25 +00:00
int getSettingsMenuStatus();
void drawSettingsMenu();
void settingsMenuCtrl();
2016-11-01 15:34:15 +00:00
void settingsAgree();
void settingsDisagree();
2016-10-31 18:35:25 +00:00
#endif