Revert "Removed TouchEvent from actor & stage"
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 19 Aug 2020 05:17:45 +0000 (14:17 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Wed, 19 Aug 2020 05:17:45 +0000 (14:17 +0900)
This reverts commit 0e446efe2d2c2a430d3d413b9c473be53508a2b3.

49 files changed:
automated-tests/src/dali/CMakeLists.txt
automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.cpp
automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h
automated-tests/src/dali/dali-test-suite-utils/test-touch-utils.h [new file with mode: 0644]
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-BaseHandle.cpp
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp
automated-tests/src/dali/utc-Dali-LongPressGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PanGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PinchGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp
automated-tests/src/dali/utc-Dali-RotationGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-Scene.cpp
automated-tests/src/dali/utc-Dali-Scripting.cpp
automated-tests/src/dali/utc-Dali-Stage.cpp
automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp
automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-TouchDataProcessing.cpp
automated-tests/src/dali/utc-Dali-TouchProcessing.cpp [new file with mode: 0644]
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
automated-tests/src/dali/utc-Dali-WeakHandle.cpp
dali/devel-api/common/stage.cpp
dali/devel-api/common/stage.h
dali/devel-api/events/touch-data-devel.cpp [moved from dali/integration-api/events/touch-data-integ.cpp with 58% similarity, mode: 0755]
dali/devel-api/events/touch-data-devel.h [new file with mode: 0755]
dali/devel-api/file.list
dali/integration-api/events/touch-data-integ.h [deleted file]
dali/integration-api/events/touch-event-integ.h
dali/integration-api/file.list
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h
dali/internal/event/actors/custom-actor-internal.h
dali/internal/event/common/scene-impl.cpp
dali/internal/event/common/scene-impl.h
dali/internal/event/common/stage-impl.cpp
dali/internal/event/common/stage-impl.h
dali/internal/event/events/touch-data-impl.h
dali/internal/event/events/touch-event-processor.cpp
dali/public-api/actors/actor.cpp
dali/public-api/actors/actor.h
dali/public-api/actors/custom-actor-impl.h
dali/public-api/dali-core.h
dali/public-api/events/touch-event.cpp [new file with mode: 0644]
dali/public-api/events/touch-event.h [new file with mode: 0644]
dali/public-api/file.list
dali/public-api/signals/dali-signal.h

index 5c90a0e..632363b 100644 (file)
@@ -93,6 +93,7 @@ SET(TC_SOURCES
         utc-Dali-Thread.cpp
         utc-Dali-ThreadPool.cpp
         utc-Dali-TouchEventCombiner.cpp
+        utc-Dali-TouchProcessing.cpp
         utc-Dali-TouchDataProcessing.cpp
         utc-Dali-TypeRegistry.cpp
         utc-Dali-CSharp-TypeRegistry.cpp
index 5723f7f..42839f0 100644 (file)
@@ -336,6 +336,11 @@ void TestCustomActor::OnSizeAnimation(Animation& animation, const Vector3& targe
   mTargetSize = targetSize;
   AddToCallStacks("OnSizeAnimation");
 }
+bool TestCustomActor::OnTouchEvent(const TouchEvent& event)
+{
+  AddToCallStacks("OnTouchEvent");
+  return true;
+}
 bool TestCustomActor::OnHoverEvent(const HoverEvent& event)
 {
   AddToCallStacks("OnHoverEvent");
index 907072f..58e3f5c 100644 (file)
@@ -131,27 +131,28 @@ public:
   virtual void OnInitialize( const char* name );
   void ResetCallStack();
   void AddToCallStacks( const char* method );
-  void OnSceneConnection( int depth ) override;
-  void OnSceneDisconnection() override;
-  void OnChildAdd(Dali::Actor& child) override;
-  void OnChildRemove(Dali::Actor& child) override;
-  void OnPropertySet( Dali::Property::Index index, Dali::Property::Value propertyValue ) override;
-  void OnSizeSet(const Dali::Vector3& targetSize) override;
-  void OnSizeAnimation(Dali::Animation& animation, const Dali::Vector3& targetSize) override;
-  bool OnHoverEvent(const Dali::HoverEvent& event) override;
-  bool OnWheelEvent(const Dali::WheelEvent& event) override;
-  bool OnKeyEvent(const Dali::KeyEvent& event) override;
+  virtual void OnSceneConnection( int depth );
+  virtual void OnSceneDisconnection();
+  virtual void OnChildAdd(Dali::Actor& child);
+  virtual void OnChildRemove(Dali::Actor& child);
+  virtual void OnPropertySet( Dali::Property::Index index, Dali::Property::Value propertyValue );
+  virtual void OnSizeSet(const Dali::Vector3& targetSize);
+  virtual void OnSizeAnimation(Dali::Animation& animation, const Dali::Vector3& targetSize);
+  virtual bool OnTouchEvent(const Dali::TouchEvent& event);
+  virtual bool OnHoverEvent(const Dali::HoverEvent& event);
+  virtual bool OnWheelEvent(const Dali::WheelEvent& event);
+  virtual bool OnKeyEvent(const Dali::KeyEvent& event);
   virtual void OnKeyInputFocusGained();
   virtual void OnKeyInputFocusLost();
-  Dali::Vector3 GetNaturalSize() override;
-  float GetHeightForWidth( float width ) override;
-  float GetWidthForHeight( float height ) override;
-  void OnRelayout( const Dali::Vector2& size, Dali::RelayoutContainer& container ) override;
-  void OnSetResizePolicy( Dali::ResizePolicy::Type policy, Dali::Dimension::Type dimension ) override;
-  void OnCalculateRelayoutSize( Dali::Dimension::Type dimension ) override;
-  float CalculateChildSize( const Dali::Actor& child, Dali::Dimension::Type dimension ) override;
-  void OnLayoutNegotiated( float size, Dali::Dimension::Type dimension ) override;
-  bool RelayoutDependentOnChildren( Dali::Dimension::Type dimension = Dali::Dimension::ALL_DIMENSIONS ) override;
+  virtual Dali::Vector3 GetNaturalSize();
+  virtual float GetHeightForWidth( float width );
+  virtual float GetWidthForHeight( float height );
+  virtual void OnRelayout( const Dali::Vector2& size, Dali::RelayoutContainer& container );
+  virtual void OnSetResizePolicy( Dali::ResizePolicy::Type policy, Dali::Dimension::Type dimension );
+  virtual void OnCalculateRelayoutSize( Dali::Dimension::Type dimension );
+  virtual float CalculateChildSize( const Dali::Actor& child, Dali::Dimension::Type dimension );
+  virtual void OnLayoutNegotiated( float size, Dali::Dimension::Type dimension );
+  virtual bool RelayoutDependentOnChildren( Dali::Dimension::Type dimension = Dali::Dimension::ALL_DIMENSIONS );
   static void SetProperty( Dali::BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value );
   static Dali::Property::Value GetProperty( Dali::BaseObject* object, Dali::Property::Index index );
 
@@ -207,7 +208,7 @@ struct TestCustomActorVariant1 : public TestCustomActor
   }
 
   // From CustomActorImpl
-  void OnSceneConnection( int depth ) override
+  virtual void OnSceneConnection( int depth )
   {
     // Chain up first
     TestCustomActor::OnSceneConnection( depth );
@@ -443,33 +444,37 @@ public:
   }
 
   // From CustomActorImpl
-  void OnSceneConnection( int depth ) override
+  virtual void OnSceneConnection( int depth )
   {
   }
-  void OnSceneDisconnection() override
+  virtual void OnSceneDisconnection()
   {
   }
-  void OnChildAdd(Dali::Actor& child) override
+  virtual void OnChildAdd(Dali::Actor& child)
   {
   }
-  void OnChildRemove(Dali::Actor& child) override
+  virtual void OnChildRemove(Dali::Actor& child)
   {
   }
-  void OnSizeSet(const Dali::Vector3& targetSize) override
+  virtual void OnSizeSet(const Dali::Vector3& targetSize)
   {
   }
-  void OnSizeAnimation(Dali::Animation& animation, const Dali::Vector3& targetSize) override
+  virtual void OnSizeAnimation(Dali::Animation& animation, const Dali::Vector3& targetSize)
   {
   }
-  bool OnHoverEvent(const Dali::HoverEvent& event) override
+  virtual bool OnTouchEvent(const Dali::TouchEvent& event)
+  {
+    return true;
+  }
+  virtual bool OnHoverEvent(const Dali::HoverEvent& event)
   {
     return true;
   }
-  bool OnWheelEvent(const Dali::WheelEvent& event) override
+  virtual bool OnWheelEvent(const Dali::WheelEvent& event)
   {
     return true;
   }
-  bool OnKeyEvent(const Dali::KeyEvent& event) override
+  virtual bool OnKeyEvent(const Dali::KeyEvent& event)
   {
     return true;
   }
@@ -480,43 +485,43 @@ public:
   {
   }
 
-  Dali::Vector3 GetNaturalSize() override
+  virtual Dali::Vector3 GetNaturalSize()
   {
     return Dali::Vector3( 0.0f, 0.0f, 0.0f );
   }
 
-  float GetHeightForWidth( float width ) override
+  virtual float GetHeightForWidth( float width )
   {
     return 0.0f;
   }
 
-  float GetWidthForHeight( float height ) override
+  virtual float GetWidthForHeight( float height )
   {
     return 0.0f;
   }
 
-  void OnRelayout( const Dali::Vector2& size, Dali::RelayoutContainer& container ) override
+  virtual void OnRelayout( const Dali::Vector2& size, Dali::RelayoutContainer& container )
   {
   }
 
-  void OnSetResizePolicy( Dali::ResizePolicy::Type policy, Dali::Dimension::Type dimension ) override
+  virtual void OnSetResizePolicy( Dali::ResizePolicy::Type policy, Dali::Dimension::Type dimension )
   {
   }
 
-  void OnCalculateRelayoutSize( Dali::Dimension::Type dimension ) override
+  virtual void OnCalculateRelayoutSize( Dali::Dimension::Type dimension )
   {
   }
 
-  float CalculateChildSize( const Dali::Actor& child, Dali::Dimension::Type dimension ) override
+  virtual float CalculateChildSize( const Dali::Actor& child, Dali::Dimension::Type dimension )
   {
     return 0.0f;
   }
 
-  void OnLayoutNegotiated( float size, Dali::Dimension::Type dimension ) override
+  virtual void OnLayoutNegotiated( float size, Dali::Dimension::Type dimension )
   {
   }
 
-  bool RelayoutDependentOnChildren( Dali::Dimension::Type dimension = Dali::Dimension::ALL_DIMENSIONS ) override
+  virtual bool RelayoutDependentOnChildren( Dali::Dimension::Type dimension = Dali::Dimension::ALL_DIMENSIONS )
   {
     return false;
   }
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-touch-utils.h b/automated-tests/src/dali/dali-test-suite-utils/test-touch-utils.h
new file mode 100644 (file)
index 0000000..3a623cb
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef TEST_TOUCH_UTILS_H
+#define TEST_TOUCH_UTILS_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/public-api/actors/actor.h>
+
+namespace Dali
+{
+
+// Data for touch events
+struct TouchEventData
+{
+  TouchEventData()
+  : functorCalled(false),
+    receivedTouch(),
+    touchActor()
+  {
+  }
+
+  void Reset()
+  {
+    functorCalled = false;
+
+    receivedTouch.points.clear();
+    receivedTouch.time = 0;
+
+    touchActor.Reset();
+  }
+
+  bool functorCalled;
+  TouchEvent receivedTouch;
+  Actor touchActor;
+};
+
+// Functor that sets the data when called
+struct TouchEventDataFunctor
+{
+  TouchEventDataFunctor(TouchEventData& data) : touchEventData(data) { }
+
+  bool operator()(Actor actor, const TouchEvent& touch)
+  {
+    touchEventData.functorCalled = true;
+    touchEventData.touchActor = actor;
+    touchEventData.receivedTouch = touch;
+    return false;
+  }
+
+  // Generate a touch-event
+  Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition ) const
+  {
+    Integration::TouchEvent touchEvent;
+    Integration::Point point;
+    point.SetState( state );
+    point.SetScreenPosition( screenPosition );
+    touchEvent.points.push_back( point );
+    return touchEvent;
+  }
+
+  TouchEventData& touchEventData;
+};
+
+
+} // namespace Dali
+
+#endif // TEST_TOUCH_UTILS_H
index c9d7ea3..65ea50b 100644 (file)
@@ -88,6 +88,12 @@ struct TestConstraintRef
   unsigned int mValue;
 };
 
+static bool TestCallback(Actor actor, const TouchEvent& event)
+{
+  gTouchCallBackCalled = true;
+  return false;
+  END_TEST;
+}
 
 static bool TestTouchCallback(Actor actor, const TouchData& touchData )
 {
@@ -2641,7 +2647,7 @@ int UtcDaliActorTouchedSignal(void)
   application.Render();
 
   // connect to its touch signal
-  actor.TouchSignal().Connect( TestTouchCallback );
+  actor.TouchedSignal().Connect( TestCallback );
 
   // simulate a touch event in the middle of the screen
   Vector2 touchPoint( application.GetScene().GetSize() * 0.5 );
@@ -2882,7 +2888,7 @@ int UtcDaliActorHitTest(void)
     DALI_TEST_CHECK( !gTouchCallBackCalled );
 
     // connect to its touch signal
-    actor.TouchSignal().Connect(TestTouchCallback);
+    actor.TouchedSignal().Connect(TestCallback);
 
     Dali::Integration::Point point;
     point.SetState( PointState::DOWN );
@@ -7736,7 +7742,7 @@ int utcDaliActorPartialUpdateSetProperty(void)
     TestApplication::DEFAULT_VERTICAL_DPI,
     true,
     true);
