RetroArch
menu_cbs.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2011-2017 - Daniel De Matteis
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef MENU_CBS_H__
17 #define MENU_CBS_H__
18 
19 #include <stdlib.h>
20 
21 #include <boolean.h>
22 #include <retro_common_api.h>
23 
24 #ifdef HAVE_CONFIG_H
25 #include "../config.h"
26 #endif
27 
28 #include "menu_entries.h"
29 
30 #include "../msg_hash.h"
31 
33 
34 typedef struct key_desc
35 {
36  /* libretro key id */
37  unsigned key;
38 
39  /* description */
40  char desc[32];
41 } key_desc_t;
42 
43 enum
44 {
145 };
146 
147 /* Function callbacks */
148 
149 int action_cancel_pop_default(const char *path,
150  const char *label, unsigned type, size_t idx);
151 
153 
154 int shader_action_parameter_right(unsigned type, const char *label, bool wraparound);
155 
156 int action_cancel_pop_with_new_pos(const char *path,
157  const char *label, unsigned type, size_t idx, size_t new_idx);
158 
159 int generic_action_ok_displaylist_push(const char *path, const char *new_path,
160  const char *label, unsigned type, size_t idx, size_t entry_idx,
161  unsigned action_type);
162 
163 int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
164  bool wraparound);
165 
166 int action_ok_push_generic_list(const char *path,
167  const char *label, unsigned type, size_t idx, size_t entry_idx);
168 
169 int action_ok_path_use_directory(const char *path,
170  const char *label, unsigned type, size_t idx, size_t entry_idx);
171 
172 int action_ok_directory_push(const char *path,
173  const char *label, unsigned type, size_t idx, size_t entry_idx);
174 
175 int core_setting_right(unsigned type, const char *label,
176  bool wraparound);
177 
178 int action_right_input_desc(unsigned type, const char *label,
179  bool wraparound);
180 
181 int action_right_input_desc_kbd(unsigned type, const char *label,
182  bool wraparound);
183 
184 int action_right_cheat(unsigned type, const char *label,
185  bool wraparound);
186 
187 /* End of function callbacks */
188 
190  const char *path, const char *label, unsigned type, size_t idx,
191  const char *menu_label,
192  uint32_t label_hash);
193 
195  const char *path, const char *label, unsigned type, size_t idx,
196  const char *menu_label,
197  uint32_t label_hash);
198 
200  const char *path, const char *label, unsigned type, size_t idx);
201 
203  const char *path, const char *label, unsigned type, size_t idx);
204 
206  const char *path, const char *label, unsigned type, size_t idx);
207 
209  const char *path, const char *label, unsigned type, size_t idx);
210 
212  const char *path, const char *label, unsigned type, size_t idx);
213 
215  const char *path, const char *label, unsigned type, size_t idx);
216 
218  const char *path, const char *label, unsigned type, size_t idx);
219 
221  const char *path, const char *label, unsigned type, size_t idx);
222 
224  const char *path, const char *label, unsigned type, size_t idx);
225 
227  const char *path, const char *label, unsigned type, size_t idx);
228 
230  const char *path, const char *label, unsigned type, size_t idx,
231  uint32_t label_hash, uint32_t menu_label_hash);
232 
234  const char *path, const char *label, unsigned type, size_t idx,
235  uint32_t label_hash);
236 
238  const char *path, const char *label, unsigned type, size_t idx);
239 
241  const char *path, const char *label, unsigned type, size_t idx);
242 
244  const char *path, const char *label, unsigned type, size_t idx,
245  uint32_t label_hash);
246 
247 #ifdef HAVE_LIBRETRODB
248 int action_scan_directory(const char *path,
249  const char *label, unsigned type, size_t idx);
250 
251 int action_scan_file(const char *path,
252  const char *label, unsigned type, size_t idx);
253 #endif
254 
255 int bind_right_generic(unsigned type, const char *label,
256  bool wraparound);
257 
258 /* This sets up all the callback functions for a menu entry.
259  *
260  * OK : When we press the 'OK' button on an entry.
261  * Cancel : When we press the 'Cancel' button on an entry.
262  * Scan : When we press the 'Scan' button on an entry.
263  * Start : When we press the 'Start' button on an entry.
264  * Select : When we press the 'Select' button on an entry.
265  * Info : When we press the 'Info' button on an entry.
266  * Content Switch : ??? (TODO/FIXME - Kivutar should document this)
267  * Up : when we press 'Up' on the D-pad while this entry is selected.
268  * Down : when we press 'Down' on the D-pad while this entry is selected.
269  * Left : when we press 'Left' on the D-pad while this entry is selected.
270  * Right : when we press 'Right' on the D-pad while this entry is selected.
271  * Deferred push : When pressing an entry results in spawning a new list, it waits until the next
272  * frame to push this onto the stack. This function callback will then be invoked.
273  * Refresh : What happens when the screen has to be refreshed. Does an entry have internal state
274  * that needs to be rebuild?
275  * Get value: Each entry has associated 'text', which we call the value. This function callback
276  * lets us render that text.
277  * Get title: Each entry can have a custom 'title'.
278  * Label: Each entry has a label name. This function callback lets us render that label text.
279  * Sublabel: each entry has a sublabel, which consists of one or more lines of additional information.
280  * This function callback lets us render that text.
281  */
282 void menu_cbs_init(void *data,
284  const char *path, const char *label,
285  unsigned type, size_t idx);
286 
287 int menu_cbs_exit(void);
288 
290 
291 #endif
Definition: menu_cbs.h:120
Definition: menu_cbs.h:68
int action_cancel_pop_with_new_pos(const char *path, const char *label, unsigned type, size_t idx, size_t new_idx)
int generic_action_ok_displaylist_push(const char *path, const char *new_path, const char *label, unsigned type, size_t idx, size_t entry_idx, unsigned action_type)
Definition: menu_cbs_ok.c:262
int menu_cbs_init_bind_down(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_down.c:42
int menu_cbs_init_bind_right(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx, const char *menu_label, uint32_t label_hash)
Definition: menu_cbs_right.c:720
int shader_action_parameter_right(unsigned type, const char *label, bool wraparound)
Definition: menu_cbs_right.c:63
Definition: menu_cbs.h:122
Definition: menu_cbs.h:71
Definition: menu_cbs.h:85
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
Definition: menu_cbs.h:144
Definition: menu_cbs.h:138
Definition: menu_cbs.h:89
Definition: menu_cbs.h:90
Definition: menu_cbs.h:92
Definition: menu_cbs.h:136
Definition: menu_cbs.h:72
int menu_cbs_init_bind_start(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_start.c:379
GLsizei const GLchar ** path
Definition: glext.h:7901
void menu_cbs_init(void *data, menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs.c:205
Definition: menu_cbs.h:69
Definition: menu_cbs.h:94
int action_right_cheat(unsigned type, const char *label, bool wraparound)
Definition: menu_cbs_right.c:95
Definition: menu_cbs.h:76
Definition: menu_cbs.h:139
Definition: menu_cbs.h:58
Definition: menu_cbs.h:142
int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_sublabel.c:733
Definition: menu_cbs.h:113
int bind_right_generic(unsigned type, const char *label, bool wraparound)
Definition: menu_cbs_right.c:467
Definition: menu_cbs.h:45
Definition: menu_cbs.h:116
Definition: menu_cbs.h:87
Definition: ibxm.h:9
Definition: menu_cbs.h:117
Definition: menu_cbs.h:134
Definition: menu_cbs.h:98
GLuint GLsizei const GLchar * label
Definition: glext.h:8583
Definition: menu_cbs.h:141
Definition: menu_cbs.h:84
Definition: menu_cbs.h:79
Definition: menu_cbs.h:95
Definition: menu_entries.c:37
Definition: menu_cbs.h:126
Definition: menu_cbs.h:97
GLenum type
Definition: glext.h:6233
int menu_cbs_exit(void)
Definition: menu_cbs.c:352
Definition: menu_cbs.h:53
Definition: menu_cbs.h:54
Definition: menu_cbs.h:102
int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx, uint32_t label_hash)
Definition: menu_cbs_title.c:1234
int action_right_input_desc_kbd(unsigned type, const char *label, bool wraparound)
Definition: menu_cbs_right.c:103
Definition: menu_cbs.h:88
Definition: menu_cbs.h:110
Definition: menu_cbs.h:62
Definition: menu_cbs.h:78
Definition: menu_cbs.h:49
int action_refresh_default(file_list_t *list, file_list_t *menu_list)
Definition: menu_cbs_refresh.c:25
unsigned entry_idx
Definition: menu_cbs_ok.c:2308
Definition: menu_cbs.h:129
Definition: menu_cbs.h:108
Definition: menu_cbs.h:74
int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx, uint32_t label_hash, uint32_t menu_label_hash)
Definition: menu_cbs_ok.c:6046
Definition: menu_cbs.h:106
Definition: menu_cbs.h:46
int menu_cbs_init_bind_label(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_label.c:81
Definition: menu_cbs.h:70
Definition: menu_entries.h:80
int action_cancel_pop_default(const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_cancel.c:33
int menu_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_cancel.c:156
Definition: menu_cbs.h:114
Definition: menu_cbs.h:63
Definition: menu_cbs.h:60
Definition: menu_cbs.h:96
unsigned key
Definition: menu_cbs.h:37
Definition: menu_cbs.h:107
Definition: menu_cbs.h:140
Definition: menu_cbs.h:65
int menu_cbs_init_bind_scan(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_scan.c:192
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 idx
Definition: pixman-arm-neon-asm.h:96
Definition: menu_cbs.h:64
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: file_list.h:47
Definition: menu_cbs.h:143
Definition: menu_cbs.h:101
int menu_cbs_init_bind_content_list_switch(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_contentlist_switch.c:34
Definition: menu_cbs.h:111
Definition: menu_cbs.h:52
Definition: menu_cbs.h:91
int menu_cbs_init_bind_refresh(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_refresh.c:39
Definition: menu_cbs.h:115
int menu_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_get_value.c:1593
Definition: menu_cbs.h:67
Definition: menu_cbs.h:66
Definition: menu_cbs.h:57
int action_ok_path_use_directory(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx)
Definition: menu_cbs_ok.c:2562
Definition: menu_cbs.h:103
RETRO_BEGIN_DECLS struct key_desc key_desc_t
Definition: menu_cbs.h:61
int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label, bool wraparound)
Definition: menu_cbs_right.c:87
int menu_cbs_init_bind_info(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_info.c:79
Definition: menu_cbs.h:56
Definition: menu_cbs.h:100
Definition: menu_cbs.h:51
Definition: menu_cbs.h:118
int menu_cbs_init_bind_up(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_up.c:42
int action_ok_push_generic_list(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx)
int menu_cbs_init_bind_select(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx)
Definition: menu_cbs_select.c:239
int action_ok_directory_push(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx)
int core_setting_right(unsigned type, const char *label, bool wraparound)
Definition: menu_cbs_right.c:449
Definition: menu_cbs.h:86
Definition: menu_cbs.h:81
Definition: menu_cbs.h:135
Definition: menu_cbs.h:55
Definition: menu_cbs.h:93
Definition: menu_cbs.h:112
unsigned int uint32_t
Definition: stdint.h:126
Definition: menu_cbs.h:50
Definition: menu_cbs.h:121
Definition: menu_cbs.h:104
int menu_cbs_init_bind_left(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx, const char *menu_label, uint32_t label_hash)
Definition: menu_cbs_left.c:700
char desc[32]
Definition: menu_cbs.h:40
int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx, uint32_t label_hash)
Definition: menu_cbs_deferred_push.c:1530
Definition: menu_cbs.h:105
int action_right_input_desc(unsigned type, const char *label, bool wraparound)
Definition: menu_cbs_right.c:136
Definition: menu_cbs.h:59
Definition: menu_cbs.h:34
Definition: menu_cbs.h:99