wxwidgets: Allow entering fullscreen mode from commandline
[lsnes.git] / include / platform / wxwidgets / platform.hpp
blob735c3f3a7d78d0feb02efb0848533f5cc7dc0e13
1 #ifndef _plat_wxwidgets__platform__hpp__included__
2 #define _plat_wxwidgets__platform__hpp__included__
4 #include "core/moviefile.hpp"
5 #include "core/window.hpp"
7 #include <cstdlib>
8 #include <cstdint>
9 #include <cstddef>
11 #include <wx/string.h>
13 class wxwin_mainwindow;
14 class wxwin_messages;
15 class wxwin_status;
16 class wxWindow;
17 class wxKeyEvent;
19 //Scaling
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, bool fscreen);
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);
48 //Editor dialogs.
49 void wxeditor_authors_display(wxWindow* parent);
50 void wxeditor_hotkeys_display(wxWindow* parent);
51 void wxeditor_memorywatches_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);
66 bool wxeditor_plugin_manager_display(wxWindow* parent);
67 void wxeditor_tracelog_display(wxWindow* parent, int cpuid, const std::string& cpuname);
68 void wxeditor_disassembler_display(wxWindow* parent);
69 void wxeditor_plugin_manager_notify_fail(const std::string& libname);
71 //Auxillary windows.
72 void wxwindow_memorysearch_display();
73 void wxwindow_memorysearch_update();
74 void wxeditor_hexeditor_update();
75 class memory_search;
76 memory_search* wxwindow_memorysearch_active();
77 bool wxeditor_hexeditor_available();
78 bool wxeditor_hexeditor_jumpto(uint64_t addr);
79 void wxwindow_tasinput_update();
81 template<typename T>
82 void functor_call_helper2(void* args)
84 (*reinterpret_cast<T*>(args))();
85 delete reinterpret_cast<T*>(args);
88 template<typename T>
89 void runuifun(T fn)
91 _runuifun_async(functor_call_helper2<T>, new T(fn));
94 //Thrown by various dialog functions if canceled.
95 class canceled_exception : public std::runtime_error
97 public:
98 canceled_exception();
101 //Prompt for stuff. These all can throw canceled_exception.
102 std::string pick_file_member(wxWindow* parent, const std::string& title, const std::string& startdir);
103 std::string pick_among(wxWindow* parent, const std::string& title, const std::string& prompt,
104 const std::vector<std::string>& choices, unsigned defaultchoice = 0);
105 std::string pick_text(wxWindow* parent, const std::string& title, const std::string& prompt,
106 const std::string& dflt = "", bool multiline = false);
107 //Show message box with OK button.
108 void show_message_ok(wxWindow* parent, const std::string& title, const std::string& text, int icon);
111 //Some important windows (if open).
112 extern wxwin_messages* msg_window;
113 extern wxwin_mainwindow* main_window;
114 extern std::string our_rom_name;
115 extern bool wxwidgets_exiting;
117 //Some important settings.
118 extern std::map<std::string, std::string> core_selections;
120 template<typename T> void runemufn_async(T fn)
122 platform::queue(functor_call_helper2<T>, new T(fn), false);
125 #endif