-
   tet_infoline( "Set/Update property with partial update" );
 
   const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
index 1402b98..f147800 100644 (file)
@@ -475,7 +475,7 @@ int UtcDaliBaseHandleConnectSignal(void)
   DALI_TEST_CHECK( gTouchCallBackCalled == false );
 
   // connect to its touch signal
-  actor.ConnectSignal( &application, "touch", TestCallback() );
+  actor.ConnectSignal( &application, "touched", TestCallback() );
 
   application.SendNotification();
   application.Render(1000);
index bce0c34..ad9943a 100644 (file)
@@ -997,6 +997,40 @@ int UtcDaliCustomActorSizeComponentAnimation(void)
   DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 2 ], TEST_LOCATION );
 
   END_TEST;
+
+}
+
+int UtcDaliCustomActorOnTouchEvent(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::CustomActor::OnTouchEvent()");
+
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
+  DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+  // set size for custom actor
+  custom.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
+  // add the custom actor to stage
+  application.GetScene().Add( custom );
+  custom.ResetCallStack();
+
+  // Render and notify a couple of times
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+  application.Render();
+
+  // simulate a touch event
+  Dali::Integration::Point point;
+  point.SetState( PointState::DOWN );
+  point.SetScreenPosition( Vector2( 1, 1 ) );
+  Dali::Integration::TouchEvent event;
+  event.AddPoint( point );
+  application.ProcessEvent( event );
+
+  DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+  DALI_TEST_EQUALS( "OnTouchEvent", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
+  END_TEST;
 }
 
 int UtcDaliCustomActorOnHoverEvent(void)
@@ -1414,6 +1448,8 @@ struct UnregisteredCustomActor : public Dali::CustomActorImpl
   { }
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
   { }
+  virtual bool OnTouchEvent(const TouchEvent& event) DALI_DEPRECATED_API
+  { return false; }
   virtual bool OnHoverEvent(const HoverEvent& event)
   { return false; }
   virtual bool OnKeyEvent(const KeyEvent& event)
@@ -1584,3 +1620,4 @@ int UtcDaliCustomActorPropertyRegistrationDefaultValue(void)
 
   END_TEST;
 }
+
index a95c166..1053762 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali/devel-api/events/long-press-gesture-detector-devel.h>
 #include <dali-test-suite-utils.h>
+#include <test-touch-utils.h>
 #include <test-touch-data-utils.h>
 
 using namespace Dali;
@@ -115,15 +116,16 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
 };
 
 // Functor for receiving a touch event
-struct TouchDataFunctor
+struct TouchEventFunctor
 {
-  bool operator()(Actor actor, Dali::TouchData touch)
+  bool operator()(Actor actor, const TouchEvent& touch)
   {
     //For line coverage
     unsigned int points = touch.GetPointCount();
     if( points > 0)
     {
-      tet_printf("Touch Point state = %d\n", touch.GetState(0));
+      const TouchPoint& touchPoint = touch.GetPoint(0);
+      tet_printf("Touch Point state = %d\n", touchPoint.state);
     }
     return false;
   }
@@ -207,8 +209,8 @@ int UtcDaliLongPressGestureDetectorNew(void)
 
   detector.Attach(actor);
 
-  TouchDataFunctor touchFunctor;
-  actor.TouchSignal().Connect(&application, touchFunctor);
+  TouchEventFunctor touchFunctor;
+  actor.TouchedSignal().Connect(&application, touchFunctor);
 
   Integration::TouchEvent touchEvent(1);
   Integration::Point point;
@@ -222,6 +224,8 @@ int UtcDaliLongPressGestureDetectorNew(void)
   application.SendNotification();
   application.Render();
 
+  // For line coverage, Initialise default constructor
+  TouchEvent touchEvent2;
   END_TEST;
 }
 
@@ -490,6 +494,9 @@ int UtcDaliLongPressGestureSignalReceptionChildHit(void)
   child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
   parent.Add(child);
 
+  TouchEventFunctor touchFunctor;
+  child.TouchedSignal().Connect(&application, touchFunctor);
+
   // Render and notify
   application.SendNotification();
   application.Render();
index 456dac7..eb90df5 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
-
+#include <test-touch-utils.h>
 
 using namespace Dali;
 
index fd9d240..f615f80 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/integration-api/profiling.h>
 #include <dali/integration-api/input-options.h>
 #include <dali-test-suite-utils.h>
+#include <test-touch-utils.h>
 #include <test-touch-data-utils.h>
 
 using namespace Dali;
@@ -119,6 +120,15 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
   Integration::Scene scene;
 };
 
+// Functor for receiving a touch event
+struct TouchEventFunctor
+{
+  bool operator()(Actor actor, const TouchEvent& touch)
+  {
+    return false;
+  }
+};
+
 // Data for constraints
 struct ConstraintData
 {
@@ -816,6 +826,8 @@ int UtcDaliPanGestureSignalReceptionChildHit(void)
   child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
   parent.Add(child);
 
+  TouchEventFunctor touchFunctor;
+  child.TouchedSignal().Connect(&application, touchFunctor);
 
   // Render and notify
   application.SendNotification();
index e79b6a3..dac0418 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
-
+#include <test-touch-utils.h>
 
 using namespace Dali;
 
index 93d5c8b..c8f30b2 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
+#include <test-touch-utils.h>
 #include <test-touch-data-utils.h>
 
 using namespace Dali;
@@ -113,6 +114,15 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
   Integration::Scene scene;
 };
 
+// Functor for receiving a touch event
+struct TouchEventFunctor
+{
+  bool operator()(Actor actor, const TouchEvent& touch)
+  {
+    return false;
+  }
+};
+
 } // anon namespace
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -612,6 +622,9 @@ int UtcDaliPinchGestureSignalReceptionChildHit(void)
   child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
   parent.Add(child);
 
+  TouchEventFunctor touchFunctor;
+  child.TouchedSignal().Connect(&application, touchFunctor);
+
   // Render and notify
   application.SendNotification();
   application.Render();
@@ -1153,7 +1166,6 @@ int UtcDaliPinchGestureInterruptedWhenTouchConsumed(void)
   END_TEST;
 }
 
-
 int UtcDaliPinchGestureDisableDetectionDuringPinchN(void)
 {
   // Crash sometimes occurred when gesture-recognizer was deleted internally during a signal when the attached actor was detached
index 940dc90..cfdc7a8 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
+#include <test-touch-utils.h>
 
 using namespace Dali;
 
index 75653c4..0219e84 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/devel-api/events/rotation-gesture.h>
 #include <dali/devel-api/events/rotation-gesture-detector.h>
 #include <dali-test-suite-utils.h>
+#include <test-touch-utils.h>
 #include <test-touch-data-utils.h>
 
 using namespace Dali;
@@ -115,6 +116,15 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
   Integration::Scene scene;
 };
 
+// Functor for receiving a touch event
+struct TouchEventFunctor
+{
+  bool operator()(Actor actor, const TouchEvent& touch)
+  {
+    return false;
+  }
+};
+
 } // anon namespace
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -604,6 +614,9 @@ int UtcDaliRotationGestureSignalReceptionChildHit(void)
   child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
   parent.Add(child);
 
+  TouchEventFunctor touchFunctor;
+  child.TouchedSignal().Connect(&application, touchFunctor);
+
   // Render and notify
   application.SendNotification();
   application.Render();
@@ -1192,3 +1205,4 @@ int UtcDaliRotationGestureDisableDetectionDuringRotationN(void)
 
   END_TEST;
 }
+
index dd92e00..3d23517 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/devel-api/events/rotation-gesture.h>
 #include <dali/devel-api/events/rotation-gesture-detector.h>
 #include <dali-test-suite-utils.h>
-
+#include <test-touch-utils.h>
 
 using namespace Dali;
 
index 6afb45c..7734414 100644 (file)
@@ -103,16 +103,35 @@ struct TouchedSignalData
     functorCalled = false;
     createNewScene = false;
     newSceneCreated = false;
+
+    receivedTouchEvent.points.clear();
+    receivedTouchEvent.time = 0;
+
     receivedTouchData.Reset();
   }
 
   bool functorCalled;
   bool createNewScene;
   bool newSceneCreated;
+  TouchEvent receivedTouchEvent;
   TouchData receivedTouchData;
 };
 
 // Functor that sets the data when touched signal is received
+struct TouchedFunctor
+{
+  TouchedFunctor( TouchedSignalData& data ) : signalData( data ) { }
+
+  void operator()( const TouchEvent& touch )
+  {
+    signalData.functorCalled = true;
+    signalData.receivedTouchEvent = touch;
+  }
+
+  TouchedSignalData& signalData;
+};
+
+// Functor that sets the data when touched signal is received
 struct TouchFunctor
 {
   TouchFunctor( TouchedSignalData& data ) : signalData( data ) { }
@@ -120,8 +139,7 @@ struct TouchFunctor
   void operator()( const TouchData& touch )
   {
     signalData.functorCalled = true;
-    Dali::TouchData touchData (touch);
-    signalData.receivedTouchData = touchData;
+    signalData.receivedTouchData = touch;
 
     if ( signalData.createNewScene )
     {
@@ -226,7 +244,7 @@ void GenerateTouch( TestApplication& application, PointState::Type state, const
   application.ProcessEvent( touchEvent );
 }
 
-bool DummyTouchCallback( Actor actor, const TouchData& touch )
+bool DummyTouchCallback( Actor actor, const TouchEvent& touch )
 {
   return true;
 }
@@ -660,7 +678,7 @@ int UtcDaliSceneTouchSignalP(void)
   actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
   actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  actor.TouchSignal().Connect( &DummyTouchCallback );
+  actor.TouchedSignal().Connect( &DummyTouchCallback );
   scene.Add( actor );
 
   // Render and notify.
@@ -783,7 +801,7 @@ int UtcDaliSceneTouchSignalN(void)
   actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
   actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  actor.TouchSignal().Connect( &DummyTouchCallback );
+  actor.TouchedSignal().Connect( &DummyTouchCallback );
   scene.Add( actor );
 
   // Render and notify.
@@ -1179,7 +1197,7 @@ int UtcDaliSceneEmptySceneRendering(void)
 
   Actor actor = Actor::New();
   actor.AddRenderer( renderer );
-
+  
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400, 400 ) );
   application.GetScene().Add( actor );
 
index f0571f1..2ae4abf 100644 (file)
@@ -163,7 +163,7 @@ int UtcDaliScriptingNewActorNegative(void)
     DALI_TEST_CHECK( !handle.WheelEventSignal().GetConnectionCount() );
     DALI_TEST_CHECK( !handle.OffSceneSignal().GetConnectionCount() );
     DALI_TEST_CHECK( !handle.OnSceneSignal().GetConnectionCount() );
-    DALI_TEST_CHECK( !handle.TouchSignal().GetConnectionCount() );
+    DALI_TEST_CHECK( !handle.TouchedSignal().GetConnectionCount() );
   }
   END_TEST;
 }
index 4ea5f5a..2456d79 100644 (file)
@@ -145,9 +145,9 @@ struct KeyEventReceivedFunctor
 };
 
 // Stores data that is populated in the touched signal callback and will be read by the TET cases
-struct TouchSignalData
+struct TouchedSignalData
 {
-  TouchSignalData()
+  TouchedSignalData()
   : functorCalled(false)
   {}
 
@@ -155,23 +155,41 @@ struct TouchSignalData
   {
     functorCalled = false;
 
+    receivedTouchEvent.points.clear();
+    receivedTouchEvent.time = 0;
+
     receivedTouchData.Reset();
   }
 
   bool functorCalled;
+  TouchEvent receivedTouchEvent;
   TouchData receivedTouchData;
 };
 
 // Functor that sets the data when touched signal is received
+struct TouchedFunctor
+{
+  TouchedFunctor( TouchedSignalData& data ) : signalData( data ) { }
+
+  void operator()( const TouchEvent& touch )
+  {
+    signalData.functorCalled = true;
+    signalData.receivedTouchEvent = touch;
+  }
+
+  TouchedSignalData& signalData;
+};
+
+
+// Functor that sets the data when touched signal is received
 struct TouchFunctor
 {
-  TouchFunctor( TouchSignalData& data ) : signalData( data ) { }
+  TouchFunctor( TouchedSignalData& data ) : signalData( data ) { }
 
   void operator()( const TouchData& touch )
   {
     signalData.functorCalled = true;
-    TouchData handle(touch);
-    signalData.receivedTouchData = handle;
+    signalData.receivedTouchData = touch;
   }
 
   void operator()()
@@ -179,7 +197,7 @@ struct TouchFunctor
     signalData.functorCalled = true;
   }
 
-  TouchSignalData& signalData;
+  TouchedSignalData& signalData;
 };
 
 // Stores data that is populated in the wheel-event callback and will be read by the TET cases
@@ -214,7 +232,7 @@ struct WheelEventReceivedFunctor
   WheelEventSignalData& signalData;
 };
 
-bool DummyTouchCallback( Actor actor, const TouchData& touch )
+bool DummyTouchCallback( Actor actor, const TouchEvent& touch )
 {
   return true;
 }
@@ -983,9 +1001,9 @@ int UtcDaliStageTouchedSignalP(void)
   TestApplication application;
   Stage stage = Stage::GetCurrent();
 
-  TouchSignalData data;
-  TouchFunctor functor( data );
-  stage.TouchSignal().Connect( &application, functor );
+  TouchedSignalData data;
+  TouchedFunctor functor( data );
+  stage.TouchedSignal().Connect( &application, functor );
 
   // Render and notify.
   application.SendNotification();
