summaryrefslogtreecommitdiff
path: root/src/inputmanager.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-30 22:53:27 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-30 22:53:27 +0300
commit5cbd0d2cb7086fda592c00dbc3b07d06af95f080 (patch)
treed36b4ac344f31f34311c7cb7a9a637ed48356e3e /src/inputmanager.h
parent4210163dae7d6266923ab11f78b631173c9533e3 (diff)
downloadmv-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.gz
mv-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.bz2
mv-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.xz
mv-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.zip
Add const to more classes.
Diffstat (limited to 'src/inputmanager.h')
-rw-r--r--src/inputmanager.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/inputmanager.h b/src/inputmanager.h
index ce1724077..394819816 100644
--- a/src/inputmanager.h
+++ b/src/inputmanager.h
@@ -53,10 +53,12 @@ enum KeyTypes
struct KeyItem
{
- KeyItem() : type(-1), value(-1)
+ KeyItem() :
+ type(-1), value(-1)
{ }
- KeyItem(int type0, int value0) : type(type0), value(value0)
+ KeyItem(const int type0, const int value0) :
+ type(type0), value(value0)
{ }
int type;
@@ -96,44 +98,44 @@ class InputManager
bool handleEvent(const SDL_Event &event);
- bool checkKey(const KeyData *key);
+ bool checkKey(const KeyData *const key) const;
void retrieve();
- void store();
+ void store() const;
void resetKeys();
- void makeDefault(int i);
+ void makeDefault(const int i);
- bool hasConflicts(int &key1, int &key2);
+ bool hasConflicts(int &key1, int &key2) const;
void callbackNewKey();
KeyFunction &getKey(int index);
- std::string getKeyValueString(int index) const;
+ std::string getKeyValueString(const int index) const;
- std::string getKeyStringLong(int index) const;
+ std::string getKeyStringLong(const int index) const;
- void addActionKey(int action, int type, int val);
+ void addActionKey(const int action, const int type, const int val);
- void setNewKey(const SDL_Event &event, int type);
+ void setNewKey(const SDL_Event &event, const int type);
void unassignKey();
- bool isActionActive(int index) const;
+ bool isActionActive(const int index) const;
/**
* Set the index of the new key to be assigned.
*/
- void setNewKeyIndex(int value)
+ void setNewKeyIndex(const int value)
{ mNewKeyIndex = value; }
/**
* Set a reference to the key setup window.
*/
- void setSetupInput(Setup_Input *setupInput)
+ void setSetupInput(Setup_Input *const setupInput)
{ mSetupInput = setupInput; }
/**
@@ -144,19 +146,19 @@ class InputManager
void updateKeyActionMap(KeyToActionMap &actionMap,
KeyToIdMap &idMap, KeyTimeMap &keyTimeMap,
- int type);
+ const int type) const;
- bool invokeKey(const KeyData *key, int keyNum);
+ bool invokeKey(const KeyData *const key, const int keyNum);
- bool handleAssignKey(const SDL_Event &event, int type);
+ bool handleAssignKey(const SDL_Event &event, const int type);
- void handleRepeat();
+ void handleRepeat() const;
- bool triggerAction(const KeysVector *ptrs);
+ bool triggerAction(const KeysVector *const ptrs);
- int getKeyIndex(int value, int grp, int type) const;
+ int getKeyIndex(const int value, const int grp, const int type) const;
- void update();
+ void update() const;
void updateConditionMask();