Add intercept touch event 58/245258/18
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 6 Oct 2020 06:38:33 +0000 (15:38 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Wed, 14 Oct 2020 02:58:14 +0000 (02:58 +0000)
commit6d08ede3a8e9fcfd9c4ca23f5d3fb9b35357f0a4
tree4b469a7fe98ce70d92467084aa76aefc5cac88ac
parentc4252ac042021ce3bade636a5e7d8c0f0916857a
Add intercept touch event

The Touch event calls the TouchEvent callback by going back from the last child actor to the parent via hitTest.
InterceptTouchEvent checks the touch event in the parent first.
Returning false from interceptTouchEvent allows child actors to receive TouchEvents.
If it returns true, the actor will receive a TouchEvent.

for example

   Actor parent = Actor::New();
   Actor actor = Actor::New();
   parent.Add(actor);
   actor.TouchedSignal().Connect(&application, functor);
   parent.TouchedSignal().Connect(&application, parentFunctor);

The callbacks are called in the order functor -> parentFunctor.

If you connect interceptTouchSignal to parentActor.

   Dali::DevelActor::InterceptTouchedSignal(parent).Connect(&application, interceptFunctor);

When interceptFunctor returns false, it is called in the same order functor -> parentFunctor.
If it returns true, it means that the TouchEvent was intercepted.
So the child actor will not be able to receive touch events.
Only the parentFunctor is called.

Change-Id: Ib6887adbcee59168a7caf7f36bcc400500c626e8
automated-tests/src/dali/utc-Dali-TouchProcessing.cpp [changed mode: 0644->0755]
dali/devel-api/actors/actor-devel.cpp [changed mode: 0644->0755]
dali/devel-api/actors/actor-devel.h [changed mode: 0644->0755]
dali/internal/event/actors/actor-impl.cpp [changed mode: 0644->0755]
dali/internal/event/actors/actor-impl.h [changed mode: 0644->0755]
dali/internal/event/events/touch-event-processor.cpp [changed mode: 0644->0755]