2012-01-06 17:28:01 +02:00
|
|
|
#ifndef _plat_wxwidgets__window_mainwindow__hpp__included__
|
|
|
|
#define _plat_wxwidgets__window_mainwindow__hpp__included__
|
|
|
|
|
2013-11-11 01:49:06 +02:00
|
|
|
#include "core/filedownload.hpp"
|
2013-09-22 17:39:52 +03:00
|
|
|
#include "core/window.hpp"
|
2012-02-07 16:34:58 +02:00
|
|
|
#include "platform/wxwidgets/window_status.hpp"
|
2012-09-25 23:05:57 +03:00
|
|
|
#include "platform/wxwidgets/menu_recent.hpp"
|
2013-09-22 17:39:52 +03:00
|
|
|
#include "platform/wxwidgets/menu_loadrom.hpp"
|
2014-02-25 03:48:19 +02:00
|
|
|
#include "platform/wxwidgets/menu_projects.hpp"
|
2013-07-07 13:54:56 +03:00
|
|
|
#include "library/dispatch.hpp"
|
2013-09-22 17:39:52 +03:00
|
|
|
#include "library/recentfiles.hpp"
|
2012-01-18 20:56:54 +02:00
|
|
|
|
2012-01-06 17:28:01 +02:00
|
|
|
#include <stack>
|
|
|
|
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/wx.h>
|
|
|
|
|
|
|
|
class wxwin_mainwindow : public wxFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
class panel : public wxPanel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
panel(wxWindow* win);
|
|
|
|
void on_paint(wxPaintEvent& e);
|
|
|
|
void request_paint();
|
|
|
|
void on_erase(wxEraseEvent& e);
|
|
|
|
void on_keyboard_down(wxKeyEvent& e);
|
|
|
|
void on_keyboard_up(wxKeyEvent& e);
|
|
|
|
void on_mouse(wxMouseEvent& e);
|
|
|
|
};
|
2014-02-16 01:05:51 +02:00
|
|
|
wxwin_mainwindow(bool fscreen);
|
2014-03-22 13:28:53 +02:00
|
|
|
~wxwin_mainwindow();
|
2012-01-06 17:28:01 +02:00
|
|
|
void request_paint();
|
|
|
|
void notify_update() throw();
|
2012-01-18 20:56:54 +02:00
|
|
|
void notify_update_status() throw();
|
2012-03-26 23:50:14 +03:00
|
|
|
void notify_resized() throw();
|
2012-01-06 17:28:01 +02:00
|
|
|
void notify_exit() throw();
|
2013-01-06 23:06:08 +02:00
|
|
|
void refresh_title() throw();
|
2012-01-06 17:28:01 +02:00
|
|
|
void on_close(wxCloseEvent& e);
|
|
|
|
void menu_start(wxString name);
|
|
|
|
void menu_special(wxString name, wxMenu* menu);
|
2014-01-18 11:50:19 +02:00
|
|
|
wxMenuItem* menu_special_sub(wxString name, wxMenu* menu);
|
2012-01-06 17:28:01 +02:00
|
|
|
void menu_entry(int id, wxString name);
|
|
|
|
void menu_entry_check(int id, wxString name);
|
|
|
|
void menu_start_sub(wxString name);
|
2012-04-03 12:30:42 +03:00
|
|
|
void menu_end_sub();
|
2012-01-06 17:28:01 +02:00
|
|
|
bool menu_ischecked(int id);
|
|
|
|
void menu_check(int id, bool newstate);
|
2013-05-08 15:42:44 +03:00
|
|
|
void menu_enable(int id, bool newstate);
|
2012-01-06 17:28:01 +02:00
|
|
|
void menu_separator();
|
|
|
|
void handle_menu_click(wxCommandEvent& e);
|
2014-04-01 00:13:36 +03:00
|
|
|
void update_statusbar();
|
2013-07-04 18:17:07 +03:00
|
|
|
void action_updated();
|
2013-08-11 22:37:11 +03:00
|
|
|
void enter_or_leave_fullscreen(bool fs);
|
2013-08-25 17:32:56 +03:00
|
|
|
void request_rom(rom_request& req);
|
2014-02-25 02:11:36 +02:00
|
|
|
recent_menu<recentfiles::multirom>* recent_roms;
|
|
|
|
recent_menu<recentfiles::path>* recent_movies;
|
|
|
|
recent_menu<recentfiles::path>* recent_scripts;
|
2013-09-22 17:39:52 +03:00
|
|
|
loadrom_menu* loadroms;
|
2013-11-11 01:49:06 +02:00
|
|
|
file_download* download_in_progress;
|
2012-01-06 17:28:01 +02:00
|
|
|
private:
|
2013-09-22 17:39:52 +03:00
|
|
|
void do_load_rom_image(core_type* t);
|
2012-01-20 16:44:53 +02:00
|
|
|
void handle_menu_click_cancelable(wxCommandEvent& e);
|
2014-02-25 03:48:19 +02:00
|
|
|
void project_selected(const std::string& id);
|
2012-01-06 17:28:01 +02:00
|
|
|
panel* gpanel;
|
|
|
|
wxMenu* current_menu;
|
|
|
|
wxMenuBar* menubar;
|
2013-03-28 11:33:25 +02:00
|
|
|
wxStatusBar* statusbar;
|
2012-01-18 20:56:54 +02:00
|
|
|
wxwin_status::panel* spanel;
|
2012-03-26 20:34:25 +03:00
|
|
|
bool spanel_shown;
|
2012-09-25 21:18:12 +03:00
|
|
|
wxwin_status* mwindow;
|
2012-03-26 20:34:25 +03:00
|
|
|
wxFlexGridSizer* toplevel;
|
2012-01-06 17:28:01 +02:00
|
|
|
std::map<int, wxMenuItem*> checkitems;
|
|
|
|
std::stack<wxMenu*> upper;
|
2013-06-30 13:20:23 +03:00
|
|
|
void* sysmenu;
|
2012-01-06 17:28:01 +02:00
|
|
|
void* ahmenu;
|
2013-01-24 18:14:37 +02:00
|
|
|
void* sounddev1;
|
|
|
|
void* sounddev2;
|
2012-01-11 01:21:13 +02:00
|
|
|
void* dmenu;
|
2014-02-25 03:48:19 +02:00
|
|
|
projects_menu* projects;
|
2013-12-04 18:23:58 +02:00
|
|
|
wxTimer* focus_timer;
|
2014-04-01 14:25:11 +03:00
|
|
|
wxTimer* status_timer;
|
2013-12-19 01:04:42 +02:00
|
|
|
struct dispatch::target<> corechange;
|
|
|
|
struct dispatch::target<> titlechange;
|
|
|
|
struct dispatch::target<> newcore;
|
|
|
|
struct dispatch::target<bool> unmuted;
|
|
|
|
struct dispatch::target<bool> modechange;
|
2012-01-06 17:28:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|