Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
emutools_gui.h
Go to the documentation of this file.
1 /* Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
2  Copyright (C)2016-2022 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17 
18 #ifndef XEMU_COMMON_EMUTOOLS_GUI_H_INCLUDED
19 #define XEMU_COMMON_EMUTOOLS_GUI_H_INCLUDED
20 
21 //#define DEBUGGUI DEBUGPRINT
22 #define DEBUGGUI DEBUG
23 //#define DEBUGGUI(...)
24 
25 #define XEMUGUI_FSEL_DIRECTORY 0
26 #define XEMUGUI_FSEL_OPEN 1
27 #define XEMUGUI_FSEL_SAVE 2
28 #define XEMUGUI_FSEL_FLAG_STORE_DIR 0x100
29 
30 #define XEMUGUI_MENUID_CALLABLE 0
31 #define XEMUGUI_MENUID_SUBMENU 1
32 #define XEMUGUI_MENUID_TITLE 2
33 
34 #define XEMUGUI_MENUFLAG_INACTIVE 0x00100
35 #define XEMUGUI_MENUFLAG_BEGIN_RADIO 0x00200
36 #define XEMUGUI_MENUFLAG_END_RADIO 0x00400
37 #define XEMUGUI_MENUFLAG_ACTIVE_RADIO 0x00800
38 #define XEMUGUI_MENUFLAG_SEPARATOR 0x01000
39 #define XEMUGUI_MENUFLAG_CHECKED 0x02000
40 #define XEMUGUI_MENUFLAG_QUERYBACK 0x04000
41 #define XEMUGUI_MENUFLAG_UNCHECKED 0x08000
42 #define XEMUGUI_MENUFLAG_HIDDEN 0x10000
43 
44 #ifndef XEMUGUI_MAX_SUBMENUS
45 #define XEMUGUI_MAX_SUBMENUS 100
46 #endif
47 #ifndef XEMUGUI_MAX_ITEMS
48 #define XEMUGUI_MAX_ITEMS 900
49 #endif
50 
51 #ifndef XEMUGUI_MAINMENU_NAME
52 #define XEMUGUI_MAINMENU_NAME "Main Menu"
53 #endif
54 
55 #define XEMUGUI_RETURN_CHECKED_ON_QUERY(query,status) \
56  do { if (query) { \
57  *query |= (status) ? XEMUGUI_MENUFLAG_CHECKED : XEMUGUI_MENUFLAG_UNCHECKED; \
58  return; \
59  } } while (0)
60 
61 struct menu_st;
62 
63 typedef void (*xemugui_callback_t)(const struct menu_st *desc, int *query);
64 
65 struct menu_st {
66  const char *name;
67  int type;
69  const void *user_data;
70 };
71 
72 extern int is_xemungui_ok;
73 
74 extern int xemugui_init ( const char *name );
75 extern void xemugui_shutdown ( void );
76 extern int xemugui_iteration ( void );
77 extern int xemugui_file_selector ( int dialog_mode, const char *dialog_title, char *default_dir, char *selected, int path_max_size );
78 extern int xemugui_popup ( const struct menu_st desc[] );
79 extern int xemugui_info ( int sdl_class, const char *msg );
80 
81 extern void xemugui_cb_call_user_data ( const struct menu_st *m, int *query );
82 extern void xemugui_cb_call_user_data_if_sure ( const struct menu_st *m, int *query );
83 extern void xemugui_cb_quit ( const struct menu_st *m, int *query );
84 extern void xemugui_cb_call_quit_if_sure ( const struct menu_st *m, int *query );
85 extern void xemugui_cb_show_info_window_text ( const struct menu_st *m, int *query );
86 extern void xemugui_cb_about_window ( const struct menu_st *m, int *query );
87 #ifdef XEMU_ARCH_WIN
88 extern void xemugui_cb_sysconsole ( const struct menu_st *m, int *query );
89 #endif
90 extern void xemugui_cb_windowsize ( const struct menu_st *m, int *query );
91 
92 #ifdef HAVE_XEMU_EXEC_API
93 extern void xemugui_cb_native_os_prefdir_browser( const struct menu_st *m, int *query );
94 extern void xemugui_cb_web_url ( const struct menu_st *m, int *query );
95 extern void xemugui_cb_web_help_main ( const struct menu_st *m, int *query );
96 #endif
97 extern void xemugui_cb_osd_key_debugger ( const struct menu_st *m, int *query );
98 extern void xemugui_cb_set_mouse_grab ( const struct menu_st *m, int *query );
99 extern void xemugui_cb_set_integer_to_one ( const struct menu_st *m, int *query );
100 extern void xemugui_cb_toggle_int ( const struct menu_st *m, int *query );
101 extern void xemugui_cb_toggle_int_inverted ( const struct menu_st *m, int *query );
102 
103 #ifdef XEMU_CONFIGDB_SUPPORT
104 enum xemuguicfgfileop_type { XEMUGUICFGFILEOP_LOAD_DEFAULT, XEMUGUICFGFILEOP_SAVE_DEFAULT, XEMUGUICFGFILEOP_LOAD_CUSTOM, XEMUGUICFGFILEOP_SAVE_CUSTOM };
105 void xemugui_cb_cfgfile ( const struct menu_st *m, int *query );
106 #endif
107 
108 #endif
xemugui_cb_toggle_int_inverted
void xemugui_cb_toggle_int_inverted(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:193
menu_st
Definition: emutools_gui.h:65
menu_st::user_data
const void * user_data
Definition: emutools_gui.h:69
xemugui_cb_show_info_window_text
void xemugui_cb_show_info_window_text(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:47
xemugui_iteration
int xemugui_iteration(void)
Definition: emutools_gui.c:120
xemugui_cb_osd_key_debugger
void xemugui_cb_osd_key_debugger(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:169
menu_st::type
int type
Definition: emutools_gui.h:67
menu_st::handler
const xemugui_callback_t handler
Definition: emutools_gui.h:68
xemugui_cb_set_mouse_grab
void xemugui_cb_set_mouse_grab(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:176
xemugui_cb_call_user_data_if_sure
void xemugui_cb_call_user_data_if_sure(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:35
xemugui_callback_t
void(* xemugui_callback_t)(const struct menu_st *desc, int *query)
Definition: emutools_gui.h:63
xemugui_cb_set_integer_to_one
void xemugui_cb_set_integer_to_one(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:187
xemugui_popup
int xemugui_popup(const struct menu_st desc[])
Definition: emutools_gui.c:135
menu_st::name
const char * name
Definition: emutools_gui.h:66
is_xemungui_ok
int is_xemungui_ok
xemugui_cb_toggle_int
void xemugui_cb_toggle_int(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:199
xemugui_info
int xemugui_info(int sdl_class, const char *msg)
Definition: emutools_gui.c:156
xemugui_cb_call_quit_if_sure
void xemugui_cb_call_quit_if_sure(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:79
xemugui_cb_call_user_data
void xemugui_cb_call_user_data(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:29
xemugui_init
int xemugui_init(const char *name)
Definition: emutools_gui.c:82
xemugui_cb_windowsize
void xemugui_cb_windowsize(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:97
name
const char * name
Definition: joystick.c:46
xemugui_cb_about_window
void xemugui_cb_about_window(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:53
xemugui_shutdown
void xemugui_shutdown(void)
Definition: emutools_gui.c:113
xemugui_cb_quit
void xemugui_cb_quit(const struct menu_st *m, int *query)
Definition: popular_user_funcs.c:41
xemugui_file_selector
int xemugui_file_selector(int dialog_mode, const char *dialog_title, char *default_dir, char *selected, int path_max_size)
Definition: emutools_gui.c:126