Add Gesture Propagation
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 11 May 2021 07:13:35 +0000 (16:13 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Tue, 8 Jun 2021 03:23:00 +0000 (12:23 +0900)
commit9a93ccc3212e0234ae9e852b6441871b16c96b22
treefebb39a4358c2d6cf2ed79fc604831cbdd23a4a3
parent05f14eb128643e883405ebc02dc8041599f42a68
Add Gesture Propagation

This is used when the parent actor wants to listen to gesture events.

example)
  The child is overlapped on the parent.
  So, if you tap a child, the parent cannot listen to the tap event.
  Now, If set to SetNeedGesturePropagation(true), the parent can receive gesture events.

 {
     Actor parent = Actor::New();
     Actor child = Actor::New();
     parent.Add(child);
     pTapDetector = TapGestureDetector::New();
     cTapDetector = TapGestureDetector::New();
     pTapDetector.Attach(parent);
     cTapDetector.Attach(child);
     pTapDetector.DetectedSignal().Connect(this, &OnParentTap);
     cTapDetector.DetectedSignal().Connect(this, &OnChildTap);
  }

  void OnChildTap(Dali::Actor actor, const Dali::TapGesture& tap)
  {
     // If you set SetNeedGesturePropagation to true here, the parent actor can also listen to events
     Dali::DevelActor::SetNeedGesturePropagation(Self(), true);
  }

Change-Id: I0e6c16c2b2dec1dfa873caa453302cc746c3f258
automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp
automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp
automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp
dali/devel-api/actors/actor-devel.cpp
dali/devel-api/actors/actor-devel.h [changed mode: 0755->0644]
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h
dali/internal/event/events/gesture-processor.cpp