@@ -996,16 +1014,15 @@ int UtcDaliStageTouchedSignalP(void)
     GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchEvent.points[0].hitActor );
     data.Reset();
 
     GenerateTouch( application, PointState::UP, Vector2( 10.0f, 10.0f ) );
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
-
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchEvent.points[0].hitActor );
     data.Reset();
   }
 
@@ -1014,7 +1031,7 @@ int UtcDaliStageTouchedSignalP(void)
   actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
   actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  actor.TouchSignal().Connect( &DummyTouchCallback );
+  actor.TouchedSignal().Connect( &DummyTouchCallback );
   stage.Add( actor );
 
   // Render and notify.
@@ -1026,8 +1043,8 @@ int UtcDaliStageTouchedSignalP(void)
     GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( data.receivedTouchData.GetHitActor(0) );
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( data.receivedTouchEvent.points[0].hitActor == actor );
     data.Reset();
 
     GenerateTouch( application, PointState::MOTION, Vector2( 150.0f, 10.0f ) ); // Some motion
@@ -1038,8 +1055,8 @@ int UtcDaliStageTouchedSignalP(void)
     GenerateTouch( application, PointState::UP, Vector2( 150.0f, 10.0f ) ); // Some motion
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchEvent.points[0].hitActor );
     data.Reset();
   }
 
@@ -1054,7 +1071,7 @@ int UtcDaliStageTouchedSignalP(void)
     touchEvent.points.push_back( point );
     application.ProcessEvent( touchEvent );
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
+    DALI_TEST_EQUALS( data.receivedTouchEvent.GetPointCount(), 1u, TEST_LOCATION );
     data.Reset();
 
     // 2nd point
@@ -1064,7 +1081,7 @@ int UtcDaliStageTouchedSignalP(void)
     touchEvent.points.push_back( point );
     application.ProcessEvent( touchEvent );
     DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_EQUALS( (bool)data.receivedTouchData, false, TEST_LOCATION );
+    DALI_TEST_EQUALS( data.receivedTouchEvent.GetPointCount(), 0u, TEST_LOCATION );
     data.Reset();
 
     // Primary point is up
@@ -1072,7 +1089,7 @@ int UtcDaliStageTouchedSignalP(void)
     touchEvent.points[1].SetState( PointState::STATIONARY );
     application.ProcessEvent( touchEvent );
     DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_EQUALS( (bool)data.receivedTouchData, false, TEST_LOCATION );
+    DALI_TEST_EQUALS( data.receivedTouchEvent.GetPointCount(), 0u, TEST_LOCATION );
     data.Reset();
 
     // Remove 1st point now, 2nd point is now in motion
@@ -1081,14 +1098,14 @@ int UtcDaliStageTouchedSignalP(void)
     touchEvent.points[0].SetScreenPosition( Vector2( 150.0f, 50.0f ) );
     application.ProcessEvent( touchEvent );
     DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_EQUALS( (bool)data.receivedTouchData, false, TEST_LOCATION );
+    DALI_TEST_EQUALS( data.receivedTouchEvent.GetPointCount(), 0u, TEST_LOCATION );
     data.Reset();
 
     // Final point Up
     touchEvent.points[0].SetState( PointState::UP );
     application.ProcessEvent( touchEvent );
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
+    DALI_TEST_EQUALS( data.receivedTouchEvent.GetPointCount(), 1u, TEST_LOCATION );
     data.Reset();
   }
   END_TEST;
@@ -1099,9 +1116,9 @@ int UtcDaliStageTouchedSignalN(void)
   TestApplication application;
   Stage stage = Stage::GetCurrent();
 
-  TouchSignalData data;
-  TouchFunctor functor( data );
-  stage.TouchSignal().Connect( &application, functor );
+  TouchedSignalData data;
+  TouchedFunctor functor( data );
+  stage.TouchedSignal().Connect( &application, functor );
 
   // Render and notify.
   application.SendNotification();
@@ -1115,8 +1132,8 @@ int UtcDaliStageTouchedSignalN(void)
     GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchEvent.points[0].hitActor );
     data.Reset();
 
     // Confirm there is no signal when the touchpoint is only moved.
@@ -1129,8 +1146,8 @@ int UtcDaliStageTouchedSignalN(void)
     GenerateTouch( application, PointState::UP, Vector2( 1200.0f, 10.0f ) );
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchEvent.points[0].hitActor );
     data.Reset();
   }
 
@@ -1139,7 +1156,7 @@ int UtcDaliStageTouchedSignalN(void)
   actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
   actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  actor.TouchSignal().Connect( &DummyTouchCallback );
+  actor.TouchedSignal().Connect( &DummyTouchCallback );
   stage.Add( actor );
 
   // Render and notify.
@@ -1151,30 +1168,41 @@ int UtcDaliStageTouchedSignalN(void)
     GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) );
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
-    DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::INTERRUPTED );
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchEvent.points[0].hitActor );
+    DALI_TEST_CHECK( data.receivedTouchEvent.points[0].state == TouchPoint::Interrupted );
     data.Reset();
 
     GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( data.receivedTouchData.GetHitActor(0) == actor );
-    DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::DOWN );
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( data.receivedTouchEvent.points[0].hitActor == actor );
+    DALI_TEST_CHECK( data.receivedTouchEvent.points[0].state == TouchPoint::Down );
     data.Reset();
 
     GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) );
 
     DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
-    DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::INTERRUPTED );
+    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchEvent.points[0].hitActor );
+    DALI_TEST_CHECK( data.receivedTouchEvent.points[0].state == TouchPoint::Interrupted );
 
-    DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
+    DALI_TEST_EQUALS( data.receivedTouchEvent.GetPointCount(), 1u, TEST_LOCATION );
 
     // Check that getting info about a non-existent point causes an assert.
-    DALI_TEST_EQUALS( data.receivedTouchData.GetState( 1 ), PointState::FINISHED, TEST_LOCATION );
+    bool asserted = false;
+    try
+    {
+      data.receivedTouchEvent.GetPoint( 1 );
+    }
+    catch( Dali::DaliException& e )
+    {
+      DALI_TEST_PRINT_ASSERT( e );
+      DALI_TEST_ASSERT( e, "point < points.size() && \"No point at index\"", TEST_LOCATION );
+      asserted = true;
+    }
+    DALI_TEST_CHECK( asserted );
 
     data.Reset();
   }
@@ -1188,7 +1216,7 @@ int UtcDaliStageTouchSignalP(void)
   TestApplication application;
   Stage stage = Stage::GetCurrent();
 
-  TouchSignalData data;
+  TouchedSignalData data;
   TouchFunctor functor( data );
   stage.TouchSignal().Connect( &application, functor );
 
@@ -1218,7 +1246,7 @@ int UtcDaliStageTouchSignalP(void)
   actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
   actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  actor.TouchSignal().Connect( &DummyTouchCallback );
+  actor.TouchedSignal().Connect( &DummyTouchCallback );
   stage.Add( actor );
 
   // Render and notify.
@@ -1300,11 +1328,11 @@ int UtcDaliStageTouchSignalN(void)
   TestApplication application;
   Stage stage = Stage::GetCurrent();
 
-  TouchSignalData data;
+  TouchedSignalData data;
   TouchFunctor functor( data );
   stage.TouchSignal().Connect( &application, functor );
 
-  TouchSignalData data2;
+  TouchedSignalData data2;
   TouchFunctor functor2( data2 );
   GetImplementation( stage ).ConnectSignal( &application, "touch", functor2 );
 
@@ -1349,7 +1377,7 @@ int UtcDaliStageTouchSignalN(void)
   actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
   actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  actor.TouchSignal().Connect( &DummyTouchCallback );
+  actor.TouchedSignal().Connect( &DummyTouchCallback );
   stage.Add( actor );
 
   // Render and notify.
index 4c449c6..cf86531 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
+#include <test-touch-utils.h>
 #include <test-touch-data-utils.h>
 
 using namespace Dali;
@@ -108,13 +109,14 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
 // Functor for receiving a touch event
 struct TouchEventFunctor
 {
-  bool operator()(Actor actor, const TouchData& touch)
+  bool operator()(Actor actor, const TouchEvent& touch)
   {
     //For line coverage
     unsigned int points = touch.GetPointCount();
     if( points > 0)
     {
-      tet_printf("Touch Point state = %d\n", touch.GetState(0));
+      const TouchPoint& touchPoint = touch.GetPoint(0);
+      tet_printf("Touch Point state = %d\n", touchPoint.state);
     }
     return false;
   }
@@ -193,7 +195,7 @@ int UtcDaliTapGestureDetectorNew(void)
   detector.Attach(actor);
 
   TouchEventFunctor touchFunctor;
-  actor.TouchSignal().Connect( &application, touchFunctor );
+  actor.TouchedSignal().Connect( &application, touchFunctor );
 
   Integration::TouchEvent touchEvent(1);
   Integration::Point point;
@@ -207,6 +209,8 @@ int UtcDaliTapGestureDetectorNew(void)
   application.SendNotification();
   application.Render();
 
+  // For line coverage, Initialise default constructor
+  TouchEvent touchEvent2;
   END_TEST;
 }
 
@@ -498,7 +502,7 @@ int UtcDaliTapGestureSignalReceptionChildHit(void)
   parent.Add(child);
 
   TouchEventFunctor touchFunctor;
-  child.TouchSignal().Connect(&application, touchFunctor);
+  child.TouchedSignal().Connect(&application, touchFunctor);
 
   // Render and notify
   application.SendNotification();
index 13c3e77..85d111d 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
-
+#include <test-touch-utils.h>
 
 using namespace Dali;
 
index c6230fe..95db95e 100644 (file)
@@ -20,7 +20,6 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-data-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 #include <dali/devel-api/actors/actor-devel.h>
@@ -261,6 +260,26 @@ struct OutOfBoundsFunctor
   bool returnValue;
 };
 
+struct TouchEventFunctor
+{
+  /**
+   * Constructor.
+   * @param[in]  functorCalled  Reference to a boolean which is set to true if the touch event functor is called.
+   */
+  TouchEventFunctor( bool& functorCalled )
+  : functorCalled( functorCalled )
+  {
+  }
+
+  bool operator()( Actor actor, const TouchEvent& touch )
+  {
+    functorCalled = true;
+    return true;
+  }
+
+  bool& functorCalled;
+};
+
 Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition )
 {
   Integration::TouchEvent touchEvent;
@@ -290,7 +309,7 @@ int UtcDaliTouchDataNormalProcessing01(void)
   application.SendNotification();
   application.Render();
 
-  // Connect to actor's touch signal
+  // Connect to actor's touched signal
   SignalData data;
   TouchDataFunctor functor( data );
   actor.TouchSignal().Connect( &application, functor );
@@ -1895,7 +1914,7 @@ int UtcDaliTouchDataGetPressure(void)
   END_TEST;
 }
 
-int UtcDaliTouchDataUsage(void)
+int UtcDaliTouchDataAndEventUsage(void)
 {
   TestApplication application;
 
@@ -1913,11 +1932,15 @@ int UtcDaliTouchDataUsage(void)
   TouchDataFunctor functor( data );
   actor.TouchSignal().Connect( &application, functor );
 
+  // Connect to actor's touched signal (OLD)
+  bool touchEventFunctorCalled = false;
+  TouchEventFunctor eventFunctor( touchEventFunctorCalled );
+  actor.TouchedSignal().Connect( &application, eventFunctor );
 
   // Emit a down signal with an angle
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-
+  DALI_TEST_EQUALS( true, touchEventFunctorCalled, TEST_LOCATION );
 
   END_TEST;
 }
@@ -2065,18 +2088,3 @@ int UtcDaliTouchDataCapturePropertySet(void)
 
   END_TEST;
 }
