Add Gesture Propagation 43/258143/17
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 11 May 2021 07:13:35 +0000 (16:13 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Mon, 31 May 2021 06:49:43 +0000 (15:49 +0900)
commit22633264ef03e463f3c11735eb88a4c8d4a0ec10
treeaedd6931d279273ad6383bea65359ede5c1de845
parent822aa247c8e17310ec1fc514b6195527439c1a5b
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