1 #ifndef _plat_wxwidgets__platform__hpp__included__
2 #define _plat_wxwidgets__platform__hpp__included__
4 #include "core/moviefile.hpp"
5 #include "core/window.hpp"
11 #include <wx/string.h>
13 class wxwin_mainwindow
;
20 extern double video_scale_factor
;
21 extern int scaling_flags
;
22 extern bool arcorrect_enabled
;
23 extern bool hflip_enabled
;
24 extern bool vflip_enabled
;
25 extern bool rotate_enabled
;
26 extern int wx_escape_count
;
28 wxString
towxstring(const std::string
& str
) throw(std::bad_alloc
);
29 std::string
tostdstring(const wxString
& str
) throw(std::bad_alloc
);
30 wxString
towxstring(const std::u32string
& str
) throw(std::bad_alloc
);
31 std::u32string
tou32string(const wxString
& str
) throw(std::bad_alloc
);
32 void bring_app_foreground();
33 std::string
pick_archive_member(wxWindow
* parent
, const std::string
& filename
) throw(std::bad_alloc
);
34 void boot_emulator(loaded_rom
& rom
, moviefile
& movie
);
35 void handle_wx_keyboard(wxKeyEvent
& e
, bool polarity
);
36 std::string
map_keycode_to_key(int kcode
);
37 void initialize_wx_keyboard();
38 void signal_program_exit();
39 void signal_resize_needed();
40 void _runuifun_async(void (*fn
)(void*), void* arg
);
41 void show_projectwindow(wxWindow
* modwin
);
42 void signal_core_change();
44 std::vector
<interface_action_paramval
> prompt_action_params(wxWindow
* parent
, const std::string
& label
,
45 const std::list
<interface_action_param
>& params
);
49 void wxeditor_authors_display(wxWindow
* parent
);
50 void wxeditor_hotkeys_display(wxWindow
* parent
);
51 void wxeditor_memorywatch_display(wxWindow
* parent
);
52 void wxeditor_subtitles_display(wxWindow
* parent
);
53 std::string
wxeditor_keyselect(wxWindow
* parent
, bool clearable
);
54 void show_wxeditor_voicesub(wxWindow
* parent
);
55 void open_rom_select_window();
56 void open_new_project_window(wxWindow
* parent
);
57 void show_conflictwindow(wxWindow
* parent
);
58 void open_vumeter_window(wxWindow
* parent
);
59 void wxeditor_movie_display(wxWindow
* parent
);
60 void wxeditor_movie_update();
61 void wxeditor_autohold_display(wxWindow
* parent
);
62 void wxeditor_tasinput_display(wxWindow
* parent
);
63 void wxeditor_macro_display(wxWindow
* parent
);
64 void wxeditor_hexedit_display(wxWindow
* parent
);
65 void wxeditor_multitrack_display(wxWindow
* parent
);
68 void wxwindow_memorysearch_display();
69 void wxwindow_memorysearch_update();
70 void wxeditor_hexeditor_update();
72 memory_search
* wxwindow_memorysearch_active();
73 bool wxeditor_hexeditor_available();
74 bool wxeditor_hexeditor_jumpto(uint64_t addr
);
75 void wxwindow_tasinput_update();
78 void functor_call_helper2(void* args
)
80 (*reinterpret_cast<T
*>(args
))();
81 delete reinterpret_cast<T
*>(args
);
87 _runuifun_async(functor_call_helper2
<T
>, new T(fn
));
90 //Thrown by various dialog functions if canceled.
91 class canceled_exception
: public std::runtime_error
97 //Prompt for stuff. These all can throw canceled_exception.
98 std::string
pick_file_member(wxWindow
* parent
, const std::string
& title
, const std::string
& startdir
);
99 std::string
pick_among(wxWindow
* parent
, const std::string
& title
, const std::string
& prompt
,
100 const std::vector
<std::string
>& choices
, unsigned defaultchoice
= 0);
101 std::string
pick_text(wxWindow
* parent
, const std::string
& title
, const std::string
& prompt
,
102 const std::string
& dflt
= "", bool multiline
= false);
103 //Show message box with OK button.
104 void show_message_ok(wxWindow
* parent
, const std::string
& title
, const std::string
& text
, int icon
);
107 //Some important windows (if open).
108 extern wxwin_messages
* msg_window
;
109 extern wxwin_mainwindow
* main_window
;
110 extern std::string our_rom_name
;
111 extern bool wxwidgets_exiting
;
113 //Some important settings.
114 extern std::map
<std::string
, std::string
> core_selections
;