-
-int UtcDaliTouchDataIntegNewTouchData(void)
-{
-  uint32_t timestamp = 92858u;
-  TouchPoint tp(1, TouchPoint::State::Started, 34.4f, 123.89f, 5.0f, 7.0f);
-  Dali::TouchData touchData = Integration::NewTouchData(timestamp, tp);
-
-  DALI_TEST_EQUALS(touchData.GetPointCount(), 1u, TEST_LOCATION);
-  DALI_TEST_EQUALS(touchData.GetState(0), PointState::Type::STARTED, TEST_LOCATION );
-  DALI_TEST_EQUALS(touchData.GetLocalPosition(0), Vector2(5.0f, 7.0f), TEST_LOCATION );
-  DALI_TEST_EQUALS(touchData.GetScreenPosition(0), Vector2(34.4f, 123.89f), TEST_LOCATION );
-
-
-  END_TEST;
-}
diff --git a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp
new file mode 100644 (file)
index 0000000..17bb058
--- /dev/null
@@ -0,0 +1,1632 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+
+#include <stdlib.h>
+#include <dali/public-api/dali-core.h>
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/render-task-list-integ.h>
+#include <dali-test-suite-utils.h>
+#include <dali/devel-api/events/touch-data-devel.h>
+
+using namespace Dali;
+
+void utc_dali_touch_processing_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_touch_processing_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+
+// Stores data that is populated in the callback and will be read by the TET cases
+struct SignalData
+{
+  SignalData()
+  : functorCalled( false ),
+    touchEvent(),
+    touchedActor()
+  {
+  }
+
+  void Reset()
+  {
+    functorCalled = false;
+
+    touchEvent.time = 0u;
+    touchEvent.points.clear();
+
+    touchedActor.Reset();
+  }
+
+  bool functorCalled;
+  TouchEvent touchEvent;
+  Actor touchedActor;
+};
+
+// Functor that sets the data when called
+struct TouchEventFunctor
+{
+  /**
+   * Constructor.
+   * @param[in]  data         Reference to the data to store callback information.
+   * @param[in]  returnValue  What the functor should return.
+   */
+  TouchEventFunctor( SignalData& data, bool returnValue = true )
+  : signalData( data ),
+    returnValue( returnValue )
+  {
+  }
+
+  bool operator()( Actor actor, const TouchEvent& touchEvent )
+  {
+    signalData.functorCalled = true;
+    signalData.touchedActor = actor;
+    signalData.touchEvent = touchEvent;
+
+    return returnValue;
+  }
+
+  SignalData& signalData;
+  bool returnValue;
+};
+
+// Functor that removes the actor when called.
+struct RemoveActorFunctor : public TouchEventFunctor
+{
+  /**
+   * Constructor.
+   * @param[in]  data         Reference to the data to store callback information.
+   * @param[in]  returnValue  What the functor should return.
+   */
+  RemoveActorFunctor( SignalData& data, bool returnValue = true )
+  : TouchEventFunctor( data, returnValue )
+  {
+  }
+
+  bool operator()( Actor actor, const TouchEvent& touchEvent )
+  {
+    Actor parent( actor.GetParent() );
+    if ( parent )
+    {
+      parent.Remove( actor );
+    }
+
+    return TouchEventFunctor::operator()( actor, touchEvent );
+  }
+};
+
+Integration::TouchEvent GenerateSingleTouch( TouchPoint::State state, const Vector2& screenPosition )
+{
+  Integration::TouchEvent touchEvent;
+  Integration::Point point;
+  point.SetState( static_cast< PointState::Type >( state ) );
+  point.SetScreenPosition( screenPosition );
+  touchEvent.points.push_back( point );
+  return touchEvent;
+}
+
+} // anon namespace
+
+///////////////////////////////////////////////////////////////////////////////
+
+int UtcDaliTouchNormalProcessing(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  Vector2 screenCoordinates( 10.0f, 10.0f );
+  Vector2 localCoordinates;
+  actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  const TouchPoint *point1 = &data.touchEvent.GetPoint(0);
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, point1->state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, point1->screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( localCoordinates, point1->local, 0.1f, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a motion signal
+  screenCoordinates.x = screenCoordinates.y = 11.0f;
+  actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, screenCoordinates ) );
+  const TouchPoint *point2 = &data.touchEvent.GetPoint(0);
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Motion, point2->state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, point2->screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( localCoordinates, point2->local, 0.1f, TEST_LOCATION );
+  data.Reset();
+
+  // Emit an up signal
+  screenCoordinates.x = screenCoordinates.y = 12.0f;
+  actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Up, screenCoordinates ) );
+
+  const TouchPoint *point3ptr = &data.touchEvent.GetPoint(0);
+  TouchPoint point3( point3ptr->deviceId, point3ptr->state, point3ptr->screen.x, point3ptr->screen.y, point3ptr->local.x, point3ptr->local.y );
+
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Up, point3.state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, point3.screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( localCoordinates, point3.local, 0.1f, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a down signal where the actor is not present
+  screenCoordinates.x = screenCoordinates.y = 200.0f;
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchOutsideCameraNearFarPlanes(void)
+{
+  TestApplication application;
+
+  Integration::Scene scene = application.GetScene();
+  Vector2 sceneSize = scene.GetSize();
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+  actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+  scene.Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Get the camera's near and far planes
+  RenderTaskList taskList = scene.GetRenderTaskList();
+  Dali::RenderTask task = taskList.GetTask(0);
+  CameraActor camera = task.GetCameraActor();
+  float nearPlane = camera.GetNearClippingPlane();
+  float farPlane = camera.GetFarClippingPlane();
+
+  // Calculate the current distance of the actor from the camera
+  float tanHalfFov = tanf(camera.GetFieldOfView() * 0.5f);
+  float distance = (sceneSize.y * 0.5f) / tanHalfFov;
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  Vector2 screenCoordinates( sceneSize.x * 0.5f, sceneSize.y * 0.5f );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a down signal where actor is just at the camera's near plane
+  actor.SetProperty( Actor::Property::POSITION_Z, distance - nearPlane);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a down signal where actor is closer than the camera's near plane
+  actor.SetProperty( Actor::Property::POSITION_Z, (distance - nearPlane) + 1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a down signal where actor is just at the camera's far plane
+  actor.SetProperty( Actor::Property::POSITION_Z, distance - farPlane);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a down signal where actor is further than the camera's far plane
+  actor.SetProperty( Actor::Property::POSITION_Z, (distance - farPlane) - 1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+  END_TEST;
+}
+
+int UtcDaliTouchEmitEmpty(void)
+{
+  TestApplication application;
+
+  try
+  {
+    // Emit an empty TouchEvent
+    Integration::TouchEvent event;
+    application.ProcessEvent( event );
+    tet_result( TET_FAIL );
+  }
+  catch ( Dali::DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "!event.points.empty()", TEST_LOCATION );
+  }
+  END_TEST;
+}
+
+int UtcDaliTouchInterrupted(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+
+  // Emit an interrupted signal, we should be signalled regardless of whether there is a hit or not.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f /* Outside actor */ ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+
+  // Emit another interrupted signal, our signal handler should not be called.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchParentConsumer(void)
+{
+  TestApplication application;
+  Actor rootActor( application.GetScene().GetRootLayer() );
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data, false );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Connect to root actor's touched signal
+  SignalData rootData;
+  TouchEventFunctor rootFunctor( rootData ); // Consumes signal
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
+
+  Vector2 screenCoordinates( 10.0f, 10.0f );
+  Vector2 actorCoordinates, rootCoordinates;
+  actor.ScreenToLocal( actorCoordinates.x, actorCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+  rootActor.ScreenToLocal( rootCoordinates.x, rootCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, rootData.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, data.touchEvent.points[0].screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, rootData.touchEvent.points[0].screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( actorCoordinates, data.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_EQUALS( rootCoordinates, rootData.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Emit a motion signal
+  screenCoordinates.x = screenCoordinates.y = 11.0f;
+  actor.ScreenToLocal( actorCoordinates.x, actorCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+  rootActor.ScreenToLocal( rootCoordinates.x, rootCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, screenCoordinates ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, rootData.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Motion, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Motion, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, data.touchEvent.points[0].screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, rootData.touchEvent.points[0].screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( actorCoordinates, data.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_EQUALS( rootCoordinates, rootData.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Emit an up signal
+  screenCoordinates.x = screenCoordinates.y = 12.0f;
+  actor.ScreenToLocal( actorCoordinates.x, actorCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+  rootActor.ScreenToLocal( rootCoordinates.x, rootCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Up, screenCoordinates ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, rootData.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Up, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Up, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, data.touchEvent.points[0].screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, rootData.touchEvent.points[0].screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( actorCoordinates, data.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_EQUALS( rootCoordinates, rootData.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Emit a down signal where the actor is not present, will hit the root actor though
+  screenCoordinates.x = screenCoordinates.y = 200.0f;
+  rootActor.ScreenToLocal( rootCoordinates.x, rootCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, rootData.touchEvent.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordinates, rootData.touchEvent.points[0].screen, TEST_LOCATION );
+  DALI_TEST_EQUALS( rootCoordinates, rootData.touchEvent.points[0].local, 0.1f, TEST_LOCATION );
+  DALI_TEST_CHECK( rootActor == rootData.touchEvent.points[0].hitActor );
+  END_TEST;
+}
+
+int UtcDaliTouchInterruptedParentConsumer(void)
+{
+  TestApplication application;
+  Actor rootActor( application.GetScene().GetRootLayer() );
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data, false );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Connect to root actor's touched signal
+  SignalData rootData;
+  TouchEventFunctor rootFunctor( rootData ); // Consumes signal
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Emit an interrupted signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Emit another down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+  rootData.Reset();
+
+  // Remove actor from scene
+  application.GetScene().Remove( actor );
+  data.Reset();
+  rootData.Reset();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Emit an interrupted signal, only root actor's signal should be called.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f /* Outside actor */ ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( rootActor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Emit another interrupted state, none of the signal's should be called.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 200.0f, 200.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( false, rootData.functorCalled, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchLeave(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Set actor to require leave events
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a motion signal outside of actor, should be signalled with a Leave
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Leave, data.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+
+  // Another motion outside of actor, no signalling
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 201.0f, 201.0f )) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Another motion event inside actor, signalled with motion
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 10.0f, 10.0f )) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Motion, data.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+
+  // We do not want to listen to leave events anymore
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, false );
+
+  // Another motion event outside of actor, no signalling
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+  END_TEST;
+}
+
+int UtcDaliTouchLeaveParentConsumer(void)
+{
+  TestApplication application;
+  Actor rootActor( application.GetScene().GetRootLayer() );
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data, false );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Connect to root actor's touched signal
+  SignalData rootData;
+  TouchEventFunctor rootFunctor( rootData ); // Consumes signal
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
+
+  // Set actor to require leave events
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+  rootActor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Emit a motion signal outside of actor, should be signalled with a Leave
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Leave, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Leave, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Another motion outside of actor, only rootActor signalled
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 201.0f, 201.0f )) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Motion, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( rootActor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Another motion event inside actor, signalled with motion
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 10.0f, 10.0f )) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Motion, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Motion, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // We do not want to listen to leave events of actor anymore
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, false );
+
+  // Another motion event outside of root actor, only root signalled
+  Vector2 sceneSize( application.GetScene().GetSize() );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( sceneSize.width + 10.0f, sceneSize.height + 10.0f )) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Leave, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchActorBecomesInsensitive(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+
+  // Change actor to insensitive
+  actor.SetProperty( Actor::Property::SENSITIVE, false );
+
+  // Emit a motion signal, signalled with an interrupted
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+  END_TEST;
+}
+
+int UtcDaliTouchActorBecomesInsensitiveParentConsumer(void)
+{
+  TestApplication application;
+  Actor rootActor( application.GetScene().GetRootLayer() );
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data, false );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Connect to root actor's touched signal
+  SignalData rootData;
+  TouchEventFunctor rootFunctor( rootData ); // Consumes signal
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  data.Reset();
+  rootData.Reset();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Make root actor insensitive
+  rootActor.SetProperty( Actor::Property::SENSITIVE, false );
+
+  // Emit a motion signal, signalled with an interrupted (should get interrupted even if within root actor)
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( 200.0f, 200.0f )) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchMultipleLayers(void)
+{
+  TestApplication application;
+  Actor rootActor( application.GetScene().GetRootLayer() );
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+
+  Layer layer1 ( Layer::New() );
+  layer1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  layer1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add( layer1 );
+
+  Actor actor1 ( Actor::New() );
+  actor1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  actor1.SetProperty( Actor::Property::POSITION_Z,  1.0f ); // Should hit actor1 in this layer
+  layer1.Add( actor1 );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to layer1 and actor1
+  layer1.TouchedSignal().Connect( &application, functor );
+  actor1.TouchedSignal().Connect( &application, functor );
+
+  // Hit in hittable area, actor1 should be hit
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( data.touchedActor == actor1 );
+  data.Reset();
+
+  // Make layer1 insensitive, nothing should be hit
+  layer1.SetProperty( Actor::Property::SENSITIVE, false );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Make layer1 sensitive again, again actor1 will be hit
+  layer1.SetProperty( Actor::Property::SENSITIVE, true );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( data.touchedActor == actor1 );
+  data.Reset();
+
+  // Make rootActor insensitive, nothing should be hit
+  rootActor.SetProperty( Actor::Property::SENSITIVE, false );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Make rootActor sensitive
+  rootActor.SetProperty( Actor::Property::SENSITIVE, true );
+
+  // Add another layer
+  Layer layer2 ( Layer::New() );
+  layer2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  layer2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  layer2.SetProperty( Actor::Property::POSITION_Z,  10.0f ); // Should hit layer2 in this layer rather than actor2
+  application.GetScene().Add( layer2 );
+
+  Actor actor2 ( Actor::New() );
+  actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  layer2.Add( actor2 );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to layer2 and actor2
+  layer2.TouchedSignal().Connect( &application, functor );
+  actor2.TouchedSignal().Connect( &application, functor );
+
+  // Emit an event, should hit layer2
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  //DALI_TEST_CHECK( data.touchedActor == layer2 ); // TODO: Uncomment this after removing renderable hack!
+  data.Reset();
+
+  // Make layer2 insensitive, should hit actor1
+  layer2.SetProperty( Actor::Property::SENSITIVE, false );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( data.touchedActor == actor1 );
+  data.Reset();
+
+  // Make layer2 sensitive again, should hit layer2
+  layer2.SetProperty( Actor::Property::SENSITIVE, true );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  //DALI_TEST_CHECK( data.touchedActor == layer2 ); // TODO: Uncomment this after removing renderable hack!
+  data.Reset();
+
+  // Make layer2 invisible, render and notify
+  layer2.SetProperty( Actor::Property::VISIBLE, false );
+  application.SendNotification();
+  application.Render();
+
+  // Should hit actor1
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( data.touchedActor == actor1 );
+  data.Reset();
+
+  // Make rootActor invisible, render and notify
+  rootActor.SetProperty( Actor::Property::VISIBLE, false );
+  application.SendNotification();
+  application.Render();
+
+  // Should not hit anything
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+  END_TEST;
+}
+
+int UtcDaliTouchMultipleRenderTasks(void)
+{
+  TestApplication application;
+  Integration::Scene scene ( application.GetScene() );
+  Vector2 sceneSize ( scene.GetSize() );
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  scene.Add(actor);
+
+  // Create render task
+  Viewport viewport( sceneSize.width * 0.5f, sceneSize.height * 0.5f, sceneSize.width * 0.5f, sceneSize.height * 0.5f );
+  RenderTask renderTask ( application.GetScene().GetRenderTaskList().CreateTask() );
+  renderTask.SetViewport( viewport );
+  renderTask.SetInputEnabled( true );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Ensure renderTask actor can be hit too.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Disable input on renderTask, should not be hittable
+  renderTask.SetInputEnabled( false );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+  END_TEST;
+}
+
+int UtcDaliTouchMultipleRenderTasksWithChildLayer(void)
+{
+  TestApplication application;
+  Integration::Scene scene ( application.GetScene() );
+  Vector2 sceneSize ( scene.GetSize() );
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  scene.Add(actor);
+
+  Layer layer = Layer::New();
+  layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  actor.Add(layer);
+
+  // Create render task
+  Viewport viewport( sceneSize.width * 0.5f, sceneSize.height * 0.5f, sceneSize.width * 0.5f, sceneSize.height * 0.5f );
+  RenderTask renderTask ( application.GetScene().GetRenderTaskList().CreateTask() );
+  renderTask.SetViewport( viewport );
+  renderTask.SetInputEnabled( true );
+  renderTask.SetSourceActor( actor );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to layer's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+  layer.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Ensure renderTask actor can be hit too.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Disable input on renderTask, should not be hittable
+  renderTask.SetInputEnabled( false );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( viewport.x + 5.0f, viewport.y + 5.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+  END_TEST;
+}
+
+int UtcDaliTouchOffscreenRenderTasks(void)
+{
+  TestApplication application;
+  Integration::Scene scene ( application.GetScene() );
+  Vector2 sceneSize ( scene.GetSize() );
+
+  // FrameBuffer for offscreen RenderTask
+  FrameBuffer frameBuffer = FrameBuffer::New( sceneSize.width, sceneSize.height );
+
+  // Create a renderable actor to display the FrameBufferImage
+  Actor renderableActor = CreateRenderableActor(frameBuffer.GetColorTexture());
+  renderableActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+  renderableActor.SetProperty( Actor::Property::SIZE, Vector2( sceneSize.x, sceneSize.y ) );
+  renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
+  scene.Add( renderableActor );
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  scene.Add( actor );
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); // Ensure framebuffer connects
+
+  scene.GetRenderTaskList().GetTask( 0u ).SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
+
+  // Create a RenderTask
+  RenderTask renderTask = scene.GetRenderTaskList().CreateTask();
+  renderTask.SetSourceActor( actor );
+  renderTask.SetFrameBuffer( frameBuffer );
+  renderTask.SetInputEnabled( true );
+
+  // Create another RenderTask
+  RenderTask renderTask2( scene.GetRenderTaskList().CreateTask() );
+  renderTask2.SetInputEnabled( true );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+  END_TEST;
+}
+
+int UtcDaliTouchRenderTaskWithExclusiveActor(void)
+{
+  TestApplication application;
+  auto scene = application.GetScene();
+  auto sceneSize( scene.GetSize() );
+
+  auto actor = CreateRenderableActor();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( sceneSize.x, sceneSize.y ) );
+  scene.Add( actor );
+
+  auto renderTask = scene.GetRenderTaskList().CreateTask();
+  renderTask.SetSourceActor( actor );
+  renderTask.SetExclusive( true );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliTouchMultipleRenderableActors(void)
+{
+  TestApplication application;
+  Integration::Scene scene ( application.GetScene() );
+  Vector2 sceneSize ( scene.GetSize() );
+
+  Actor parent = CreateRenderableActor();
+  parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  scene.Add(parent);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  parent.Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to layer's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  parent.TouchedSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchedActor );
+  END_TEST;
+}
+
+int UtcDaliTouchActorRemovedInSignal(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  RemoveActorFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Register for leave events
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Re-add, render and notify
+  application.GetScene().Add(actor);
+  application.SendNotification();
+  application.Render();
+
+  // Emit another signal outside of actor's area, should not get anything as the scene has changed.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Emit another signal outside of actor's area, should not get anything as the scene has changed.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Re-add actor back to scene, render and notify
+  application.GetScene().Add(actor);
+  application.SendNotification();
+  application.Render();
+
+  // Emit another down event
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Completely delete the actor
+  actor.Reset();
+
+  // Emit event, should not crash and should not receive an event.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 210.0f, 210.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchActorSignalNotConsumed(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data, false );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchActorRemovedFromScene(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Remove actor from scene
+  application.GetScene().Remove( actor );
+  data.Reset();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Emit a move at the same point, we should not be signalled.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+  END_TEST;
+}
+
+int UtcDaliTouchLayerConsumesTouch(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Add a layer to overlap the actor
+  Layer layer = Layer::New();
+  layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add( layer );
+  layer.RaiseToTop();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Emit a few touch signals
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Up, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Set layer to consume all touch
+  layer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Emit the same signals again, should not receive
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Up, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
+  data.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliTouchLeaveActorReadded(void)
+{
+  TestApplication application;
+  Integration::Scene scene = application.GetScene();
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  scene.Add(actor);
+
+  // Set actor to receive touch-events
+  actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down and motion
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 11.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Remove actor from scene and add again
+  scene.Remove( actor );
+  scene.Add( actor );
+
+  // Emit a motion within the actor's bounds
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 12.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Emit a motion outside the actor's bounds
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 200.0f, 200.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Leave, data.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliTouchClippingActor(void)
+{
+  TestApplication application;
+  Integration::Scene scene = application.GetScene();
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  scene.Add( actor );
+
+  Actor clippingActor = Actor::New();
+  clippingActor.SetProperty( Actor::Property::SIZE, Vector2( 50.0f, 50.0f ) );
+  clippingActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  clippingActor.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+  scene.Add( clippingActor );
+
+  // Add a child to the clipped region.
+  Actor clippingChild = Actor::New();
+  clippingChild.SetProperty( Actor::Property::SIZE, Vector2( 50.0f, 50.0f ) );
+  clippingChild.SetProperty( Actor::Property::POSITION, Vector2( 25.0f, 25.0f ));
+  clippingChild.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  clippingActor.Add( clippingChild );
+
+  // Render and notify.
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal.
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit an event within clipped area - no hit.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  // Emit an event outside the clipped area but within the actor area, we should have a hit.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 60.0f, 60.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  clippingChild.TouchedSignal().Connect( &application, functor );
+
+  // Emit an event inside part of the child which is within the clipped area, we should have a hit.
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 30.0f, 30.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  data.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliTouchActorUnparented(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  data.Reset();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Unparent the actor
+  actor.Unparent();
+
+  // Should receive an interrupted event
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchParentRemovedFromScene(void)
+{
+  TestApplication application;
+
+  Actor parent = Actor::New();
+  parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(parent);
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  parent.Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  data.Reset();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Unparent the parent of the touchable actor
+  parent.Unparent();
+
+  // Should receive an interrupted event
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliTouchActorRemovedFromSceneDifferentConsumer(void)
+{
+  TestApplication application;
+
+  Actor parent = Actor::New();
+  parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(parent);
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  parent.Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data, false /* Do not consume */ );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Connect to parent's touched signal
+  SignalData parentData;
+  TouchEventFunctor parentFunctor( parentData );
+  parent.TouchedSignal().Connect( &application, parentFunctor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == data.touchedActor );
+  DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, parentData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == parentData.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( parent == parentData.touchedActor );
+  data.Reset();
+  parentData.Reset();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Unparent the actor
+  actor.Unparent();
+
+  // Should receive an interrupted event for both actor & parent
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, parentData.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+  parentData.Reset();
+
+  // Readd actor to parent
+  parent.Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Emit a motion signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
+  data.Reset();
+  parentData.Reset();
+
+  // Parent is now consumer, connect again to the touched signal of the actor so that it becomes the consumer
+  SignalData secondData;
+  TouchEventFunctor secondFunctor( secondData /* Consume */ );
+  actor.TouchedSignal().Connect( &application, secondFunctor );
+
+  // Unparent the actor
+  actor.Unparent();
+
+  // Should receive an interrupted event for both actor functors & the parent as well as it was last consumer
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, parentData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, secondData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, secondData.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+  parentData.Reset();
+  secondData.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliTouchInterruptedDifferentConsumer(void)
+{
+  TestApplication application;
+  Actor rootActor( application.GetScene().GetRootLayer() );
+
+  Actor parent = Actor::New();
+  parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(parent);
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  parent.Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  SignalData data;
+  TouchEventFunctor functor( data, false /* Do not consume */ );
+  actor.TouchedSignal().Connect( &application, functor );
+
+  // Connect to parent's touched signal
+  SignalData parentData;
+  TouchEventFunctor parentFunctor( parentData, false /* Do not consume */ );
+  parent.TouchedSignal().Connect( &application, parentFunctor );
+
+  // Connect to root's touched signal and consume
+  SignalData rootData;
+  TouchEventFunctor rootFunctor( rootData );
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
+
+  // Emit a down signal
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == data.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( actor == data.touchedActor );
+  DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, parentData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == parentData.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( parent == parentData.touchedActor );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Down, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_CHECK( actor == rootData.touchEvent.points[0].hitActor );
+  DALI_TEST_CHECK( rootActor == rootData.touchedActor );
+  data.Reset();
+  parentData.Reset();
+  rootData.Reset();
+
+  // Root is now consumer, connect to the touched signal of the parent so that it becomes the consumer
+  SignalData secondData;
+  TouchEventFunctor secondFunctor( secondData /* Consume */ );
+  parent.TouchedSignal().Connect( &application, secondFunctor );
+
+  // Emit an interrupted signal, all three should STILL be called
+  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Interrupted, Vector2( 10.0f, 10.0f ) ) );
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, data.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, parentData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, parentData.touchEvent.points[0].state, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( TouchPoint::Interrupted, rootData.touchEvent.points[0].state, TEST_LOCATION );
+  data.Reset();
+  parentData.Reset();
+  rootData.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliTouchDataConvert(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touch signal
+  SignalData data;
+  TouchEventFunctor functor(data);
+  actor.TouchedSignal().Connect(&application, functor);
+
+  Vector2 screenCoordiantes(10.0f, 10.0f);
+  Vector2 localCoordinates;
+  actor.ScreenToLocal(localCoordinates.x, localCoordinates.y, screenCoordiantes.x, screenCoordiantes.y);
+
+  // Emit a down signal
+  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Down, screenCoordiantes));
+  Dali::TouchData touchData = Dali::DevelTouchData::Convert(data.touchEvent);
+
+  DALI_TEST_EQUALS( 1u, touchData.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordiantes, touchData.GetScreenPosition(0), TEST_LOCATION );
+  DALI_TEST_EQUALS( localCoordinates, touchData.GetLocalPosition(0), 0.1f, TEST_LOCATION );
+  DALI_TEST_EQUALS( PointState::DOWN, touchData.GetState(0), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor, touchData.GetHitActor(0), TEST_LOCATION );
+
+  data.Reset();
+
+  END_TEST;
+
+}
index 2820c48..6b3a29d 100644 (file)
@@ -155,6 +155,10 @@ struct MyTestCustomActor : public CustomActorImpl
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
   {
   }
+  virtual bool OnTouchEvent(const TouchEvent& event)
+  {
+    return true;
+  }
   virtual bool OnHoverEvent(const HoverEvent& event)
   {
     return true;
@@ -2389,7 +2393,7 @@ int UtcDaliTypeInfoGetSignalNameP(void)
 
   std::string name = typeInfo.GetSignalName(0);
 
-  DALI_TEST_EQUALS( name, "hovered", TEST_LOCATION );
+  DALI_TEST_EQUALS( name, "touched", TEST_LOCATION );
 
   TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyTestCustomActor" );
 
@@ -2397,11 +2401,13 @@ int UtcDaliTypeInfoGetSignalNameP(void)
   bool foundSignal = false;
   for( std::size_t i = 0; i < typeInfo2.GetSignalCount(); i++ )
   {
-    std::string name = typeInfo2.GetSignalName( i );
-    if( name == "hovered")
-    {
-      foundSignal = true;
-    }
+
+       std::string name = typeInfo2.GetSignalName( i );
+       if( name == "touched")
+       {
+         foundSignal = true;
+       }
+
   }
 
   DALI_TEST_EQUALS( foundSignal, true, TEST_LOCATION );
index a30b03d..e7f3b70 100644 (file)
@@ -64,6 +64,10 @@ struct MyTestCustomActor : public CustomActorImpl
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
   {
   }
+  virtual bool OnTouchEvent(const TouchEvent& event)
+  {
+    return true;
+  }
   virtual bool OnHoverEvent(const HoverEvent& event)
   {
     return true;
@@ -485,3 +489,4 @@ int UtcDaliWeakHandleMoveAssignment(void)
 
   END_TEST;
 }
+
index b07b63f..267ca21 100644 (file)
@@ -144,6 +144,13 @@ Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSignal()
   return GetImplementation(*this).EventProcessingFinishedSignal();
 }
 
+Stage::TouchedSignalType& Stage::TouchedSignal()
+{
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchedSignal() is deprecated and will be removed from next release. Use TouchSignal() instead.\n" );
+
+  return GetImplementation(*this).TouchedSignal();
+}
+
 Stage::TouchSignalType& Stage::TouchSignal()
 {
   return GetImplementation( *this ).TouchSignal();
index ea99ee1..fe5c064 100644 (file)
@@ -46,6 +46,7 @@ struct Vector2;
 struct Vector3;
 struct Vector4;
 struct KeyEvent;
+struct TouchEvent;
 struct WheelEvent;
 
 /**
@@ -76,7 +77,7 @@ struct WheelEvent;
  * |-------------------------|--------------------------------------|
  * | keyEvent                | @ref KeyEventSignal()                |
  * | eventProcessingFinished | @ref EventProcessingFinishedSignal() |
- * | touch                   | @ref TouchSignal()                   |
+ * | touched                 | @ref TouchedSignal()                 |
  * | wheelEvent              | @ref WheelEventSignal()              |
  * | contextLost             | @ref ContextLostSignal()             |
  * | contextRegained         | @ref ContextRegainedSignal()         |
@@ -89,8 +90,9 @@ public:
 
   typedef Signal< void (const KeyEvent&) > KeyEventSignalType;       ///< Key event signal type @SINCE_1_0.0
   typedef Signal< void () > EventProcessingFinishedSignalType;       ///< Event Processing finished signal type @SINCE_1_0.0
-  typedef Signal< void (const TouchData&) > TouchSignalType;         ///< Touch signal type @SINCE_1_1.37
-  typedef Signal< void (const WheelEvent&) > WheelEventSignalType;   ///< Wheel signal type @SINCE_1_0.0
+  typedef Signal< void (const TouchEvent&) > TouchedSignalType;      ///< @DEPRECATED_1_1.37 @brief Touched signal type @SINCE_1_0.0
+  typedef Signal< void (const TouchData&) > TouchSignalType;                ///< Touch signal type @SINCE_1_1.37
+  typedef Signal< void (const WheelEvent&) > WheelEventSignalType;   ///< Touched signal type @SINCE_1_0.0
   typedef Signal< void () > ContextStatusSignal;                     ///< Context status signal type @SINCE_1_0.0
   typedef Signal< void () > SceneCreatedSignalType;                  ///< Scene created signal type @SINCE_1_0.0
 
@@ -270,6 +272,24 @@ public:
   EventProcessingFinishedSignalType& EventProcessingFinishedSignal();
 
   /**
+   * @DEPRECATED_1_1.37 Use TouchSignal() instead.
+   * @brief This signal is emitted when the screen is touched and when the touch ends
+   * (i.e. the down & up touch events only).
+   *
+   * If there are multiple touch points, then this will be emitted when the first touch occurs and
+   * then when the last finger is lifted.
+   * An interrupted event will also be emitted (if it occurs).
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName(const TouchEvent& event);
+   * @endcode
+   *
+   * @return The touch signal to connect to
+   * @note Motion events are not emitted.
+   */
+  TouchedSignalType& TouchedSignal() DALI_DEPRECATED_API;
+
+  /**
    * @brief This signal is emitted when the screen is touched and when the touch ends
    * (i.e. the down & up touch events only).
    *
old mode 100644 (file)
new mode 100755 (executable)
similarity index 58%
rename from dali/integration-api/events/touch-data-integ.cpp
rename to dali/devel-api/events/touch-data-devel.cpp
index 572f6db..e9a953d
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
  */
 
-#include <dali/integration-api/events/touch-data-integ.h>
+// INTERNAL INCLUDES
+#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
+#include <dali/devel-api/events/touch-data-devel.h>
 #include <dali/internal/event/events/touch-data-impl.h>
 
 namespace Dali
 {
-namespace Integration
+
+namespace DevelTouchData
 {
 
-Dali::TouchData NewTouchData(uint32_t timestamp, const TouchPoint& point)
+TouchData Convert( const TouchEvent& touchEvent )
 {
-  Internal::TouchDataPtr touchDataImpl( new Internal::TouchData(timestamp) );
-  touchDataImpl->AddPoint(Integration::Point(point));
-  Dali::TouchData handle(touchDataImpl.Get());
-  return handle;
+  Internal::TouchDataPtr touchDataImpl( new Internal::TouchData(touchEvent.time ) );
+
+  for( auto&& touchEventPoint : touchEvent.points )
+  {
+    touchDataImpl->AddPoint( Integration::Point( touchEventPoint ) );
+  }
+
+  return TouchData( touchDataImpl.Get() );
 }
 
-} // namespace Integration
+} // namespace DevelTouchData
 
 } // namespace Dali
diff --git a/dali/devel-api/events/touch-data-devel.h b/dali/devel-api/events/touch-data-devel.h
new file mode 100755 (executable)
index 0000000..c63dc2d
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef DALI_TOUCH_DATA_DEVEL_H
+#define DALI_TOUCH_DATA_DEVEL_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+
+class TouchData;
+struct TouchEvent;
+
+namespace DevelTouchData
+{
+
+/**
+ * @brief Convert TouchEvent to TouchData.
+ *
+ * @return The TouchData convert from Dali::TouchEvent
+ *
+ * @note Use this API with caution.
+*/
+DALI_CORE_API TouchData Convert( const TouchEvent& touchEvent );
+
+} // namespace DevelTouchData
+
+} // namespace Dali
+
+
+
+#endif // DALI_TOUCH_DATA_DEVEL_H
index e87a103..8c908b8 100644 (file)
@@ -17,6 +17,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
   ${devel_api_src_dir}/events/rotation-gesture.cpp
   ${devel_api_src_dir}/events/rotation-gesture-detector.cpp
+  ${devel_api_src_dir}/events/touch-data-devel.cpp
   ${devel_api_src_dir}/events/key-event-devel.cpp
   ${devel_api_src_dir}/images/distance-field.cpp
   ${devel_api_src_dir}/images/pixel-data-devel.cpp
@@ -75,6 +76,7 @@ SET( devel_api_core_events_header_files
   ${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
   ${devel_api_src_dir}/events/rotation-gesture.h
   ${devel_api_src_dir}/events/rotation-gesture-detector.h
+  ${devel_api_src_dir}/events/touch-data-devel.h
   ${devel_api_src_dir}/events/key-event-devel.h
 )
 
diff --git a/dali/integration-api/events/touch-data-integ.h b/dali/integration-api/events/touch-data-integ.h
deleted file mode 100644 (file)
index 1478210..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef DALI_INTEGRATION_TOUCH_DATA_INTEG_H
-#define DALI_INTEGRATION_TOUCH_DATA_INTEG_H
-
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <dali/public-api/events/touch-data.h>
-#include <dali/public-api/events/touch-point.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-/**
- * Create a new touch data handle from timestamp and touch point.
- *
- * @param[in] timestamp The timestamp of the touch event.
- * @param[in] point The point on screen where the touch occurred.
- * @return A new touch data handle.
- */
-DALI_CORE_API Dali::TouchData NewTouchData(uint32_t timestamp, const TouchPoint& point);
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif //DALI_INTEGRATION_TOUCH_DATA_INTEG_H
index 0c3a933..2d8bcd3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_TOUCH_EVENT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/events/touch-event.h>
 #include <dali/integration-api/events/multi-point-event-integ.h>
 
 namespace Dali
index 27597e9..f5ffa3c 100644 (file)
@@ -19,7 +19,6 @@ SET( platform_abstraction_src_files
    ${platform_abstraction_src_dir}/events/wheel-event-integ.cpp
    ${platform_abstraction_src_dir}/events/multi-point-event-integ.cpp
    ${platform_abstraction_src_dir}/events/point.cpp
-   ${platform_abstraction_src_dir}/events/touch-data-integ.cpp
    ${platform_abstraction_src_dir}/events/touch-event-combiner.cpp
    ${platform_abstraction_src_dir}/events/touch-event-integ.cpp
 )
@@ -59,7 +58,6 @@ SET( platform_abstraction_events_header_files
    ${platform_abstraction_src_dir}/events/point.h
    ${platform_abstraction_src_dir}/events/touch-event-combiner.h
    ${platform_abstraction_src_dir}/events/touch-event-integ.h
-   ${platform_abstraction_src_dir}/events/touch-data-integ.h
 )
 
 
index 2930e1e..d620da5 100755 (executable)
@@ -225,6 +225,7 @@ DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultPropert
 
 // Signals
 
+const char* const SIGNAL_TOUCHED = "touched";
 const char* const SIGNAL_HOVERED = "hovered";
 const char* const SIGNAL_WHEEL_EVENT = "wheelEvent";
 const char* const SIGNAL_ON_SCENE = "onScene";
@@ -248,6 +249,7 @@ BaseHandle CreateActor()
 
 TypeRegistration mType( typeid(Dali::Actor), typeid(Dali::Handle), CreateActor, ActorDefaultProperties );
 
+SignalConnectorType signalConnector1( mType, SIGNAL_TOUCHED, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector2( mType, SIGNAL_HOVERED, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector3( mType, SIGNAL_WHEEL_EVENT, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector4( mType, SIGNAL_ON_SCENE, &Actor::DoConnectSignal );
@@ -1788,7 +1790,7 @@ bool Actor::IsKeyboardFocusable() const
 
 bool Actor::GetTouchRequired() const
 {
-  return !mTouchSignal.Empty() || mDerivedRequiresTouch;
+  return !mTouchedSignal.Empty() || !mTouchSignal.Empty() || mDerivedRequiresTouch;
 }
 
 bool Actor::GetHoverRequired() const
@@ -1822,7 +1824,7 @@ bool Actor::IsGestureRequred( DevelGesture::Type type ) const
   return mGestureData && mGestureData->IsGestureRequred( type );
 }
 
-bool Actor::EmitTouchEventSignal( const Dali::TouchData& touch )
+bool Actor::EmitTouchEventSignal( const TouchEvent& event, const Dali::TouchData& touch )
 {
   bool consumed = false;
 
@@ -1832,6 +1834,18 @@ bool Actor::EmitTouchEventSignal( const Dali::TouchData& touch )
     consumed = mTouchSignal.Emit( handle, touch );
   }
 
+  if( !mTouchedSignal.Empty() )
+  {
+    Dali::Actor handle( this );
+    consumed |= mTouchedSignal.Emit( handle, event );
+  }
+
+  if( !consumed )
+  {
+    // Notification for derived classes
+    consumed = OnTouchEvent( event ); // TODO
+  }
+
   return consumed;
 }
 
@@ -1909,6 +1923,11 @@ void Actor::EmitChildRemovedSignal( Actor& child )
   }
 }
 
+Dali::Actor::TouchSignalType& Actor::TouchedSignal()
+{
+  return mTouchedSignal;
+}
+
 Dali::Actor::TouchDataSignalType& Actor::TouchSignal()
 {
   return mTouchSignal;
@@ -1969,7 +1988,11 @@ bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   bool connected( true );
   Actor* actor = static_cast< Actor* >( object ); // TypeRegistry guarantees that this is the correct type.
 
-  if( 0 == signalName.compare( SIGNAL_HOVERED ) )
+  if( 0 == signalName.compare( SIGNAL_TOUCHED ) )
+  {
+    actor->TouchedSignal().Connect( tracker, functor );
+  }
+  else if( 0 == signalName.compare( SIGNAL_HOVERED ) )
   {
     actor->HoveredSignal().Connect( tracker, functor );
   }
@@ -2028,6 +2051,7 @@ Actor::Actor( DerivedType derivedType, const SceneGraph::Node& node )
   mAnchorPoint( NULL ),
   mRelayoutData( NULL ),
   mGestureData( NULL ),
+  mTouchedSignal(),
   mTouchSignal(),
   mHoveredSignal(),
   mWheelEventSignal(),
index 082fd98..87f98fd 100644 (file)
@@ -1406,10 +1406,11 @@ public:
 
   /**
    * Used by the EventProcessor to emit touch event signals.
+   * @param[in] event The touch event (Old API).
    * @param[in] touch The touch data.
    * @return True if the event was consumed.
    */
-  bool EmitTouchEventSignal( const Dali::TouchData& touch );
+  bool EmitTouchEventSignal( const TouchEvent& event, const Dali::TouchData& touch );
 
   /**
    * Used by the EventProcessor to emit hover event signals.
@@ -1451,6 +1452,11 @@ public:
   void EmitChildRemovedSignal( Actor& child );
 
   /**
+   * @copydoc Dali::Actor::TouchedSignal()
+   */
+  Dali::Actor::TouchSignalType& TouchedSignal();
+
+  /**
    * @copydoc Dali::Actor::TouchEventSignal()
    */
   Dali::Actor::TouchDataSignalType& TouchSignal();
@@ -1832,6 +1838,17 @@ private:
 
   /**
    * For use in derived classes.
+   * This is only called if mDerivedRequiresTouch is true, and the touch-signal was not consumed.
+   * @param[in] event The touch event.
+   * @return True if the event should be consumed.
+   */
+  virtual bool OnTouchEvent( const TouchEvent& event )
+  {
+    return false;
+  }
+
+  /**
+   * For use in derived classes.
    * This is only called if mDerivedRequiresHover is true, and the hover-signal was not consumed.
    * @param[in] event The hover event.
    * @return True if the event should be consumed.
@@ -1967,6 +1984,7 @@ protected:
   ActorGestureData* mGestureData;   ///< Optional Gesture data. Only created when actor requires gestures
 
   // Signals
+  Dali::Actor::TouchSignalType             mTouchedSignal;
   Dali::Actor::TouchDataSignalType         mTouchSignal;
   Dali::Actor::HoverSignalType             mHoveredSignal;
   Dali::Actor::WheelEventSignalType        mWheelEventSignal;
index c2a42be..b70c0b9 100644 (file)
@@ -134,6 +134,14 @@ private:
   }
 
   /**
+   * @copydoc Internal::Actor::OnTouchEvent
+   */
+  virtual bool OnTouchEvent(const TouchEvent& event)
+  {
+    return mImpl->OnTouchEvent(event);
+  }
+
+  /**
    * @copydoc Internal::Actor::OnHoverEvent
    */
   virtual bool OnHoverEvent(const HoverEvent& event)
index 2b6398d..936b4ff 100755 (executable)
@@ -320,9 +320,13 @@ void Scene::EmitEventProcessingFinishedSignal()
   }
 }
 
-void Scene::EmitTouchedSignal( const Dali::TouchData& touch )
+void Scene::EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch )
 {
   Dali::Integration::Scene handle( this );
+  if ( !mTouchedSignal.Empty() )
+  {
+    mTouchedSignal.Emit( touchEvent );
+  }
   if ( !mTouchSignal.Empty() )
   {
     mTouchSignal.Emit( touch );
@@ -375,6 +379,11 @@ Integration::Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFin
   return mEventProcessingFinishedSignal;
 }
 
+Scene::TouchedSignalType& Scene::TouchedSignal()
+{
+  return mTouchedSignal;
+}
+
 Integration::Scene::TouchSignalType& Scene::TouchSignal()
 {
   return mTouchSignal;
index 0db8ba2..021cd2e 100755 (executable)
@@ -255,9 +255,10 @@ public:
 
   /**
    * Emits the touched signal.
+   * @param[in] touchEvent The touch event details (Old API).
    * @param[in] touch The touch event details.
    */
-  void EmitTouchedSignal( const Dali::TouchData& touch );
+  void EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch );
 
   /**
    * Used by the EventProcessor to emit wheel event signals.
@@ -300,6 +301,14 @@ public:
    */
   Integration::Scene::EventProcessingFinishedSignalType& EventProcessingFinishedSignal();
 
+  // The touched signal, to support Stage touched signal, will be removed when deprecated in public Stage API
+  using TouchedSignalType = Signal< void (const TouchEvent&) >;
+
+  /**
+   * Touched signal to support deprecated stage touched signal.
+   */
+  TouchedSignalType& TouchedSignal();
+
   /**
     * @copydoc Integration::Scene::TouchSignal()
     */
@@ -385,6 +394,9 @@ private:
   // The touch signal
   Integration::Scene::TouchSignalType mTouchSignal;
 
+  // The touched signal
+  TouchedSignalType mTouchedSignal;
+
   // The wheel event signal
   Integration::Scene::WheelEventSignalType mWheelEventSignal;
 
index f306823..69b0584 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@
 #include <dali/internal/event/common/object-registry-impl.h>
 #include <dali/integration-api/platform-abstraction.h>
 #include <dali/public-api/common/constants.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
@@ -64,6 +65,7 @@ namespace
 const char* const SIGNAL_KEY_EVENT =                 "keyEvent";
 const char* const SIGNAL_KEY_EVENT_GENERATED =       "keyEventGenerated";
 const char* const SIGNAL_EVENT_PROCESSING_FINISHED = "eventProcessingFinished";
+const char* const SIGNAL_TOUCHED =                   "touched";
 const char* const SIGNAL_TOUCH =                     "touch";
 const char* const SIGNAL_WHEEL_EVENT =               "wheelEvent";
 const char* const SIGNAL_CONTEXT_LOST =              "contextLost";
@@ -74,6 +76,7 @@ TypeRegistration mType( typeid(Dali::Stage), typeid(Dali::BaseHandle), NULL );
 
 SignalConnectorType signalConnector1( mType, SIGNAL_KEY_EVENT,                 &Stage::DoConnectSignal );
 SignalConnectorType signalConnector2( mType, SIGNAL_EVENT_PROCESSING_FINISHED, &Stage::DoConnectSignal );
+SignalConnectorType signalConnector3( mType, SIGNAL_TOUCHED,                   &Stage::DoConnectSignal );
 SignalConnectorType signalConnector4( mType, SIGNAL_WHEEL_EVENT,               &Stage::DoConnectSignal );
 SignalConnectorType signalConnector5( mType, SIGNAL_CONTEXT_LOST,              &Stage::DoConnectSignal );
 SignalConnectorType signalConnector6( mType, SIGNAL_CONTEXT_REGAINED,          &Stage::DoConnectSignal );
@@ -94,6 +97,7 @@ void Stage::Initialize( Scene& scene )
   mScene->SetBackgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR );
   mScene->EventProcessingFinishedSignal().Connect( this, &Stage::OnEventProcessingFinished );
   mScene->KeyEventSignal().Connect( this, &Stage::OnKeyEvent );
+  mScene->TouchedSignal().Connect( this, &Stage::OnTouchedEvent );
   mScene->TouchSignal().Connect( this, &Stage::OnTouchEvent );
   mScene->WheelEventSignal().Connect( this, &Stage::OnWheelEvent );
 }
@@ -230,6 +234,10 @@ bool Stage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   {
     stage->EventProcessingFinishedSignal().Connect( tracker, functor );
   }
+  else if( 0 == strcmp( signalName.c_str(), SIGNAL_TOUCHED ) )
+  {
+    stage->TouchedSignal().Connect( tracker, functor );
+  }
   else if( 0 == strcmp( signalName.c_str(), SIGNAL_TOUCH ) )
   {
     stage->TouchSignal().Connect( tracker, functor );
@@ -273,6 +281,11 @@ void Stage::OnKeyEvent( const Dali::KeyEvent& event )
   }
 }
 
+void Stage::OnTouchedEvent( const Dali::TouchEvent& touchEvent )
+{
+  mTouchedSignal.Emit( touchEvent );
+}
+
 void Stage::OnTouchEvent( const Dali::TouchData& touch )
 {
   mTouchSignal.Emit( touch );
@@ -302,8 +315,9 @@ void Stage::EmitEventProcessingFinishedSignal()
    mEventProcessingFinishedSignal.Emit();
 }
 
-void Stage::EmitTouchedSignal( const Dali::TouchData& touch )
+void Stage::EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch )
 {
+  mTouchedSignal.Emit( touchEvent );
   mTouchSignal.Emit( touch );
 }
 
