2012-01-06 17:28:01 +02:00
|
|
|
#ifndef _plat_wxwidgets__platform__hpp__included__
|
|
|
|
#define _plat_wxwidgets__platform__hpp__included__
|
|
|
|
|
|
|
|
#include "core/moviefile.hpp"
|
|
|
|
#include "core/window.hpp"
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <cstddef>
|
|
|
|
|
|
|
|
#include <wx/string.h>
|
|
|
|
|
|
|
|
class wxwin_mainwindow;
|
|
|
|
class wxwin_messages;
|
|
|
|
class wxwin_status;
|
|
|
|
class wxWindow;
|
|
|
|
class wxKeyEvent;
|
|
|
|
|
2012-04-07 11:42:22 +03:00
|
|
|
//Scaling
|
|
|
|
extern double horizontal_scale_factor;
|
|
|
|
extern double vertical_scale_factor;
|
|
|
|
extern int scaling_flags;
|
2013-01-19 20:16:55 +02:00
|
|
|
extern bool hflip_enabled;
|
|
|
|
extern bool vflip_enabled;
|
|
|
|
extern bool rotate_enabled;
|
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);
|
2013-05-03 15:39:27 +03:00
|
|
|
wxString towxstring(const std::u32string& str) throw(std::bad_alloc);
|
2012-01-06 17:28:01 +02:00
|
|
|
std::string tostdstring(const wxString& str) throw(std::bad_alloc);
|
|
|
|
void bring_app_foreground();
|
|
|
|
std::string pick_archive_member(wxWindow* parent, const std::string& filename) throw(std::bad_alloc);
|
|
|
|
void boot_emulator(loaded_rom& rom, moviefile& movie);
|
|
|
|
void handle_wx_keyboard(wxKeyEvent& e, bool polarity);
|
2012-04-19 12:35:25 +03:00
|
|
|
std::string map_keycode_to_key(int kcode);
|
2012-01-06 17:28:01 +02:00
|
|
|
void initialize_wx_keyboard();
|
|
|
|
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);
|
2012-08-24 20:24:18 +03:00
|
|
|
void show_projectwindow(wxWindow* modwin);
|
2012-01-06 17:28:01 +02:00
|
|
|
|
|
|
|
//Editor dialogs.
|
|
|
|
void wxeditor_authors_display(wxWindow* parent);
|
2012-02-20 21:15:51 +02:00
|
|
|
void wxeditor_hotkeys_display(wxWindow* parent);
|
2012-09-07 21:57:43 +03:00
|
|
|
void wxeditor_memorywatch_display(wxWindow* parent);
|
2012-09-08 20:29:44 +03:00
|
|
|
void wxeditor_subtitles_display(wxWindow* parent);
|
2012-02-20 21:15:51 +02:00
|
|
|
std::string wxeditor_keyselect(wxWindow* parent, bool clearable);
|
2012-08-29 16:25:05 +03:00
|
|
|
void wxsetingsdialog_display(wxWindow* parent, bool hotkeys_only);
|
2012-09-23 19:16:30 +03:00
|
|
|
void show_wxeditor_voicesub(wxWindow* parent);
|
2012-04-09 15:46:25 +03:00
|
|
|
void open_rom_select_window();
|
2013-01-26 13:20:39 +02:00
|
|
|
void open_vumeter_window(wxWindow* parent);
|
2013-02-03 16:01:21 +02:00
|
|
|
void wxeditor_movie_display(wxWindow* parent);
|
|
|
|
void wxeditor_movie_update();
|
2012-01-06 17:28:01 +02:00
|
|
|
|
2012-01-15 16:50:08 +02:00
|
|
|
//Auxillary windows.
|
|
|
|
void wxwindow_memorysearch_display();
|
2012-01-06 17:28:01 +02:00
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
void functor_call_helper2(void* args)
|
|
|
|
{
|
|
|
|
(*reinterpret_cast<T*>(args))();
|
|
|
|
delete reinterpret_cast<T*>(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
void runuifun(T fn)
|
|
|
|
{
|
|
|
|
_runuifun_async(functor_call_helper<T>, new T(fn));
|
|
|
|
}
|
|
|
|
|
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.
|
2013-03-25 11:28:06 +02:00
|
|
|
std::string pick_file(wxWindow* parent, const std::string& title, const std::string& startdir, bool forsave,
|
|
|
|
std::string ext = "");
|
2012-01-20 16:44:53 +02:00
|
|
|
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,
|
|
|
|
const std::vector<std::string>& choices);
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
#endif
|