Recent Lua scripts
[lsnes.git] / include / platform / wxwidgets / window_mainwindow.hpp
blobe47e4c952593c0f8e8e16999aee5c4d37c895fdd
1 #ifndef _plat_wxwidgets__window_mainwindow__hpp__included__
2 #define _plat_wxwidgets__window_mainwindow__hpp__included__
4 #include "core/window.hpp"
5 #include "platform/wxwidgets/window_status.hpp"
6 #include "platform/wxwidgets/menu_recent.hpp"
7 #include "platform/wxwidgets/menu_loadrom.hpp"
8 #include "library/dispatch.hpp"
9 #include "library/recentfiles.hpp"
11 #include <stack>
13 #include <wx/string.h>
14 #include <wx/wx.h>
16 class wxwin_mainwindow : public wxFrame
18 public:
19 class panel : public wxPanel
21 public:
22 panel(wxWindow* win);
23 void on_paint(wxPaintEvent& e);
24 void request_paint();
25 void on_erase(wxEraseEvent& e);
26 void on_keyboard_down(wxKeyEvent& e);
27 void on_keyboard_up(wxKeyEvent& e);
28 void on_mouse(wxMouseEvent& e);
30 wxwin_mainwindow();
31 void request_paint();
32 void notify_update() throw();
33 void notify_update_status() throw();
34 void notify_resized() throw();
35 void notify_exit() throw();
36 void refresh_title() throw();
37 void on_close(wxCloseEvent& e);
38 void menu_start(wxString name);
39 void menu_special(wxString name, wxMenu* menu);
40 void menu_special_sub(wxString name, wxMenu* menu);
41 void menu_entry(int id, wxString name);
42 void menu_entry_check(int id, wxString name);
43 void menu_start_sub(wxString name);
44 void menu_end_sub();
45 bool menu_ischecked(int id);
46 void menu_check(int id, bool newstate);
47 void menu_enable(int id, bool newstate);
48 void menu_separator();
49 void handle_menu_click(wxCommandEvent& e);
50 void update_statusbar(const std::map<std::string, std::u32string>& vars);
51 void action_updated();
52 void enter_or_leave_fullscreen(bool fs);
53 void request_rom(rom_request& req);
54 recent_menu<recentfile_multirom>* recent_roms;
55 recent_menu<recentfile_path>* recent_movies;
56 recent_menu<recentfile_path>* recent_scripts;
57 loadrom_menu* loadroms;
58 private:
59 void do_load_rom_image(core_type* t);
60 void handle_menu_click_cancelable(wxCommandEvent& e);
61 panel* gpanel;
62 wxMenu* current_menu;
63 wxMenuBar* menubar;
64 wxStatusBar* statusbar;
65 wxwin_status::panel* spanel;
66 bool spanel_shown;
67 wxwin_status* mwindow;
68 wxFlexGridSizer* toplevel;
69 std::map<int, wxMenuItem*> checkitems;
70 std::stack<wxMenu*> upper;
71 void* sysmenu;
72 void* ahmenu;
73 void* sounddev1;
74 void* sounddev2;
75 void* dmenu;
76 struct dispatch_target<> corechange;
77 struct dispatch_target<> newcore;
78 struct dispatch_target<bool> unmuted;
79 struct dispatch_target<bool> modechange;
82 #endif