@@ -350,6 +364,12 @@ Dali::Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSi
   return mEventProcessingFinishedSignal;
 }
 
+Dali::Stage::TouchedSignalType& Stage::TouchedSignal()
+{
+  DALI_LOG_WARNING( "Deprecated. Use TouchSignal() instead.\n" );
+  return mTouchedSignal;
+}
+
 Dali::Stage::TouchSignalType& Stage::TouchSignal()
 {
   return mTouchSignal;
@@ -390,6 +410,7 @@ Stage::Stage( SceneGraph::UpdateManager& updateManager )
   mKeyEventSignal(),
   mKeyEventGeneratedSignal(),
   mEventProcessingFinishedSignal(),
+  mTouchedSignal(),
   mTouchSignal(),
   mWheelEventSignal(),
   mContextLostSignal(),
index a64e964..a6eaf39 100644 (file)
@@ -206,6 +206,11 @@ public:
   void OnKeyEvent( const Dali::KeyEvent& event );
 
   /**
+   * Callback for Internal::Scene TouchedEventSignal signal
+   */
+  void OnTouchedEvent( const Dali::TouchEvent& touch );
+
+  /**
    * Callback for Internal::Scene TouchSignal signal
    */
   void OnTouchEvent( const Dali::TouchData& touch );
@@ -237,9 +242,10 @@ public:
 
   /**
    * Emits the touched signal.
+   * @param[in] touchEvent The touch event details (Old API).
    * @param[in] touch The touch event details.
    */
-  void EmitTouchedSignal( const Dali::TouchData& touch );
+  void EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch );
 
   /**
    * Used by the EventProcessor to emit wheel event signals.
@@ -263,6 +269,11 @@ public:
   Dali::Stage::EventProcessingFinishedSignalType& EventProcessingFinishedSignal();
 
   /**
+    * @copydoc Dali::Stage::TouchedSignal()
+    */
+  Dali::Stage::TouchedSignalType& TouchedSignal();
+
+  /**
     * @copydoc Dali::Stage::TouchSignal()
     */
   Dali::Stage::TouchSignalType& TouchSignal();
