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