gramods
ButtonsMapper.hh
1 
2 #ifndef GRAMODS_TRACK_BUTTONSMAPPER
3 #define GRAMODS_TRACK_BUTTONSMAPPER
4 
5 #include <gmTrack/ButtonsTracker.hh>
6 #include <gmTrack/export.hh>
7 
8 #include <gmCore/io_size.hh>
9 
10 #include <gmCore/OFactory.hh>
11 
12 BEGIN_NAMESPACE_GMTRACK;
13 
21  : public ButtonsTracker {
22 
23 public:
24 
29  struct ButtonIdx {
30  static gmTrack_API const size_t MAIN; //< 0
31  static gmTrack_API const size_t SECONDARY; //< 1
32  static gmTrack_API const size_t MENU; //< 2
33  };
34 
40  void setButtonsTracker(std::shared_ptr<ButtonsTracker> bt);
41 
48  void addMapping(gmCore::size2 m);
49 
56  void setMainButton(int idx);
57 
64  void setSecondaryButton(int idx);
65 
72  void setMenuButton(int idx);
73 
79  bool getButtons(ButtonsSample &p) override;
80 
86  void traverse(Visitor *visitor) override;
87 
88  GM_OFI_DECLARE;
89 
90 private:
91 
92  std::map<size_t, size_t> mappings;
93  std::shared_ptr<ButtonsTracker> buttonsTracker;
94 };
95 
96 END_NAMESPACE_GMTRACK;
97 
98 #endif
Buttons filter that re-maps button indices to a standard order for application compatibility between ...
Definition: ButtonsMapper.hh:21
The base of ButtonsTrackers, reporting button states.
Definition: ButtonsTracker.hh:18
std::array< size_t, 2 > size2
Array of 2 size_t.
Definition: io_size.hh:9
The visitor of a design pattern for automatic traversal.
Definition: Object.hh:75
Standard button index, in the ButtonsSample::buttons map, for compatibility.
Definition: ButtonsMapper.hh:29
A sample containing the state of any number of buttons.
Definition: ButtonsTracker.hh:27