@@ -350,7 +361,8 @@ private:
   // The event processing finished signal
   Dali::Stage::EventProcessingFinishedSignalType  mEventProcessingFinishedSignal;
 
-  // The touched signal
+  // The touched signals
+  Dali::Stage::TouchedSignalType                  mTouchedSignal;
   Dali::Stage::TouchSignalType                    mTouchSignal;
 
   // The wheel event signal
index f016c10..5135e83 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TOUCH_DATA_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ public:
    *
    * Required because base class copy constructor is not implemented.
    * @param[in]  other  The TouchData to clone from.
-   * @return A new TouchData object which has the same touch point data.
+   * @return A new TouchData object which is has the same touch point data.
    */
   static TouchDataPtr Clone( const TouchData& other );
 
index cafdeef..1d63633 100644 (file)
@@ -64,7 +64,7 @@ const char * TOUCH_POINT_STATE[ 6 ] =
 /**
  *  Recursively deliver events to the actor and its parents, until the event is consumed or the stage is reached.
  */
-Dali::Actor EmitTouchSignals( Dali::Actor actor, const Dali::TouchData& touchData )
+Dali::Actor EmitTouchSignals( Dali::Actor actor, const TouchEvent& event, const Dali::TouchData& touchData )
 {
   Dali::Actor consumedActor;
 
@@ -79,7 +79,7 @@ Dali::Actor EmitTouchSignals( Dali::Actor actor, const Dali::TouchData& touchDat
     // Only emit the signal if the actor's touch signal has connections (or derived actor implementation requires touch).
     if ( actorImpl.GetTouchRequired() )
     {
-      consumed = actorImpl.EmitTouchEventSignal( touchData );
+      consumed = actorImpl.EmitTouchEventSignal( event, touchData );
     }
 
     if ( consumed )
@@ -96,7 +96,7 @@ Dali::Actor EmitTouchSignals( Dali::Actor actor, const Dali::TouchData& touchDat
            (parent == oldParent) )
       {
         // One of the actor's parents may consumed the event and they should be set as the consumed actor.
-        consumedActor = EmitTouchSignals( parent, touchData );
+        consumedActor = EmitTouchSignals( parent, event, touchData );
       }
     }
   }
