summaryrefslogtreecommitdiff
path: root/src/hotkeys.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-06-15 15:28:09 +0000
committerfrosch <frosch@openttd.org>2013-06-15 15:28:09 +0000
commit1b8b1f3f6cbd65b73399b1d39aacb7fb674a091c (patch)
tree555791c9e1370b2caba036286b98f64efe970bd3 /src/hotkeys.h
parent40c2864e4dd478693ef6c108cc95cd2e6b5e70d0 (diff)
downloadopenttd-1b8b1f3f6cbd65b73399b1d39aacb7fb674a091c.tar.xz
(svn r25410) -Codechange: Put all hotkeys of a window into a static HotkeyList member.
Diffstat (limited to 'src/hotkeys.h')
-rw-r--r--src/hotkeys.h25
1 files changed, 24 insertions, 1 deletions
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);