2015-06-16 00:15:32 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2015 - Daniel De Matteis
|
|
|
|
*
|
|
|
|
* 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>
|
|
|
|
|
2015-06-16 00:15:32 +00:00
|
|
|
#include "menu_setting.h"
|
2015-07-13 22:38:16 +00:00
|
|
|
#include "menu_entry.h"
|
2015-06-16 00:15:32 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-10-17 17:38:33 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
MENU_LIST_PLAIN = 0,
|
|
|
|
MENU_LIST_HORIZONTAL
|
|
|
|
} menu_list_type_t;
|
|
|
|
|
2015-10-17 16:57:47 +00:00
|
|
|
typedef struct menu_file_list_cbs
|
|
|
|
{
|
|
|
|
rarch_setting_t *setting;
|
|
|
|
|
|
|
|
int (*action_iterate)(const char *label, unsigned action);
|
|
|
|
const char *action_iterate_ident;
|
|
|
|
|
|
|
|
int (*action_deferred_push)(menu_displaylist_info_t *info);
|
|
|
|
const char *action_deferred_push_ident;
|
|
|
|
|
|
|
|
int (*action_select)(const char *path, const char *label, unsigned type,
|
|
|
|
size_t idx);
|
|
|
|
const char *action_select_ident;
|
|
|
|
|
|
|
|
int (*action_get_title)(const char *path, const char *label,
|
|
|
|
unsigned type, char *s, size_t len);
|
|
|
|
const char *action_get_title_ident;
|
|
|
|
|
|
|
|
int (*action_ok)(const char *path, const char *label, unsigned type,
|
|
|
|
size_t idx, size_t entry_idx);
|
|
|
|
const char *action_ok_ident;
|
|
|
|
|
|
|
|
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
|
|
|
size_t idx);
|
|
|
|
const char *action_cancel_ident;
|
|
|
|
|
|
|
|
int (*action_scan)(const char *path, const char *label, unsigned type,
|
|
|
|
size_t idx);
|
|
|
|
const char *action_scan_ident;
|
|
|
|
|
|
|
|
int (*action_start)(unsigned type, const char *label);
|
|
|
|
const char *action_start_ident;
|
|
|
|
|
|
|
|
int (*action_info)(unsigned type, const char *label);
|
|
|
|
const char *action_info_ident;
|
|
|
|
|
|
|
|
int (*action_content_list_switch)(void *data, void *userdata, const char
|
|
|
|
*path, const char *label, unsigned type);
|
|
|
|
const char *action_content_list_switch_ident;
|
|
|
|
|
|
|
|
int (*action_left)(unsigned type, const char *label, bool wraparound);
|
|
|
|
const char *action_left_ident;
|
|
|
|
|
|
|
|
int (*action_right)(unsigned type, const char *label, bool wraparound);
|
|
|
|
const char *action_right_ident;
|
|
|
|
|
|
|
|
int (*action_refresh)(file_list_t *list, file_list_t *menu_list);
|
|
|
|
const char *action_refresh_ident;
|
|
|
|
|
|
|
|
int (*action_up)(unsigned type, const char *label);
|
|
|
|
const char *action_up_ident;
|
|
|
|
|
|
|
|
int (*action_down)(unsigned type, const char *label);
|
|
|
|
const char *action_down_ident;
|
|
|
|
|
|
|
|
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);
|
|
|
|
const char *action_get_value_ident;
|
|
|
|
|
|
|
|
} menu_file_list_cbs_t;
|
|
|
|
|
2015-10-17 17:38:33 +00:00
|
|
|
typedef struct menu_list menu_list_t;
|
|
|
|
|
2015-09-06 03:04:16 +00:00
|
|
|
typedef struct menu_entries menu_entries_t;
|
2015-06-16 00:15:32 +00:00
|
|
|
|
|
|
|
void menu_entries_set_start(size_t i);
|
|
|
|
|
|
|
|
size_t menu_entries_get_start(void);
|
|
|
|
|
|
|
|
size_t menu_entries_get_end(void);
|
|
|
|
|
2015-07-13 22:38:16 +00:00
|
|
|
void menu_entries_get(size_t i, menu_entry_t *entry);
|
|
|
|
|
2015-06-16 00:15:32 +00:00
|
|
|
int menu_entries_get_title(char *title, size_t title_len);
|
|
|
|
|
|
|
|
bool menu_entries_show_back(void);
|
|
|
|
|
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
|
|
|
|
2015-08-21 19:19:29 +00:00
|
|
|
rarch_setting_t *menu_setting_get_ptr(void);
|
|
|
|
|
2015-06-16 01:03:20 +00:00
|
|
|
bool menu_entries_needs_refresh(void);
|
|
|
|
|
2015-08-21 16:44:14 +00:00
|
|
|
void menu_entries_set_refresh(bool nonblocking);
|
2015-06-16 01:03:20 +00:00
|
|
|
|
2015-08-21 16:44:14 +00:00
|
|
|
void menu_entries_unset_refresh(bool nonblocking);
|
2015-06-16 01:07:44 +00:00
|
|
|
|
2015-10-17 15:44:57 +00:00
|
|
|
file_list_t *menu_entries_get_selection_buf_ptr(void);
|
|
|
|
|
|
|
|
file_list_t *menu_entries_get_menu_stack_ptr(void);
|
|
|
|
|
2015-10-17 15:10:29 +00:00
|
|
|
void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
|
|
|
unsigned type, size_t directory_ptr, size_t entry_idx);
|
|
|
|
|
2015-08-21 19:19:29 +00:00
|
|
|
bool menu_entries_init(void *data);
|
|
|
|
|
|
|
|
void menu_entries_free(void);
|
|
|
|
|
2015-09-06 03:04:16 +00:00
|
|
|
void menu_entries_free_list(menu_entries_t *entries);
|
2015-09-06 00:56:57 +00:00
|
|
|
|
2015-09-06 03:04:16 +00:00
|
|
|
void menu_entries_new_list(menu_entries_t *entries, unsigned flags);
|
2015-09-06 00:56:57 +00:00
|
|
|
|
2015-10-17 16:31:16 +00:00
|
|
|
void menu_entries_get_last_stack(const char **path, const char **label,
|
|
|
|
unsigned *file_type, size_t *entry_idx);
|
|
|
|
|
2015-10-17 16:57:47 +00:00
|
|
|
menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void);
|
|
|
|
|
2015-10-17 16:38:14 +00:00
|
|
|
void menu_entries_pop_stack(size_t *ptr);
|
|
|
|
|
2015-10-17 17:10:37 +00:00
|
|
|
void menu_entries_flush_stack(const char *needle, unsigned final_type);
|
|
|
|
|
2015-10-17 17:14:49 +00:00
|
|
|
size_t menu_entries_get_stack_size(void);
|
|
|
|
|
2015-10-17 17:21:18 +00:00
|
|
|
size_t menu_entries_get_size(void);
|
|
|
|
|
2015-10-17 17:38:33 +00:00
|
|
|
void menu_list_get_at_offset(const file_list_t *list, size_t idx,
|
|
|
|
const char **path, const char **label, unsigned *file_type,
|
|
|
|
size_t *entry_idx);
|
|
|
|
|
|
|
|
menu_list_t *menu_list_get_ptr(void);
|
|
|
|
|
|
|
|
void *menu_list_get_userdata_at_offset(const file_list_t *list, size_t idx);
|
|
|
|
|
|
|
|
menu_file_list_cbs_t *menu_list_get_actiondata_at_offset(const file_list_t *list, size_t idx);
|
|
|
|
|
|
|
|
void menu_list_get_last(const file_list_t *list,
|
|
|
|
const char **path, const char **label,
|
|
|
|
unsigned *file_type, size_t *entry_idx);
|
|
|
|
|
2015-10-18 19:44:44 +00:00
|
|
|
void menu_entries_clear(file_list_t *list);
|
2015-10-17 17:38:33 +00:00
|
|
|
|
|
|
|
void menu_list_get_alt_at_offset(const file_list_t *list, size_t idx,
|
|
|
|
const char **alt);
|
|
|
|
|
|
|
|
void menu_list_set_alt_at_offset(file_list_t *list, size_t idx,
|
|
|
|
const char *alt);
|
|
|
|
|
|
|
|
void menu_list_refresh(file_list_t *list);
|
|
|
|
|
2015-10-18 18:21:12 +00:00
|
|
|
rarch_setting_t *menu_entries_get_setting(uint32_t i);
|
|
|
|
|
2015-06-16 00:15:32 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|