@@ -106,19 +106,21 @@ Dali::Actor EmitTouchSignals( Dali::Actor actor, const Dali::TouchData& touchDat
 
 Dali::Actor AllocAndEmitTouchSignals( unsigned long time,  Dali::Actor actor, const Integration::Point& point )
 {
+  TouchEvent touchEvent( time );
   TouchDataPtr touchData( new TouchData( time ) );
   Dali::TouchData touchDataHandle( touchData.Get() );
 
+  touchEvent.points.push_back( point.GetTouchPoint() );
   touchData->AddPoint( point );
 
-  return EmitTouchSignals( actor, touchDataHandle );
+  return EmitTouchSignals( actor, touchEvent, touchDataHandle );
 }
 
 
 /**
  * Changes the state of the primary point to leave and emits the touch signals
  */
-Dali::Actor EmitTouchSignals( Actor* actor, RenderTask& renderTask, const TouchDataPtr& originalTouchData, PointState::Type state )
+Dali::Actor EmitTouchSignals( Actor* actor, RenderTask& renderTask, const TouchEvent& originalEvent, const TouchDataPtr& originalTouchData, PointState::Type state )
 {
   Dali::Actor consumingActor;
 
@@ -136,7 +138,10 @@ Dali::Actor EmitTouchSignals( Actor* actor, RenderTask& renderTask, const TouchD
     primaryPoint.SetHitActor( Dali::Actor( actor ) );
     primaryPoint.SetState( state );
 
-    consumingActor = EmitTouchSignals( Dali::Actor(actor), Dali::TouchData( touchData.Get() ) );
+    TouchEvent touchEvent( originalEvent );
+    touchEvent.points[0] = primaryPoint.GetTouchPoint();
+
+    consumingActor = EmitTouchSignals( Dali::Actor(actor), touchEvent, Dali::TouchData( touchData.Get() ) );
   }
 
   return consumingActor;
@@ -258,16 +263,19 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
 
     currentPoint.SetHitActor( Dali::Actor() );
 
+    TouchEvent touchEvent( event.time );
     TouchDataPtr touchData( new TouchData( event.time ) );
     Dali::TouchData touchDataHandle( touchData.Get() );
 
+    touchEvent.points.push_back( currentPoint.GetTouchPoint() );
     touchData->AddPoint( currentPoint );
 
-    mScene.EmitTouchedSignal( touchDataHandle );
+    mScene.EmitTouchedSignal( touchEvent, touchDataHandle );
     return false; // No need for hit testing & already an interrupted event so just return false
   }
 
   // 2) Hit Testing.
+  TouchEvent touchEvent( event.time );
   TouchDataPtr touchData( new TouchData( event.time ) );
   Dali::TouchData touchDataHandle( touchData.Get() );
 
@@ -297,6 +305,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
     newPoint.SetHitActor( hitTestResults.actor );
     newPoint.SetLocalPosition( hitTestResults.actorCoordinates );
 
+    touchEvent.points.push_back( newPoint.GetTouchPoint() );
     touchData->AddPoint( newPoint );
 
     DALI_LOG_INFO( gLogFilter, Debug::General, "  State(%s), Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
@@ -315,7 +324,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
   Dali::Actor consumedActor;
   if ( currentRenderTask )
   {
-    consumedActor = EmitTouchSignals( touchData->GetPoint( 0 ).GetHitActor(), touchDataHandle );
+    consumedActor = EmitTouchSignals( touchData->GetPoint( 0 ).GetHitActor(), touchEvent, touchDataHandle );
     consumed = consumedActor ? true : false;
   }
 
@@ -327,7 +336,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
   DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor:       (%p) %s\n", consumedActor ? reinterpret_cast< void* >( &consumedActor.GetBaseObject() ) : NULL, consumedActor ? consumedActor.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str() : "" );
 
   if ( ( primaryPointState == PointState::DOWN ) &&
-       ( touchData->GetPointCount() == 1 ) &&
+       ( touchEvent.GetPointCount() == 1 ) &&
        ( consumedActor && consumedActor.GetProperty< bool >( Dali::Actor::Property::CONNECTED_TO_SCENE ) ) )
   {
     mTouchDownConsumedActor.SetActor( &GetImplementation( consumedActor ) );
@@ -354,7 +363,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
           if ( lastPrimaryHitActor->GetLeaveRequired() )
           {
             DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit):     (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
-            leaveEventConsumer = EmitTouchSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, touchData, PointState::LEAVE );
+            leaveEventConsumer = EmitTouchSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::LEAVE );
           }
         }
         else
