aboutsummaryrefslogtreecommitdiff
path: root/backends/keymapper
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-24 15:17:42 +0000
committerJohannes Schickel2009-05-24 15:17:42 +0000
commitb3c6751b9b7fc1401fd5e87a034cdaec92b67b20 (patch)
treeaa00dba58fb88ea2e095b886963370c7290c692b /backends/keymapper
parent7c1eb057146af11793c627327f3fefe309d27fbb (diff)
downloadscummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.tar.gz
scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.tar.bz2
scummvm-rg350-b3c6751b9b7fc1401fd5e87a034cdaec92b67b20.zip
Strip trailing whitespaces in the whole code base.
svn-id: r40867
Diffstat (limited to 'backends/keymapper')
-rw-r--r--backends/keymapper/action.cpp2
-rw-r--r--backends/keymapper/action.h10
-rw-r--r--backends/keymapper/hardware-key.h10
-rw-r--r--backends/keymapper/keymap.cpp16
-rw-r--r--backends/keymapper/keymap.h10
-rw-r--r--backends/keymapper/keymapper.cpp4
-rw-r--r--backends/keymapper/keymapper.h16
-rw-r--r--backends/keymapper/remap-dialog.cpp14
8 files changed, 41 insertions, 41 deletions
diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp
index 2541f60ddd..3feb593f19 100644
--- a/backends/keymapper/action.cpp
+++ b/backends/keymapper/action.cpp
@@ -31,7 +31,7 @@
namespace Common {
-Action::Action(Keymap *boss, const char *i, String des, ActionType typ,
+Action::Action(Keymap *boss, const char *i, String des, ActionType typ,
KeyType prefKey, int pri, int flg)
: _boss(boss), description(des), type(typ), preferredKey(prefKey),
priority(pri), flags(flg), _hwKey(0) {
diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h
index 04d8dd4067..31576e2960 100644
--- a/backends/keymapper/action.h
+++ b/backends/keymapper/action.h
@@ -63,12 +63,12 @@ private:
Keymap *_boss;
public:
- Action(Keymap *boss, const char *id, String des = "",
+ Action(Keymap *boss, const char *id, String des = "",
ActionType typ = kGenericActionType,
KeyType prefKey = kGenericKeyType,
int pri = 0, int flg = 0 );
- void addEvent(const Event &evt) {
+ void addEvent(const Event &evt) {
events.push_back(evt);
}
@@ -101,7 +101,7 @@ public:
addEvent(evt);
}
- Keymap *getParent() {
+ Keymap *getParent() {
return _boss;
}
@@ -111,10 +111,10 @@ public:
};
struct ActionPriorityComp : public BinaryFunction<Action, Action, bool> {
- bool operator()(const Action *x, const Action *y) const {
+ bool operator()(const Action *x, const Action *y) const {
return x->priority > y->priority;
}
- bool operator()(const Action &x, const Action &y) const {
+ bool operator()(const Action &x, const Action &y) const {
return x.priority > y.priority;
}
};
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index e70148cb0f..8ddeada51e 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -38,17 +38,17 @@ namespace Common {
#define HWKEY_ID_SIZE (30)
/**
-* Describes an available hardware key
+* Describes an available hardware key
*/
struct HardwareKey {
/** unique id used for saving/loading to config */
char hwKeyId[HWKEY_ID_SIZE];
/** Human readable description */
- String description;
+ String description;
- /**
- * The KeyState that is generated by the back-end
+ /**
+ * The KeyState that is generated by the back-end
* when this hardware key is pressed.
*/
KeyState key;
@@ -69,7 +69,7 @@ struct HardwareKey {
* Simple class to encapsulate a device's set of HardwareKeys.
* Each device should instantiate this and call addHardwareKey a number of times
* in its constructor to define the device's available keys.
- */
+ */
class HardwareKeySet {
public:
diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp
index 13be1ad8bc..840ba5a0c5 100644
--- a/backends/keymapper/keymap.cpp
+++ b/backends/keymapper/keymap.cpp
@@ -124,7 +124,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
if (!_configDomain)
return;
- ConfigManager::Domain::iterator it;
+ ConfigManager::Domain::iterator it;
String prefix = KEYMAP_KEY_PREFIX + _name + "_";
for (it = _configDomain->begin(); it != _configDomain->end(); it++) {
@@ -138,7 +138,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
Action *ua = getAction(actionId);
if (!ua) {
- warning("'%s' keymap does not contain Action with ID %s",
+ warning("'%s' keymap does not contain Action with ID %s",
_name.c_str(), actionId);
_configDomain->erase(key);
@@ -199,7 +199,7 @@ bool Keymap::isComplete(const HardwareKeySet *hwKeys) {
// TODO:
// - current weakness:
-// - if an action finds a key with required type but a parent action with
+// - if an action finds a key with required type but a parent action with
// higher priority is using it, that key is never used
void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
// Create copies of action and key lists.
@@ -208,7 +208,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
List<Action*>::iterator actIt;
List<const HardwareKey*>::iterator keyIt, selectedKey;
-
+
// Remove actions and keys from local lists that have already been mapped.
actIt = actions.begin();
@@ -227,16 +227,16 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
// Sort remaining actions by priority.
ActionPriorityComp priorityComp;
sort(actions.begin(), actions.end(), priorityComp);
-
+
// First mapping pass:
- // - Match if a key's preferred action type is the same as the action's
+ // - Match if a key's preferred action type is the same as the action's
// type, or vice versa.
// - Priority is given to:
// - keys that match action types over key types.
// - keys that have not been used by parent maps.
// - If a key has been used by a parent map the new action must have a
// higher priority than the parent action.
- // - As soon as the number of skipped actions equals the number of keys
+ // - As soon as the number of skipped actions equals the number of keys
// remaining we stop matching. This means that the second pass will assign keys
// to these higher priority skipped actions.
uint skipped = 0;
@@ -317,7 +317,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
if (selectedKey != keys.end()) {
act->mapKey(*selectedKey);
keys.erase(selectedKey);
- } else {// no match = no keys left
+ } else {// no match = no keys left
break;
}
}
diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h
index 35ad732bdc..615fd9097d 100644
--- a/backends/keymapper/keymap.h
+++ b/backends/keymapper/keymap.h
@@ -48,7 +48,7 @@ class HardwareKeySet;
template<> struct Hash<KeyState>
: public UnaryFunction<KeyState, uint> {
- uint operator()(const KeyState &val) const {
+ uint operator()(const KeyState &val) const {
return (uint)val.keycode | ((uint)val.flags << 24);
}
};
@@ -78,7 +78,7 @@ public:
* @return a pointer to the Action or 0 if no
*/
Action *getMappedAction(const KeyState& ks) const;
-
+
void setConfigDomain(ConfigManager::Domain *dom);
/**
@@ -94,7 +94,7 @@ public:
*/
void saveMappings();
-
+
void automaticMapping(HardwareKeySet *hwKeys);
/**
@@ -110,7 +110,7 @@ private:
friend struct Action;
/**
- * Adds a new Action to this Map,
+ * Adds a new Action to this Map,
* adding it at the back of the internal array
* @param action the Action to add
*/
@@ -141,7 +141,7 @@ private:
String _name;
Keymap *_parent;
List<Action*> _actions;
- HashMap<KeyState, Action*> _keymap;
+ HashMap<KeyState, Action*> _keymap;
ConfigManager::Domain *_configDomain;
};
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index 4668d34421..c74aa45b17 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -86,7 +86,7 @@ void Keymapper::addGlobalKeymap(Keymap *keymap) {
void Keymapper::addGameKeymap(Keymap *keymap) {
if (ConfMan.getActiveDomain() == 0)
error("Call to Keymapper::addGameKeymap when no game loaded");
-
+
// Detect whether the active game changed since last call.
// If so, flush the game key configuration.
if (_gameDomain.getConfigDomain() != ConfMan.getActiveDomain()) {
@@ -118,7 +118,7 @@ void Keymapper::initKeymap(Domain &domain, Keymap *map) {
void Keymapper::cleanupGameKeymaps() {
// Flush all game specific keymaps
_gameDomain.deleteAllKeyMaps();
-
+
// Now restore the stack of active maps. Re-add all global keymaps, drop
// the game specific (=deleted) ones.
Stack<MapRecord> newStack;
diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h
index 3bc9ea2327..c82f64b0ed 100644
--- a/backends/keymapper/keymapper.h
+++ b/backends/keymapper/keymapper.h
@@ -41,7 +41,7 @@ namespace Common {
class Keymapper {
public:
-
+
struct MapRecord {
Keymap* keymap;
bool inherit;
@@ -53,11 +53,11 @@ public:
IgnoreCase_Hash, IgnoreCase_EqualTo> {
public:
Domain() : _configDomain(0) {}
- ~Domain() {
+ ~Domain() {
deleteAllKeyMaps();
}
- void setConfigDomain(ConfigManager::Domain *confDom) {
+ void setConfigDomain(ConfigManager::Domain *confDom) {
_configDomain = confDom;
}
ConfigManager::Domain *getConfigDomain() {
@@ -69,7 +69,7 @@ public:
void deleteAllKeyMaps();
Keymap *getKeymap(const String& name);
-
+
private:
ConfigManager::Domain *_configDomain;
};
@@ -120,10 +120,10 @@ public:
Keymap *getKeymap(const String& name, bool &global);
/**
- * Push a new keymap to the top of the active stack, activating
+ * Push a new keymap to the top of the active stack, activating
* it for use.
* @param name name of the keymap to push
- * @param inherit if true keymapper will iterate down the
+ * @param inherit if true keymapper will iterate down the
* stack if it cannot find a key in the new map
* @return true if succesful
*/
@@ -136,7 +136,7 @@ public:
/**
* @brief Map a key press event.
- * If the active keymap contains a Action mapped to the given key, then
+ * If the active keymap contains a Action mapped to the given key, then
* the Action's events are pushed into the EventManager's event queue.
* @param key key that was pressed
* @param keyDown true for key down, false for key up
@@ -180,7 +180,7 @@ private:
HardwareKeySet *_hardwareKeys;
void pushKeymap(Keymap *newMap, bool inherit, bool global);
-
+
Action *getAction(const KeyState& key);
void executeAction(const Action *act, bool keyDown);
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 35706e89dd..389ca7d1f9 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -146,7 +146,7 @@ void RemapDialog::reflowLayout() {
_colCount = (areaW - scrollbarWidth) / colWidth;
_rowCount = (areaH + spacing) / (buttonHeight + spacing);
- if (_colCount <= 0 || _rowCount <= 0)
+ if (_colCount <= 0 || _rowCount <= 0)
error("Remap dialog too small to display any keymaps!");
_scrollBar->resize(areaX + areaW - scrollbarWidth, areaY, scrollbarWidth, areaH);
@@ -164,9 +164,9 @@ void RemapDialog::reflowLayout() {
ActionWidgets widg;
if (i >= _keymapWidgets.size()) {
- widg.actionText =
+ widg.actionText =
new GUI::StaticTextWidget(this, 0, 0, 0, 0, "", Graphics::kTextAlignRight);
- widg.keyButton =
+ widg.keyButton =
new GUI::ButtonWidget(this, 0, 0, 0, 0, "", kRemapCmd + i);
_keymapWidgets.push_back(widg);
} else {
@@ -208,7 +208,7 @@ void RemapDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 d
void RemapDialog::startRemapping(uint i) {
if (_topAction + i >= _currentActions.size())
- return;
+ return;
_remapTimeout = getMillis() + kRemapTimeoutDelay;
_activeRemapAction = _currentActions[_topAction + i].action;
@@ -287,7 +287,7 @@ void RemapDialog::loadKeymap() {
if (act->getMappedKey())
freeKeys.remove(act->getMappedKey());
}
-
+
// loop through remaining finding mappings for unmapped keys
if (top.inherit) {
for (int i = activeKeymaps.size() - 2; i >= 0; --i) {
@@ -365,7 +365,7 @@ void RemapDialog::refreshKeymap() {
widg.actionText->setVisible(true);
widg.keyButton->setVisible(true);
- actionI++;
+ actionI++;
} else {
widg.actionText->setVisible(false);
widg.keyButton->setVisible(false);
@@ -373,7 +373,7 @@ void RemapDialog::refreshKeymap() {
//widg.actionText->draw();
//widg.keyButton->draw();
}
- // need to redraw entire Dialog so that invisible
+ // need to redraw entire Dialog so that invisible
// widgets disappear
draw();
}