Fix number of compile errors and warnings with GCC 14
[lsnes.git] / include / platform / wxwidgets / menu_branches.hpp
blobe0d973efbb5b3a98f6627433ace427da9b19430e
1 #ifndef _plat_wxwidgets__menu_branches__hpp__included__
2 #define _plat_wxwidgets__menu_branches__hpp__included__
4 #include "core/dispatch.hpp"
5 #include <functional>
6 #include <wx/string.h>
7 #include <wx/wx.h>
8 #include <map>
9 #include <set>
10 #include <vector>
12 class emulator_instance;
14 class branches_menu : public wxMenu
16 public:
17 branches_menu(wxWindow* win, emulator_instance& inst, int wxid_low, int wxid_high);
18 ~branches_menu();
19 void on_select(wxCommandEvent& e);
20 void update();
21 bool any_enabled();
22 struct miteminfo
24 miteminfo(wxMenuItem* it, bool ismenu, wxMenu* p)
25 : item(it), is_menu(ismenu), parent(p)
28 wxMenuItem* item;
29 bool is_menu;
30 wxMenu* parent;
32 void set_disabler(std::function<void(bool enabled)> fn) { disabler_fn = fn; }
33 private:
34 struct dispatch::target<> branchchange;
35 wxWindow* pwin;
36 int wxid_range_low;
37 int wxid_range_high;
38 std::map<int, uint64_t> branch_ids;
39 std::list<wxMenu*> menus;
40 std::list<miteminfo> otheritems;
41 std::function<void(bool enabled)> disabler_fn;
42 emulator_instance& inst;
45 #endif