Add <functional> to files that use std::function
[lsnes.git] / include / platform / wxwidgets / menu_projects.hpp
bloba2b1e4cde4c544f5a59a03381d322f5de2b985c1
1 #ifndef _plat_wxwidgets__menu_projects__hpp__included__
2 #define _plat_wxwidgets__menu_projects__hpp__included__
4 #include "core/dispatch.hpp"
5 #include "library/recentfiles.hpp"
6 #include <functional>
7 #include <wx/string.h>
8 #include <wx/wx.h>
9 #include <map>
10 #include <set>
11 #include <vector>
13 class emulator_instance;
15 class projects_menu : public wxMenu
17 public:
18 projects_menu(wxWindow* win, emulator_instance& _inst, int wxid_low, int wxid_high, const std::string& cfg,
19 std::function<void(const std::string& id)> cb);
20 ~projects_menu();
21 void on_select(wxCommandEvent& e);
22 void update();
23 void add(recentfiles::namedobj obj) { rfiles.add(obj); }
24 private:
25 emulator_instance& inst;
26 class rhook : public recentfiles::hook
28 public:
29 rhook(projects_menu& _pmenu) : pmenu(_pmenu) {}
30 ~rhook() {}
31 void operator()() { pmenu.update(); }
32 private:
33 projects_menu& pmenu;
34 } hook;
35 wxWindow* pwin;
36 int wxid_range_low;
37 int wxid_range_high;
38 std::map<int, wxMenuItem*> items;
39 std::map<int, recentfiles::namedobj> entries;
40 std::function<void(std::string id)> selected_cb;
41 recentfiles::set<recentfiles::namedobj> rfiles;
44 #endif