2015-06-16 00:15:32 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2017-01-22 12:40:32 +00:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2017-12-12 07:55:31 +00:00
|
|
|
*
|
2015-06-16 00:15:32 +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 __MENU_ENTRIES_H__
|
|
|
|
#define __MENU_ENTRIES_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2015-08-21 19:19:29 +00:00
|
|
|
#include <boolean.h>
|
2016-06-03 03:49:46 +00:00
|
|
|
#include <retro_common_api.h>
|
2015-08-21 19:19:29 +00:00
|
|
|
|
2018-02-24 23:39:20 +00:00
|
|
|
#include <lists/file_list.h>
|
2016-09-15 14:36:36 +00:00
|
|
|
|
2015-06-16 00:15:32 +00:00
|
|
|
#include "menu_setting.h"
|
2015-11-08 15:19:54 +00:00
|
|
|
#include "menu_displaylist.h"
|
2015-06-16 00:15:32 +00:00
|
|
|
|
2016-06-03 03:49:46 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
2015-06-16 00:15:32 +00:00
|
|
|
|
2016-02-25 18:27:06 +00:00
|
|
|
enum menu_entries_ctl_state
|
|
|
|
{
|
|
|
|
MENU_ENTRIES_CTL_NONE = 0,
|
|
|
|
MENU_ENTRIES_CTL_DEINIT,
|
|
|
|
MENU_ENTRIES_CTL_INIT,
|
|
|
|
MENU_ENTRIES_CTL_LIST_GET,
|
|
|
|
MENU_ENTRIES_CTL_LIST_DEINIT,
|
|
|
|
MENU_ENTRIES_CTL_LIST_INIT,
|
|
|
|
MENU_ENTRIES_CTL_SETTINGS_GET,
|
|
|
|
MENU_ENTRIES_CTL_SETTINGS_DEINIT,
|
|
|
|
MENU_ENTRIES_CTL_SETTINGS_INIT,
|
|
|
|
MENU_ENTRIES_CTL_SET_REFRESH,
|
|
|
|
MENU_ENTRIES_CTL_UNSET_REFRESH,
|
|
|
|
MENU_ENTRIES_CTL_NEEDS_REFRESH,
|
|
|
|
/* Sets the starting index of the menu entry list. */
|
|
|
|
MENU_ENTRIES_CTL_SET_START,
|
|
|
|
/* Returns the starting index of the menu entry list. */
|
|
|
|
MENU_ENTRIES_CTL_START_GET,
|
|
|
|
MENU_ENTRIES_CTL_REFRESH,
|
|
|
|
MENU_ENTRIES_CTL_CLEAR,
|
|
|
|
MENU_ENTRIES_CTL_SHOW_BACK
|
|
|
|
};
|
2015-10-17 17:38:33 +00:00
|
|
|
|
2018-02-24 23:39:20 +00:00
|
|
|
enum menu_list_type
|
|
|
|
{
|
|
|
|
MENU_LIST_PLAIN = 0,
|
|
|
|
MENU_LIST_HORIZONTAL,
|
|
|
|
MENU_LIST_TABS
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct menu_list menu_list_t;
|
|
|
|
|
|
|
|
typedef struct menu_ctx_list
|
|
|
|
{
|
|
|
|
enum menu_list_type type;
|
|
|
|
const char *path;
|
|
|
|
char *fullpath;
|
|
|
|
const char *label;
|
|
|
|
unsigned entry_type;
|
|
|
|
unsigned action;
|
|
|
|
size_t idx;
|
|
|
|
size_t selection;
|
|
|
|
size_t size;
|
|
|
|
size_t list_size;
|
|
|
|
void *entry;
|
|
|
|
file_list_t *list;
|
|
|
|
} menu_ctx_list_t;
|
|
|
|
|
2015-10-17 16:57:47 +00:00
|
|
|
typedef struct menu_file_list_cbs
|
|
|
|
{
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums enum_idx;
|
2015-10-17 16:57:47 +00:00
|
|
|
const char *action_iterate_ident;
|
|
|
|
const char *action_deferred_push_ident;
|
2017-09-08 23:10:00 +00:00
|
|
|
const char *action_select_ident;
|
|
|
|
const char *action_get_title_ident;
|
|
|
|
const char *action_ok_ident;
|
|
|
|
const char *action_cancel_ident;
|
|
|
|
const char *action_scan_ident;
|
|
|
|
const char *action_right_ident;
|
|
|
|
const char *action_start_ident;
|
|
|
|
const char *action_info_ident;
|
|
|
|
const char *action_content_list_switch_ident;
|
|
|
|
const char *action_left_ident;
|
|
|
|
const char *action_refresh_ident;
|
|
|
|
const char *action_up_ident;
|
|
|
|
const char *action_label_ident;
|
|
|
|
const char *action_sublabel_ident;
|
|
|
|
const char *action_down_ident;
|
|
|
|
const char *action_get_value_ident;
|
|
|
|
|
|
|
|
rarch_setting_t *setting;
|
2015-10-17 16:57:47 +00:00
|
|
|
|
2017-09-08 23:10:00 +00:00
|
|
|
int (*action_iterate)(const char *label, unsigned action);
|
2018-04-11 04:11:54 +00:00
|
|
|
int (*action_deferred_push)(menu_displaylist_info_t *info);
|
2018-04-11 04:11:23 +00:00
|
|
|
int (*action_select)(const char *path, const char *label, unsigned type,
|
2015-10-17 16:57:47 +00:00
|
|
|
size_t idx);
|
|
|
|
int (*action_get_title)(const char *path, const char *label,
|
|
|
|
unsigned type, char *s, size_t len);
|
2018-04-11 04:12:26 +00:00
|
|
|
int (*action_ok)(const char *path, const char *label, unsigned type,
|
2015-10-17 16:57:47 +00:00
|
|
|
size_t idx, size_t entry_idx);
|
|
|
|
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
|
|
|
size_t idx);
|
|
|
|
int (*action_scan)(const char *path, const char *label, unsigned type,
|
|
|
|
size_t idx);
|
2018-04-11 04:11:23 +00:00
|
|
|
int (*action_start)(unsigned type, const char *label);
|
|
|
|
int (*action_info)(unsigned type, const char *label);
|
2018-04-11 04:11:38 +00:00
|
|
|
int (*action_content_list_switch)(void *data, void *userdata, const char
|
2015-10-17 16:57:47 +00:00
|
|
|
*path, const char *label, unsigned type);
|
2018-04-11 04:11:38 +00:00
|
|
|
int (*action_left)(unsigned type, const char *label, bool wraparound);
|
|
|
|
int (*action_right)(unsigned type, const char *label, bool wraparound);
|
|
|
|
int (*action_refresh)(file_list_t *list, file_list_t *menu_list);
|
2015-10-17 16:57:47 +00:00
|
|
|
int (*action_up)(unsigned type, const char *label);
|
2016-07-09 11:49:31 +00:00
|
|
|
int (*action_label)(file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len);
|
2016-10-20 13:57:35 +00:00
|
|
|
int (*action_sublabel)(file_list_t *list,
|
|
|
|
unsigned type, unsigned i,
|
|
|
|
const char *label, const char *path,
|
|
|
|
char *s, size_t len);
|
2015-10-17 16:57:47 +00:00
|
|
|
int (*action_down)(unsigned type, const char *label);
|
|
|
|
void (*action_get_value)(file_list_t* list,
|
|
|
|
unsigned *w, unsigned type, unsigned i,
|
|
|
|
const char *label, char *s, size_t len,
|
|
|
|
const char *entry_label,
|
|
|
|
const char *path,
|
|
|
|
char *path_buf, size_t path_buf_size);
|
|
|
|
} menu_file_list_cbs_t;
|
|
|
|
|
2015-06-16 00:15:32 +00:00
|
|
|
int menu_entries_get_title(char *title, size_t title_len);
|
|
|
|
|
2015-08-17 16:14:51 +00:00
|
|
|
int menu_entries_get_core_title(char *title_msg, size_t title_msg_len);
|
2015-06-16 00:15:32 +00:00
|
|
|
|
2017-04-29 18:27:40 +00:00
|
|
|
int menu_entries_get_core_name(char *s, size_t len);
|
|
|
|
|
2015-10-27 09:33:19 +00:00
|
|
|
file_list_t *menu_entries_get_selection_buf_ptr(size_t idx);
|
2015-10-17 15:44:57 +00:00
|
|
|
|
2015-10-27 09:33:19 +00:00
|
|
|
file_list_t *menu_entries_get_menu_stack_ptr(size_t idx);
|
2015-10-17 15:44:57 +00:00
|
|
|
|
2016-07-12 23:13:20 +00:00
|
|
|
void menu_entries_append(file_list_t *list, const char *path, const char *label,
|
2015-10-17 15:10:29 +00:00
|
|
|
unsigned type, size_t directory_ptr, size_t entry_idx);
|
|
|
|
|
2015-10-17 16:31:16 +00:00
|
|
|
void menu_entries_get_last_stack(const char **path, const char **label,
|
2016-06-19 22:31:13 +00:00
|
|
|
unsigned *file_type, enum msg_hash_enums *enum_idx, size_t *entry_idx);
|
2015-10-17 16:31:16 +00:00
|
|
|
|
2015-10-17 16:57:47 +00:00
|
|
|
menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void);
|
|
|
|
|
2016-04-25 17:19:23 +00:00
|
|
|
void menu_entries_pop_stack(size_t *ptr, size_t idx, bool animate);
|
2015-10-17 16:38:14 +00:00
|
|
|
|
2015-10-17 17:10:37 +00:00
|
|
|
void menu_entries_flush_stack(const char *needle, unsigned final_type);
|
|
|
|
|
2015-10-27 09:29:50 +00:00
|
|
|
size_t menu_entries_get_stack_size(size_t idx);
|
2015-10-17 17:14:49 +00:00
|
|
|
|
2015-10-17 17:21:18 +00:00
|
|
|
size_t menu_entries_get_size(void);
|
|
|
|
|
2015-10-18 19:54:20 +00:00
|
|
|
void menu_entries_get_at_offset(const file_list_t *list, size_t idx,
|
2015-10-17 17:38:33 +00:00
|
|
|
const char **path, const char **label, unsigned *file_type,
|
2015-10-18 19:54:20 +00:00
|
|
|
size_t *entry_idx, const char **alt);
|
2015-10-17 17:38:33 +00:00
|
|
|
|
2015-10-18 18:21:12 +00:00
|
|
|
rarch_setting_t *menu_entries_get_setting(uint32_t i);
|
|
|
|
|
2016-04-11 16:18:16 +00:00
|
|
|
void menu_entries_prepend(file_list_t *list, const char *path, const char *label,
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums enum_idx,
|
2016-04-11 16:02:50 +00:00
|
|
|
unsigned type, size_t directory_ptr, size_t entry_idx);
|
|
|
|
|
2016-07-12 23:17:09 +00:00
|
|
|
void menu_entries_append_enum(file_list_t *list, const char *path, const char *label,
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums enum_idx,
|
2016-06-14 23:15:37 +00:00
|
|
|
unsigned type, size_t directory_ptr, size_t entry_idx);
|
|
|
|
|
2015-12-11 20:32:00 +00:00
|
|
|
bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data);
|
|
|
|
|
2016-06-03 03:49:46 +00:00
|
|
|
RETRO_END_DECLS
|
2015-06-16 00:15:32 +00:00
|
|
|
|
|
|
|
#endif
|