InputManager.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 #include <ewol/widget/Widget.hpp>
8 
9 #define MAX_MANAGE_INPUT (15)
10 
11 namespace ewol {
12  namespace context {
17  class InputPoperty {
18  public:
19  bool isUsed;
20  int32_t destinationInputId;
21  echrono::Clock lastTimeEvent;
22  ewol::WidgetWeak curentWidgetEvent;
23  vec2 origin;
24  vec2 size;
25  vec2 downStart;
26  vec2 posEvent;
27  bool isDown;
28  bool isInside;
29  int32_t nbClickEvent; // 0 .. 1 .. 2 .. 3
30  };
31 
36  class InputLimit {
37  public:
38  echrono::Duration sepatateTime;
39  int32_t DpiOffset;
40  };
41  class Context;
42  class InputManager{
43  // special grab pointer mode :
44  private:
45  ewol::WidgetWeak m_grabWidget;
46  private:
47  int32_t m_dpi;
48  InputLimit m_eventInputLimit;
49  InputLimit m_eventMouseLimit;
50  void calculateLimit();
51  InputPoperty m_eventInputSaved[MAX_MANAGE_INPUT];
52  InputPoperty m_eventMouseSaved[MAX_MANAGE_INPUT];
53  void abortElement(InputPoperty* _eventTable, int32_t _idInput, enum gale::key::type _type);
54  void cleanElement(InputPoperty* _eventTable, int32_t _idInput);
64  bool localEventInput(enum gale::key::type _type,
65  ewol::WidgetShared _destWidget,
66  int32_t _IdInput,
67  enum gale::key::status _typeEvent,
68  vec2 _pos);
78  int32_t localGetDestinationId(enum gale::key::type _type,
79  ewol::WidgetShared _destWidget,
80  int32_t _realInputId);
81  private:
82  ewol::Context& m_context;
83  public:
84  InputManager(ewol::Context& _context);
85  ~InputManager();
86  void setDpi(int32_t _newDPI);
87 
88  // note if id<0 == > the it was finger event ...
89  void motion(enum gale::key::type _type, int _pointerID, vec2 _pos );
90  void state(enum gale::key::type _type, int _pointerID, bool _isDown, vec2 _pos);
91  public:
95  void newLayerSet();
101  void transfertEvent(ewol::WidgetShared _source, ewol::WidgetShared _destination);
106  void grabPointer(ewol::WidgetShared _widget);
110  void unGrabPointer();
111  private:
112  gale::key::Special m_specialKey;
113  public:
114  void setLastKeyboardSpecial(const gale::key::Special& _specialKey) {
115  m_specialKey = _specialKey;
116  }
117  };
118  };
119 };
120 
Definition: InputManager.hpp:42
internal structure
Definition: InputManager.hpp:36
internal structure
Definition: InputManager.hpp:17
Definition: Area.hpp:16
Definition: Context.hpp:26