@@ -362,7 +371,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
           // At this point mLastPrimaryHitActor was touchable and sensitive in the previous touch event process but is not in the current one.
           // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
           DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit):     (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
-          leaveEventConsumer = EmitTouchSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, touchData, PointState::INTERRUPTED );
+          leaveEventConsumer = EmitTouchSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::INTERRUPTED );
         }
       }
 
@@ -382,7 +391,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
           if( lastConsumedActor->GetLeaveRequired() )
           {
             DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
-            EmitTouchSignals( lastConsumedActor, lastRenderTaskImpl, touchData, PointState::LEAVE );
+            EmitTouchSignals( lastConsumedActor, lastRenderTaskImpl, touchEvent, touchData, PointState::LEAVE );
           }
         }
         else
@@ -390,7 +399,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
           // At this point mLastConsumedActor was touchable and sensitive in the previous touch event process but is not in the current one.
           // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
           DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume):     (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
-          EmitTouchSignals( mLastConsumedActor.GetActor(), lastRenderTaskImpl, touchData, PointState::INTERRUPTED );
+          EmitTouchSignals( mLastConsumedActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::INTERRUPTED );
         }
       }
     }
@@ -437,7 +446,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
   // 6) Emit an interrupted event to the touch-down actor if it hasn't consumed the up and
   //    emit the stage touched event if required.
 
-  if ( touchData->GetPointCount() == 1 ) // Only want the first touch and the last release
+  if ( touchEvent.GetPointCount() == 1 ) // Only want the first touch and the last release
   {
     switch ( primaryPointState )
     {
@@ -465,7 +474,7 @@ bool TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
 
       case PointState::DOWN:
       {
-        mScene.EmitTouchedSignal( touchDataHandle );
+        mScene.EmitTouchedSignal( touchEvent, touchDataHandle );
         break;
       }
 
@@ -497,11 +506,14 @@ void TouchEventProcessor::OnObservedActorDisconnected( Actor* actor )
     touchData->AddPoint( point );
     Dali::TouchData touchDataHandle( touchData.Get() );
 
-    Dali::Actor eventConsumer = EmitTouchSignals( handle, touchDataHandle );
+    TouchEvent touchEvent( 0 );
+    touchEvent.points.push_back( point.GetTouchPoint() );
+
+    Dali::Actor eventConsumer = EmitTouchSignals( handle, touchEvent, touchDataHandle );
 
     if ( mLastConsumedActor.GetActor() != eventConsumer )
     {
-      EmitTouchSignals( Dali::Actor( mLastConsumedActor.GetActor() ), touchDataHandle );
+      EmitTouchSignals( Dali::Actor( mLastConsumedActor.GetActor() ), touchEvent, touchDataHandle );
     }
 
     // Do not set mLastPrimaryHitActor to NULL we may be iterating through its observers
index 3c314fc..a999efa 100644 (file)
@@ -202,6 +202,13 @@ float Actor::GetRelayoutSize( Dimension::Type dimension ) const
   return GetImplementation(*this).GetRelayoutSize( dimension );
 }
 
+Actor::TouchSignalType& Actor::TouchedSignal()
+{
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchedSignal() is deprecated and will be removed from next release. Use TouchSignal() instead.\n" );
+
+  return GetImplementation(*this).TouchedSignal();
+}
+
 Actor::TouchDataSignalType& Actor::TouchSignal()
 {
   return GetImplementation( *this ).TouchSignal();
index ac5564f..2f12cdf 100644 (file)
@@ -50,6 +50,7 @@ struct Degree;
 class Quaternion;
 class Layer;
 class TouchData;
+struct TouchEvent;
 struct HoverEvent;
 struct WheelEvent;
 struct Vector2;
@@ -65,7 +66,7 @@ typedef Rect<float> Padding;      ///< Padding definition @SINCE_1_0.0
  *
  * <h3>Multi-Touch Events:</h3>
  *
- * Touch or hover events are received via signals; see Actor::TouchSignal() and Actor::HoveredSignal() for more details.
+ * Touch or hover events are received via signals; see Actor::TouchedSignal() and Actor::HoveredSignal() for more details.
  *
  * <i>Hit Testing Rules Summary:</i>
  *
@@ -220,7 +221,7 @@ typedef Rect<float> Padding;      ///< Padding definition @SINCE_1_0.0
  * Signals
  * | %Signal Name      | Method                       |
  * |-------------------|------------------------------|
- * | touch             | @ref TouchSignal()           |
+ * | touched           | @ref TouchedSignal()         |
  * | hovered           | @ref HoveredSignal()         |
  * | wheelEvent        | @ref WheelEventSignal()      |
  * | onScene           | @ref OnSceneSignal()         |
@@ -730,6 +731,7 @@ public:
 
   // Typedefs
 
+  typedef Signal< bool (Actor, const TouchEvent&) > TouchSignalType;        ///< @DEPRECATED_1_1.37 @brief Touch signal type @SINCE_1_0.0
   typedef Signal< bool (Actor, const TouchData&) >  TouchDataSignalType;    ///< Touch signal type @SINCE_1_1.37
   typedef Signal< bool (Actor, const HoverEvent&) > HoverSignalType;        ///< Hover signal type @SINCE_1_0.0
   typedef Signal< bool (Actor, const WheelEvent&) > WheelEventSignalType;   ///< Wheel signal type @SINCE_1_0.0
@@ -1161,6 +1163,22 @@ public: // Renderer
 public: // Signals
 
   /**
+   * @DEPRECATED_1_1.37 Use TouchSignal() instead.
+   * @brief This signal is emitted when touch input is received.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   bool YourCallbackName(Actor actor, const TouchEvent& event);
+   * @endcode
+   * The return value of True, indicates that the touch event should be consumed.
+   * Otherwise the signal will be emitted on the next sensitive parent of the actor.
+   * @SINCE_1_0.0
+   * @return The signal to connect to
+   * @pre The Actor has been initialized.
+   */
+  TouchSignalType& TouchedSignal() DALI_DEPRECATED_API;
+
+  /**
    * @brief This signal is emitted when touch input is received.
    *
    * A callback of the following type may be connected:
index 12b8828..df35bf7 100644 (file)
@@ -45,6 +45,7 @@ class CustomActor;
 class CustomActorImpl;
 class RelayoutContainer;
 struct KeyEvent;
+struct TouchEvent;
 struct HoverEvent;
 struct WheelEvent;
 struct Vector2;
@@ -175,6 +176,18 @@ public:
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize) = 0;
 
   /**
+   * @DEPRECATED_1_1.37 Connect to TouchSignal() instead.
+   *
+   * @brief Called after a touch-event is received by the owning actor.
+   *
+   * @SINCE_1_0.0
+   * @param[in] event The touch event
+   * @return True if the event should be consumed
+   * @note CustomActorImpl::REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ).
+   */
+  virtual bool OnTouchEvent(const TouchEvent& event) DALI_DEPRECATED_API = 0;
+
+  /**
    * @brief Called after a hover-event is received by the owning actor.
    *
    * @SINCE_1_0.0
index 86f339f..39fc2f1 100644 (file)
@@ -59,6 +59,7 @@
 #include <dali/public-api/events/tap-gesture-detector.h>
 #include <dali/public-api/events/tap-gesture.h>
 #include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/events/touch-point.h>
 
 #include <dali/public-api/images/native-image-interface.h>
diff --git a/dali/public-api/events/touch-event.cpp b/dali/public-api/events/touch-event.cpp
new file mode 100644 (file)
index 0000000..9a3a821
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/public-api/events/touch-event.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+
+TouchEvent::TouchEvent()
+: time(0)
+{
+}
+
+TouchEvent::TouchEvent(unsigned long time)
+: time(time)
+{
+}
+
+TouchEvent::~TouchEvent()
+{
+}
+
+uint32_t TouchEvent::GetPointCount() const
+{
+  return static_cast<uint32_t>( points.size() );
+}
+
+const TouchPoint& TouchEvent::GetPoint( uint32_t point ) const
+{
+  DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" );
+  return points[point];
+}
+
+} // namespace Dali
diff --git a/dali/public-api/events/touch-event.h b/dali/public-api/events/touch-event.h
new file mode 100644 (file)
index 0000000..83c03d1
--- /dev/null
@@ -0,0 +1,115 @@
+#ifndef DALI_TOUCH_EVENT_H
+#define DALI_TOUCH_EVENT_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/events/touch-point.h>
+
+namespace Dali
+{
+/**
+ * @addtogroup dali_core_events
+ * @{
+ */
+
+/**
+ * @DEPRECATED_1_1.37 Use TouchData instead
+ *
+ * @brief Touch events are a collection of touch points at a specific moment in time.
+ *
+ * When a multi-touch event occurs, each touch point represents the points that are currently being
+ * touched or the points where a touch has stopped.
+ * @SINCE_1_0.0
+ */
+struct DALI_CORE_API TouchEvent
+{
+  // Construction & Destruction
+
+  /**
+   * @DEPRECATED_1_1.37
+   * @brief Default constructor.
+   * @SINCE_1_0.0
+   */
+  TouchEvent() DALI_DEPRECATED_API;
+
+  /**
+   * @DEPRECATED_1_1.37
+   * @brief Constructor.
+   * @SINCE_1_0.0
+   * @param[in] time The time the event occurred
+   */
+  TouchEvent(unsigned long time) DALI_DEPRECATED_API;
+
+  /**
+   * @DEPRECATED_1_1.37
+   * @brief Destructor.
+   * @SINCE_1_0.0
+   */
+  ~TouchEvent() DALI_DEPRECATED_API;
+
+  // Data
+
+  /**
+   * @DEPRECATED_1_1.37
+   * @brief This is a container of points for this touch event.
+   *
+   * The first point in the set is always the
+   * primary touch point (i.e. the first point touched in a multi-touch event).
+   */
+  TouchPointContainer points;
+
+  /**
+   * @DEPRECATED_1_1.37
+   * @brief The time (in ms) that the touch event occurred.
+   */
+  unsigned long time;
+
+  // Convenience Methods
+
+  /**
+   * @DEPRECATED_1_1.37
+   * @brief Returns the total number of points in this TouchEvent.
+   *
+   * @SINCE_1_0.0
+   * @return Total number of Points
+   */
+  uint32_t GetPointCount() const DALI_DEPRECATED_API;
+
+  /**
+   * @DEPRECATED_1_1.37
+   * @brief Returns a touch point at the index requested.
+   *
+   * The first point in the set is always the primary
+   * touch point (i.e. the first point touched in a multi-touch event).
+   * @SINCE_1_0.0
+   * @param[in] point The index of the required Point
+   * @return Point requested
+   * @note "point" should be less than the value returned by GetPointCount().
+   *       If out of range, then program asserts.
+   */
+  const TouchPoint& GetPoint( uint32_t point ) const DALI_DEPRECATED_API;
+};
+
+/**
+ * @}
+ */
+} // namespace Dali
+
+#endif // DALI_TOUCH_EVENT_H
index e4d7486..e40a700 100644 (file)
@@ -34,6 +34,7 @@ SET( public_api_src_files
   ${public_api_src_dir}/events/tap-gesture.cpp
   ${public_api_src_dir}/events/tap-gesture-detector.cpp
   ${public_api_src_dir}/events/touch-point.cpp
+  ${public_api_src_dir}/events/touch-event.cpp
   ${public_api_src_dir}/events/touch-data.cpp
   ${public_api_src_dir}/images/pixel.cpp
   ${public_api_src_dir}/images/pixel-data.cpp
@@ -144,6 +145,7 @@ SET( public_api_core_events_header_files
   ${public_api_src_dir}/events/tap-gesture.h
   ${public_api_src_dir}/events/tap-gesture-detector.h
   ${public_api_src_dir}/events/touch-point.h
+  ${public_api_src_dir}/events/touch-event.h
   ${public_api_src_dir}/events/touch-data.h
   ${public_api_src_dir}/events/mouse-button.h
 )
index b31b1b6..4812ca9 100644 (file)
@@ -31,7 +31,7 @@
  * class MyClass : public ConnectionTracker
  * {
  *
- *   void Callback( Actor actor, const TouchData& event )
+ *   void Callback( Actor actor, const TouchEvent& event )
  *   {
  *     ...
  *   }
@@ -40,7 +40,7 @@
  *   {
  *     Actor actor = Actor::New();
  *
- *     actor.TouchSignal().Connect( this, &MyClass::Callback );
+ *     actor.TouchedSignal().Connect( this, &MyClass::Callback );
  *   }
  *
  *   ~MyClass()