25 #if defined(XEMU_HAS_GTK3) || defined(XEMU_ARCH_MAC) || defined(XEMU_ARCH_WIN)
26 static void store_dir_from_file_selection (
char *store_dir,
const char *filename,
int dialog_mode )
30 strcpy(store_dir, filename);
34 memcpy(store_dir, filename, p - filename + 1);
35 store_dir[p - filename + 1] =
'\0';
50 int (*
file_selector)(
int dialog_mode,
const char *dialog_title,
char *default_dir,
char *selected,
int path_max_size );
52 int (*
info)(
int sdl_class,
const char *msg);
55 #if defined(XEMU_HAS_GTK3)
57 #elif defined(XEMU_ARCH_MAC)
59 #elif defined(XEMU_ARCH_WIN)
68 #if defined(XEMU_ARCH_MAC)
69 &xemuosxgui_descriptor,
71 #if defined (XEMU_ARCH_WIN)
72 &xemuwingui_descriptor,
74 #if defined(XEMU_HAS_GTK3)
75 &xemugtkgui_descriptor,
78 &xemunullgui_descriptor
89 for (
int a = 0 ;; a++) {
91 strcat(avail, xemugui_descriptor_list[a]->
name);
92 if (
name && !strcasecmp(xemugui_descriptor_list[a]->
name,
name)) {
93 current_gui = xemugui_descriptor_list[a];
96 if (xemugui_descriptor_list[a] == &xemunullgui_descriptor) {
97 current_gui = xemugui_descriptor_list[0];
100 "Requested GUI (\"%s\") cannot be found, using \"%s\" instead.\nAvailable GUI implementations:%s",
104 DEBUGPRINT(
"GUI: no GUI was specified, using the first available one from this list:%s" NL, avail);
109 return current_gui->
init ? current_gui->
init() : 1;
115 if (current_gui && current_gui->
shutdown)
126 int xemugui_file_selector (
int dialog_mode,
const char *dialog_title,
char *default_dir,
char *selected,
int path_max_size )
129 return current_gui->
file_selector(dialog_mode, dialog_title, default_dir, selected, path_max_size);
138 ERROR_WINDOW(
"GUI hasn't been initialized yet, cannot pop menu.");
141 if (!current_gui->
popup) {
142 #ifndef GUI_HAS_POPUP
143 ERROR_WINDOW(
"GUI support is not compiled for this Xemu build for any GUI backend which can pop menu");
146 if (current_gui == &xemunullgui_descriptor)
147 ERROR_WINDOW(
"The 'none' GUI is used. It does not support popping menu");
149 ERROR_WINDOW(
"Current GUI backend (%s) does not support popping menu", current_gui->
name);
152 return current_gui->
popup(desc);
158 if (current_gui && current_gui->
info)
159 return current_gui->
info(sdl_class, msg);