Fix number of compile errors and warnings with GCC 14
[lsnes.git] / include / platform / wxwidgets / menu_recent.hpp
blobb6a784d9635011476e3a3229532b8455ee126324
1 #ifndef _plat_wxwidgets__menu_recent__hpp__included__
2 #define _plat_wxwidgets__menu_recent__hpp__included__
4 #include <wx/string.h>
5 #include <wx/wx.h>
6 #include "library/recentfiles.hpp"
7 #include <map>
9 class emulator_instance;
11 template<class T>
12 class recent_menu : public wxMenu
14 public:
15 recent_menu(wxWindow* win, emulator_instance& _inst, int wxid_low, int wxid_high, const std::string& cfg,
16 void (*cb)(emulator_instance& inst, const T& name)) __attribute__((noinline));
17 void on_select(wxCommandEvent& e);
18 void update();
19 void add(const T& file);
20 private:
21 emulator_instance& inst;
22 class rhook : public recentfiles::hook
24 public:
25 rhook(recent_menu& _pmenu) : pmenu(_pmenu) {}
26 ~rhook() {}
27 void operator()() { pmenu.update(); }
28 private:
29 recent_menu& pmenu;
30 } hook;
31 recentfiles::set<T> rfiles;
32 wxWindow* pwin;
33 std::map<int, T> entries;
34 std::map<int, wxMenuItem*> items;
35 int wxid_range_low;
36 int wxid_range_high;
37 void (*callback)(emulator_instance& inst, const T& name);
40 #endif