RetroArch
ui_companion_driver.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2010-2014 - Hans-Kristian Arntzen
3  * Copyright (C) 2011-2017 - Daniel De Matteis
4  *
5  * RetroArch is free software: you can redistribute it and/or modify it under the terms
6  * of the GNU General Public License as published by the Free Software Found-
7  * ation, either version 3 of the License, or (at your option) any later version.
8  *
9  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  * PURPOSE. See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along with RetroArch.
14  * If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef __UI_COMPANION_DRIVER_H
18 #define __UI_COMPANION_DRIVER_H
19 
20 #include <stddef.h>
21 
22 #include <boolean.h>
23 #include <retro_common_api.h>
24 #include <lists/file_list.h>
25 
26 #ifdef HAVE_CONFIG_H
27 #include "../config.h"
28 #endif
29 
30 #include "../command.h"
31 
33 
35 {
40 };
41 
43 {
49 };
50 
52 {
57 };
58 
59 typedef struct ui_msg_window_state
60 {
62  char *text;
63  char *title;
64  void *window;
66 
68 {
69  struct
70  {
79  } capabilities;
80  void *window;
81  char *filters;
83  char *startdir;
84  char *path;
85  char *title;
86  char *result;
88 
89 typedef struct ui_browser_window
90 {
93  const char *ident;
95 
96 typedef struct ui_msg_window
97 {
102  const char *ident;
104 
105 typedef struct ui_application
106 {
107  void* (*initialize)(void);
110  void (*run)(void *args);
112  const char *ident;
114 
115 typedef struct ui_window
116 {
117  void* (*init)(void);
118  void (*destroy)(void *data);
119  void (*set_focused)(void *data);
120  void (*set_visible)(void *data, bool visible);
121  void (*set_title)(void *data, char *buf);
122  void (*set_droppable)(void *data, bool droppable);
123  bool (*focused)(void *data);
124  const char *ident;
125 } ui_window_t;
126 
127 typedef struct ui_companion_driver
128 {
129  void *(*init)(void);
130  void (*deinit)(void *data);
131  int (*iterate)(void *data, unsigned action);
132  void (*toggle)(void *data, bool force);
133  void (*event_command)(void *data, enum event_command action);
137  void (*msg_queue_push)(void *data, const char *msg, unsigned priority, unsigned duration, bool flush);
138  void (*render_messagebox)(const char *msg);
139  void *(*get_main_window)(void *data);
140  void (*log_msg)(void *data, const char *msg);
145  const char *ident;
147 
152 
157 
162 
167 
173 
182 const ui_companion_driver_t *ui_companion_find_driver(const char *ident);
183 
185 
194 
196 
198 
199 void ui_companion_set_foreground(unsigned enable);
200 
201 void ui_companion_event_command(enum event_command action);
202 
203 void ui_companion_driver_deinit(void);
204 
206 
208 
210 
211 void ui_companion_driver_toggle(bool force);
212 
213 void ui_companion_driver_free(void);
214 
216 
218 
220 
222 
223 #ifdef HAVE_QT
224 const ui_application_t *ui_companion_driver_get_qt_application_ptr(void);
225 #endif
226 
227 void ui_companion_driver_log_msg(const char *msg);
228 
229 void ui_companion_driver_msg_queue_push(const char *msg, unsigned priority, unsigned duration, bool flush);
230 
232 
233 const char *ui_companion_driver_get_ident(void);
234 
236 
237 #endif
Definition: ui_companion_driver.h:127
char * filters_title
Definition: ui_companion_driver.h:82
bool(* save)(ui_browser_window_state_t *state)
Definition: ui_companion_driver.h:92
ui_window_t ui_window_cocoa
Definition: ui_cocoa_window.m:90
ui_application_t ui_application_null
Definition: ui_null_application.c:43
Definition: ui_companion_driver.h:53
void(* set_visible)(void *data, bool visible)
Definition: ui_companion_driver.h:120
void ui_companion_event_command(enum event_command action)
Definition: ui_companion_driver.c:100
ui_window_t ui_window_qt
Definition: ui_qt_window.cpp:3427
ui_msg_window_t ui_msg_window_qt
Definition: ui_qt_msg_window.cpp:101
void * window
Definition: ui_companion_driver.h:64
void ui_companion_driver_log_msg(const char *msg)
Definition: ui_companion_driver.c:293
void(* destroy)(void *data)
Definition: ui_companion_driver.h:118
void ui_companion_driver_notify_list_loaded(file_list_t *list, file_list_t *menu_list)
Definition: ui_companion_driver.c:199
Definition: ui_companion_driver.h:89
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
enum ui_msg_window_response(* warning)(ui_msg_window_state *state)
Definition: ui_companion_driver.h:101
bool(* pending_events)(void)
Definition: ui_companion_driver.h:108
Definition: ui_companion_driver.h:47
Definition: ui_companion_driver.h:115
Definition: ui_companion_driver.h:48
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
void(* toggle)(void *data, bool force)
Definition: ui_companion_driver.h:132
ui_application_t ui_application_qt
Definition: ui_qt_application.cpp:186
ui_application_t ui_application_win32
Definition: ui_win32_application.c:56
Definition: ui_companion_driver.h:39
ui_window_t ui_window_null
Definition: ui_null_window.c:55
bool allows_multiple_selection
Definition: ui_companion_driver.h:75
bool ui_companion_is_on_foreground(void)
Definition: ui_companion_driver.c:78
char * result
Definition: ui_companion_driver.h:86
GLboolean enable
Definition: glext.h:12027
ui_msg_window_type
Definition: ui_companion_driver.h:51
int(* iterate)(void *data, unsigned action)
Definition: ui_companion_driver.h:131
Definition: ui_companion_driver.h:37
void ui_companion_set_foreground(unsigned enable)
Definition: ui_companion_driver.c:73
struct ui_application ui_application_t
Definition: ui_companion_driver.h:59
const ui_application_t * ui_companion_driver_get_application_ptr(void)
Definition: ui_companion_driver.c:253
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
Definition: ui_companion_driver.h:36
const char * ident
Definition: ui_companion_driver.h:93
enum ui_msg_window_response(* error)(ui_msg_window_state *state)
Definition: ui_companion_driver.h:98
char * title
Definition: ui_companion_driver.h:85
ui_msg_window_t ui_msg_window_null
Definition: ui_null_msg_window.c:44
void ui_companion_driver_free(void)
Definition: ui_companion_driver.c:217
struct ui_window ui_window_t
void ui_companion_driver_notify_content_loaded(void)
Definition: ui_companion_driver.c:208
bool treat_file_packages_as_directories
Definition: ui_companion_driver.h:77
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:6303
enum ui_msg_window_buttons buttons
Definition: ui_companion_driver.h:61
void(* run)(void *args)
Definition: ui_companion_driver.h:110
typedef bool(RETRO_CALLCONV *retro_replace_image_index_t)(unsigned index
struct ui_msg_window ui_msg_window_t
Definition: ui_companion_driver.h:54
bool treat_file_packages_as_directories_val
Definition: ui_companion_driver.h:78
Definition: ui_companion_driver.h:105
ui_msg_window_t ui_msg_window_cocoa
Definition: ui_cocoa_msg_window.m:132
const char * ident
Definition: ui_companion_driver.h:124
Definition: ui_companion_driver.h:44
void ui_companion_driver_toggle(bool force)
Definition: ui_companion_driver.c:157
const char * ident
Definition: ui_companion_driver.h:145
Definition: menu_entries.c:37
void(* msg_queue_push)(void *data, const char *msg, unsigned priority, unsigned duration, bool flush)
Definition: ui_companion_driver.h:137
void(* set_droppable)(void *data, bool droppable)
Definition: ui_companion_driver.h:122
ui_companion_driver_t ui_companion_cocoatouch
Definition: ui_cocoatouch.m:700
ui_companion_driver_t ui_companion_win32
Definition: ui_win32.c:325
ui_application_t ui_application_cocoa
Definition: ui_cocoa_application.m:57
void(* deinit)(void *data)
Definition: ui_companion_driver.h:130
enum ui_msg_window_response(* question)(ui_msg_window_state *state)
Definition: ui_companion_driver.h:100
ui_browser_window_t ui_browser_window_null
Definition: ui_null_browser_window.c:34
bool allows_multiple_selection_val
Definition: ui_companion_driver.h:76
ui_msg_window_t ui_msg_window_win32
Definition: ui_win32_msg_window.c:100
Definition: ui_companion_driver.h:46
Definition: ui_companion_driver.h:96
Definition: ui_companion_driver.h:56
bool(* open)(ui_browser_window_state_t *state)
Definition: ui_companion_driver.h:91
Definition: ui_companion_driver.h:38
Definition: ui_companion_driver.h:67
ui_browser_window_t ui_browser_window_win32
Definition: ui_win32_browser_window.c:93
static const unsigned char msg[]
Definition: ccm.c:375
struct ui_browser_window ui_browser_window_t
char * filters
Definition: ui_companion_driver.h:81
void ui_companion_driver_deinit(void)
Definition: ui_companion_driver.c:112
const ui_companion_driver_t * ui_companion_get_ptr(void)
Definition: ui_companion_driver.c:95
static uint64_t state[MAX_PADS]
Definition: xenon360_input.c:33
char * title
Definition: ui_companion_driver.h:63
const ui_msg_window_t * ui_companion_driver_get_msg_window_ptr(void)
Definition: ui_companion_driver.c:222
const ui_window_t * ui_companion_driver_get_window_ptr(void)
Definition: ui_companion_driver.c:230
const char * ui_companion_driver_get_ident(void)
Definition: ui_companion_driver.c:285
enum ui_msg_window_response(* information)(ui_msg_window_state *state)
Definition: ui_companion_driver.h:99
bool can_choose_files_val
Definition: ui_companion_driver.h:74
const char * ident
Definition: ui_companion_driver.h:102
dictionary args
Definition: test_shaders.py:20
bool can_choose_files
Definition: ui_companion_driver.h:73
static const struct @104 priority[]
char * startdir
Definition: ui_companion_driver.h:83
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: file_list.h:47
Definition: ui_companion_driver.h:55
ui_window_t ui_window_win32
Definition: ui_win32_window.c:97
event_command
Definition: command.h:42
ui_companion_driver_t ui_companion_null
Definition: ui_null.c:81
ui_window_t * window
Definition: ui_companion_driver.h:143
struct ui_browser_window_state::@850 capabilities
void(* log_msg)(void *data, const char *msg)
Definition: ui_companion_driver.h:140
void(* set_focused)(void *data)
Definition: ui_companion_driver.h:119
ui_browser_window_t * browser_window
Definition: ui_companion_driver.h:141
ui_browser_window_t ui_browser_window_cocoa
Definition: ui_cocoa_browser_window.m:63
void(* notify_refresh)(void *data)
Definition: ui_companion_driver.h:136
void(* process_events)(void)
Definition: ui_companion_driver.h:109
Definition: ui_companion_driver.h:45
char * text
Definition: ui_companion_driver.h:62
ui_browser_window_t ui_browser_window_qt
Definition: ui_qt_browser_window.cpp:38
bool(* focused)(void *data)
Definition: ui_companion_driver.h:123
ui_companion_driver_t ui_companion_cocoa
Definition: ui_cocoa.m:583
void * ui_companion_driver_get_main_window(void)
Definition: ui_companion_driver.c:277
struct ui_companion_driver ui_companion_driver_t
bool can_choose_directories_val
Definition: ui_companion_driver.h:72
ui_application_t * application
Definition: ui_companion_driver.h:144
struct ui_msg_window_state ui_msg_window_state
ui_msg_window_buttons
Definition: ui_companion_driver.h:34
char * path
Definition: ui_companion_driver.h:84
struct ui_browser_window_state ui_browser_window_state_t
ui_msg_window_response
Definition: ui_companion_driver.h:42
const char * ident
Definition: ui_companion_driver.h:112
void ui_companion_driver_notify_refresh(void)
Definition: ui_companion_driver.c:181
void(* notify_content_loaded)(void *data)
Definition: ui_companion_driver.h:134
bool can_choose_directories
Definition: ui_companion_driver.h:71
void ui_companion_driver_msg_queue_push(const char *msg, unsigned priority, unsigned duration, bool flush)
Definition: ui_companion_driver.c:261
const ui_browser_window_t * ui_companion_driver_get_browser_window_ptr(void)
Definition: ui_companion_driver.c:238
const ui_companion_driver_t * ui_companion_init_first(void)
Definition: ui_companion_driver.c:90
void ui_companion_driver_init_first(void)
Definition: ui_companion_driver.c:131
void(* render_messagebox)(const char *msg)
Definition: ui_companion_driver.h:138
void(* set_title)(void *data, char *buf)
Definition: ui_companion_driver.h:121
void * window
Definition: ui_companion_driver.h:80
ui_msg_window_t * msg_window
Definition: ui_companion_driver.h:142
const ui_companion_driver_t * ui_companion_find_driver(const char *ident)
Definition: ui_companion_driver.c:60
ui_companion_driver_t ui_companion_qt
Definition: ui_qt.cpp:719
void(* notify_list_loaded)(void *data, file_list_t *list, file_list_t *menu_list)
Definition: ui_companion_driver.h:135
void(* quit)(void)
Definition: ui_companion_driver.h:111