From 1b8b1f3f6cbd65b73399b1d39aacb7fb674a091c Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 15 Jun 2013 15:28:09 +0000 Subject: (svn r25410) -Codechange: Put all hotkeys of a window into a static HotkeyList member. --- src/hotkeys.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/hotkeys.h') diff --git a/src/hotkeys.h b/src/hotkeys.h index 87fafe2a1..ce57de6f6 100644 --- a/src/hotkeys.h +++ b/src/hotkeys.h @@ -32,7 +32,30 @@ struct Hotkey { #define HOTKEY_LIST_END Hotkey((uint16)0, NULL, -1) -int CheckHotkeyMatch(Hotkey *list, uint16 keycode, bool global_only = false); +struct IniFile; + +/** + * List of hotkeys for a window. + */ +struct HotkeyList { + HotkeyList(const char *ini_group, Hotkey *items); + ~HotkeyList(); + + void Load(IniFile *ini); + void Save(IniFile *ini) const; + + int CheckMatch(uint16 keycode, bool global_only = false) const; + +private: + const char *ini_group; + Hotkey *items; + + /** + * Dummy private copy constructor to prevent compilers from + * copying the structure, which fails due to _hotkey_lists. + */ + HotkeyList(const HotkeyList &other); +}; bool IsQuitKey(uint16 keycode); -- cgit v1.2.3-54-g00ecf