2012-01-06 17:28:01 +02:00
|
|
|
#ifndef _plat_wxwidgets__platform__hpp__included__
|
|
|
|
#define _plat_wxwidgets__platform__hpp__included__
|
|
|
|
|
2014-05-24 14:05:04 +03:00
|
|
|
#include "core/queue.hpp"
|
2012-01-06 17:28:01 +02:00
|
|
|
#include "core/moviefile.hpp"
|
|
|
|
#include "core/window.hpp"
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <cstddef>
|
|
|
|
|
|
|
|
#include <wx/string.h>
|
2014-06-02 15:28:48 +03:00
|
|
|
#include <wx/event.h>
|
2012-01-06 17:28:01 +02:00
|
|
|
|
|
|
|
class wxwin_mainwindow;
|
|
|
|
class wxwin_messages;
|
|
|
|
class wxwin_status;
|
|
|
|
class wxWindow;
|
|
|
|
class wxKeyEvent;
|
2014-06-02 11:08:37 +03:00
|
|
|
class emulator_instance;
|
2012-01-06 17:28:01 +02:00
|
|
|
|
2012-04-07 11:42:22 +03:00
|
|
|
//Scaling
|
2013-08-11 21:17:29 +03:00
|
|
|
extern double video_scale_factor;
|
2012-04-07 11:42:22 +03:00
|
|
|
extern int scaling_flags;
|
2013-08-11 21:17:29 +03:00
|
|
|
extern bool arcorrect_enabled;
|
2013-01-19 20:09:46 +02:00
|
|
|
extern bool hflip_enabled;
|
|
|
|
extern bool vflip_enabled;
|
|
|
|
extern bool rotate_enabled;
|
2013-08-11 22:37:11 +03:00
|
|
|
extern int wx_escape_count;
|
2012-04-07 11:42:22 +03:00
|
|
|
|
2012-01-06 17:28:01 +02:00
|
|
|
wxString towxstring(const std::string& str) throw(std::bad_alloc);
|
|
|
|
std::string tostdstring(const wxString& str) throw(std::bad_alloc);
|
2013-03-25 10:58:06 +02:00
|
|
|
wxString towxstring(const std::u32string& str) throw(std::bad_alloc);
|
|
|
|
std::u32string tou32string(const wxString& str) throw(std::bad_alloc);
|
2012-01-06 17:28:01 +02:00
|
|
|
void bring_app_foreground();
|
|
|
|
std::string pick_archive_member(wxWindow* parent, const std::string& filename) throw(std::bad_alloc);
|
2014-06-02 11:08:37 +03:00
|
|
|
void boot_emulator(emulator_instance& inst, loaded_rom& rom, moviefile& movie, bool fscreen);
|
|
|
|
void handle_wx_keyboard(emulator_instance& inst, wxKeyEvent& e, bool polarity);
|
2014-06-02 15:28:48 +03:00
|
|
|
void handle_wx_mouse(emulator_instance& inst, wxMouseEvent& e);
|
2012-04-19 12:35:25 +03:00
|
|
|
std::string map_keycode_to_key(int kcode);
|
2014-06-02 15:28:48 +03:00
|
|
|
void initialize_wx_keyboard(emulator_instance& inst);
|
|
|
|
void deinitialize_wx_keyboard(emulator_instance& inst);
|
|
|
|
void initialize_wx_mouse(emulator_instance& inst);
|
|
|
|
void deinitialize_wx_mouse(emulator_instance& inst);
|
2012-01-06 17:28:01 +02:00
|
|
|
void signal_program_exit();
|
2012-03-26 23:50:14 +03:00
|
|
|
void signal_resize_needed();
|
2012-01-06 17:28:01 +02:00
|
|
|
void _runuifun_async(void (*fn)(void*), void* arg);
|
2014-06-02 11:08:37 +03:00
|
|
|
void show_projectwindow(wxWindow* modwin, emulator_instance& inst);
|
2013-01-06 23:06:08 +02:00
|
|
|
void signal_core_change();
|
2014-03-30 21:20:21 +03:00
|
|
|
void do_save_configuration();
|
2012-01-06 17:28:01 +02:00
|
|
|
|
2013-06-30 13:20:23 +03:00
|
|
|
std::vector<interface_action_paramval> prompt_action_params(wxWindow* parent, const std::string& label,
|
|
|
|
const std::list<interface_action_param>& params);
|
|
|
|
|
|
|
|
|
2012-01-06 17:28:01 +02:00
|
|
|
//Editor dialogs.
|
2014-06-02 11:08:37 +03:00
|
|
|
void wxeditor_authors_display(wxWindow* parent, emulator_instance& inst);
|
2012-02-20 21:15:51 +02:00
|
|
|
void wxeditor_hotkeys_display(wxWindow* parent);
|
2014-06-02 11:08:37 +03:00
|
|
|
void wxeditor_memorywatches_display(wxWindow* parent, emulator_instance& inst);
|
|
|
|
void wxeditor_subtitles_display(wxWindow* parent, emulator_instance& inst);
|
2012-02-20 21:15:51 +02:00
|
|
|
std::string wxeditor_keyselect(wxWindow* parent, bool clearable);
|
2014-06-02 11:41:41 +03:00
|
|
|
void show_wxeditor_voicesub(wxWindow* parent, emulator_instance& inst);
|
2012-04-09 15:46:25 +03:00
|
|
|
void open_rom_select_window();
|
2014-06-02 11:08:37 +03:00
|
|
|
void open_new_project_window(wxWindow* parent, emulator_instance& inst);
|
2013-01-16 17:12:05 +02:00
|
|
|
void show_conflictwindow(wxWindow* parent);
|
2014-06-02 11:41:41 +03:00
|
|
|
void open_vumeter_window(wxWindow* parent, emulator_instance& inst);
|
|
|
|
void wxeditor_movie_display(wxWindow* parent, emulator_instance& inst);
|
|
|
|
void wxeditor_movie_update(emulator_instance& inst);
|
2014-06-02 11:08:37 +03:00
|
|
|
void wxeditor_autohold_display(wxWindow* parent, emulator_instance& inst);
|
2014-06-02 11:41:41 +03:00
|
|
|
void wxeditor_tasinput_display(wxWindow* parent, emulator_instance& inst);
|
2014-06-02 11:08:37 +03:00
|
|
|
void wxeditor_macro_display(wxWindow* parent, emulator_instance& inst);
|
2014-06-02 11:41:41 +03:00
|
|
|
void wxeditor_hexedit_display(wxWindow* parent, emulator_instance& inst);
|
2014-06-02 11:08:37 +03:00
|
|
|
void wxeditor_multitrack_display(wxWindow* parent, emulator_instance& inst);
|
2013-12-29 00:03:57 +02:00
|
|
|
bool wxeditor_plugin_manager_display(wxWindow* parent);
|
2014-06-02 11:08:37 +03:00
|
|
|
void wxeditor_tracelog_display(wxWindow* parent, emulator_instance& inst, int cpuid, const std::string& cpuname);
|
|
|
|
void wxeditor_disassembler_display(wxWindow* parent, emulator_instance& inst);
|
2013-12-29 23:07:58 +02:00
|
|
|
void wxeditor_plugin_manager_notify_fail(const std::string& libname);
|
2012-01-06 17:28:01 +02:00
|
|
|
|
2012-01-15 16:50:08 +02:00
|
|
|
//Auxillary windows.
|
2014-06-02 11:41:41 +03:00
|
|
|
void wxwindow_memorysearch_display(emulator_instance& inst);
|
|
|
|
void wxwindow_memorysearch_update(emulator_instance& inst);
|
|
|
|
void wxeditor_hexeditor_update(emulator_instance& inst);
|
2013-09-29 18:35:15 +03:00
|
|
|
class memory_search;
|
2014-06-02 11:41:41 +03:00
|
|
|
memory_search* wxwindow_memorysearch_active(emulator_instance& inst);
|
|
|
|
bool wxeditor_hexeditor_available(emulator_instance& inst);
|
|
|
|
bool wxeditor_hexeditor_jumpto(emulator_instance& inst, uint64_t addr);
|
|
|
|
void wxwindow_tasinput_update(emulator_instance& inst);
|
2012-01-06 17:28:01 +02:00
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
void runuifun(T fn)
|
|
|
|
{
|
2012-10-13 15:04:18 +03:00
|
|
|
_runuifun_async(functor_call_helper2<T>, new T(fn));
|
2012-01-06 17:28:01 +02:00
|
|
|
}
|
|
|
|
|
2012-01-20 16:44:53 +02:00
|
|
|
//Thrown by various dialog functions if canceled.
|
|
|
|
class canceled_exception : public std::runtime_error
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
canceled_exception();
|
|
|
|
};
|
|
|
|
|
|
|
|
//Prompt for stuff. These all can throw canceled_exception.
|
|
|
|
std::string pick_file_member(wxWindow* parent, const std::string& title, const std::string& startdir);
|
|
|
|
std::string pick_among(wxWindow* parent, const std::string& title, const std::string& prompt,
|
2013-05-17 17:22:24 +03:00
|
|
|
const std::vector<std::string>& choices, unsigned defaultchoice = 0);
|
2012-01-20 16:44:53 +02:00
|
|
|
std::string pick_text(wxWindow* parent, const std::string& title, const std::string& prompt,
|
|
|
|
const std::string& dflt = "", bool multiline = false);
|
|
|
|
//Show message box with OK button.
|
|
|
|
void show_message_ok(wxWindow* parent, const std::string& title, const std::string& text, int icon);
|
|
|
|
|
2014-05-18 03:28:48 +03:00
|
|
|
//Run function and show errors. Returns true on error.
|
2014-05-18 19:58:56 +03:00
|
|
|
|
2014-05-18 03:28:48 +03:00
|
|
|
bool run_show_error(wxWindow* parent, const std::string& title, const std::string& text, std::function<void()> fn);
|
2014-05-18 19:58:56 +03:00
|
|
|
void show_exception(wxWindow* parent, const std::string& title, const std::string& text, std::exception& e);
|
2014-05-31 18:16:05 +03:00
|
|
|
void show_exception_any(wxWindow* parent, const std::string& title, const std::string& text, std::exception& e);
|
2012-01-20 16:44:53 +02:00
|
|
|
|
2012-01-06 17:28:01 +02:00
|
|
|
//Some important windows (if open).
|
|
|
|
extern wxwin_messages* msg_window;
|
|
|
|
extern wxwin_mainwindow* main_window;
|
2012-01-17 00:31:17 +02:00
|
|
|
extern std::string our_rom_name;
|
2012-09-19 12:13:08 +03:00
|
|
|
extern bool wxwidgets_exiting;
|
2012-01-06 17:28:01 +02:00
|
|
|
|
2013-01-16 17:12:05 +02:00
|
|
|
//Some important settings.
|
|
|
|
extern std::map<std::string, std::string> core_selections;
|
|
|
|
|
2014-02-04 21:16:38 +02:00
|
|
|
|
2012-01-06 17:28:01 +02:00
|
|
|
#endif
|