5 #ifndef __itouchevent__ 6 #define __itouchevent__ 11 #if VSTGUI_TOUCH_EVENT_HANDLING 37 bool targetIsSingleTouch;
40 Touch () : timeStamp (0), state (kUndefined), target (0), targetIsSingleTouch (false), tapCount (0) {}
42 using TouchPair = std::pair<int32_t, ITouchEvent::Touch>;
43 using TouchMap = std::map<int32_t, Touch>;
45 int32_t numTouches ()
const {
return static_cast<int32_t
> (touches.size ()); }
47 TouchMap::const_iterator begin ()
const {
return touches.begin (); }
48 TouchMap::const_iterator end ()
const {
return touches.end (); }
50 const Touch* find (int32_t identifier)
const 52 TouchMap::const_iterator it = touches.find (identifier);
53 if (it != touches.end ())
58 bool setTouchTarget (int32_t identifier, CView* view,
bool targetIsSingleTouch)
60 TouchMap::iterator it = touches.find (identifier);
61 if (it != touches.end () && it->second.target == 0)
63 it->second.target = view;
64 it->second.targetIsSingleTouch = targetIsSingleTouch;
70 bool unsetTouchTarget (int32_t identifier, CView* view)
72 TouchMap::iterator it = touches.find (identifier);
73 if (it != touches.end () && it->second.target == view)
75 it->second.target =
nullptr;
81 virtual double getTimeStamp ()
const = 0;
84 virtual ~ITouchEvent () noexcept = default;
91 #endif // VSTGUI_TOUCH_EVENT_HANDLING 93 #endif // __itouchevent__ Definition: customcontrols.cpp:8