]> git.tdb.fi Git - libs/gui.git/blob - source/input/controlscheme.cpp
Include the matching header first in .cpp files
[libs/gui.git] / source / input / controlscheme.cpp
1 #include "controlscheme.h"
2 #include <msp/core/maputils.h>
3 #include "control.h"
4
5 using namespace std;
6
7 namespace Msp {
8 namespace Input {
9
10 void ControlScheme::add(const string &name, Control &ctrl)
11 {
12         insert_unique(controls, name, &ctrl);
13 }
14
15 Control &ControlScheme::get(const string &name) const
16 {
17         return *get_item(controls, name);
18 }
19
20 Control *ControlScheme::find(const string &name) const
21 {
22         auto i = controls.find(name);
23         return (i!=controls.end() ? i->second : 0);
24 }
25
26 void ControlScheme::reset_edges()
27 {
28         for(const auto &kvp: controls)
29                 kvp.second->reset_edges();
30 }
31
32 } // namespace Input
33 } // namespace Msp