[dali_1.9.28] Merge branch 'devel/master' 81/243281/1
authorRichard Huang <r.huang@samsung.com>
Fri, 4 Sep 2020 10:16:10 +0000 (11:16 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 4 Sep 2020 10:16:10 +0000 (11:16 +0100)
Change-Id: I3f7cd18342490e72c5c7b05349a25f3036facde4

173 files changed:
automated-tests/src/dali-internal/CMakeLists.txt
automated-tests/src/dali-internal/utc-Dali-Internal-Gesture.cpp [new file with mode: 0644]
automated-tests/src/dali-internal/utc-Dali-Internal-LongPressGesture.cpp [new file with mode: 0644]
automated-tests/src/dali-internal/utc-Dali-Internal-PinchGesture.cpp [new file with mode: 0644]
automated-tests/src/dali-internal/utc-Dali-Internal-PinchGestureProcessor.cpp [new file with mode: 0644]
automated-tests/src/dali-internal/utc-Dali-Internal-RotationGesture.cpp [new file with mode: 0644]
automated-tests/src/dali-internal/utc-Dali-Internal-TapGesture.cpp [new file with mode: 0644]
automated-tests/src/dali-internal/utc-Dali-Internal-TapGestureProcessor.cpp [new file with mode: 0644]
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-event-utils.h
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-BaseHandle.cpp
automated-tests/src/dali/utc-Dali-Constraint.cpp
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-Gesture.cpp [deleted file]
automated-tests/src/dali/utc-Dali-HoverProcessing.cpp
automated-tests/src/dali/utc-Dali-LongPressGesture.cpp [deleted file]
automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp
automated-tests/src/dali/utc-Dali-LongPressGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-PanGesture.cpp
automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PanGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-PinchGesture.cpp [deleted file]
automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PinchGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-PropertyNotification.cpp
automated-tests/src/dali/utc-Dali-RotationGesture.cpp [deleted file]
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-TapGesture.cpp [deleted file]
automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp
automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp
automated-tests/src/dali/utc-Dali-TouchEvent.cpp [new file with mode: 0644]
automated-tests/src/dali/utc-Dali-TouchEventCombiner.cpp
automated-tests/src/dali/utc-Dali-TouchProcessing.cpp
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/hover-event-devel.cpp [new file with mode: 0644]
dali/devel-api/events/hover-event-devel.h [new file with mode: 0644]
dali/devel-api/events/pan-gesture-devel.cpp [new file with mode: 0644]
dali/devel-api/events/pan-gesture-devel.h [new file with mode: 0644]
dali/devel-api/events/touch-point.cpp [moved from dali/public-api/events/touch-point.cpp with 73% similarity]
dali/devel-api/events/touch-point.h [moved from dali/public-api/events/touch-point.h with 73% similarity]
dali/devel-api/file.list
dali/integration-api/events/point.cpp
dali/integration-api/events/point.h
dali/integration-api/events/touch-event-combiner.cpp
dali/integration-api/events/touch-event-combiner.h
dali/integration-api/events/touch-integ.h
dali/integration-api/scene.cpp
dali/integration-api/scene.h
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h
dali/internal/event/actors/custom-actor-internal.cpp
dali/internal/event/actors/custom-actor-internal.h
dali/internal/event/animation/linear-constrainer-impl.cpp
dali/internal/event/animation/path-constrainer-impl.cpp
dali/internal/event/common/object-impl.h
dali/internal/event/common/property-notification-impl.cpp
dali/internal/event/common/property-notification-manager.cpp
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/actor-gesture-data.cpp
dali/internal/event/events/actor-gesture-data.h
dali/internal/event/events/gesture-detector-impl.cpp
dali/internal/event/events/gesture-detector-impl.h
dali/internal/event/events/gesture-event-processor.cpp
dali/internal/event/events/gesture-event-processor.h
dali/internal/event/events/gesture-event.cpp
dali/internal/event/events/gesture-event.h
dali/internal/event/events/gesture-impl.h [new file with mode: 0644]
dali/internal/event/events/gesture-processor.cpp
dali/internal/event/events/gesture-processor.h
dali/internal/event/events/gesture-recognizer.h
dali/internal/event/events/gesture-requests.h
dali/internal/event/events/hover-event-impl.cpp
dali/internal/event/events/hover-event-impl.h
dali/internal/event/events/hover-event-processor.cpp
dali/internal/event/events/key-event-impl.cpp
dali/internal/event/events/key-event-impl.h
dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-detector-impl.h
dali/internal/event/events/long-press-gesture/long-press-gesture-event.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-event.h
dali/internal/event/events/long-press-gesture/long-press-gesture-impl.h [new file with mode: 0644]
dali/internal/event/events/long-press-gesture/long-press-gesture-processor.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.h
dali/internal/event/events/pan-gesture/pan-gesture-detector-impl.cpp
dali/internal/event/events/pan-gesture/pan-gesture-detector-impl.h
dali/internal/event/events/pan-gesture/pan-gesture-event.cpp
dali/internal/event/events/pan-gesture/pan-gesture-event.h
dali/internal/event/events/pan-gesture/pan-gesture-impl.h [new file with mode: 0644]
dali/internal/event/events/pan-gesture/pan-gesture-processor.cpp
dali/internal/event/events/pan-gesture/pan-gesture-processor.h
dali/internal/event/events/pan-gesture/pan-gesture-recognizer.cpp
dali/internal/event/events/pan-gesture/pan-gesture-recognizer.h
dali/internal/event/events/pinch-gesture/pinch-gesture-detector-impl.cpp
dali/internal/event/events/pinch-gesture/pinch-gesture-detector-impl.h
dali/internal/event/events/pinch-gesture/pinch-gesture-event.cpp
dali/internal/event/events/pinch-gesture/pinch-gesture-event.h
dali/internal/event/events/pinch-gesture/pinch-gesture-impl.h [new file with mode: 0644]
dali/internal/event/events/pinch-gesture/pinch-gesture-processor.cpp
dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.cpp
dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.h
dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.cpp
dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.h
dali/internal/event/events/rotation-gesture/rotation-gesture-event.h
dali/internal/event/events/rotation-gesture/rotation-gesture-impl.h [new file with mode: 0644]
dali/internal/event/events/rotation-gesture/rotation-gesture-processor.cpp
dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.cpp
dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.h
dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.cpp
dali/internal/event/events/tap-gesture/tap-gesture-detector-impl.h
dali/internal/event/events/tap-gesture/tap-gesture-event.cpp
dali/internal/event/events/tap-gesture/tap-gesture-event.h
dali/internal/event/events/tap-gesture/tap-gesture-impl.h [new file with mode: 0644]
dali/internal/event/events/tap-gesture/tap-gesture-processor.cpp
dali/internal/event/events/tap-gesture/tap-gesture-recognizer.cpp
dali/internal/event/events/tap-gesture/tap-gesture-recognizer.h
dali/internal/event/events/touch-event-impl.cpp
dali/internal/event/events/touch-event-impl.h
dali/internal/event/events/wheel-event-impl.cpp
dali/internal/event/events/wheel-event-impl.h
dali/internal/update/animation/scene-graph-constraint.h
dali/internal/update/common/scene-graph-property-notification.cpp
dali/internal/update/gestures/pan-gesture-profiling.h
dali/internal/update/gestures/scene-graph-pan-gesture.cpp
dali/internal/update/gestures/scene-graph-pan-gesture.h
dali/internal/update/manager/update-manager.cpp
dali/public-api/actors/actor.cpp
dali/public-api/actors/actor.h
dali/public-api/actors/custom-actor-impl.cpp
dali/public-api/actors/custom-actor-impl.h
dali/public-api/animation/constraint.cpp
dali/public-api/animation/constraint.h
dali/public-api/common/constants.h
dali/public-api/dali-core-version.cpp
dali/public-api/dali-core.h
dali/public-api/events/gesture-enumerations.h [new file with mode: 0644]
dali/public-api/events/gesture.cpp
dali/public-api/events/gesture.h
dali/public-api/events/long-press-gesture-detector.h
dali/public-api/events/long-press-gesture.cpp
dali/public-api/events/long-press-gesture.h
dali/public-api/events/pan-gesture-detector.cpp
dali/public-api/events/pan-gesture-detector.h
dali/public-api/events/pan-gesture.cpp
dali/public-api/events/pan-gesture.h
dali/public-api/events/pinch-gesture-detector.h
dali/public-api/events/pinch-gesture.cpp
dali/public-api/events/pinch-gesture.h
dali/public-api/events/rotation-gesture-detector.h
dali/public-api/events/rotation-gesture.cpp
dali/public-api/events/rotation-gesture.h
dali/public-api/events/tap-gesture-detector.h
dali/public-api/events/tap-gesture.cpp
dali/public-api/events/tap-gesture.h
dali/public-api/events/touch-event.cpp
dali/public-api/events/touch-event.h
dali/public-api/file.list
dali/public-api/object/property-notification.h
dali/public-api/signals/dali-signal.h
packaging/dali.spec

index 22a472d..3ace2e3 100644 (file)
@@ -10,9 +10,16 @@ SET(TC_SOURCES
         utc-Dali-Internal-Core.cpp
         utc-Dali-Internal-FixedSizeMemoryPool.cpp
         utc-Dali-Internal-FrustumCulling.cpp
+        utc-Dali-Internal-Gesture.cpp
         utc-Dali-Internal-Handles.cpp
+        utc-Dali-Internal-LongPressGesture.cpp
         utc-Dali-Internal-MemoryPoolObjectAllocator.cpp
         utc-Dali-Internal-OwnerPointer.cpp
+        utc-Dali-Internal-PinchGesture.cpp
+        utc-Dali-Internal-PinchGestureProcessor.cpp
+        utc-Dali-Internal-RotationGesture.cpp
+        utc-Dali-Internal-TapGesture.cpp
+        utc-Dali-Internal-TapGestureProcessor.cpp
 )
 
 LIST(APPEND TC_SOURCES
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-Gesture.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-Gesture.cpp
new file mode 100644 (file)
index 0000000..25938e1
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2014 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-test-suite-utils.h>
+#include <dali/internal/event/events/gesture-impl.h>
+
+using namespace Dali;
+
+void utc_dali_internal_gesture_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_gesture_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+namespace
+{
+
+// TestGesture Struct (Gesture constructor is protected)
+struct TestGesture : public Internal::Gesture
+{
+public:
+  TestGesture(GestureType::Value type, GestureState state)
+  : Gesture(type, state) {}
+
+  virtual ~TestGesture() {}
+};
+
+} // anon namespace
+
+int UtcDaliGestureConstructorP(void)
+{
+  TestApplication application; // Reset all test adapter return codes
+
+  Gesture empty;
+  DALI_TEST_CHECK( !empty );
+
+  Gesture pan( new TestGesture(GestureType::PAN, GestureState::STARTED) );
+  DALI_TEST_EQUALS(GestureType::PAN, pan.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, pan.GetState(), TEST_LOCATION);
+
+  Gesture pinch( new TestGesture(GestureType::PINCH, GestureState::CLEAR) );
+  DALI_TEST_EQUALS(GestureType::PINCH, pinch.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CLEAR, pinch.GetState(), TEST_LOCATION);
+
+  // Test copy constructor
+  Gesture pan2(pan);
+  DALI_TEST_EQUALS(GestureType::PAN, pan2.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, pan2.GetState(), TEST_LOCATION);
+  END_TEST;
+
+  // Test move constructor
+  const auto refCount = pan.GetObjectPtr()->ReferenceCount();
+  Gesture pan3( std::move( pan ) );
+  DALI_TEST_EQUALS(pan, Gesture(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, pan3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(pan3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliGestureAssignmentP(void)
+{
+  TestApplication application; // Reset all test adapter return codes
+
+  // Test Assignment operator
+  Gesture pan( new TestGesture(GestureType::PAN, GestureState::FINISHED) );
+  DALI_TEST_EQUALS(GestureType::PAN, pan.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, pan.GetState(), TEST_LOCATION);
+
+  Gesture test( new TestGesture(GestureType::PINCH, GestureState::STARTED) );
+  DALI_TEST_EQUALS(GestureType::PINCH, test.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, test.GetState(), TEST_LOCATION);
+
+  // Copy assignment
+  test = pan;
+  DALI_TEST_EQUALS(GestureType::PAN, test.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, test.GetState(), TEST_LOCATION);
+
+  // Move assignment
+  const auto refCount = pan.GetObjectPtr()->ReferenceCount();
+  Gesture pan3;
+  DALI_TEST_EQUALS(pan3, Gesture(), TEST_LOCATION);
+  pan3 = std::move(pan);
+  DALI_TEST_EQUALS(pan, Gesture(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, pan3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(pan3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliGestureGetTypeP(void)
+{
+  TestApplication application; // Reset all test adapter return codes
+
+  Gesture pan( new TestGesture(GestureType::PAN, GestureState::STARTED) );
+  DALI_TEST_EQUALS(GestureType::PAN, pan.GetType(), TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliGestureGetStateP(void)
+{
+  TestApplication application; // Reset all test adapter return codes
+
+  Gesture pan( new TestGesture(GestureType::PAN, GestureState::STARTED) );
+  DALI_TEST_EQUALS(GestureState::STARTED, pan.GetState(), TEST_LOCATION);
+
+  GetImplementation(pan).SetState(GestureState::FINISHED);
+  DALI_TEST_EQUALS(GestureState::FINISHED, pan.GetState(), TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliGestureGetTimeP(void)
+{
+  TestApplication application; // Reset all test adapter return codes
+
+  Gesture pan( new TestGesture(GestureType::PAN, GestureState::STARTED) );
+  DALI_TEST_EQUALS(0, pan.GetTime(), TEST_LOCATION);
+
+  GetImplementation(pan).SetTime(61282);
+  DALI_TEST_EQUALS(61282, pan.GetTime(), TEST_LOCATION);
+
+  END_TEST;
+}
+
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-LongPressGesture.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-LongPressGesture.cpp
new file mode 100644 (file)
index 0000000..b3c9bf3
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2014 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-test-suite-utils.h>
+#include <dali/internal/event/events/long-press-gesture/long-press-gesture-impl.h>
+
+using namespace Dali;
+
+void utc_dali_internal_long_press_gesture_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_long_press_gesture_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+int UtcDaliLongPressGestureConstructorP(void)
+{
+  TestApplication application;
+
+  LongPressGesture gesture(new Internal::LongPressGesture( GestureState::STARTED ));
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::LONG_PRESS, gesture.GetType(), TEST_LOCATION);
+
+  // Test Copy constructor
+  GetImplementation( gesture ).SetNumberOfTouches( 5u );
+
+  LongPressGesture gesture2(gesture);
+  DALI_TEST_EQUALS(5u, gesture2.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::LONG_PRESS, gesture2.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, gesture2.GetState(), TEST_LOCATION);
+
+  // Test move constructor
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  LongPressGesture gesture3( std::move( gesture ) );
+  DALI_TEST_EQUALS(gesture, LongPressGesture(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::LONG_PRESS, gesture3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliLongPressGestureAssignmentP(void)
+{
+  // Test Assignment operator
+  LongPressGesture gesture(new Internal::LongPressGesture( GestureState::STARTED ));
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::LONG_PRESS, gesture.GetType(), TEST_LOCATION);
+
+  GetImplementation( gesture ).SetNumberOfTouches( 5u );
+
+  LongPressGesture gesture2(new Internal::LongPressGesture( GestureState::FINISHED ));
+  DALI_TEST_EQUALS(GestureState::FINISHED, gesture2.GetState(), TEST_LOCATION);
+  gesture2 = gesture;
+  DALI_TEST_EQUALS(5u, gesture2.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::LONG_PRESS, gesture2.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, gesture2.GetState(), TEST_LOCATION);
+
+  // Move assignment
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  LongPressGesture gesture3;
+  DALI_TEST_EQUALS(gesture3, Gesture(), TEST_LOCATION);
+  gesture3 = std::move(gesture);
+  DALI_TEST_EQUALS(gesture, Gesture(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::LONG_PRESS, gesture3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliLongPressGestureGetNumberOfTouchesP(void)
+{
+  TestApplication application;
+
+  LongPressGesture gesture(new Internal::LongPressGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetNumberOfTouches(), 1, TEST_LOCATION);
+
+  GetImplementation(gesture).SetNumberOfTouches(4);
+  DALI_TEST_EQUALS(gesture.GetNumberOfTouches(), 4, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliLongPressGestureGetScreenPointP(void)
+{
+  TestApplication application;
+
+  LongPressGesture gesture(new Internal::LongPressGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetScreenPoint(), Vector2::ZERO , TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture.GetLocalPoint(), Vector2::ZERO , TEST_LOCATION);
+
+  GetImplementation(gesture).SetScreenPoint(Vector2(100.0f, 300.0f));
+  DALI_TEST_EQUALS(gesture.GetScreenPoint(), Vector2(100.0f, 300.0f), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture.GetLocalPoint(), Vector2::ZERO , TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliLongPressGestureGetLocalPointP(void)
+{
+  TestApplication application;
+
+  LongPressGesture gesture(new Internal::LongPressGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetLocalPoint(), Vector2::ZERO , TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture.GetScreenPoint(), Vector2::ZERO , TEST_LOCATION);
+
+  GetImplementation(gesture).SetLocalPoint(Vector2(100.0f, 300.0f));
+  DALI_TEST_EQUALS(gesture.GetLocalPoint(), Vector2(100.0f, 300.0f), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture.GetScreenPoint(), Vector2::ZERO , TEST_LOCATION);
+
+  END_TEST;
+}
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-PinchGesture.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-PinchGesture.cpp
new file mode 100644 (file)
index 0000000..0447e34
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2014 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-test-suite-utils.h>
+#include <dali/internal/event/events/pinch-gesture/pinch-gesture-impl.h>
+
+using namespace Dali;
+
+void utc_dali_internal_pinch_gesture_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_pinch_gesture_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+// Positive test case for a method
+int UtcDaliPinchGestureConstructor(void)
+{
+  TestApplication application; // Reset all test adapter return codes
+
+  PinchGesture gesture(new Internal::PinchGesture( GestureState::STARTED ));
+  DALI_TEST_EQUALS(GestureState::STARTED, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture.GetScale(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture.GetSpeed(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PINCH, gesture.GetType(), TEST_LOCATION);
+
+  PinchGesture gesture2(new Internal::PinchGesture( GestureState::CONTINUING ));
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture2.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture2.GetScale(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture2.GetSpeed(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PINCH, gesture2.GetType(), TEST_LOCATION);
+
+  PinchGesture gesture3(new Internal::PinchGesture( GestureState::FINISHED ));
+  DALI_TEST_EQUALS(GestureState::FINISHED, gesture3.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture3.GetScale(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture3.GetSpeed(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PINCH, gesture3.GetType(), TEST_LOCATION);
+
+  // Test copy constructor
+  GetImplementation( gesture3 ).SetScale( 3.0f );
+  GetImplementation( gesture3 ).SetSpeed( 5.0f );
+
+  PinchGesture pinch(gesture3);
+  DALI_TEST_EQUALS(GestureState::FINISHED, pinch.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(3.0f, pinch.GetScale(), TEST_LOCATION);
+  DALI_TEST_EQUALS(5.0f, pinch.GetSpeed(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PINCH, pinch.GetType(), TEST_LOCATION);
+
+  // Test move constructor
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  PinchGesture gesture4( std::move( gesture ) );
+  DALI_TEST_CHECK(!gesture);
+  DALI_TEST_EQUALS(GestureType::PINCH, gesture4.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture4.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliPinchGestureAssignment(void)
+{
+  // Test Assignment operator
+  PinchGesture gesture(new Internal::PinchGesture( GestureState::STARTED ));
+  DALI_TEST_EQUALS(GestureState::STARTED, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture.GetScale(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture.GetSpeed(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PINCH, gesture.GetType(), TEST_LOCATION);
+
+  PinchGesture gesture2(new Internal::PinchGesture( GestureState::CONTINUING ));
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture2.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture2.GetScale(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture2.GetSpeed(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PINCH, gesture2.GetType(), TEST_LOCATION);
+
+  GetImplementation( gesture2 ).SetScale( 3.0f );
+  GetImplementation( gesture2 ).SetSpeed( 5.0f );
+
+  gesture = gesture2;
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(3.0f, gesture.GetScale(), TEST_LOCATION);
+  DALI_TEST_EQUALS(5.0f, gesture.GetSpeed(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PINCH, gesture.GetType(), TEST_LOCATION);
+
+  // Move assignment
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  PinchGesture gesture3;
+  DALI_TEST_EQUALS(gesture3, Gesture(), TEST_LOCATION);
+  gesture3 = std::move(gesture);
+  DALI_TEST_CHECK(!gesture);
+  DALI_TEST_EQUALS(GestureType::PINCH, gesture3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliPinchGestureSetGetScaleP(void)
+{
+  PinchGesture gesture(new Internal::PinchGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetScale(), 0.0f, TEST_LOCATION);
+
+  GetImplementation(gesture).SetScale(123.0f);
+  DALI_TEST_EQUALS(gesture.GetScale(), 123.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliPinchGestureSetGetSpeedP(void)
+{
+  PinchGesture gesture(new Internal::PinchGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetSpeed(), 0.0f, TEST_LOCATION);
+
+  GetImplementation(gesture).SetSpeed(123.0f);
+  DALI_TEST_EQUALS(gesture.GetSpeed(), 123.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliPinchGestureSetGetScreenCenterPointP(void)
+{
+  PinchGesture gesture(new Internal::PinchGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetScreenCenterPoint(), Vector2::ZERO, TEST_LOCATION);
+
+  GetImplementation(gesture).SetScreenCenterPoint(Vector2(123.0f, 321.0f));
+  DALI_TEST_EQUALS(gesture.GetScreenCenterPoint(), Vector2(123.0f,321.0f), TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliPinchGestureSetGetLocalCenterPointP(void)
+{
+  PinchGesture gesture(new Internal::PinchGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetLocalCenterPoint(), Vector2::ZERO, TEST_LOCATION);
+
+  GetImplementation(gesture).SetLocalCenterPoint(Vector2(123.0f,321.0f));
+  DALI_TEST_EQUALS(gesture.GetLocalCenterPoint(), Vector2(123.0f,321.0f), TEST_LOCATION);
+
+  END_TEST;
+}
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-PinchGestureProcessor.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-PinchGestureProcessor.cpp
new file mode 100644 (file)
index 0000000..02c43eb
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014 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-test-suite-utils.h>
+#include <dali/internal/event/events/pinch-gesture/pinch-gesture-processor.h>
+#include <dali/internal/event/events/pinch-gesture/pinch-gesture-event.h>
+#include <dali/internal/event/common/scene-impl.h>
+
+using namespace Dali;
+
+void utc_dali_internal_pinch_gesture_processor_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_pinch_gesture_processor_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+namespace
+{
+
+void TestAbortWithState(GestureState state)
+{
+  TestApplication application;
+
+  Internal::PinchGestureProcessor processor;
+  Integration::Scene scene( application.GetScene() );
+  Internal::Scene& sceneImpl = GetImplementation( scene );
+  Internal::PinchGestureEvent event(state);
+
+  try
+  {
+    processor.Process(sceneImpl, event);
+    DALI_TEST_CHECK( false ); // Should not get here as we expect an abort
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true ); // We aborted, so the test has passed
+  }
+}
+
+} // anon namespace
+
+int UtcDaliPinchGestureProcessorProcessClearStateN(void)
+{
+  TestAbortWithState(GestureState::CLEAR);
+  END_TEST;
+}
+
+int UtcDaliPinchGestureProcessorProcessPossibleStateN(void)
+{
+  TestAbortWithState(GestureState::POSSIBLE);
+  END_TEST;
+}
+
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-RotationGesture.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-RotationGesture.cpp
new file mode 100644 (file)
index 0000000..12f0313
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * 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-test-suite-utils.h>
+#include <dali/internal/event/events/rotation-gesture/rotation-gesture-impl.h>
+
+using namespace Dali;
+
+void utc_dali_internal_rotation_gesture_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_rotation_gesture_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+// Positive test case for a method
+int UtcDaliRotationGestureConstructor(void)
+{
+  TestApplication application; // Reset all test adapter return codes
+
+  RotationGesture gesture(new Internal::RotationGesture( GestureState::STARTED ));
+  DALI_TEST_EQUALS(GestureState::STARTED, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture.GetRotation().radian, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::ROTATION, gesture.GetType(), TEST_LOCATION);
+
+  RotationGesture gesture2(new Internal::RotationGesture( GestureState::CONTINUING ));
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture2.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture2.GetRotation().radian, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::ROTATION, gesture2.GetType(), TEST_LOCATION);
+
+  RotationGesture gesture3(new Internal::RotationGesture( GestureState::FINISHED ));
+  DALI_TEST_EQUALS(GestureState::FINISHED, gesture3.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture3.GetRotation().radian, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::ROTATION, gesture3.GetType(), TEST_LOCATION);
+
+  // Test copy constructor
+  GetImplementation( gesture3 ).SetRotation( Radian( 3.0f ));
+
+  RotationGesture rotation(gesture3);
+  DALI_TEST_EQUALS(GestureState::FINISHED, rotation.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(3.0f, rotation.GetRotation().radian, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::ROTATION, rotation.GetType(), TEST_LOCATION);
+
+  // Test move constructor
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  RotationGesture gesture4( std::move( gesture ) );
+  DALI_TEST_CHECK(!gesture);
+  DALI_TEST_EQUALS(GestureType::ROTATION, gesture4.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture4.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliRotationGestureAssignment(void)
+{
+  // Test Assignment operator
+  RotationGesture gesture(new Internal::RotationGesture( GestureState::STARTED ));
+  DALI_TEST_EQUALS(GestureState::STARTED, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture.GetRotation().radian, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::ROTATION, gesture.GetType(), TEST_LOCATION);
+
+  RotationGesture gesture2(new Internal::RotationGesture( GestureState::CONTINUING ));
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture2.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.0f, gesture2.GetRotation().radian, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::ROTATION, gesture2.GetType(), TEST_LOCATION);
+
+  GetImplementation( gesture2 ).SetRotation( Radian( 3.0f ));
+
+  gesture = gesture2;
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(3.0f, gesture.GetRotation().radian, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::ROTATION, gesture.GetType(), TEST_LOCATION);
+
+  // Move assignment
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  RotationGesture gesture3;
+  DALI_TEST_EQUALS(gesture3, Gesture(), TEST_LOCATION);
+  gesture3 = std::move(gesture);
+  DALI_TEST_CHECK(!gesture);
+  DALI_TEST_EQUALS(GestureType::ROTATION, gesture3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliRotationGestureSetGetRotationP(void)
+{
+  RotationGesture gesture(new Internal::RotationGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetRotation(), Radian(), TEST_LOCATION);
+
+  GetImplementation(gesture).SetRotation(Dali::ANGLE_270);
+  DALI_TEST_EQUALS(gesture.GetRotation(), Dali::ANGLE_270, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliRotationGestureSetGetScreenCenterPointP(void)
+{
+  RotationGesture gesture(new Internal::RotationGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetScreenCenterPoint(), Vector2::ZERO, TEST_LOCATION);
+
+  GetImplementation(gesture).SetScreenCenterPoint(Vector2(123.0f,321.0f));
+  DALI_TEST_EQUALS(gesture.GetScreenCenterPoint(), Vector2(123.0f,321.0f), TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliRotationGestureSetGetLocalCenterPointP(void)
+{
+  RotationGesture gesture(new Internal::RotationGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetLocalCenterPoint(), Vector2::ZERO, TEST_LOCATION);
+
+  GetImplementation(gesture).SetLocalCenterPoint(Vector2(123.0f,321.0f));
+  DALI_TEST_EQUALS(gesture.GetLocalCenterPoint(), Vector2(123.0f,321.0f), TEST_LOCATION);
+
+  END_TEST;
+}
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-TapGesture.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-TapGesture.cpp
new file mode 100644 (file)
index 0000000..de9a012
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2014 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-test-suite-utils.h>
+#include <dali/internal/event/events/tap-gesture/tap-gesture-impl.h>
+
+using namespace Dali;
+
+void utc_dali_internal_tap_gesture_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_tap_gesture_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+
+// Positive test case for a method
+int UtcDaliTapGestureConstructor(void)
+{
+  TestApplication application; // Reset all test adapter return codes
+
+  TapGesture gesture(new Internal::TapGesture( GestureState::STARTED ));
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::TAP, gesture.GetType(), TEST_LOCATION);
+
+  // Test Copy constructor
+  GetImplementation( gesture ).SetNumberOfTouches( 5u );
+  GetImplementation( gesture ).SetNumberOfTaps( 2u );
+
+  TapGesture gesture2(gesture);
+  DALI_TEST_EQUALS(5u, gesture2.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(2u, gesture2.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::TAP, gesture2.GetType(), TEST_LOCATION);
+
+  // Test move constructor
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  TapGesture gesture3( std::move( gesture ) );
+  DALI_TEST_CHECK(!gesture);
+  DALI_TEST_EQUALS(GestureType::TAP, gesture3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliTapGestureAssignment(void)
+{
+  // Test Assignment operator
+  TapGesture gesture(new Internal::TapGesture( GestureState::STARTED ));
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::TAP, gesture.GetType(), TEST_LOCATION);
+
+  GetImplementation( gesture ).SetNumberOfTouches( 5u );
+  GetImplementation( gesture ).SetNumberOfTaps( 2u );
+
+  TapGesture gesture2;
+  gesture2 = gesture;
+  DALI_TEST_EQUALS(5u, gesture2.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(2u, gesture2.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::TAP, gesture2.GetType(), TEST_LOCATION);
+
+  // Move assignment
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  TapGesture gesture3;
+  DALI_TEST_EQUALS(gesture3, Gesture(), TEST_LOCATION);
+  gesture3 = std::move(gesture);
+  DALI_TEST_CHECK(!gesture);
+  DALI_TEST_EQUALS(GestureType::TAP, gesture3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliTapGestureSetGetNumberOfTapsP(void)
+{
+  TapGesture gesture(new Internal::TapGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetNumberOfTaps(), 1u, TEST_LOCATION);
+
+  GetImplementation(gesture).SetNumberOfTaps(123u);
+  DALI_TEST_EQUALS(gesture.GetNumberOfTaps(), 123u, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliTapGestureSetGetNumberOfTouchesP(void)
+{
+  TapGesture gesture(new Internal::TapGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetNumberOfTouches(), 1u, TEST_LOCATION);
+
+  GetImplementation(gesture).SetNumberOfTouches(321u);
+  DALI_TEST_EQUALS(gesture.GetNumberOfTouches(), 321u, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliTapGestureSetGetScreenPointP(void)
+{
+  TapGesture gesture(new Internal::TapGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetScreenPoint(), Vector2::ZERO, TEST_LOCATION);
+
+  GetImplementation(gesture).SetScreenPoint(Vector2(123.0f,321.0f));
+  DALI_TEST_EQUALS(gesture.GetScreenPoint(), Vector2(123.0f,321.0f), TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliTapGestureSetGetLocalPointP(void)
+{
+  TapGesture gesture(new Internal::TapGesture(GestureState::STARTED));
+  DALI_TEST_EQUALS(gesture.GetLocalPoint(), Vector2::ZERO, TEST_LOCATION);
+
+  GetImplementation(gesture).SetLocalPoint(Vector2(123.0f,321.0f));
+  DALI_TEST_EQUALS(gesture.GetLocalPoint(), Vector2(123.0f,321.0f), TEST_LOCATION);
+
+  END_TEST;
+}
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-TapGestureProcessor.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-TapGestureProcessor.cpp
new file mode 100644 (file)
index 0000000..231dfcb
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014 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-test-suite-utils.h>
+#include <dali/internal/event/events/tap-gesture/tap-gesture-processor.h>
+#include <dali/internal/event/events/tap-gesture/tap-gesture-event.h>
+#include <dali/internal/event/common/scene-impl.h>
+
+using namespace Dali;
+
+void utc_dali_internal_tap_gesture_processor_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_tap_gesture_processor_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+namespace
+{
+
+void TestAbortWithState(GestureState state)
+{
+  TestApplication application;
+
+  Internal::TapGestureProcessor processor;
+  Integration::Scene scene( application.GetScene() );
+  Internal::Scene& sceneImpl = GetImplementation( scene );
+  Internal::TapGestureEvent event(state);
+
+  try
+  {
+    processor.Process(sceneImpl, event);
+    DALI_TEST_CHECK( false ); // Should not get here as we expect an abort
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK( true ); // We aborted, so the test has passed
+  }
+}
+
+} // anon namespace
+
+int UtcDaliTapGestureProcessorProcessClearStateN(void)
+{
+  TestAbortWithState(GestureState::CLEAR);
+  END_TEST;
+}
+
+int UtcDaliTapGestureProcessorProcessContinuingStateN(void)
+{
+  TestAbortWithState(GestureState::CONTINUING);
+  END_TEST;
+}
+
+int UtcDaliTapGestureProcessorProcessFinishedStateN(void)
+{
+  TestAbortWithState(GestureState::FINISHED);
+  END_TEST;
+}
+
index afa6443..bab6fb6 100644 (file)
@@ -31,7 +31,6 @@ SET(TC_SOURCES
         utc-Dali-FrameBuffer.cpp
         utc-Dali-FrameCallbackInterface.cpp
         utc-Dali-Geometry.cpp
-        utc-Dali-Gesture.cpp
         utc-Dali-GestureDetector.cpp
         utc-Dali-Handle.cpp
         utc-Dali-Hash.cpp
@@ -41,7 +40,6 @@ SET(TC_SOURCES
         utc-Dali-KeyEvent.cpp
         utc-Dali-Layer.cpp
         utc-Dali-LocklessBuffer.cpp
-        utc-Dali-LongPressGesture.cpp
         utc-Dali-LongPressGestureDetector.cpp
         utc-Dali-LongPressGestureRecognizer.cpp
         utc-Dali-MathUtils.cpp
@@ -54,7 +52,6 @@ SET(TC_SOURCES
         utc-Dali-PanGestureDetector.cpp
         utc-Dali-PanGestureRecognizer.cpp
         utc-Dali-Path.cpp
-        utc-Dali-PinchGesture.cpp
         utc-Dali-PinchGestureDetector.cpp
         utc-Dali-PinchGestureRecognizer.cpp
         utc-Dali-Pixel.cpp
@@ -72,7 +69,6 @@ SET(TC_SOURCES
         utc-Dali-Renderer.cpp
         utc-Dali-RenderTask.cpp
         utc-Dali-RenderTaskList.cpp
-        utc-Dali-RotationGesture.cpp
         utc-Dali-RotationGestureDetector.cpp
         utc-Dali-RotationGestureRecognizer.cpp
         utc-Dali-Sampler.cpp
@@ -84,13 +80,13 @@ SET(TC_SOURCES
         utc-Dali-SignalTemplates.cpp
         utc-Dali-SingletonService.cpp
         utc-Dali-Stage.cpp
-        utc-Dali-TapGesture.cpp
         utc-Dali-TapGestureDetector.cpp
         utc-Dali-TapGestureRecognizer.cpp
         utc-Dali-Texture.cpp
         utc-Dali-TextureSet.cpp
         utc-Dali-Thread.cpp
         utc-Dali-ThreadPool.cpp
+        utc-Dali-TouchEvent.cpp
         utc-Dali-TouchEventCombiner.cpp
         utc-Dali-TouchProcessing.cpp
         utc-Dali-TypeRegistry.cpp
index 5723f7f..84f54b6 100644 (file)
@@ -240,7 +240,7 @@ namespace Impl
 {
 
 TestCustomActor::TestCustomActor()
-: CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS | REQUIRES_WHEEL_EVENTS | REQUIRES_HOVER_EVENTS | DISABLE_SIZE_NEGOTIATION ) ),
+: CustomActorImpl( ActorFlags( DISABLE_SIZE_NEGOTIATION ) ),
   mDaliProperty( Property::INVALID_INDEX ),
   mSizeSet( Vector3::ZERO ),
   mTargetSize( Vector3::ZERO ),
@@ -251,7 +251,7 @@ TestCustomActor::TestCustomActor()
 }
 
 TestCustomActor::TestCustomActor(bool nego)
-: CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS | REQUIRES_WHEEL_EVENTS | REQUIRES_HOVER_EVENTS ) ),
+: CustomActorImpl( ActorFlags() ),
   mDaliProperty( Property::INVALID_INDEX ),
   mSizeSet( Vector3::ZERO ),
   mTargetSize( Vector3::ZERO ),
@@ -322,7 +322,7 @@ void TestCustomActor::OnChildRemove(Actor& child)
 {
   AddToCallStacks("OnChildRemove");
 }
-void TestCustomActor::OnPropertySet( Property::Index index, Property::Value propertyValue )
+void TestCustomActor::OnPropertySet( Property::Index index, const Property::Value& propertyValue )
 {
   AddToCallStacks("OnPropertySet");
 }
@@ -336,21 +336,6 @@ void TestCustomActor::OnSizeAnimation(Animation& animation, const Vector3& targe
   mTargetSize = targetSize;
   AddToCallStacks("OnSizeAnimation");
 }
-bool TestCustomActor::OnHoverEvent(const HoverEvent& event)
-{
-  AddToCallStacks("OnHoverEvent");
-  return true;
-}
-bool TestCustomActor::OnWheelEvent(const WheelEvent& event)
-{
-  AddToCallStacks("OnWheelEvent");
-  return true;
-}
-bool TestCustomActor::OnKeyEvent(const KeyEvent& event)
-{
-  AddToCallStacks("OnKeyEvent");
-  return true;
-}
 void TestCustomActor::OnKeyInputFocusGained()
 {
   AddToCallStacks("OnKeyInputFocusGained");
index 907072f..97dffcd 100644 (file)
@@ -135,12 +135,9 @@ public:
   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 OnPropertySet( Dali::Property::Index index, const 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 OnKeyInputFocusGained();
   virtual void OnKeyInputFocusLost();
   Dali::Vector3 GetNaturalSize() override;
@@ -431,7 +428,7 @@ public:
    * Constructor
    */
   SimpleTestCustomActor()
-  : CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS | DISABLE_SIZE_NEGOTIATION ) )
+  : CustomActorImpl( ActorFlags( DISABLE_SIZE_NEGOTIATION ) )
   {
   }
 
@@ -461,25 +458,12 @@ public:
   void OnSizeAnimation(Dali::Animation& animation, const Dali::Vector3& targetSize) override
   {
   }
-  bool OnHoverEvent(const Dali::HoverEvent& event) override
-  {
-    return true;
-  }
-  bool OnWheelEvent(const Dali::WheelEvent& event) override
-  {
-    return true;
-  }
-  bool OnKeyEvent(const Dali::KeyEvent& event) override
-  {
-    return true;
-  }
   virtual void OnKeyInputFocusGained()
   {
   }
   virtual void OnKeyInputFocusLost()
   {
   }
-
   Dali::Vector3 GetNaturalSize() override
   {
     return Dali::Vector3( 0.0f, 0.0f, 0.0f );
index ef8cadc..08bf684 100644 (file)
@@ -21,7 +21,7 @@
 #include <dali/public-api/actors/actor.h>
 
 /**
- * Functor to be connected to an Actor's TouchSignal.
+ * Functor to be connected to an Actor's TouchedSignal.
  * Allows the user to specify whether the functor should return true (consumed) or false.
  */
 struct TouchEventFunctorConsumeSetter
index 57a9d73..01419e2 100644 (file)
@@ -2641,7 +2641,7 @@ int UtcDaliActorTouchedSignal(void)
   application.Render();
 
   // connect to its touch signal
-  actor.TouchSignal().Connect( TestTouchCallback );
+  actor.TouchedSignal().Connect( TestTouchCallback );
 
   // simulate a touch event in the middle of the screen
   Vector2 touchPoint( application.GetScene().GetSize() * 0.5 );
@@ -2882,7 +2882,7 @@ int UtcDaliActorHitTest(void)
     DALI_TEST_CHECK( !gTouchCallBackCalled );
 
     // connect to its touch signal
-    actor.TouchSignal().Connect(TestTouchCallback);
+    actor.TouchedSignal().Connect(TestTouchCallback);
 
     Dali::Integration::Point point;
     point.SetState( PointState::DOWN );
@@ -4855,9 +4855,9 @@ int UtcDaliActorRaiseLower(void)
 
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
-  actorA.TouchSignal().Connect( TestTouchCallback );
-  actorB.TouchSignal().Connect( TestTouchCallback2 );
-  actorC.TouchSignal().Connect( TestTouchCallback3 );
+  actorA.TouchedSignal().Connect( TestTouchCallback );
+  actorB.TouchedSignal().Connect( TestTouchCallback2 );
+  actorC.TouchedSignal().Connect( TestTouchCallback3 );
 
   // Connect ChildOrderChangedSignal
   bool orderChangedSignal( false );
@@ -5034,9 +5034,9 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
-  actorA.TouchSignal().Connect( TestTouchCallback );
-  actorB.TouchSignal().Connect( TestTouchCallback2 );
-  actorC.TouchSignal().Connect( TestTouchCallback3 );
+  actorA.TouchedSignal().Connect( TestTouchCallback );
+  actorB.TouchedSignal().Connect( TestTouchCallback2 );
+  actorC.TouchedSignal().Connect( TestTouchCallback3 );
 
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
@@ -5221,9 +5221,9 @@ int UtcDaliActorRaiseAbove(void)
 
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
-  actorA.TouchSignal().Connect( TestTouchCallback );
-  actorB.TouchSignal().Connect( TestTouchCallback2 );
-  actorC.TouchSignal().Connect( TestTouchCallback3 );
+  actorA.TouchedSignal().Connect( TestTouchCallback );
+  actorB.TouchedSignal().Connect( TestTouchCallback2 );
+  actorC.TouchedSignal().Connect( TestTouchCallback3 );
 
   bool orderChangedSignal( false );
   Actor orderChangedActor;
@@ -5386,9 +5386,9 @@ int UtcDaliActorLowerBelow(void)
 
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
-  actorA.TouchSignal().Connect( TestTouchCallback );
-  actorB.TouchSignal().Connect( TestTouchCallback2 );
-  actorC.TouchSignal().Connect( TestTouchCallback3 );
+  actorA.TouchedSignal().Connect( TestTouchCallback );
+  actorB.TouchedSignal().Connect( TestTouchCallback2 );
+  actorC.TouchedSignal().Connect( TestTouchCallback3 );
 
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
@@ -5580,9 +5580,9 @@ int UtcDaliActorRaiseAboveDifferentParentsN(void)
 
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
-  actorA.TouchSignal().Connect( TestTouchCallback );
-  actorB.TouchSignal().Connect( TestTouchCallback2 );
-  actorC.TouchSignal().Connect( TestTouchCallback3 );
+  actorA.TouchedSignal().Connect( TestTouchCallback );
+  actorB.TouchedSignal().Connect( TestTouchCallback2 );
+  actorC.TouchedSignal().Connect( TestTouchCallback3 );
 
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
@@ -5666,9 +5666,9 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
-  actorA.TouchSignal().Connect( TestTouchCallback );
-  actorB.TouchSignal().Connect( TestTouchCallback2 );
-  actorC.TouchSignal().Connect( TestTouchCallback3 );
+  actorA.TouchedSignal().Connect( TestTouchCallback );
+  actorB.TouchedSignal().Connect( TestTouchCallback2 );
+  actorC.TouchedSignal().Connect( TestTouchCallback3 );
 
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
@@ -5827,9 +5827,9 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
 
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
-  actorA.TouchSignal().Connect( TestTouchCallback );
-  actorB.TouchSignal().Connect( TestTouchCallback2 );
-  actorC.TouchSignal().Connect( TestTouchCallback3 );
+  actorA.TouchedSignal().Connect( TestTouchCallback );
+  actorB.TouchedSignal().Connect( TestTouchCallback2 );
+  actorC.TouchedSignal().Connect( TestTouchCallback3 );
 
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
@@ -5984,9 +5984,9 @@ int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void)
 
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
-  actorA.TouchSignal().Connect( TestTouchCallback );
-  actorB.TouchSignal().Connect( TestTouchCallback2 );
-  actorC.TouchSignal().Connect( TestTouchCallback3 );
+  actorA.TouchedSignal().Connect( TestTouchCallback );
+  actorB.TouchedSignal().Connect( TestTouchCallback2 );
+  actorC.TouchedSignal().Connect( TestTouchCallback3 );
 
   ResetTouchCallbacks();
 
@@ -7251,7 +7251,7 @@ int utcDaliActorCulled(void)
   DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::CULLED ), false, TEST_LOCATION );
 
   PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::CULLED, LessThanCondition( 0.5f ) );
-  notification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+  notification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
 
   // Connect NotifySignal
   bool propertyNotificationSignal( false );
@@ -8000,13 +8000,13 @@ int UtcDaliActorAddRendererNegative(void)
   END_TEST;
 }
 
-int UtcDaliActorTouchSignalNegative(void)
+int UtcDaliActorTouchedSignalNegative(void)
 {
   TestApplication application;
   Dali::Actor instance;
   try
   {
-    instance.TouchSignal();
+    instance.TouchedSignal();
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)
index 121c7bb..6623b87 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 678d2ad..2e4b354 100644 (file)
@@ -485,7 +485,7 @@ int UtcDaliConstraintCloneCheckSourcesAndSetters(void)
   constraint.AddSource( LocalSource( Actor::Property::ORIENTATION ) );
   constraint.AddSource( LocalSource( Actor::Property::COLOR ) );
   constraint.AddSource( LocalSource( Actor::Property::VISIBLE ) );
-  constraint.SetRemoveAction( Constraint::Discard );
+  constraint.SetRemoveAction( Constraint::DISCARD );
   constraint.SetTag( 123 );
 
   // Clone the constraint & apply the clone
@@ -751,11 +751,11 @@ int UtcDaliConstraintRemoveActionP(void)
   Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &BasicFunction< Vector3 > );
   DALI_TEST_EQUALS( constraint.GetRemoveAction(), Constraint::DEFAULT_REMOVE_ACTION, TEST_LOCATION );
 
-  constraint.SetRemoveAction( Constraint::Discard );
-  DALI_TEST_EQUALS( constraint.GetRemoveAction(), Constraint::Discard, TEST_LOCATION );
+  constraint.SetRemoveAction( Constraint::DISCARD );
+  DALI_TEST_EQUALS( constraint.GetRemoveAction(), Constraint::DISCARD, TEST_LOCATION );
 
-  constraint.SetRemoveAction( Constraint::Bake );
-  DALI_TEST_EQUALS( constraint.GetRemoveAction(), Constraint::Bake, TEST_LOCATION );
+  constraint.SetRemoveAction( Constraint::BAKE );
+  DALI_TEST_EQUALS( constraint.GetRemoveAction(), Constraint::BAKE, TEST_LOCATION );
 
   END_TEST;
 }
@@ -769,7 +769,7 @@ int UtcDaliConstraintSetRemoveActionN(void)
   Constraint constraint;
   try
   {
-    constraint.SetRemoveAction( Constraint::Discard );
+    constraint.SetRemoveAction( Constraint::DISCARD );
     DALI_TEST_CHECK( false ); // Should not reach here!
   }
   catch( ... )
@@ -819,7 +819,7 @@ int UtcDaliConstraintBakeRemoveAction(void)
 
   // Create a constraint that constrains to position
   Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, SetValueFunctor< Vector3 >( position ) );
-  constraint.SetRemoveAction( Constraint::Bake );
+  constraint.SetRemoveAction( Constraint::BAKE );
   constraint.Apply();
 
   application.SendNotification();
@@ -859,7 +859,7 @@ int UtcDaliConstraintDiscardRemoveAction(void)
 
   // Create a constraint that constrains to position
   Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, SetValueFunctor< Vector3 >( position ) );
-  constraint.SetRemoveAction( Constraint::Discard );
+  constraint.SetRemoveAction( Constraint::DISCARD );
   constraint.Apply();
 
   application.SendNotification();
@@ -1309,7 +1309,7 @@ int UtcDaliConstraintEnsureResetterAppliedOnSceneRemoval(void)
 
   // Create a constraint whose value is discarded when it is removed
   Constraint constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, SetHalfOpacity );
-  constraint.SetRemoveAction( Constraint::RemoveAction::Discard );
+  constraint.SetRemoveAction( Constraint::RemoveAction::DISCARD );
   constraint.Apply();
 
   // Check value after one render, it should be constrained
@@ -1364,7 +1364,7 @@ int UtcDaliConstraintOnActorAddedAndRemoved(void)
 
   // Create a constraint whose value is discarded when it is removed
   Constraint constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, SetHalfOpacity );
-  constraint.SetRemoveAction( Constraint::RemoveAction::Discard );
+  constraint.SetRemoveAction( Constraint::RemoveAction::DISCARD );
   constraint.Apply();
 
   // Check value after one render, it should be constrained
@@ -1428,7 +1428,7 @@ int UtcDaliConstraintSetRemoveActionNegative(void)
   Dali::Constraint instance;
   try
   {
-    Dali::Constraint::RemoveAction arg1(Constraint::Bake);
+    Dali::Constraint::RemoveAction arg1(Constraint::BAKE);
     instance.SetRemoveAction(arg1);
     DALI_TEST_CHECK(false); // Should not get here
   }
index bce0c34..47bacfb 100644 (file)
@@ -999,69 +999,6 @@ int UtcDaliCustomActorSizeComponentAnimation(void)
   END_TEST;
 }
 
-int UtcDaliCustomActorOnHoverEvent(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::CustomActor::OnHoverEvent()");
-
-  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 hover event
-  Dali::Integration::Point point;
-  point.SetState( PointState::MOTION );
-  point.SetScreenPosition( Vector2( 1, 1 ) );
-  Dali::Integration::HoverEvent event;
-  event.AddPoint( point );
-  application.ProcessEvent( event );
-
-  DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
-  DALI_TEST_EQUALS( "OnHoverEvent", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliCustomActorOnWheelEvent(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::CustomActor::OnWheelEvent()");
-
-  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 wheel event
-  Vector2 screenCoordinates( 10.0f, 10.0f );
-  Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
-  application.ProcessEvent( event );
-
-  DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
-  DALI_TEST_EQUALS( "OnWheelEvent", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
-  END_TEST;
-}
-
 int UtcDaliCustomActorImplOnPropertySet(void)
 {
   TestApplication application;
@@ -1408,7 +1345,7 @@ struct UnregisteredCustomActor : public Dali::CustomActorImpl
   { }
   virtual void OnChildRemove(Actor& child)
   { }
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue )
+  virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue )
   { }
   virtual void OnSizeSet(const Vector3& targetSize)
   { }
@@ -1416,8 +1353,6 @@ struct UnregisteredCustomActor : public Dali::CustomActorImpl
   { }
   virtual bool OnHoverEvent(const HoverEvent& event)
   { return false; }
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  { return false; }
   virtual bool OnWheelEvent(const WheelEvent& event)
   { return false; }
   virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
diff --git a/automated-tests/src/dali/utc-Dali-Gesture.cpp b/automated-tests/src/dali/utc-Dali-Gesture.cpp
deleted file mode 100644 (file)
index ccd31a6..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2014 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-test-suite-utils.h>
-
-using namespace Dali;
-
-void utc_dali_gesture_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_gesture_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-namespace
-{
-
-// TestGesture Struct (Gesture constructor is protected)
-struct TestGesture : public Gesture
-{
-public:
-  TestGesture(Gesture::Type type, Gesture::State state)
-  : Gesture(type, state) {}
-
-  virtual ~TestGesture() {}
-};
-
-} // anon namespace
-
-int UtcDaliGestureConstructor(void)
-{
-  TestApplication application; // Reset all test adapter return codes
-
-  TestGesture pan(Gesture::Pan, Gesture::Started);
-  DALI_TEST_EQUALS(Gesture::Pan, pan.type, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, pan.state, TEST_LOCATION);
-
-  TestGesture pinch(Gesture::Pinch, Gesture::Clear);
-  DALI_TEST_EQUALS(Gesture::Pinch, pinch.type, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Clear, pinch.state, TEST_LOCATION);
-
-  // Test copy constructor
-  TestGesture pan2(pan);
-  DALI_TEST_EQUALS(Gesture::Pan, pan2.type, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, pan2.state, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliGestureAssignment(void)
-{
-  // Test Assignment operator
-  TestGesture pan(Gesture::Pan, Gesture::Finished);
-  DALI_TEST_EQUALS(Gesture::Pan, pan.type, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, pan.state, TEST_LOCATION);
-
-  TestGesture test(Gesture::Pinch, Gesture::Started);
-  DALI_TEST_EQUALS(Gesture::Pinch, test.type, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, test.state, TEST_LOCATION);
-
-  test = pan;
-  DALI_TEST_EQUALS(Gesture::Pan, test.type, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, test.state, TEST_LOCATION);
-  END_TEST;
-}
index c0dc5b6..861ade2 100644 (file)
@@ -21,6 +21,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/integration-api/render-task-list-integ.h>
+#include <dali/devel-api/events/hover-event-devel.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -1280,3 +1281,18 @@ int UtcDaliHoverClippingActor(void)
 
   END_TEST;
 }
+
+int UtcDaliHoverEventCreate(void)
+{
+  TestApplication application;
+
+  Dali::HoverEvent hoverEvent = DevelHoverEvent::New( 100 );
+  DALI_TEST_CHECK( hoverEvent );
+
+  // Emit a started signal
+  DALI_TEST_EQUALS( 100, hoverEvent.GetTime(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 0, hoverEvent.GetPointCount(), TEST_LOCATION );
+
+  END_TEST;
+}
+
diff --git a/automated-tests/src/dali/utc-Dali-LongPressGesture.cpp b/automated-tests/src/dali/utc-Dali-LongPressGesture.cpp
deleted file mode 100644 (file)
index b870366..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2014 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-test-suite-utils.h>
-
-using namespace Dali;
-
-void utc_dali_long_press_gesture_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_long_press_gesture_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-
-// Positive test case for a method
-int UtcDaliLongPressGestureConstructor(void)
-{
-  TestApplication application; // Reset all test adapter return codes
-
-  LongPressGesture gesture( Gesture::Started );
-  DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::LongPress, gesture.type, TEST_LOCATION);
-
-  // Test Copy constructor
-  gesture.numberOfTouches = 5u;
-
-  LongPressGesture gesture2(gesture);
-  DALI_TEST_EQUALS(5u, gesture2.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::LongPress, gesture2.type, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, gesture2.state, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliLongPressGestureAssignment(void)
-{
-  // Test Assignment operator
-  LongPressGesture gesture( Gesture::Started );
-  DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::LongPress, gesture.type, TEST_LOCATION);
-
-  gesture.numberOfTouches = 5u;
-
-  LongPressGesture gesture2( Gesture::Finished );
-  DALI_TEST_EQUALS(Gesture::Finished, gesture2.state, TEST_LOCATION);
-  gesture2 = gesture;
-  DALI_TEST_EQUALS(5u, gesture2.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::LongPress, gesture2.type, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, gesture2.state, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliLongPressGestureDynamicAllocation(void)
-{
-  LongPressGesture* gesture = new LongPressGesture( Gesture::Started );
-  DALI_TEST_EQUALS(1u, gesture->numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::LongPress, gesture->type, TEST_LOCATION);
-  delete gesture;
-
-  END_TEST;
-}
index 20c821e..0a1b6a9 100644 (file)
@@ -48,7 +48,7 @@ struct SignalData
   SignalData()
   : functorCalled( false ),
     voidFunctorCalled( false ),
-    receivedGesture( Gesture::Clear ),
+    receivedGesture(),
     pressedActor()
   {}
 
@@ -57,9 +57,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.numberOfTouches = 0u;
-    receivedGesture.screenPoint = Vector2(0.0f, 0.0f);
-    receivedGesture.localPoint = Vector2(0.0f, 0.0f);
+    receivedGesture.Reset();
 
     pressedActor.Reset();
   }
@@ -93,7 +91,7 @@ struct GestureReceivedFunctor
 // Functor that removes the gestured actor from stage
 struct UnstageActorFunctor : public GestureReceivedFunctor
 {
-  UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
+  UnstageActorFunctor( SignalData& data, GestureState& stateToUnstage, Integration::Scene scene )
   : GestureReceivedFunctor( data ),
     stateToUnstage( stateToUnstage ),
     scene( scene )
@@ -104,13 +102,13 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
   {
     GestureReceivedFunctor::operator()( actor, longPress );
 
-    if ( longPress.state == stateToUnstage )
+    if ( longPress.GetState() == stateToUnstage )
     {
       scene.Remove( actor );
     }
   }
 
-  Gesture::State& stateToUnstage;
+  GestureState& stateToUnstage;
   Integration::Scene scene;
 };
 
@@ -208,7 +206,7 @@ int UtcDaliLongPressGestureDetectorNew(void)
   detector.Attach(actor);
 
   TouchEventFunctor touchFunctor;
-  actor.TouchSignal().Connect(&application, touchFunctor);
+  actor.TouchedSignal().Connect(&application, touchFunctor);
 
   Integration::TouchEvent touchEvent(1);
   Integration::Point point;
@@ -322,8 +320,8 @@ int UtcDaliLongPressGestureSignalReceptionPositive(void)
   // Do a long press inside actor's area
   TestGenerateLongPress( application, 50.0f, 50.0f );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
   TestEndLongPress( application, 50.0f, 50.0f);
   END_TEST;
 }
@@ -351,16 +349,16 @@ int UtcDaliLongPressGestureSignalReceptionDetach(void)
   // Start long press within the actor's area
   TestGenerateLongPress( application, 20.0f, 20.0f );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(20.0f, 20.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(20.0f, 20.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
   TestEndLongPress( application, 20.0f, 20.0f);
 
   // repeat the long press within the actor's area - we should still receive the signal
   data.Reset();
   TestGenerateLongPress( application, 50.0f, 50.0f );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
   TestEndLongPress( application, 50.0f, 50.0f);
 
   // Detach actor
@@ -442,8 +440,8 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void)
   TestGenerateLongPress( application, 5.0f, 5.0f );
   TestEndLongPress( application, 5.0f, 5.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.GetScreenPoint(), 0.1, TEST_LOCATION);
 
   // Rotate actor again and render
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
@@ -455,8 +453,8 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void)
   TestGenerateLongPress( application, 5.0f, 5.0f );
   TestEndLongPress( application, 5.0f, 5.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.GetScreenPoint(), 0.1, TEST_LOCATION);
 
   // Rotate actor again and render
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS) );
@@ -506,7 +504,7 @@ int UtcDaliLongPressGestureSignalReceptionChildHit(void)
   TestEndLongPress( application, 50.0f, 50.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, parent == data.pressedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.GetScreenPoint(), 0.01f, TEST_LOCATION);
 
   // Attach child and generate same touch points
   // (Also proves that you can detach and then re-attach another actor)
@@ -519,7 +517,7 @@ int UtcDaliLongPressGestureSignalReceptionChildHit(void)
   TestEndLongPress( application, 51.0f, 51.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, child == data.pressedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.GetScreenPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -701,7 +699,7 @@ int UtcDaliLongPressGestureSignalReceptionDifferentPossible(void)
   application.SendNotification();
   application.Render();
 
-  // Emit Started event, we should not receive the long press.
+  // Emit STARTED event, we should not receive the long press.
   TestTriggerLongPress( application );
   TestEndLongPress( application, 50.0f, 10.0f );
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
@@ -769,7 +767,7 @@ int UtcDaliLongPressGestureDetachAfterStarted(void)
   // Detach actor
   detector.Detach(actor);
 
-  // Emit Finished, no signal
+  // Emit FINISHED, no signal
   TestEndLongPress( application, 50.0f, 10.0f );
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
@@ -789,7 +787,7 @@ int UtcDaliLongPressGestureActorUnstaged(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage( GestureState::STARTED );
 
   // Attach actor to detector
   SignalData data;
@@ -816,8 +814,8 @@ int UtcDaliLongPressGestureActorUnstaged(void)
   application.SendNotification();
   application.Render();
 
-  // Change state to Gesture::Continuing to remove
-  stateToUnstage = Gesture::Finished;
+  // Change state to GestureState::CONTINUING to remove
+  stateToUnstage = GestureState::FINISHED;
 
   // Emit signals
   TestGenerateLongPress( application, 50.0f, 10.0f );
@@ -850,7 +848,7 @@ int UtcDaliLongPressGestureActorStagedAndDestroyed(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage( GestureState::STARTED );
 
   // Attach actor to detector
   SignalData data;
@@ -860,7 +858,7 @@ int UtcDaliLongPressGestureActorStagedAndDestroyed(void)
   detector.Attach(dummyActor);
   detector.DetectedSignal().Connect( &application, functor );
 
-  // Here we are testing a Started actor which is removed in the Started callback, but then added back
+  // Here we are testing a STARTED actor which is removed in the STARTED callback, but then added back
   // before we get a finished state.  As we were removed from the stage, even if we're at the same
   // position, we should still not be signalled.
 
@@ -1002,7 +1000,7 @@ int UtcDaliLongPressGestureInterruptedWhenTouchConsumed(void)
 
   bool consume = false;
   TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchSignal().Connect(&application,touchFunctor);
+  actor.TouchedSignal().Connect(&application,touchFunctor);
 
   // Render and notify
   application.SendNotification();
@@ -1053,7 +1051,7 @@ int UtcDaliLongPressGestureDisableDetectionDuringLongPressN(void)
       &application,
       [&detector, &functorCalled](Actor actor, const LongPressGesture& gesture)
       {
-        if( gesture.state == Gesture::Finished )
+        if( gesture.GetState() == GestureState::FINISHED )
         {
           detector.Detach(actor);
           functorCalled = true;
index ab81b80..27b4494 100644 (file)
@@ -25,7 +25,6 @@
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 
-
 using namespace Dali;
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -37,7 +36,7 @@ struct SignalData
   SignalData()
   : functorCalled(false),
     voidFunctorCalled(false),
-    receivedGesture(Gesture::Started)
+    receivedGesture()
   {}
 
   void Reset()
@@ -45,7 +44,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.state = Gesture::Started;
+    receivedGesture.Reset();
 
     pressedActor.Reset();
   }
index b35ec97..4c6ab70 100644 (file)
@@ -10,7 +10,8 @@
  * 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
+ * See the License for the specific language governing permissions an
+ * d
  * limitations under the License.
  *
  */
@@ -20,6 +21,7 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
+#include <dali/devel-api/events/pan-gesture-devel.h>
 
 using namespace Dali;
 
@@ -33,120 +35,128 @@ void utc_dali_pan_gesture_cleanup(void)
   test_return_value = TET_PASS;
 }
 
-
-
-int UtcDaliPanGestureConstructor(void)
+int UtcDaliPanGestureConstructorP(void)
 {
   TestApplication application; // Reset all test adapter return codes
 
-  PanGesture gesture;
-  DALI_TEST_EQUALS(Gesture::Clear, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, gesture.type, TEST_LOCATION);
+  PanGesture gesture = DevelPanGesture::New( GestureState::CLEAR );
+
+  DALI_TEST_EQUALS(GestureState::CLEAR, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture.GetType(), TEST_LOCATION);
+
+  PanGesture gesture2 = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(GestureState::STARTED, gesture2.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, gesture2.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture2.GetType(), TEST_LOCATION);
 
-  PanGesture gesture2(Gesture::Started);
-  DALI_TEST_EQUALS(Gesture::Started, gesture2.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture2.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, gesture2.type, TEST_LOCATION);
+  PanGesture gesture3 = DevelPanGesture::New( GestureState::CONTINUING );
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture3.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, gesture3.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture3.GetType(), TEST_LOCATION);
 
-  PanGesture gesture3(Gesture::Continuing);
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture3.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture3.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, gesture3.type, TEST_LOCATION);
+  PanGesture gesture4 = DevelPanGesture::New( GestureState::FINISHED );
 
-  PanGesture gesture4(Gesture::Finished);
-  DALI_TEST_EQUALS(Gesture::Finished, gesture4.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture4.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, gesture4.type, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, gesture4.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, gesture4.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture4.GetType(), TEST_LOCATION);
 
   // Test copy constructor
-  gesture4.numberOfTouches = 3u;
+  DevelPanGesture::SetNumberOfTouches( gesture4, 3u );
 
   PanGesture pan(gesture4);
-  DALI_TEST_EQUALS(Gesture::Finished, pan.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(3u, pan.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, pan.type, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, pan.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(3u, pan.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, pan.GetType(), TEST_LOCATION);
+
+  // Test move constructor
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  PanGesture gesture5( std::move( gesture ) );
+  DALI_TEST_CHECK(!gesture);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture5.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture5.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
   END_TEST;
 }
 
-int UtcDaliPanGestureAssignment(void)
+int UtcDaliPanGestureAssignmentP(void)
 {
   // Test Assignment operator
-  PanGesture gesture(Gesture::Started);
-  DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, gesture.type, TEST_LOCATION);
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(GestureState::STARTED, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture.GetType(), TEST_LOCATION);
 
-  PanGesture gesture2(Gesture::Continuing);
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture2.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, gesture2.type, TEST_LOCATION);
+  PanGesture gesture2 = DevelPanGesture::New( GestureState::CONTINUING );
 
-  gesture2.numberOfTouches = 3u;
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture2.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, gesture2.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture2.GetType(), TEST_LOCATION);
+
+  DevelPanGesture::SetNumberOfTouches( gesture2, 3u );
 
   gesture = gesture2;
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(3u, gesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, gesture.type, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, gesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(3u, gesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture.GetType(), TEST_LOCATION);
+
+  // Move assignment
+  const auto refCount = gesture.GetObjectPtr()->ReferenceCount();
+  PanGesture gesture3;
+  DALI_TEST_EQUALS(gesture3, Gesture(), TEST_LOCATION);
+  gesture3 = std::move(gesture);
+  DALI_TEST_CHECK(!gesture);
+  DALI_TEST_EQUALS(GestureType::PAN, gesture3.GetType(), TEST_LOCATION);
+  DALI_TEST_EQUALS(gesture3.GetBaseObject().ReferenceCount(), refCount, TEST_LOCATION);
+
   END_TEST;
 }
 
-int UtcDaliPanGestureGetSpeed(void)
+int UtcDaliPanGestureGetSpeedP(void)
 {
-  PanGesture gesture(Gesture::Started);
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
   DALI_TEST_EQUALS(0.0f, gesture.GetSpeed(), TEST_LOCATION);
 
-  gesture.velocity = Vector2(3.0f, -4.0f);
+  DevelPanGesture::SetVelocity( gesture, Vector2( 3.0f, -4.0f ) );
 
   DALI_TEST_EQUALS(5.0f, gesture.GetSpeed(), TEST_LOCATION);
   END_TEST;
 }
 
-int UtcDaliPanGestureGetDistance(void)
+int UtcDaliPanGestureGetDistanceP(void)
 {
-  PanGesture gesture(Gesture::Started);
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
   DALI_TEST_EQUALS(0.0f, gesture.GetDistance(), TEST_LOCATION);
 
-  gesture.displacement = Vector2(-30.0f, -40.0f);
+  DevelPanGesture::SetDisplacement( gesture, Vector2( -30.0f, -40.0f ) );
 
   DALI_TEST_EQUALS(50.0f, gesture.GetDistance(), TEST_LOCATION);
   END_TEST;
 }
 
-int UtcDaliPanGestureGetScreenSpeed(void)
+int UtcDaliPanGestureGetScreenSpeedP(void)
 {
-  PanGesture gesture(Gesture::Started);
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
   DALI_TEST_EQUALS(0.0f, gesture.GetScreenSpeed(), TEST_LOCATION);
 
-  gesture.screenVelocity = Vector2(3.0f, -4.0f);
+  DevelPanGesture::SetScreenVelocity( gesture, Vector2( 3.0f, -4.0f ) );
 
   DALI_TEST_EQUALS(5.0f, gesture.GetScreenSpeed(), TEST_LOCATION);
   END_TEST;
 }
 
-int UtcDaliPanGestureGetScreenDistance(void)
+int UtcDaliPanGestureGetScreenDistanceP(void)
 {
-  PanGesture gesture(Gesture::Started);
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
   DALI_TEST_EQUALS(0.0f, gesture.GetScreenDistance(), TEST_LOCATION);
 
-  gesture.screenDisplacement = Vector2(-30.0f, -40.0f);
+  DevelPanGesture::SetScreenDisplacement( gesture, Vector2( -30.0f, -40.0f ) );
 
   DALI_TEST_EQUALS(50.0f, gesture.GetScreenDistance(), TEST_LOCATION);
   END_TEST;
 }
 
-int UtcDaliPanGestureDynamicAllocation(void)
-{
-  PanGesture* gesture = new PanGesture( Gesture::Started );
-  DALI_TEST_EQUALS(Gesture::Started, gesture->state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture->numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pan, gesture->type, TEST_LOCATION);
-  delete gesture;
-
-  END_TEST;
-}
-
-int UtcDaliPanGestureDetectorRegisterProperty(void)
+int UtcDaliPanGestureDetectorRegisterPropertyP(void)
 {
   TestApplication application;
 
@@ -197,3 +207,90 @@ int UtcDaliPanGestureDetectorRegisterProperty(void)
   END_TEST;
 }
 
+int UtcDaliPanGestureSetGetTimeP(void)
+{
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(0, gesture.GetTime(), TEST_LOCATION);
+
+  DevelPanGesture::SetTime( gesture, 123123 );
+
+  DALI_TEST_EQUALS(123123, gesture.GetTime(), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliPanGestureSetGetVelocityP(void)
+{
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(Vector2::ZERO, gesture.GetVelocity(), TEST_LOCATION);
+
+  DevelPanGesture::SetVelocity( gesture, Vector2(123.0f, 321.0f) );
+
+  DALI_TEST_EQUALS(Vector2(123.0f, 321.0f), gesture.GetVelocity(), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliPanGestureSetGetDisplacementP(void)
+{
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(Vector2::ZERO, gesture.GetDisplacement(), TEST_LOCATION);
+
+  DevelPanGesture::SetDisplacement( gesture, Vector2(123.0f, 321.0f) );
+
+  DALI_TEST_EQUALS(Vector2(123.0f, 321.0f), gesture.GetDisplacement(), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliPanGestureSetGetPositionP(void)
+{
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(Vector2::ZERO, gesture.GetPosition(), TEST_LOCATION);
+
+  DevelPanGesture::SetPosition( gesture, Vector2(123.0f, 321.0f) );
+
+  DALI_TEST_EQUALS(Vector2(123.0f, 321.0f), gesture.GetPosition(), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliPanGestureSetGetScreenVelocityP(void)
+{
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(Vector2::ZERO, gesture.GetScreenVelocity(), TEST_LOCATION);
+
+  DevelPanGesture::SetScreenVelocity( gesture, Vector2(123.0f, 321.0f) );
+
+  DALI_TEST_EQUALS(Vector2(123.0f, 321.0f), gesture.GetScreenVelocity(), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliPanGestureSetGetScreenDisplacementP(void)
+{
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(Vector2::ZERO, gesture.GetScreenDisplacement(), TEST_LOCATION);
+
+  DevelPanGesture::SetScreenDisplacement( gesture, Vector2(123.0f, 321.0f) );
+
+  DALI_TEST_EQUALS(Vector2(123.0f, 321.0f), gesture.GetScreenDisplacement(), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliPanGestureSetGetScreenPositionP(void)
+{
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(Vector2::ZERO, gesture.GetScreenPosition(), TEST_LOCATION);
+
+  DevelPanGesture::SetScreenPosition( gesture, Vector2(123.0f, 321.0f) );
+
+  DALI_TEST_EQUALS(Vector2(123.0f, 321.0f), gesture.GetScreenPosition(), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliPanGestureSetGetNumberOfTouchesP(void)
+{
+  PanGesture gesture = DevelPanGesture::New( GestureState::STARTED );
+  DALI_TEST_EQUALS(1u, gesture.GetNumberOfTouches(), TEST_LOCATION);
+
+  DevelPanGesture::SetNumberOfTouches( gesture, 3123 );
+
+  DALI_TEST_EQUALS(3123, gesture.GetNumberOfTouches(), TEST_LOCATION);
+  END_TEST;
+}
index b0e245e..48790fe 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/integration-api/input-options.h>
 #include <dali-test-suite-utils.h>
 #include <test-touch-event-utils.h>
+#include <dali/devel-api/events/pan-gesture-devel.h>
 
 using namespace Dali;
 
@@ -51,7 +52,7 @@ struct SignalData
   SignalData()
   : functorCalled(false),
     voidFunctorCalled(false),
-    receivedGesture(Gesture::Clear)
+    receivedGesture()
   {}
 
   void Reset()
@@ -59,12 +60,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.state = Gesture::Clear;
-    receivedGesture.velocity = Vector2(0.0f, 0.0f);
-    receivedGesture.displacement = Vector2(0.0f, 0.0f);
-    receivedGesture.position = Vector2(0.0f, 0.0f);
-    receivedGesture.screenPosition = Vector2(0.0f, 0.0f);
-    receivedGesture.numberOfTouches = 0;
+    receivedGesture.Reset();
 
     pannedActor.Reset();
   }
@@ -98,7 +94,7 @@ struct GestureReceivedFunctor
 // Functor that removes the gestured actor from stage
 struct UnstageActorFunctor : public GestureReceivedFunctor
 {
-  UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
+  UnstageActorFunctor( SignalData& data, GestureState& stateToUnstage, Integration::Scene scene )
   : GestureReceivedFunctor( data ),
     stateToUnstage( stateToUnstage ),
     scene( scene )
@@ -109,13 +105,13 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
   {
     GestureReceivedFunctor::operator()( actor, pan );
 
-    if ( pan.state == stateToUnstage )
+    if ( pan.GetState() == stateToUnstage )
     {
       scene.Remove( actor );
     }
   }
 
-  Gesture::State& stateToUnstage;
+  GestureState& stateToUnstage;
   Integration::Scene scene;
 };
 
@@ -168,7 +164,7 @@ struct PanConstraint
 
 // Generate a PanGesture
 PanGesture GeneratePan( unsigned int time,
-                        Gesture::State state,
+                        GestureState state,
                         Vector2 screenPosition,
                         Vector2 localPosition,
                         Vector2 screenDisplacement = Vector2::ONE,
@@ -177,20 +173,20 @@ PanGesture GeneratePan( unsigned int time,
                         Vector2 localVelocity = Vector2::ONE,
                         unsigned int numberOfTouches = 1 )
 {
-  PanGesture pan( state );
+  Dali::PanGesture pan = DevelPanGesture::New( state );
 
-  pan.time = time;
+  DevelPanGesture::SetTime( pan, time );
 
-  pan.screenPosition = screenPosition;
-  pan.position = localPosition;
+  DevelPanGesture::SetScreenPosition( pan, screenPosition );
+  DevelPanGesture::SetPosition( pan, localPosition );
 
-  pan.screenDisplacement = screenDisplacement;
-  pan.displacement = localDisplacement;
+  DevelPanGesture::SetScreenDisplacement( pan, screenDisplacement );
+  DevelPanGesture::SetDisplacement( pan, localDisplacement );
 
-  pan.screenVelocity = screenVelocity;
-  pan.velocity = localVelocity;
+  DevelPanGesture::SetScreenVelocity( pan, screenVelocity );
+  DevelPanGesture::SetVelocity( pan, localVelocity );
 
-  pan.numberOfTouches = numberOfTouches;
+  DevelPanGesture::SetNumberOfTouches( pan, numberOfTouches );
 
   return pan;
 }
@@ -455,10 +451,10 @@ int UtcDaliPanGestureSignalReceptionDownMotionLeave(void)
   TestStartPan( application, Vector2( 10.0f, 20.0f ),  Vector2( 26.0f, 20.0f ), time );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(16.0f, 0.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(0.5f, 0.0f), data.receivedGesture.velocity, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(16.0f, 0.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(0.5f, 0.0f), data.receivedGesture.GetVelocity(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(16.0f, data.receivedGesture.GetDistance(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(0.5f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
 
@@ -469,10 +465,10 @@ int UtcDaliPanGestureSignalReceptionDownMotionLeave(void)
   time += TestGetFrameInterval();
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(0.0f, -16.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(0.0f, -1.0f), data.receivedGesture.velocity, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(0.0f, -16.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(0.0f, -1.0f), data.receivedGesture.GetVelocity(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(16.0f, data.receivedGesture.GetDistance(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(1.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
 
@@ -483,10 +479,10 @@ int UtcDaliPanGestureSignalReceptionDownMotionLeave(void)
   time += TestGetFrameInterval();
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(320.0f, 0.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 0.0f), data.receivedGesture.velocity, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(320.0f, 0.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 0.0f), data.receivedGesture.GetVelocity(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(320.0f, data.receivedGesture.GetDistance(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(20.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
 
@@ -496,10 +492,10 @@ int UtcDaliPanGestureSignalReceptionDownMotionLeave(void)
   TestEndPan( application, Vector2(314.0f, 4.0f), time );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(-32.0f, 0.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(-2.0f, 0.0f), data.receivedGesture.velocity, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(-32.0f, 0.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(-2.0f, 0.0f), data.receivedGesture.GetVelocity(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(32.0f, data.receivedGesture.GetDistance(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(2.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
   END_TEST;
@@ -530,10 +526,10 @@ int UtcDaliPanGestureSignalReceptionDownMotionUp(void)
   TestStartPan( application, Vector2( 10.0f, 20.0f ),  Vector2( 26.0f, 20.0f ), time );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(16.0f, 0.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(0.5f, 0.0f), data.receivedGesture.velocity, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(16.0f, 0.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(0.5f, 0.0f), data.receivedGesture.GetVelocity(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(16.0f, data.receivedGesture.GetDistance(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(0.5f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
 
@@ -544,10 +540,10 @@ int UtcDaliPanGestureSignalReceptionDownMotionUp(void)
   time += TestGetFrameInterval();
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(0.0f, -16.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(0.0f, -1.0f), data.receivedGesture.velocity, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(0.0f, -16.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(0.0f, -1.0f), data.receivedGesture.GetVelocity(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(16.0f, data.receivedGesture.GetDistance(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(1.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
 
@@ -557,10 +553,10 @@ int UtcDaliPanGestureSignalReceptionDownMotionUp(void)
   TestEndPan( application, Vector2(10.0f, 4.0f), time );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(-16.0f, 0.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(-1.0f, 0.0f), data.receivedGesture.velocity, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(-16.0f, 0.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(-1.0f, 0.0f), data.receivedGesture.GetVelocity(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(16.0f, data.receivedGesture.GetDistance(), 0.01f, TEST_LOCATION);
   DALI_TEST_EQUALS(1.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
   END_TEST;
@@ -763,7 +759,7 @@ int UtcDaliPanGestureSignalReceptionRotatedActor(void)
   TestEndPan( application, Vector2(25.0f, 28.0f), time );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(16.0f, 2.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
+  DALI_TEST_EQUALS(Vector2(16.0f, 2.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION); // Actor relative
 
   // Rotate actor again and render a couple of times
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
@@ -778,7 +774,7 @@ int UtcDaliPanGestureSignalReceptionRotatedActor(void)
   TestEndPan( application, Vector2(25.0f, 28.0f), time );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(2.0f, -16.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
+  DALI_TEST_EQUALS(Vector2(2.0f, -16.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION); // Actor relative
 
   // Rotate actor again and render a couple of times
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) );
@@ -793,7 +789,7 @@ int UtcDaliPanGestureSignalReceptionRotatedActor(void)
   TestEndPan( application, Vector2(25.0f, 28.0f), time );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(-16.0f, -2.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
+  DALI_TEST_EQUALS(Vector2(-16.0f, -2.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION); // Actor relative
   END_TEST;
 }
 
@@ -838,7 +834,7 @@ int UtcDaliPanGestureSignalReceptionChildHit(void)
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, parent == data.pannedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(-2.0f, 16.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
+  DALI_TEST_EQUALS(Vector2(-2.0f, 16.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION); // Actor relative
 
   // Attach child and generate same touch points to yield a different displacement
   // (Also proves that you can detach and then re-attach another actor)
@@ -854,7 +850,7 @@ int UtcDaliPanGestureSignalReceptionChildHit(void)
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, child == data.pannedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(16.0f, 2.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
+  DALI_TEST_EQUALS(Vector2(16.0f, 2.0f), data.receivedGesture.GetDisplacement(), 0.01f, TEST_LOCATION); // Actor relative
   END_TEST;
 }
 
@@ -1251,14 +1247,14 @@ int UtcDaliPanGestureSignalReceptionDifferentPossible(void)
   application.SendNotification();
   application.Render();
 
-  // Emit Started event, we should not receive the pan.
+  // Emit STARTED event, we should not receive the pan.
   TestStartPan( application, Vector2( 10.0f, 20.0f ),  Vector2( 26.0f, 20.0f ), time );
   TestEndPan( application, Vector2( 26.0f, 20.0f ), time );
   time += TestGetFrameInterval();
 
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
-  // LongPress possible in empty area.
+  // LONG_PRESS possible in empty area.
   TestStartLongPress( application, 10.0f, 20.0f, time );
   time += TestGetFrameInterval();
 
@@ -1271,7 +1267,7 @@ int UtcDaliPanGestureSignalReceptionDifferentPossible(void)
   application.SendNotification();
   application.Render();
 
-  // Emit Started event, we should be receiving the pan now.
+  // Emit STARTED event, we should be receiving the pan now.
   TestStartPan( application, Vector2( 10.0f, 20.0f ),  Vector2( 26.0f, 20.0f ), time );
   TestEndPan( application, Vector2( 26.0f, 20.0f ), time );
   time += TestGetFrameInterval();
@@ -1300,7 +1296,7 @@ int UtcDaliPanGestureActorUnstaged(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage( GestureState::STARTED );
 
   // Attach actor to detector
   SignalData data;
@@ -1332,8 +1328,8 @@ int UtcDaliPanGestureActorUnstaged(void)
   application.SendNotification();
   application.Render();
 
-  // Change state to Gesture::Continuing to remove
-  stateToUnstage = Gesture::Continuing;
+  // Change state to GestureState::CONTINUING to remove
+  stateToUnstage = GestureState::CONTINUING;
 
   // Emit signals
   TestStartPan( application, Vector2( 10.0f, 20.0f ),  Vector2( 26.0f, 20.0f ), time );
@@ -1364,8 +1360,8 @@ int UtcDaliPanGestureActorUnstaged(void)
   application.SendNotification();
   application.Render();
 
-  // Change state to Gesture::Finished to remove
-  stateToUnstage = Gesture::Finished;
+  // Change state to GestureState::FINISHED to remove
+  stateToUnstage = GestureState::FINISHED;
 
   // Emit signals
   TestStartPan( application, Vector2( 10.0f, 20.0f ),  Vector2( 26.0f, 20.0f ), time );
@@ -1407,7 +1403,7 @@ int UtcDaliPanGestureActorStagedAndDestroyed(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage( GestureState::STARTED );
 
   // Attach actor to detector
   SignalData data;
@@ -1417,7 +1413,7 @@ int UtcDaliPanGestureActorStagedAndDestroyed(void)
   detector.Attach(dummyActor);
   detector.DetectedSignal().Connect( &application, functor );
 
-  // Here we are testing a Started actor which is removed in the Started callback, but then added back
+  // Here we are testing a STARTED actor which is removed in the STARTED callback, but then added back
   // before we get a continuing state.  As we were removed from the stage, even if we're at the same
   // position, we should still not be signalled.
 
@@ -2557,7 +2553,7 @@ int UtcDaliPanGestureSetProperties(void)
   Vector2 localDisplacement( 0.5f, 0.5f );
   Vector2 localVelocity( 1.5f, 2.5f );
 
-  PanGestureDetector::SetPanGestureProperties( GeneratePan( 1u, Gesture::Started, screenPosition, localPosition, screenDisplacement, localDisplacement, screenVelocity, localVelocity ) );
+  PanGestureDetector::SetPanGestureProperties( GeneratePan( 1u, GestureState::STARTED, screenPosition, localPosition, screenDisplacement, localDisplacement, screenVelocity, localVelocity ) );
   DALI_TEST_EQUALS( renderController.WasCalled( TestRenderController::RequestUpdateFunc ), true, TEST_LOCATION );
 
   // Render and notify
@@ -2617,7 +2613,7 @@ int UtcDaliPanGestureSetPropertiesAlreadyPanning(void)
   Vector2 screenPosition( 100.0f, 20.0f );
   Vector2 localPosition( 110.0f, 110.0f );
 
-  PanGestureDetector::SetPanGestureProperties( GeneratePan( 1u, Gesture::Started, screenPosition, localPosition ) );
+  PanGestureDetector::SetPanGestureProperties( GeneratePan( 1u, GestureState::STARTED, screenPosition, localPosition ) );
 
   // Render and notify
   application.SendNotification();
@@ -2824,10 +2820,10 @@ int UtcDaliPanGestureNoTimeDiff(void)
   TestEndPan( application, Vector2(26.0f, 20.0f), 100 );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_CHECK( !std::isinf( data.receivedGesture.velocity.x ) );
-  DALI_TEST_CHECK( !std::isinf( data.receivedGesture.velocity.y ) );
-  DALI_TEST_CHECK( !std::isinf( data.receivedGesture.screenVelocity.x ) );
-  DALI_TEST_CHECK( !std::isinf( data.receivedGesture.screenVelocity.y ) );
+  DALI_TEST_CHECK( !std::isinf( data.receivedGesture.GetVelocity().x ) );
+  DALI_TEST_CHECK( !std::isinf( data.receivedGesture.GetVelocity().y ) );
+  DALI_TEST_CHECK( !std::isinf( data.receivedGesture.GetScreenVelocity().x ) );
+  DALI_TEST_CHECK( !std::isinf( data.receivedGesture.GetScreenVelocity().y ) );
   data.Reset();
 
   data.Reset();
@@ -2846,7 +2842,7 @@ int UtcDaliPanGestureInterruptedWhenTouchConsumed(void)
 
   bool consume = false;
   TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchSignal().Connect(&application,touchFunctor);
+  actor.TouchedSignal().Connect(&application,touchFunctor);
 
   // Render and notify
   application.SendNotification();
@@ -2864,7 +2860,7 @@ int UtcDaliPanGestureInterruptedWhenTouchConsumed(void)
   TestStartPan( application, Vector2( 10.0f, 20.0f ),  Vector2( 26.0f, 20.0f ), time );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
   data.Reset();
 
   // Continue the gesture within the actor's area, but now the touch consumes thus cancelling the gesture
@@ -2874,7 +2870,7 @@ int UtcDaliPanGestureInterruptedWhenTouchConsumed(void)
   time += TestGetFrameInterval();
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Cancelled, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CANCELLED, data.receivedGesture.GetState(), TEST_LOCATION);
 
   END_TEST;
 }
@@ -2898,7 +2894,7 @@ int UtcDaliPanGestureDisableDetectionDuringPanN(void)
       &application,
       [&detector, &functorCalled](Actor actor, const PanGesture& pan)
       {
-        if( pan.state == Gesture::Finished )
+        if( pan.GetState() == GestureState::FINISHED )
         {
           detector.Detach(actor);
           functorCalled = true;
index e79b6a3..df4dd07 100644 (file)
@@ -24,7 +24,6 @@
 #include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 
-
 using namespace Dali;
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -44,7 +43,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.state = Gesture::Started;
+    receivedGesture.Reset();
 
     pannedActor.Reset();
   }
@@ -544,7 +543,7 @@ int UtcDaliPanGestureRecognizerOtherEvent(void)
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 151 ) );
   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 60.0f ), 152 ) );
-  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 60.0f ), 153 ) );      // Exercise default case in Started case. Not sure if realistic
+  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 60.0f ), 153 ) );      // Exercise default case in STARTED case. Not sure if realistic
   application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 65.0f ), 154 ) );
 
   application.SendNotification();
diff --git a/automated-tests/src/dali/utc-Dali-PinchGesture.cpp b/automated-tests/src/dali/utc-Dali-PinchGesture.cpp
deleted file mode 100644 (file)
index 3058f1f..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2014 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-test-suite-utils.h>
-
-using namespace Dali;
-
-void utc_dali_pinch_gesture_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_pinch_gesture_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-// Positive test case for a method
-int UtcDaliPinchGestureConstructor(void)
-{
-  TestApplication application; // Reset all test adapter return codes
-
-  PinchGesture gesture(Gesture::Started);
-  DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture.scale, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture.speed, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pinch, gesture.type, TEST_LOCATION);
-
-  PinchGesture gesture2(Gesture::Continuing);
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture2.scale, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture2.speed, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pinch, gesture2.type, TEST_LOCATION);
-
-  PinchGesture gesture3(Gesture::Finished);
-  DALI_TEST_EQUALS(Gesture::Finished, gesture3.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture3.scale, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture3.speed, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pinch, gesture3.type, TEST_LOCATION);
-
-  // Test copy constructor
-  gesture3.scale = 3.0f;
-  gesture3.speed = 5.0f;
-
-  PinchGesture pinch(gesture3);
-  DALI_TEST_EQUALS(Gesture::Finished, pinch.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(3.0f, pinch.scale, TEST_LOCATION);
-  DALI_TEST_EQUALS(5.0f, pinch.speed, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pinch, pinch.type, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliPinchGestureAssignment(void)
-{
-  // Test Assignment operator
-  PinchGesture gesture(Gesture::Started);
-  DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture.scale, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture.speed, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pinch, gesture.type, TEST_LOCATION);
-
-  PinchGesture gesture2(Gesture::Continuing);
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture2.scale, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture2.speed, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pinch, gesture2.type, TEST_LOCATION);
-
-  gesture2.scale = 3.0f;
-  gesture2.speed = 5.0f;
-
-  gesture = gesture2;
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(3.0f, gesture.scale, TEST_LOCATION);
-  DALI_TEST_EQUALS(5.0f, gesture.speed, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pinch, gesture.type, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliPinchGestureDynamicAllocation(void)
-{
-  PinchGesture* gesture = new PinchGesture( Gesture::Started );
-  DALI_TEST_EQUALS(Gesture::Started, gesture->state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture->scale, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture->speed, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Pinch, gesture->type, TEST_LOCATION);
-  delete gesture;
-
-  END_TEST;
-}
index 3ba550d..0693f23 100644 (file)
@@ -46,7 +46,7 @@ struct SignalData
   SignalData()
   : functorCalled(false),
     voidFunctorCalled(false),
-    receivedGesture(Gesture::Started)
+    receivedGesture()
   {}
 
   void Reset()
@@ -54,11 +54,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.state = Gesture::Started;
-    receivedGesture.scale = 0.0f;
-    receivedGesture.speed = 0.0f;
-    receivedGesture.screenCenterPoint = Vector2(0.0f, 0.0f);
-    receivedGesture.localCenterPoint = Vector2(0.0f, 0.0f);
+    receivedGesture.Reset();
 
     pinchedActor.Reset();
   }
@@ -92,7 +88,7 @@ struct GestureReceivedFunctor
 // Functor that removes the gestured actor from stage
 struct UnstageActorFunctor : public GestureReceivedFunctor
 {
-  UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
+  UnstageActorFunctor( SignalData& data, GestureState& stateToUnstage, Integration::Scene scene )
   : GestureReceivedFunctor( data ),
     stateToUnstage( stateToUnstage ),
     scene( scene )
@@ -103,13 +99,13 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
   {
     GestureReceivedFunctor::operator()( actor, pinch );
 
-    if ( pinch.state == stateToUnstage )
+    if ( pinch.GetState() == stateToUnstage )
     {
       scene.Remove( actor );
     }
   }
 
-  Gesture::State& stateToUnstage;
+  GestureState& stateToUnstage;
   Integration::Scene scene;
 };
 
@@ -283,40 +279,44 @@ int UtcDaliPinchGestureSignalReceptionDownMotionLeave(void)
   TestStartPinch( application,  Vector2( 5.0f, 20.0f ), Vector2( 35.0f, 20.0f ),
                                 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.666f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(66.666f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.666f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(66.666f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Continue the pan within the actor's area - we should still receive the signal
   data.Reset();
   TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                   Vector2( 17.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 400 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.2666f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(80.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(21.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.2666f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(80.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(21.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(21.0f, 20.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
-  // Pan Gesture leaves actor's area - we should still receive the signal
+  // Pinch Gesture leaves actor's area - we should still receive the signal
   data.Reset();
   TestContinuePinch( application, Vector2( 17.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                                   Vector2( 300.0f, 10.0f ), Vector2( 340.0f, 10.0f ), 1000 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(1.333f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(213.333f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(320.0f, 10.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1.333f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(213.333f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(320.0f, 10.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(320.0f, 10.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Gesture ends - we would receive a finished state
   data.Reset();
   TestEndPinch( application,  Vector2( 300.0f, 10.0f ), Vector2( 340.0f, 10.0f ),
                               Vector2( 305.0f, 10.0f ), Vector2( 315.0f, 10.0f ), 1500);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.333f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(600.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(310.0f, 10.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.333f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(600.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(310.0f, 10.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(310.0f, 10.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -344,30 +344,33 @@ int UtcDaliPinchGestureSignalReceptionDownMotionUp(void)
   TestStartPinch( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
                                 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.555f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(106.667f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.555f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(106.667f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Continue the pinch within the actor's area - we should still receive the signal
   data.Reset();
   TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                   Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.277f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(66.666f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.277f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(66.666f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Gesture ends within actor's area - we would receive a finished state
   data.Reset();
   TestEndPinch( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                               Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.055f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(160.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -395,7 +398,7 @@ int UtcDaliPinchGestureSignalReceptionDetach(void)
   TestStartPinch( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
                                 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
 
 
   // Continue the pinch within the actor's area - we should still receive the signal
@@ -403,14 +406,14 @@ int UtcDaliPinchGestureSignalReceptionDetach(void)
   TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                   Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
 
   // Gesture ends within actor's area
   data.Reset();
   TestEndPinch( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                               Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, data.receivedGesture.GetState(), TEST_LOCATION);
 
   // Detach actor
   detector.DetachAll();
@@ -446,14 +449,14 @@ int UtcDaliPinchGestureSignalReceptionDetachWhilePinching(void)
   TestStartPinch( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
                                 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
 
   // Continue the pinch within the actor's area - we should still receive the signal
   data.Reset();
   TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                   Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
 
   // Detach actor during the pinch, we should not receive the next event
   detector.DetachAll();
@@ -501,14 +504,14 @@ int UtcDaliPinchGestureSignalReceptionActorDestroyedWhilePinching(void)
     TestStartPinch( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
                                   Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-    DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+    DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
 
     // Continue the pinch within the actor's area - we should still receive the signal
     data.Reset();
     TestContinuePinch( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                     Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-    DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
+    DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
 
     // Remove the actor from stage and reset the data
     application.GetScene().Remove(actor);
@@ -555,9 +558,10 @@ int UtcDaliPinchGestureSignalReceptionRotatedActor(void)
   TestEndPinch( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                               Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(0.055f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(160.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(70.0f, 30.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Rotate actor again and render and notify
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
@@ -571,9 +575,10 @@ int UtcDaliPinchGestureSignalReceptionRotatedActor(void)
   TestEndPinch( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                               Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 3000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(0.055f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(160.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(30.0f, 30.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Rotate actor again and render and notify
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) );
@@ -587,9 +592,10 @@ int UtcDaliPinchGestureSignalReceptionRotatedActor(void)
   TestEndPinch( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                               Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 5000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(0.055f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(160.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(30.0f, 70.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -631,9 +637,9 @@ int UtcDaliPinchGestureSignalReceptionChildHit(void)
                               Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, parent == data.pinchedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(0.055f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(160.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Attach child and generate same touch points to yield same results
   // (Also proves that you can detach and then re-attach another actor)
@@ -648,9 +654,10 @@ int UtcDaliPinchGestureSignalReceptionChildHit(void)
                               Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 3000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, child == data.pinchedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.055f, data.receivedGesture.scale, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(160.0f, data.receivedGesture.speed, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(0.055f, data.receivedGesture.GetScale(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(160.0f, data.receivedGesture.GetSpeed(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 80.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -881,7 +888,7 @@ int UtcDaliPinchGestureActorUnstaged(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage( GestureState::STARTED );
 
   // Attach actor to detector
   SignalData data;
@@ -911,8 +918,8 @@ int UtcDaliPinchGestureActorUnstaged(void)
   application.SendNotification();
   application.Render();
 
-  // Change state to Gesture::Continuing to remove
-  stateToUnstage = Gesture::Continuing;
+  // Change state to GestureState::CONTINUING to remove
+  stateToUnstage = GestureState::CONTINUING;
 
   // Emit signals
   TestStartPinch( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
@@ -939,8 +946,8 @@ int UtcDaliPinchGestureActorUnstaged(void)
   application.SendNotification();
   application.Render();
 
-  // Change state to Gesture::Continuing to remove
-  stateToUnstage = Gesture::Finished;
+  // Change state to GestureState::CONTINUING to remove
+  stateToUnstage = GestureState::FINISHED;
 
   // Emit signals
   TestStartPinch( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
@@ -979,7 +986,7 @@ int UtcDaliPinchGestureActorStagedAndDestroyed(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage( GestureState::STARTED );
 
   // Attach actor to detector
   SignalData data;
@@ -989,7 +996,7 @@ int UtcDaliPinchGestureActorStagedAndDestroyed(void)
   detector.Attach(dummyActor);
   detector.DetectedSignal().Connect( &application, functor );
 
-  // Here we are testing a Started actor which is removed in the Started callback, but then added back
+  // Here we are testing a STARTED actor which is removed in the STARTED callback, but then added back
   // before we get a continuing state.  As we were removed from the stage, even if we're at the same
   // position, we should still not be signalled.
 
@@ -1114,7 +1121,7 @@ int UtcDaliPinchGestureInterruptedWhenTouchConsumed(void)
 
   bool consume = false;
   TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchSignal().Connect(&application,touchFunctor);
+  actor.TouchedSignal().Connect(&application,touchFunctor);
 
   // Render and notify
   application.SendNotification();
@@ -1132,7 +1139,7 @@ int UtcDaliPinchGestureInterruptedWhenTouchConsumed(void)
                                 Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
   data.Reset();
 
   // Continue the gesture within the actor's area, but now the touch consumes thus cancelling the gesture
@@ -1142,7 +1149,7 @@ int UtcDaliPinchGestureInterruptedWhenTouchConsumed(void)
                                   Vector2( 5.0f, 5.0f ), Vector2( 35.0f, 35.0f ), 200 );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Cancelled, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CANCELLED, data.receivedGesture.GetState(), TEST_LOCATION);
   data.Reset();
 
   // Start another pinch, we should not even get the callback this time
@@ -1173,7 +1180,7 @@ int UtcDaliPinchGestureDisableDetectionDuringPinchN(void)
       &application,
       [&detector, &functorCalled](Actor actor, const PinchGesture& gesture)
       {
-        if( gesture.state == Gesture::Finished )
+        if( gesture.GetState() == GestureState::FINISHED )
         {
           detector.Detach(actor);
           functorCalled = true;
index 940dc90..72b34fe 100644 (file)
@@ -35,7 +35,7 @@ struct SignalData
   SignalData()
   : functorCalled(false),
     voidFunctorCalled(false),
-    receivedGesture(Gesture::Started)
+    receivedGesture()
   {}
 
   void Reset()
@@ -43,7 +43,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.state = Gesture::Started;
+    receivedGesture.Reset();
 
     pinchedActor.Reset();
   }
@@ -677,7 +677,7 @@ int UtcDaliPinchGestureRecognizerMinimumTouchEvents(void)
   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 150 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 90.0f, 90.0f ), 160 ) );
 
-  DALI_TEST_EQUALS( Gesture::Started, data.receivedGesture.state, TEST_LOCATION );
+  DALI_TEST_EQUALS( GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   data.Reset();
 
@@ -723,20 +723,20 @@ int UtcDaliPinchGestureRecognizerMinimumTouchEventsAfterStart(void)
   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 150 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 90.0f, 90.0f ), 160 ) );
 
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
 
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 170 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 180 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 190 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 200 ) );
-  // > Test : not enough touch events to make the gesture state "Continuing"
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  // > Test : not enough touch events to make the gesture state "CONTINUING"
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
 
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 210 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 220 ) );
-  // > Test : 6 touch events after start make the gesture state "Continuing"
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
+  // > Test : 6 touch events after start make the gesture state "CONTINUING"
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
 
   END_TEST;
 }
index a9a45e2..7e65a8e 100644 (file)
@@ -459,10 +459,10 @@ int UtcDaliPropertyNotificationGetNotifyMode(void)
 
   PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::POSITION_X,
                                                                     GreaterThanCondition(100.0f));
-  notification.SetNotifyMode(PropertyNotification::NotifyOnChanged);
+  notification.SetNotifyMode(PropertyNotification::NOTIFY_ON_CHANGED);
   PropertyNotification::NotifyMode notifyMode = notification.GetNotifyMode();
 
-  DALI_TEST_EQUALS( notifyMode, PropertyNotification::NotifyOnChanged, TEST_LOCATION );
+  DALI_TEST_EQUALS( notifyMode, PropertyNotification::NOTIFY_ON_CHANGED, TEST_LOCATION );
   END_TEST;
 }
 
@@ -475,7 +475,7 @@ int UtcDaliPropertyNotificationGetNotifyResultP(void)
 
   PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::POSITION_X,
                                                                     GreaterThanCondition(100.0f));
-  notification.SetNotifyMode(PropertyNotification::NotifyOnChanged);
+  notification.SetNotifyMode(PropertyNotification::NOTIFY_ON_CHANGED);
   gCallBackCalled = false;
   notification.NotifySignal().Connect( &TestCallback );
 
@@ -840,7 +840,7 @@ int UtcDaliPropertyNotificationSetSizeResultP(void)
   Actor actor = Actor::New();
 
   PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::SIZE, StepCondition( 1.0f, 1.0f ) );
-  notification.SetNotifyMode(PropertyNotification::NotifyOnChanged);
+  notification.SetNotifyMode(PropertyNotification::NOTIFY_ON_CHANGED);
   gCallBackCalled = false;
   notification.NotifySignal().Connect( &TestCallback );
 
diff --git a/automated-tests/src/dali/utc-Dali-RotationGesture.cpp b/automated-tests/src/dali/utc-Dali-RotationGesture.cpp
deleted file mode 100644 (file)
index e140a98..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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-test-suite-utils.h>
-
-using namespace Dali;
-
-void utc_dali_rotation_gesture_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_rotation_gesture_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-// Positive test case for a method
-int UtcDaliRotationGestureConstructor(void)
-{
-  TestApplication application; // Reset all test adapter return codes
-
-  RotationGesture gesture(Gesture::Started);
-  DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture.rotation.radian, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
-
-  RotationGesture gesture2(Gesture::Continuing);
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture2.rotation.radian, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Rotation, gesture2.type, TEST_LOCATION);
-
-  RotationGesture gesture3(Gesture::Finished);
-  DALI_TEST_EQUALS(Gesture::Finished, gesture3.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture3.rotation.radian, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Rotation, gesture3.type, TEST_LOCATION);
-
-  // Test copy constructor
-  gesture3.rotation = 3.0f;
-
-  RotationGesture rotation(gesture3);
-  DALI_TEST_EQUALS(Gesture::Finished, rotation.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(3.0f, rotation.rotation.radian, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Rotation, rotation.type, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliRotationGestureAssignment(void)
-{
-  // Test Assignment operator
-  RotationGesture gesture(Gesture::Started);
-  DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture.rotation.radian, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
-
-  RotationGesture gesture2(Gesture::Continuing);
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture2.rotation.radian, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Rotation, gesture2.type, TEST_LOCATION);
-
-  gesture2.rotation.radian = 3.0f;
-
-  gesture = gesture2;
-  DALI_TEST_EQUALS(Gesture::Continuing, gesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(3.0f, gesture.rotation.radian, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliRotationGestureDynamicAllocation(void)
-{
-  RotationGesture* gesture = new RotationGesture( Gesture::Started );
-  DALI_TEST_EQUALS(Gesture::Started, gesture->state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.0f, gesture->rotation.radian, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Rotation, gesture->type, TEST_LOCATION);
-  delete gesture;
-
-  END_TEST;
-}
index 48fa876..4298366 100644 (file)
@@ -46,7 +46,7 @@ struct SignalData
   SignalData()
   : functorCalled(false),
     voidFunctorCalled(false),
-    receivedGesture(Gesture::Started)
+    receivedGesture()
   {}
 
   void Reset()
@@ -54,10 +54,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.state = Gesture::Started;
-    receivedGesture.rotation = 0.0f;
-    receivedGesture.screenCenterPoint = Vector2(0.0f, 0.0f);
-    receivedGesture.localCenterPoint = Vector2(0.0f, 0.0f);
+    receivedGesture.Reset();
 
     rotatedActor.Reset();
   }
@@ -91,7 +88,7 @@ struct GestureReceivedFunctor
 // Functor that removes the gestured actor from stage
 struct UnstageActorFunctor : public GestureReceivedFunctor
 {
-  UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
+  UnstageActorFunctor( SignalData& data, GestureState& stateToUnstage, Integration::Scene scene )
   : GestureReceivedFunctor( data ),
     stateToUnstage( stateToUnstage ),
     scene( scene )
@@ -102,13 +99,13 @@ struct UnstageActorFunctor : public GestureReceivedFunctor
   {
     GestureReceivedFunctor::operator()( actor, rotation );
 
-    if ( rotation.state == stateToUnstage )
+    if ( rotation.GetState() == stateToUnstage )
     {
       scene.Remove( actor );
     }
   }
 
-  Gesture::State& stateToUnstage;
+  GestureState& stateToUnstage;
   Integration::Scene scene;
 };
 
@@ -278,40 +275,44 @@ int UtcDaliRotationGestureSignalReceptionDownMotionLeave(void)
   detector.Attach(actor);
   detector.DetectedSignal().Connect(&application, functor);
 
-  // Start pan within the actor's area
+  // Start rotation within the actor's area
   TestStartRotation( application,  Vector2( 5.0f, 5.0f ), Vector2( 20.0f, 20.0f ),
                                    Vector2( 5.0f, 5.0f ), Vector2( 20.0f, 30.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.244f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(12.5f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.244f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(12.5f, 17.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(12.48f, 17.5f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
-  // Continue the pan within the actor's area - we should still receive the signal
+  // Continue the rotation within the actor's area - we should still receive the signal
   data.Reset();
   TestContinueRotation( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                      Vector2( 17.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 400 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(-0.785398f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(21.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(-0.785398f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(21.0f, 20.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(21.0f, 20.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
-  // Pan Gesture leaves actor's area - we should still receive the signal
+  // Rotation Gesture leaves actor's area - we should still receive the signal
   data.Reset();
   TestContinueRotation( application, Vector2( 17.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                                      Vector2( 300.0f, 10.0f ), Vector2( 340.0f, 10.0f ), 1000 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(-0.785398f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(320.0f, 10.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(-0.785398f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(320.0f, 10.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(320.0f, 10.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Gesture ends - we would receive a finished state
   data.Reset();
   TestEndRotation( application,  Vector2( 300.0f, 10.0f ), Vector2( 340.0f, 10.0f ),
                                  Vector2( 305.0f, 10.0f ), Vector2( 315.0f, 10.0f ), 1500);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(-0.785398f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(310.0f, 10.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(-0.785398f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(310.0f, 10.0f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(310.0f, 10.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -339,27 +340,30 @@ int UtcDaliRotationGestureSignalReceptionDownMotionUp(void)
   TestStartRotation( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
                                    Vector2( 10.0f, 20.0f ), Vector2( 31.0f, 29.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.404892f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(20.5f, 24.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0.404892f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.5f, 24.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.5f, 24.5f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Continue the rotation within the actor's area - we should still receive the signal
   data.Reset();
   TestContinueRotation( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                      Vector2( 15.0f, 20.0f ), Vector2( 29.0f, 15.0f ), 500 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(-0.343024f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(22.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(-0.343024f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(22.0f, 17.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(22.0f, 17.5f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Gesture ends within actor's area - we would receive a finished state
   data.Reset();
   TestEndRotation( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                                  Vector2( 19.0f, 20.0f ), Vector2( 29.0f, 15.0f ), 1000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
-  DALI_TEST_EQUALS(-0.463648f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(24.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, data.receivedGesture.GetState(), TEST_LOCATION);
+  DALI_TEST_EQUALS(-0.463648f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(24.0f, 17.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(24.0f, 17.5f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -387,7 +391,7 @@ int UtcDaliRotationGestureSignalReceptionDetach(void)
   TestStartRotation( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
                                    Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
 
 
   // Continue the rotation within the actor's area - we should still receive the signal
@@ -395,14 +399,14 @@ int UtcDaliRotationGestureSignalReceptionDetach(void)
   TestContinueRotation( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                      Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
 
   // Gesture ends within actor's area
   data.Reset();
   TestEndRotation( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                                  Vector2( 19.0f, 20.0f ), Vector2( 21.0f, 20.0f ), 1000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Finished, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::FINISHED, data.receivedGesture.GetState(), TEST_LOCATION);
 
   // Detach actor
   detector.DetachAll();
@@ -438,14 +442,14 @@ int UtcDaliRotationGestureSignalReceptionDetachWhileRotationing(void)
   TestStartRotation( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
                                    Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
 
   // Continue the rotation within the actor's area - we should still receive the signal
   data.Reset();
   TestContinueRotation( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                      Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
 
   // Detach actor during the rotation, we should not receive the next event
   detector.DetachAll();
@@ -493,14 +497,14 @@ int UtcDaliRotationGestureSignalReceptionActorDestroyedWhileRotationing(void)
     TestStartRotation( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
                                      Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-    DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+    DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
 
     // Continue the rotation within the actor's area - we should still receive the signal
     data.Reset();
     TestContinueRotation( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                        Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-    DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
+    DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
 
     // Remove the actor from stage and reset the data
     application.GetScene().Remove(actor);
@@ -547,8 +551,9 @@ int UtcDaliRotationGestureSignalReceptionRotatedActor(void)
   TestEndRotation( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                                  Vector2( 19.0f, 20.0f ), Vector2( 27.0f, 15.0f ), 1000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(-0.558599f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(-0.558599f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(67.5f, 27.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Rotate actor again and render and notify
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
@@ -562,8 +567,9 @@ int UtcDaliRotationGestureSignalReceptionRotatedActor(void)
   TestEndRotation( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                                  Vector2( 19.0f, 20.0f ), Vector2( 27.0f, 15.0f ), 3000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(-0.558599f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(-0.558599f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(27.0f, 32.5f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Rotate actor again and render and notify
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) );
@@ -577,8 +583,9 @@ int UtcDaliRotationGestureSignalReceptionRotatedActor(void)
   TestEndRotation( application,  Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ),
                                  Vector2( 19.0f, 20.0f ), Vector2( 27.0f, 15.0f ), 5000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(-0.558599f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(-0.558599f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(32.5f, 73.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -620,8 +627,9 @@ int UtcDaliRotationGestureSignalReceptionChildHit(void)
                                  Vector2( 19.0f, 20.0f ), Vector2( 29.0f, 25.0f ), 1000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, parent == data.rotatedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.463648f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(24.0f, 22.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(0.463648f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(24.0f, 22.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(24.0f, 22.5f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
 
   // Attach child and generate same touch points to yield same results
   // (Also proves that you can detach and then re-attach another actor)
@@ -636,8 +644,9 @@ int UtcDaliRotationGestureSignalReceptionChildHit(void)
                                  Vector2( 19.0f, 20.0f ), Vector2( 29.0f, 35.0f ), 3000);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, child == data.rotatedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(0.982794f, data.receivedGesture.rotation.radian, 0.01f, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(24.0f, 27.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(0.982794f, data.receivedGesture.GetRotation().radian, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(24.0f, 27.5f), data.receivedGesture.GetScreenCenterPoint(), 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(27.5f, 76.0f), data.receivedGesture.GetLocalCenterPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -717,7 +726,7 @@ int UtcDaliRotationGestureSignalReceptionActorBecomesUntouchable(void)
                                    Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
 
-  // Pan continues within actor's area
+  // Rotation continues within actor's area
   data.Reset();
   TestContinueRotation( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                      Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
@@ -868,7 +877,7 @@ int UtcDaliRotationGestureActorUnstaged(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage( GestureState::STARTED );
 
   // Attach actor to detector
   SignalData data;
@@ -898,8 +907,8 @@ int UtcDaliRotationGestureActorUnstaged(void)
   application.SendNotification();
   application.Render();
 
-  // Change state to Gesture::Continuing to remove
-  stateToUnstage = Gesture::Continuing;
+  // Change state to GestureState::CONTINUING to remove
+  stateToUnstage = GestureState::CONTINUING;
 
   // Emit signals
   TestStartRotation( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
@@ -926,8 +935,8 @@ int UtcDaliRotationGestureActorUnstaged(void)
   application.SendNotification();
   application.Render();
 
-  // Change state to Gesture::Continuing to remove
-  stateToUnstage = Gesture::Finished;
+  // Change state to GestureState::CONTINUING to remove
+  stateToUnstage = GestureState::FINISHED;
 
   // Emit signals
   TestStartRotation( application,  Vector2( 2.0f, 20.0f ), Vector2( 38.0f, 20.0f ),
@@ -966,7 +975,7 @@ int UtcDaliRotationGestureActorStagedAndDestroyed(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage( GestureState::STARTED );
 
   // Attach actor to detector
   SignalData data;
@@ -976,7 +985,7 @@ int UtcDaliRotationGestureActorStagedAndDestroyed(void)
   detector.Attach(dummyActor);
   detector.DetectedSignal().Connect( &application, functor );
 
-  // Here we are testing a Started actor which is removed in the Started callback, but then added back
+  // Here we are testing a STARTED actor which is removed in the STARTED callback, but then added back
   // before we get a continuing state.  As we were removed from the stage, even if we're at the same
   // position, we should still not be signalled.
 
@@ -1101,7 +1110,7 @@ int UtcDaliRotationGestureInterruptedWhenTouchConsumed(void)
 
   bool consume = false;
   TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchSignal().Connect(&application,touchFunctor);
+  actor.TouchedSignal().Connect(&application,touchFunctor);
 
   // Render and notify
   application.SendNotification();
@@ -1119,7 +1128,7 @@ int UtcDaliRotationGestureInterruptedWhenTouchConsumed(void)
                                    Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
   data.Reset();
 
   // Continue the gesture within the actor's area, but now the touch consumes thus cancelling the gesture
@@ -1128,7 +1137,7 @@ int UtcDaliRotationGestureInterruptedWhenTouchConsumed(void)
   TestContinueRotation( application, Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ),
                                      Vector2( 15.0f, 20.0f ), Vector2( 25.0f, 20.0f ), 500 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Cancelled, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::CANCELLED, data.receivedGesture.GetState(), TEST_LOCATION);
   data.Reset();
 
   // Start another rotation, we should not even get the callback this time
@@ -1158,7 +1167,7 @@ int UtcDaliRotationGestureDisableDetectionDuringRotationN(void)
       &application,
       [&detector, &functorCalled](Actor actor, const RotationGesture& gesture)
       {
-        if( gesture.state == Gesture::Finished )
+        if( gesture.GetState() == GestureState::FINISHED )
         {
           detector.Detach(actor);
           functorCalled = true;
index 85ba2e3..8c25595 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali-test-suite-utils.h>
 
-
 using namespace Dali;
 
 void utc_dali_rotation_gesture_recognizer_startup(void)
@@ -45,7 +44,7 @@ struct SignalData
   SignalData()
   : functorCalled(false),
     voidFunctorCalled(false),
-    receivedGesture(Gesture::Started)
+    receivedGesture()
   {}
 
   void Reset()
@@ -53,10 +52,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.state = Gesture::Started;
-    receivedGesture.rotation = 0.0f;
-    receivedGesture.screenCenterPoint = Vector2(0.0f, 0.0f);
-    receivedGesture.localCenterPoint = Vector2(0.0f, 0.0f);
+    receivedGesture.Reset();
 
     rotatedActor.Reset();
   }
@@ -87,6 +83,19 @@ struct GestureReceivedFunctor
   SignalData& signalData;
 };
 
+Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition, uint32_t time )
+{
+  Integration::TouchEvent touchEvent;
+  Integration::Point point;
+  point.SetState( state );
+  point.SetScreenPosition( screenPosition );
+  point.SetDeviceClass( Device::Class::TOUCH );
+  point.SetDeviceSubclass( Device::Subclass::NONE );
+  touchEvent.points.push_back( point );
+  touchEvent.time = time;
+  return touchEvent;
+}
+
 Integration::TouchEvent GenerateDoubleTouch( PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time )
 {
   Integration::TouchEvent touchEvent;
@@ -107,6 +116,77 @@ Integration::TouchEvent GenerateDoubleTouch( PointState::Type stateA, const Vect
 } // anon namespace
 
 ///////////////////////////////////////////////////////////////////////////////
+int UtcDaliRotationGestureRecognizerRealistic(void)
+{
+  TestApplication application;
+
+  RotationGestureDetector detector = RotationGestureDetector::New();
+
+  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();
+
+  detector.Attach(actor);
+
+  SignalData data;
+  GestureReceivedFunctor functor(data);
+  detector.DetectedSignal().Connect(&application, functor);
+
+  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 100 ) );
+  application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 20.0f, 20.0f ), 105 ) );
+  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 110 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 25.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 115 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 30.0f ), PointState::MOTION, Vector2( 20.0f, 85.0f ), 120 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 35.0f ), PointState::MOTION, Vector2( 20.0f, 80.0f ), 125 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), PointState::MOTION, Vector2( 20.0f, 75.0f ), 130 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 45.0f ), PointState::MOTION, Vector2( 20.0f, 70.0f ), 135 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 50.0f ), PointState::MOTION, Vector2( 20.0f, 65.0f ), 140 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 55.0f ), PointState::MOTION, Vector2( 20.0f, 60.0f ), 145 ) );
+  application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 20.0f, 56.0f ), 155 ) );
+
+  application.SendNotification();
+
+  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliRotationGestureRecognizerBasicInterrupted(void)
+{
+  TestApplication application;
+
+  RotationGestureDetector detector = RotationGestureDetector::New();
+
+  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();
+
+  detector.Attach(actor);
+
+  SignalData data;
+  GestureReceivedFunctor functor(data);
+  detector.DetectedSignal().Connect(&application, functor);
+
+  // application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 150 ) );
+  // application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 25.0f ), 151 ) );
+  application.ProcessEvent( GenerateSingleTouch( PointState::INTERRUPTED, Vector2( 20.0f, 30.0f ), 152 ) );
+
+  application.SendNotification();
+
+  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
+
+  END_TEST;
+}
 
 int UtcDaliRotationGestureRecognizerMinimumTouchEvents(void)
 {
@@ -133,7 +213,7 @@ int UtcDaliRotationGestureRecognizerMinimumTouchEvents(void)
   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 150 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 90.0f, 90.0f ), 160 ) );
 
-  DALI_TEST_EQUALS( Gesture::Started, data.receivedGesture.state, TEST_LOCATION );
+  DALI_TEST_EQUALS( GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   data.Reset();
 
@@ -177,20 +257,20 @@ int UtcDaliRotationGestureRecognizerMinimumTouchEventsAfterStart(void)
   application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 150 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 90.0f, 90.0f ), 160 ) );
 
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
 
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 170 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 180 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 190 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 200 ) );
-  // > Test : not enough touch events to make the gesture state "Continuing"
-  DALI_TEST_EQUALS(Gesture::Started, data.receivedGesture.state, TEST_LOCATION);
+  // > Test : not enough touch events to make the gesture state "CONTINUING"
+  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
 
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 210 ) );
   application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 20.0f, 90.0f ), 220 ) );
-  // > Test : 6 touch events after start make the gesture state "Continuing"
-  DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
+  // > Test : 6 touch events after start make the gesture state "CONTINUING"
+  DALI_TEST_EQUALS(GestureState::CONTINUING, data.receivedGesture.GetState(), TEST_LOCATION);
 
   END_TEST;
 }
index e8526ae..f23df12 100644 (file)
@@ -437,7 +437,7 @@ int UtcDaliSceneCreateNewSceneDuringCoreEventProcessing(void)
   TouchedSignalData data;
   data.createNewScene = true;
   TouchFunctor functor( data );
-  scene.TouchSignal().Connect( &application, functor );
+  scene.TouchedSignal().Connect( &application, functor );
 
   // Render and notify.
   application.SendNotification();
@@ -620,14 +620,14 @@ int UtcDaliSceneSignalKeyEventN(void)
   END_TEST;
 }
 
-int UtcDaliSceneTouchSignalP(void)
+int UtcDaliSceneTouchedSignalP(void)
 {
   TestApplication application;
   Dali::Integration::Scene scene = application.GetScene();
 
   TouchedSignalData data;
   TouchFunctor functor( data );
-  scene.TouchSignal().Connect( &application, functor );
+  scene.TouchedSignal().Connect( &application, functor );
 
   // Render and notify.
   application.SendNotification();
@@ -655,7 +655,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.
@@ -732,14 +732,14 @@ int UtcDaliSceneTouchSignalP(void)
   END_TEST;
 }
 
-int UtcDaliSceneTouchSignalN(void)
+int UtcDaliSceneTouchedSignalN(void)
 {
   TestApplication application;
   Dali::Integration::Scene scene = application.GetScene();
 
   TouchedSignalData data;
   TouchFunctor functor( data );
-  scene.TouchSignal().Connect( &application, functor );
+  scene.TouchedSignal().Connect( &application, functor );
 
   // Render and notify.
   application.SendNotification();
@@ -778,7 +778,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.
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 1ba3ab4..8ca978e 100644 (file)
@@ -141,9 +141,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)
   {}
 
@@ -161,7 +161,7 @@ struct TouchSignalData
 // 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 TouchEvent& touch )
   {
@@ -175,7 +175,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
@@ -746,7 +746,7 @@ int UtcDaliStageGetBackgroundColorP(void)
 
   Stage stage = Stage::GetCurrent();
 
-  DALI_TEST_EQUALS( Stage::DEFAULT_BACKGROUND_COLOR, stage.GetBackgroundColor(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DEFAULT_BACKGROUND_COLOR, stage.GetBackgroundColor(), TEST_LOCATION );
   END_TEST;
 }
 
@@ -979,9 +979,9 @@ int UtcDaliStageTouchedSignalP(void)
   TestApplication application;
   Stage stage = Stage::GetCurrent();
 
-  TouchSignalData data;
+  TouchedSignalData data;
   TouchFunctor functor( data );
-  stage.TouchSignal().Connect( &application, functor );
+  stage.TouchedSignal().Connect( &application, functor );
 
   // Render and notify.
   application.SendNotification();
@@ -1010,7 +1010,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.
@@ -1095,9 +1095,9 @@ int UtcDaliStageTouchedSignalN(void)
   TestApplication application;
   Stage stage = Stage::GetCurrent();
 
-  TouchSignalData data;
+  TouchedSignalData data;
   TouchFunctor functor( data );
-  stage.TouchSignal().Connect( &application, functor );
+  stage.TouchedSignal().Connect( &application, functor );
 
   // Render and notify.
   application.SendNotification();
@@ -1135,7 +1135,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.
@@ -1178,217 +1178,6 @@ int UtcDaliStageTouchedSignalN(void)
   END_TEST;
 }
 
-
-int UtcDaliStageTouchSignalP(void)
-{
-  TestApplication application;
-  Stage stage = Stage::GetCurrent();
-
-  TouchSignalData data;
-  TouchFunctor functor( data );
-  stage.TouchSignal().Connect( &application, functor );
-
-  // Render and notify.
-  application.SendNotification();
-  application.Render();
-
-  // Basic test: No actors, single touch (down then up).
-  {
-    GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchEvent.GetHitActor(0) );
-    data.Reset();
-
-    GenerateTouch( application, PointState::UP, Vector2( 10.0f, 10.0f ) );
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchEvent.GetHitActor(0) );
-    data.Reset();
-  }
-
-  // Add an actor to the scene.
-  Actor actor = Actor::New();
-  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 );
-  stage.Add( actor );
-
-  // Render and notify.
-  application.SendNotification();
-  application.Render();
-
-  // Actor on scene, single touch, down in actor, motion, then up outside actor.
-  {
-    GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetHitActor(0) == actor );
-    data.Reset();
-
-    GenerateTouch( application, PointState::MOTION, Vector2( 150.0f, 10.0f ) ); // Some motion
-
-    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-    data.Reset();
-
-    GenerateTouch( application, PointState::UP, Vector2( 150.0f, 10.0f ) ); // Some motion
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchEvent.GetHitActor(0) );
-    data.Reset();
-  }
-
-  // Multiple touch. Should only receive a touch on first down and last up.
-  {
-    Integration::TouchEvent touchEvent;
-    Integration::Point point;
-
-    // 1st point
-    point.SetState( PointState::DOWN );
-    point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
-    touchEvent.points.push_back( point );
-    application.ProcessEvent( touchEvent );
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_EQUALS( data.receivedTouchEvent.GetPointCount(), 1u, TEST_LOCATION );
-    data.Reset();
-
-    // 2nd point
-    touchEvent.points[0].SetState( PointState::STATIONARY );
-    point.SetDeviceId( 1 );
-    point.SetScreenPosition( Vector2( 50.0f, 50.0f ) );
-    touchEvent.points.push_back( point );
-    application.ProcessEvent( touchEvent );
-    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-    data.Reset();
-
-    // Primary point is up
-    touchEvent.points[0].SetState( PointState::UP );
-    touchEvent.points[1].SetState( PointState::STATIONARY );
-    application.ProcessEvent( touchEvent );
-    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-    data.Reset();
-
-    // Remove 1st point now, 2nd point is now in motion
-    touchEvent.points.erase( touchEvent.points.begin() );
-    touchEvent.points[0].SetState( PointState::MOTION );
-    touchEvent.points[0].SetScreenPosition( Vector2( 150.0f, 50.0f ) );
-    application.ProcessEvent( touchEvent );
-    DALI_TEST_EQUALS( false, data.functorCalled, 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.receivedTouchEvent.GetPointCount(), 1u, TEST_LOCATION );
-    data.Reset();
-  }
-  END_TEST;
-}
-
-int UtcDaliStageTouchSignalN(void)
-{
-  TestApplication application;
-  Stage stage = Stage::GetCurrent();
-
-  TouchSignalData data;
-  TouchFunctor functor( data );
-  stage.TouchSignal().Connect( &application, functor );
-
-  TouchSignalData data2;
-  TouchFunctor functor2( data2 );
-  GetImplementation( stage ).ConnectSignal( &application, "touch", functor2 );
-
-  // Render and notify.
-  application.SendNotification();
-  application.Render();
-
-  // Confirm functor not called before there has been any touch event.
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, data2.functorCalled, TEST_LOCATION );
-
-  // No actors, single touch, down, motion then up.
-  {
-    GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchEvent.GetHitActor(0));
-
-    DALI_TEST_EQUALS( true, data2.functorCalled, TEST_LOCATION );
-
-    data.Reset();
-    data2.Reset();
-
-    // Confirm there is no signal when the touchpoint is only moved.
-    GenerateTouch( application, PointState::MOTION, Vector2( 1200.0f, 10.0f ) ); // Some motion
-
-    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-    data.Reset();
-
-    // Confirm a following up event generates a signal.
-    GenerateTouch( application, PointState::UP, Vector2( 1200.0f, 10.0f ) );
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchEvent.GetHitActor(0));
-    data.Reset();
-  }
-
-  // Add an actor to the scene.
-  Actor actor = Actor::New();
-  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 );
-  stage.Add( actor );
-
-  // Render and notify.
-  application.SendNotification();
-  application.Render();
-
-  // Actor on scene. Interrupted before down and interrupted after down.
-  {
-    GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) );
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchEvent.GetHitActor(0) );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetState(0) == PointState::INTERRUPTED );
-    data.Reset();
-
-    GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetHitActor(0) == actor );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetState(0) == PointState::DOWN );
-    data.Reset();
-
-    GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) );
-
-    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetPointCount() != 0u );
-    DALI_TEST_CHECK( !data.receivedTouchEvent.GetHitActor(0) );
-    DALI_TEST_CHECK( data.receivedTouchEvent.GetState(0) == PointState::INTERRUPTED );
-
-    DALI_TEST_EQUALS( data.receivedTouchEvent.GetPointCount(), 1u, TEST_LOCATION );
-
-    // Check that getting info about a non-existent point returns an empty handle
-    Actor actor = data.receivedTouchEvent.GetHitActor( 1 );
-    DALI_TEST_CHECK( !actor );
-
-    data.Reset();
-  }
-
-  END_TEST;
-}
-
 int UtcDaliStageSignalWheelEventP(void)
 {
   TestApplication application;
diff --git a/automated-tests/src/dali/utc-Dali-TapGesture.cpp b/automated-tests/src/dali/utc-Dali-TapGesture.cpp
deleted file mode 100644 (file)
index e53dcbb..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2014 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-test-suite-utils.h>
-
-using namespace Dali;
-
-void utc_dali_tap_gesture_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_tap_gesture_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-
-// Positive test case for a method
-int UtcDaliTapGestureConstructor(void)
-{
-  TestApplication application; // Reset all test adapter return codes
-
-  TapGesture gesture;
-  DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Tap, gesture.type, TEST_LOCATION);
-
-  // Test Copy constructor
-  gesture.numberOfTouches = 5u;
-  gesture.numberOfTaps = 2u;
-
-  TapGesture gesture2(gesture);
-  DALI_TEST_EQUALS(5u, gesture2.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(2u, gesture2.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Tap, gesture2.type, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTapGestureAssignment(void)
-{
-  // Test Assignment operator
-  TapGesture gesture;
-  DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Tap, gesture.type, TEST_LOCATION);
-
-  gesture.numberOfTouches = 5u;
-  gesture.numberOfTaps = 2u;
-
-  TapGesture gesture2;
-  gesture2 = gesture;
-  DALI_TEST_EQUALS(5u, gesture2.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(2u, gesture2.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Tap, gesture2.type, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTapGestureDynamicAllocation(void)
-{
-  TapGesture* gesture = new TapGesture;
-  DALI_TEST_EQUALS(1u, gesture->numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, gesture->numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(Gesture::Tap, gesture->type, TEST_LOCATION);
-  delete gesture;
-
-  END_TEST;
-}
index c6b8858..30a1441 100644 (file)
@@ -53,10 +53,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.numberOfTaps = 0u;
-    receivedGesture.numberOfTouches = 0u;
-    receivedGesture.screenPoint = Vector2(0.0f, 0.0f);
-    receivedGesture.localPoint = Vector2(0.0f, 0.0f);
+    receivedGesture.Reset();
 
     tappedActor.Reset();
   }
@@ -193,7 +190,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;
@@ -330,9 +327,9 @@ int UtcDaliTapGestureSignalReceptionPositive(void)
   // Do a tap inside actor's area
   TestGenerateTap( application, 50.0f, 50.0f, 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
   END_TEST;
 }
 
@@ -359,17 +356,17 @@ int UtcDaliTapGestureSignalReceptionDetach(void)
   // Start tap within the actor's area
   TestGenerateTap( application, 20.0f, 20.0f, 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(20.0f, 20.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(20.0f, 20.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
 
   // repeat the tap within the actor's area - we should still receive the signal
   data.Reset();
   TestGenerateTap( application, 50.0f, 50.0f, 700 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
 
   // Detach actor
   detector.DetachAll();
@@ -449,9 +446,9 @@ int UtcDaliTapGestureSignalReceptionRotatedActor(void)
   // Do tap, only check finished value
   TestGenerateTap( application, 5.0f, 5.0f, 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.GetScreenPoint(), 0.1, TEST_LOCATION);
 
   // Rotate actor again and render
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
@@ -462,9 +459,9 @@ int UtcDaliTapGestureSignalReceptionRotatedActor(void)
   data.Reset();
   TestGenerateTap( application, 5.0f, 5.0f, 700 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTaps, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTaps(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.GetScreenPoint(), 0.1, TEST_LOCATION);
 
   // Rotate actor again and render
   actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS) );
@@ -498,7 +495,7 @@ int UtcDaliTapGestureSignalReceptionChildHit(void)
   parent.Add(child);
 
   TouchEventFunctor touchFunctor;
-  child.TouchSignal().Connect(&application, touchFunctor);
+  child.TouchedSignal().Connect(&application, touchFunctor);
 
   // Render and notify
   application.SendNotification();
@@ -515,7 +512,7 @@ int UtcDaliTapGestureSignalReceptionChildHit(void)
   TestGenerateTap( application, 50.0f, 50.0f, 100 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, parent == data.tappedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.GetScreenPoint(), 0.01f, TEST_LOCATION);
 
   // Attach child and generate same touch points
   // (Also proves that you can detach and then re-attach another actor)
@@ -527,7 +524,7 @@ int UtcDaliTapGestureSignalReceptionChildHit(void)
   TestGenerateTap( application, 51.0f, 51.0f, 700 );
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, child == data.tappedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.GetScreenPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -672,7 +669,7 @@ int UtcDaliTapGestureSignalReceptionMultipleGestureDetectors(void)
     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
     DALI_TEST_EQUALS(true, first == data.tappedActor, TEST_LOCATION);
 
-    // Pan changes to double-touch - we shouldn't receive event
+    // Tap changes to double-touch - we shouldn't receive event
     data.Reset();
 
     TestGenerateTwoPointTap( application, 50.0f, 10.0f, 60.0f, 20.0f, 2000 );
@@ -748,7 +745,7 @@ int UtcDaliTapGestureSignalReceptionDifferentPossible(void)
   application.SendNotification();
   application.Render();
 
-  // Emit Started event, we should not receive the tap.
+  // Emit STARTED event, we should not receive the tap.
   TestEndPan( application, Vector2(50.0f, 10.0f), 120 );
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
@@ -763,7 +760,7 @@ int UtcDaliTapGestureSignalReceptionDifferentPossible(void)
   application.SendNotification();
   application.Render();
 
-  // Emit Started event, we should not receive the tap.
+  // Emit STARTED event, we should not receive the tap.
   TestEndPan( application, Vector2(50.0f, 10.0f), 720 );
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
@@ -822,7 +819,7 @@ int UtcDaliTapGestureDetectorRemovedWhilePossible(void)
   // Emit a possible - Down press, as emitted by long press function
   TestStartLongPress( application, 50.0f, 10.0f, 100 );
 
-  // Detach actor and send a Started state, no signal.
+  // Detach actor and send a STARTED state, no signal.
   detector.DetachAll();
   TestEndPan( application, Vector2(50.0f, 10.0f), 120 );
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
@@ -858,7 +855,7 @@ int UtcDaliTapGestureActorRemovedWhilePossible(void)
   application.Render();
   actor.Reset();
 
-  // Send a Started state, no signal - Up motion as provided by end pan function
+  // Send a STARTED state, no signal - Up motion as provided by end pan function
   TestEndPan( application, Vector2(50.0f, 10.0f), 120 );
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
@@ -922,7 +919,7 @@ int UtcDaliTapGestureInterruptedWhenTouchConsumed(void)
 
   bool consume = false;
   TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchSignal().Connect(&application,touchFunctor);
+  actor.TouchedSignal().Connect(&application,touchFunctor);
 
   // Render and notify
   application.SendNotification();
index 13c3e77..f1669c2 100644 (file)
@@ -43,7 +43,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.state = Gesture::Started;
+    receivedGesture.Reset();
 
     tappedActor.Reset();
   }
diff --git a/automated-tests/src/dali/utc-Dali-TouchEvent.cpp b/automated-tests/src/dali/utc-Dali-TouchEvent.cpp
new file mode 100644 (file)
index 0000000..dbd663b
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2014 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-integ.h>
+#include <dali-test-suite-utils.h>
+
+void utc_dali_touch_event_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_touch_event_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+namespace
+{
+TouchPoint GenerateTouchPoint()
+{
+  return TouchPoint(1, PointState::STARTED, 100.0f, 200.0f);
+}
+}
+
+int UtcDaliTouchEventConstructorP(void)
+{
+  TouchEvent touchEvent;
+  DALI_TEST_CHECK( !touchEvent );
+  END_TEST;
+}
+
+int UtcDaliTouchEventCopyConstructorP(void)
+{
+  TouchEvent touchEvent = Integration::NewTouchEvent(123u, GenerateTouchPoint());
+  DALI_TEST_CHECK( touchEvent );
+
+  const auto refCount = touchEvent.GetBaseObject().ReferenceCount();
+
+  TouchEvent touchEvent2( touchEvent );
+  DALI_TEST_CHECK( touchEvent );
+  DALI_TEST_CHECK( touchEvent2 );
+  DALI_TEST_EQUALS( touchEvent, touchEvent2, TEST_LOCATION );
+  DALI_TEST_EQUALS( refCount + 1, touchEvent.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTouchEventMoveConstructorP(void)
+{
+  TouchEvent touchEvent = Integration::NewTouchEvent(123u, GenerateTouchPoint());
+  DALI_TEST_CHECK( touchEvent );
+
+  const auto refCount = touchEvent.GetBaseObject().ReferenceCount();
+
+  TouchEvent touchEvent2( std::move(touchEvent) );
+  DALI_TEST_CHECK( !touchEvent );
+  DALI_TEST_CHECK( touchEvent2 );
+  DALI_TEST_EQUALS( refCount, touchEvent2.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTouchEventCopyAssignmentP(void)
+{
+  TouchEvent touchEvent = Integration::NewTouchEvent(123u, GenerateTouchPoint());
+  DALI_TEST_CHECK( touchEvent );
+
+  const auto refCount = touchEvent.GetBaseObject().ReferenceCount();
+
+  TouchEvent touchEvent2;
+  DALI_TEST_CHECK( !touchEvent2 );
+
+  touchEvent2 = touchEvent;
+  DALI_TEST_CHECK( touchEvent );
+  DALI_TEST_CHECK( touchEvent2 );
+  DALI_TEST_EQUALS( touchEvent, touchEvent2, TEST_LOCATION );
+  DALI_TEST_EQUALS( refCount + 1, touchEvent.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTouchEventMoveAssignmentP(void)
+{
+  TouchEvent touchEvent = Integration::NewTouchEvent(123u, GenerateTouchPoint());
+  DALI_TEST_CHECK( touchEvent );
+
+  const auto refCount = touchEvent.GetBaseObject().ReferenceCount();
+
+  TouchEvent touchEvent2;
+  DALI_TEST_CHECK( !touchEvent2 );
+
+  touchEvent2 = std::move(touchEvent);
+  DALI_TEST_CHECK( !touchEvent );
+  DALI_TEST_CHECK( touchEvent2 );
+  DALI_TEST_EQUALS( refCount, touchEvent2.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+  END_TEST;
+}
index 81475c7..09fb6aa 100644 (file)
@@ -232,7 +232,7 @@ int UtcDaliTouchEventCombinerSingleTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -247,7 +247,7 @@ int UtcDaliTouchEventCombinerSingleTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 101.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -262,7 +262,7 @@ int UtcDaliTouchEventCombinerSingleTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 101.0f, 101.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -275,7 +275,7 @@ int UtcDaliTouchEventCombinerSingleTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
 
   time++;
@@ -286,7 +286,7 @@ int UtcDaliTouchEventCombinerSingleTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -301,7 +301,7 @@ int UtcDaliTouchEventCombinerSingleTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
 
   // Up event, no time diff, no movement
@@ -310,7 +310,7 @@ int UtcDaliTouchEventCombinerSingleTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 102.0f, 102.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -330,7 +330,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionWithoutDown(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), PointState::STARTED, TEST_LOCATION );
@@ -345,7 +345,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionWithoutDown(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -365,7 +365,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionFollowedByDown(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), PointState::STARTED, TEST_LOCATION );
@@ -380,7 +380,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionFollowedByDown(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -395,7 +395,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionFollowedByDown(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 103.0f, 103.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -410,7 +410,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionFollowedByDown(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 103.0f, 103.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchBoth, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_BOTH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -434,7 +434,7 @@ int UtcDaliTouchEventCombinerSingleTouchTwoDowns(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -449,7 +449,7 @@ int UtcDaliTouchEventCombinerSingleTouchTwoDowns(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
   END_TEST;
 }
@@ -465,7 +465,7 @@ int UtcDaliTouchEventCombinerSingleTouchUpWithoutDown(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
 
   time++;
@@ -476,7 +476,7 @@ int UtcDaliTouchEventCombinerSingleTouchUpWithoutDown(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 102.0f, 102.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
   END_TEST;
 }
@@ -492,7 +492,7 @@ int UtcDaliTouchEventCombinerSingleTouchTwoUps(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -507,7 +507,7 @@ int UtcDaliTouchEventCombinerSingleTouchTwoUps(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -522,7 +522,7 @@ int UtcDaliTouchEventCombinerSingleTouchTwoUps(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
   END_TEST;
 }
@@ -538,7 +538,7 @@ int UtcDaliTouchEventCombinerSingleTouchUpWithDifferentId(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -553,7 +553,7 @@ int UtcDaliTouchEventCombinerSingleTouchUpWithDifferentId(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 2, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
 
   time++;
@@ -564,7 +564,7 @@ int UtcDaliTouchEventCombinerSingleTouchUpWithDifferentId(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -584,7 +584,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionWithDifferentId(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -599,7 +599,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionWithDifferentId(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 2, PointState::MOTION, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchHover, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.points[0].GetState(), PointState::STARTED, TEST_LOCATION );
@@ -614,7 +614,7 @@ int UtcDaliTouchEventCombinerSingleTouchMotionWithDifferentId(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 102.0f, 102.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -634,7 +634,7 @@ int UtcDaliTouchEventCombinerMultiTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -649,7 +649,7 @@ int UtcDaliTouchEventCombinerMultiTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 2, PointState::DOWN, 200.0f, 200.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 2u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[1].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), PointState::STATIONARY, TEST_LOCATION );
@@ -665,7 +665,7 @@ int UtcDaliTouchEventCombinerMultiTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::MOTION, 101.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 2u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -679,7 +679,7 @@ int UtcDaliTouchEventCombinerMultiTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 2, PointState::MOTION, 200.0f, 200.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
 
   time++;
@@ -690,7 +690,7 @@ int UtcDaliTouchEventCombinerMultiTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 2, PointState::MOTION, 201.0f, 201.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 2u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[1].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), PointState::STATIONARY, TEST_LOCATION );
@@ -706,7 +706,7 @@ int UtcDaliTouchEventCombinerMultiTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 101.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 2u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -722,7 +722,7 @@ int UtcDaliTouchEventCombinerMultiTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 2, PointState::MOTION, 202.0f, 202.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -737,7 +737,7 @@ int UtcDaliTouchEventCombinerMultiTouchNormal(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 2, PointState::UP, 202.0f, 202.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -759,7 +759,7 @@ int UtcDaliTouchEventCombinerSeveralPoints(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( pointCount, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time++, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time++, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), pointCount, TEST_LOCATION );
   }
 
@@ -770,7 +770,7 @@ int UtcDaliTouchEventCombinerSeveralPoints(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( pointCount, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time++, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time++, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), pointCount, TEST_LOCATION );
   }
   END_TEST;
@@ -787,7 +787,7 @@ int UtcDaliTouchEventCombinerReset(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -805,7 +805,7 @@ int UtcDaliTouchEventCombinerReset(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
   END_TEST;
 }
@@ -821,7 +821,7 @@ int UtcDaliTouchEventCombinerSingleTouchInterrupted(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
@@ -836,7 +836,7 @@ int UtcDaliTouchEventCombinerSingleTouchInterrupted(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::INTERRUPTED, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchBoth, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_BOTH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
@@ -850,7 +850,7 @@ int UtcDaliTouchEventCombinerSingleTouchInterrupted(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
   END_TEST;
 }
@@ -868,7 +868,7 @@ int UtcDaliTouchEventCombinerMultiTouchInterrupted(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( pointCount, PointState::DOWN, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchTouch, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), pointCount, TEST_LOCATION );
   }
 
@@ -878,7 +878,7 @@ int UtcDaliTouchEventCombinerMultiTouchInterrupted(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::INTERRUPTED, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchBoth, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_BOTH, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.GetPointCount(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION );
     DALI_TEST_EQUALS( hoverEvent.GetPointCount(), 1u, TEST_LOCATION );
@@ -892,7 +892,7 @@ int UtcDaliTouchEventCombinerMultiTouchInterrupted(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::UP, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
   END_TEST;
 }
@@ -908,7 +908,7 @@ int UtcDaliTouchEventCombinerInvalidState(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point point = GeneratePoint( 1, PointState::STATIONARY, 100.0f, 100.0f );
 
-    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DispatchNone, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
+    DALI_TEST_EQUALS( Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent( point, time, touchEvent, hoverEvent ), TEST_LOCATION );
   }
   END_TEST;
 }
index 8cdf264..eeb635e 100644 (file)
@@ -289,7 +289,7 @@ int UtcDaliTouchEventNormalProcessing01(void)
   // Connect to actor's touch signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   Vector2 screenCoordinates( 10.0f, 10.0f );
   Vector2 localCoordinates;
@@ -353,7 +353,7 @@ int UtcDaliTouchEventNormalProcessing02(void)
   // Connect to actor's touched signal
   HandleData handleData;
   TouchEventHandleFunctor functor( handleData );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   Vector2 screenCoordinates( 10.0f, 10.0f );
   Vector2 localCoordinates;
@@ -387,7 +387,7 @@ int UtcDaliTouchEventAPINegative(void)
   // Connect to actor's touched signal
   OutOfBoundsData data;
   OutOfBoundsFunctor functor( data, true );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   Vector2 screenCoordinates( 10.0f, 10.0f );
   Vector2 localCoordinates;
@@ -438,7 +438,7 @@ int UtcDaliTouchEventOutsideCameraNearFarPlanes(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   Vector2 screenCoordinates( sceneSize.x * 0.5f, sceneSize.y * 0.5f );
 
@@ -527,7 +527,7 @@ int UtcDaliTouchEventInterrupted(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -564,12 +564,12 @@ int UtcDaliTouchEventParentConsumer(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data, false );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Connect to root actor's touched signal
   SignalData rootData;
   TouchEventFunctor rootFunctor( rootData ); // Consumes signal
-  rootActor.TouchSignal().Connect( &application, rootFunctor );
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
 
   Vector2 screenCoordinates( 10.0f, 10.0f );
   Vector2 actorCoordinates, rootCoordinates;
@@ -664,12 +664,12 @@ int UtcDaliTouchEventInterruptedParentConsumer(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data, false );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Connect to root actor's touched signal
   SignalData rootData;
   TouchEventFunctor rootFunctor( rootData ); // Consumes signal
-  rootActor.TouchSignal().Connect( &application, rootFunctor );
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -743,7 +743,7 @@ int UtcDaliTouchEventLeave(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Set actor to require leave events
   actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
@@ -798,12 +798,12 @@ int UtcDaliTouchEventLeaveParentConsumer(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data, false );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Connect to root actor's touched signal
   SignalData rootData;
   TouchEventFunctor rootFunctor( rootData ); // Consumes signal
-  rootActor.TouchSignal().Connect( &application, rootFunctor );
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
 
   // Set actor to require leave events
   actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
@@ -879,7 +879,7 @@ int UtcDaliTouchEventActorBecomesInsensitive(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -915,12 +915,12 @@ int UtcDaliTouchEventActorBecomesInsensitiveParentConsumer(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data, false );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Connect to root actor's touched signal
   SignalData rootData;
   TouchEventFunctor rootFunctor( rootData ); // Consumes signal
-  rootActor.TouchSignal().Connect( &application, rootFunctor );
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -974,8 +974,8 @@ int UtcDaliTouchEventMultipleLayers(void)
   application.Render();
 
   // Connect to layer1 and actor1
-  layer1.TouchSignal().Connect( &application, functor );
-  actor1.TouchSignal().Connect( &application, functor );
+  layer1.TouchedSignal().Connect( &application, functor );
+  actor1.TouchedSignal().Connect( &application, functor );
 
   // Hit in hittable area, actor1 should be hit
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1022,8 +1022,8 @@ int UtcDaliTouchEventMultipleLayers(void)
   application.Render();
 
   // Connect to layer2 and actor2
-  layer2.TouchSignal().Connect( &application, functor );
-  actor2.TouchSignal().Connect( &application, functor );
+  layer2.TouchedSignal().Connect( &application, functor );
+  actor2.TouchedSignal().Connect( &application, functor );
 
   // Emit an event, should hit layer2
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1092,7 +1092,7 @@ int UtcDaliTouchEventMultipleRenderTasks(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1142,8 +1142,8 @@ int UtcDaliTouchEventMultipleRenderTasksWithChildLayer(void)
   // Connect to layer's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
-  layer.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
+  layer.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1204,7 +1204,7 @@ int UtcDaliTouchEventOffscreenRenderTasks(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1236,8 +1236,8 @@ int UtcDaliTouchEventMultipleRenderableActors(void)
   // Connect to layer's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  parent.TouchSignal().Connect( &application, functor );
-  actor.TouchSignal().Connect( &application, functor );
+  parent.TouchedSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1262,7 +1262,7 @@ int UtcDaliTouchEventActorRemovedInSignal(void)
   // Connect to actor's touched signal
   SignalData data;
   RemoveActorFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Register for leave events
   actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
@@ -1331,7 +1331,7 @@ int UtcDaliTouchEventActorSignalNotConsumed(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data, false );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1355,7 +1355,7 @@ int UtcDaliTouchEventActorRemovedFromScene(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1393,7 +1393,7 @@ int UtcDaliTouchEventLayerConsumesTouch(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Add a layer to overlap the actor
   Layer layer = Layer::New();
@@ -1448,7 +1448,7 @@ int UtcDaliTouchEventLeaveActorReadded(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down and motion
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1504,7 +1504,7 @@ int UtcDaliTouchEventClippedActor(void)
   // Connect to actor's touch signal.
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit an event within clipped area - no hit.
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1516,7 +1516,7 @@ int UtcDaliTouchEventClippedActor(void)
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   data.Reset();
 
-  clippingChild.TouchSignal().Connect( &application, functor );
+  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( PointState::DOWN, Vector2( 30.0f, 30.0f ) ) );
@@ -1542,7 +1542,7 @@ int UtcDaliTouchEventActorUnparented(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1585,7 +1585,7 @@ int UtcDaliTouchEventParentRemovedFromScene(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1628,12 +1628,12 @@ int UtcDaliTouchEventActorRemovedFromSceneDifferentConsumer(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data, false /* Do not consume */ );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Connect to parent's touched signal
   SignalData parentData;
   TouchEventFunctor parentFunctor( parentData );
-  parent.TouchSignal().Connect( &application, parentFunctor );
+  parent.TouchedSignal().Connect( &application, parentFunctor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1680,7 +1680,7 @@ int UtcDaliTouchEventActorRemovedFromSceneDifferentConsumer(void)
   // 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.TouchSignal().Connect( &application, secondFunctor );
+  actor.TouchedSignal().Connect( &application, secondFunctor );
 
   // Unparent the actor
   actor.Unparent();
@@ -1721,17 +1721,17 @@ int UtcDaliTouchEventInterruptedDifferentConsumer(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data, false /* Do not consume */ );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Connect to parent's touched signal
   SignalData parentData;
   TouchEventFunctor parentFunctor( parentData, false /* Do not consume */ );
-  parent.TouchSignal().Connect( &application, parentFunctor );
+  parent.TouchedSignal().Connect( &application, parentFunctor );
 
   // Connect to root's touched signal and consume
   SignalData rootData;
   TouchEventFunctor rootFunctor( rootData );
-  rootActor.TouchSignal().Connect( &application, rootFunctor );
+  rootActor.TouchedSignal().Connect( &application, rootFunctor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
@@ -1754,7 +1754,7 @@ int UtcDaliTouchEventInterruptedDifferentConsumer(void)
   // 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.TouchSignal().Connect( &application, secondFunctor );
+  parent.TouchedSignal().Connect( &application, secondFunctor );
 
   // Emit an interrupted signal, all three should STILL be called
   application.ProcessEvent( GenerateSingleTouch( PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) ) );
@@ -1787,7 +1787,7 @@ int UtcDaliTouchEventGetRadius(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal with an angle
   Integration::TouchEvent touchEvent = GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) );
@@ -1818,7 +1818,7 @@ int UtcDaliTouchEventGetEllipseRadius(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal with an angle
   Integration::TouchEvent touchEvent = GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) );
@@ -1849,7 +1849,7 @@ int UtcDaliTouchEventGetAngle(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal with an angle
   Integration::TouchEvent touchEvent = GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) );
@@ -1878,7 +1878,7 @@ int UtcDaliTouchEventGetPressure(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal with an angle
   Integration::TouchEvent touchEvent = GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) );
@@ -1907,7 +1907,7 @@ int UtcDaliTouchEventUsage(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
 
   // Emit a down signal with an angle
@@ -1934,7 +1934,7 @@ int UtcDaliTouchEventGetDeviceAPINegative(void)
   // Connect to actor's touched signal
   HandleData handleData;
   TouchEventHandleFunctor functor( handleData );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   Vector2 screenCoordinates( 10.0f, 10.0f );
   Vector2 localCoordinates;
@@ -1965,7 +1965,7 @@ int UtcDaliTouchEventGetMouseButtonPositive(void)
   // Connect to actor's touched signal
   HandleData handleData;
   TouchEventHandleFunctor functor( handleData );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal with MouseButton
   Integration::TouchEvent touchEvent = GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) );
@@ -1994,7 +1994,7 @@ int UtcDaliTouchEventGetMouseButtonNagative(void)
   // Connect to actor's touched signal
   HandleData handleData;
   TouchEventHandleFunctor functor( handleData );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal with MouseButton
   Integration::TouchEvent touchEvent = GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) );
@@ -2024,7 +2024,7 @@ int UtcDaliTouchEventCapturePropertySet(void)
   // Connect to actor's touched signal
   SignalData data;
   TouchEventFunctor functor( data );
-  actor.TouchSignal().Connect( &application, functor );
+  actor.TouchedSignal().Connect( &application, functor );
 
   // Emit a down signal
   application.ProcessEvent( GenerateSingleTouch( PointState::STARTED, Vector2( 10.0f, 10.0f ) ) );
@@ -2065,11 +2065,11 @@ int UtcDaliTouchEventCapturePropertySet(void)
 int UtcDaliTouchEventIntegNewTouchEvent(void)
 {
   uint32_t timestamp = 92858u;
-  TouchPoint tp(1, TouchPoint::State::Started, 34.4f, 123.89f, 5.0f, 7.0f);
+  TouchPoint tp(1, PointState::STARTED, 34.4f, 123.89f, 5.0f, 7.0f);
   Dali::TouchEvent touchEvent = Integration::NewTouchEvent(timestamp, tp);
 
   DALI_TEST_EQUALS(touchEvent.GetPointCount(), 1u, TEST_LOCATION);
-  DALI_TEST_EQUALS(touchEvent.GetState(0), PointState::Type::STARTED, TEST_LOCATION );
+  DALI_TEST_EQUALS(touchEvent.GetState(0), PointState::STARTED, TEST_LOCATION );
   DALI_TEST_EQUALS(touchEvent.GetLocalPosition(0), Vector2(5.0f, 7.0f), TEST_LOCATION );
   DALI_TEST_EQUALS(touchEvent.GetScreenPosition(0), Vector2(34.4f, 123.89f), TEST_LOCATION );
 
index 54685ee..5388fe9 100644 (file)
@@ -36,7 +36,7 @@ struct SignalData
   SignalData()
   : functorCalled( false ),
     voidFunctorCalled( false ),
-    receivedGesture( Gesture::Clear ),
+    receivedGesture( ),
     pressedActor()
   {}
 
@@ -45,9 +45,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.numberOfTouches = 0u;
-    receivedGesture.screenPoint = Vector2(0.0f, 0.0f);
-    receivedGesture.localPoint = Vector2(0.0f, 0.0f);
+    receivedGesture.Reset();
 
     pressedActor.Reset();
   }
@@ -125,7 +123,7 @@ struct MyTestCustomActor : public CustomActorImpl
   typedef Signal< void ()> SignalType;
   typedef Signal< void (float)> SignalTypeFloat;
 
-  MyTestCustomActor() : CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS ) )
+  MyTestCustomActor() : CustomActorImpl( ActorFlags() )
   { }
 
   virtual ~MyTestCustomActor()
@@ -154,18 +152,6 @@ struct MyTestCustomActor : public CustomActorImpl
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
   {
   }
-  virtual bool OnHoverEvent(const HoverEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnWheelEvent(const WheelEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  {
-    return true;
-  }
   virtual void OnKeyInputFocusGained()
   {
   }
index a30b03d..5bfd5c3 100644 (file)
@@ -35,7 +35,7 @@ struct MyTestCustomActor : public CustomActorImpl
   typedef Signal< void ()> SignalType;
   typedef Signal< void (float)> SignalTypeFloat;
 
-  MyTestCustomActor() : CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS ) )
+  MyTestCustomActor() : CustomActorImpl( ActorFlags() )
   { }
 
   virtual ~MyTestCustomActor()
@@ -64,18 +64,6 @@ struct MyTestCustomActor : public CustomActorImpl
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
   {
   }
-  virtual bool OnHoverEvent(const HoverEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnWheelEvent(const WheelEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  {
-    return true;
-  }
   virtual void OnKeyInputFocusGained()
   {
   }
index b07b63f..826ec0d 100644 (file)
@@ -31,9 +31,6 @@ namespace Dali
 
 using Internal::Core;
 
-const Vector4 Stage::DEFAULT_BACKGROUND_COLOR(0.0f, 0.0f, 0.0f, 1.0f);
-const Vector4 Stage::DEBUG_BACKGROUND_COLOR(0.2f, 0.5f, 0.2f, 1.0f);
-
 Stage::Stage()
 {
 }
@@ -144,9 +141,9 @@ Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSignal()
   return GetImplementation(*this).EventProcessingFinishedSignal();
 }
 
-Stage::TouchSignalType& Stage::TouchSignal()
+Stage::TouchEventSignalType& Stage::TouchedSignal()
 {
-  return GetImplementation( *this ).TouchSignal();
+  return GetImplementation( *this ).TouchedSignal();
 }
 
 Stage::WheelEventSignalType& Stage::WheelEventSignal()
index 81e5b2f..90d572c 100644 (file)
@@ -76,26 +76,22 @@ class KeyEvent;
  * |-------------------------|--------------------------------------|
  * | keyEvent                | @ref KeyEventSignal()                |
  * | eventProcessingFinished | @ref EventProcessingFinishedSignal() |
- * | touch                   | @ref TouchSignal()                   |
+ * | touched                 | @ref TouchedSignal()                 |
  * | wheelEvent              | @ref WheelEventSignal()              |
  * | contextLost             | @ref ContextLostSignal()             |
  * | contextRegained         | @ref ContextRegainedSignal()         |
  * | sceneCreated            | @ref SceneCreatedSignal()            |
- * @SINCE_1_0.0
  */
 class DALI_CORE_API Stage : public BaseHandle
 {
 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 TouchEvent&) > TouchSignalType;         ///< Touch signal type @SINCE_1_1.37
-  typedef Signal< void (const WheelEvent&) > WheelEventSignalType;   ///< Wheel 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
-
-  static const Vector4 DEFAULT_BACKGROUND_COLOR; ///< Default black background.
-  static const Vector4 DEBUG_BACKGROUND_COLOR;   ///< Green background, useful when debugging.
+  typedef Signal< void (const KeyEvent&) > KeyEventSignalType;       ///< Key event signal type
+  typedef Signal< void () > EventProcessingFinishedSignalType;       ///< Event Processing finished signal type
+  typedef Signal< void (const TouchEvent&) > TouchEventSignalType;   ///< Touch signal type
+  typedef Signal< void (const WheelEvent&) > WheelEventSignalType;   ///< Wheel signal type
+  typedef Signal< void () > ContextStatusSignal;                     ///< Context status signal type
+  typedef Signal< void () > SceneCreatedSignalType;                  ///< Scene created signal type
 
   /**
    * @brief Allows the creation of an empty stage handle.
@@ -167,7 +163,6 @@ public:
    * The x component will be the width of the Stage in pixels.
    * The y component will be the height of the Stage in pixels.
    * The z component will be the distance between far and near planes.
-   * @SINCE_1_0.0
    * @return The size of the Stage as a Vector
    */
   Vector2 GetSize() const;
@@ -257,7 +252,6 @@ public:
    * @code
    *   void YourCallbackName(const KeyEvent& event);
    * @endcode
-   * @SINCE_1_0.0
    * @return The signal to connect to
    */
   KeyEventSignalType& KeyEventSignal();
@@ -284,7 +278,7 @@ public:
    * @return The touch signal to connect to
    * @note Motion events are not emitted.
    */
-  TouchSignalType& TouchSignal();
+  TouchEventSignalType& TouchedSignal();
 
   /**
    * @brief This signal is emitted when wheel event is received.
diff --git a/dali/devel-api/events/hover-event-devel.cpp b/dali/devel-api/events/hover-event-devel.cpp
new file mode 100644 (file)
index 0000000..7f67b81
--- /dev/null
@@ -0,0 +1,36 @@
+/*\r
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/devel-api/events/hover-event-devel.h>\r
+#include <dali/internal/event/events/hover-event-impl.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace DevelHoverEvent\r
+{\r
+\r
+HoverEvent New( uint32_t time )\r
+{\r
+  return HoverEvent( new Internal::HoverEvent( time ) );\r
+}\r
+\r
+} // namespace DevelHoverEvent\r
+\r
+} // namespace Dali\r
+\r
diff --git a/dali/devel-api/events/hover-event-devel.h b/dali/devel-api/events/hover-event-devel.h
new file mode 100644 (file)
index 0000000..13f2c0a
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef DALI_HOVER_EVENT_DEVEL_H\r
+#define DALI_HOVER_EVENT_DEVEL_H\r
+\r
+/*\r
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/public-api/events/hover-event.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace DevelHoverEvent\r
+{\r
+\r
+/**\r
+ * @brief Creates an initialized HoverEvent.\r
+ *\r
+ * @SINCE_1_9.28\r
+ * @param[in] time The time the event occurred.\r
+ * @return A handle to a newly allocated Dali resource\r
+ */\r
+DALI_CORE_API HoverEvent New( uint32_t time );\r
+\r
+\r
+} // namespace DevelHoverEvent\r
+\r
+} // namespace Dali\r
+\r
+#endif // DALI_HOVER_EVENT_DEVEL_H\r
diff --git a/dali/devel-api/events/pan-gesture-devel.cpp b/dali/devel-api/events/pan-gesture-devel.cpp
new file mode 100644 (file)
index 0000000..e750480
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/devel-api/events/pan-gesture-devel.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/event/events/pan-gesture/pan-gesture-impl.h>
+
+
+namespace Dali
+{
+
+namespace DevelPanGesture
+{
+
+Dali::PanGesture New( GestureState state )
+{
+  return PanGesture( new Internal::PanGesture( state ) );
+}
+
+void SetTime( Dali::PanGesture& gesture, uint32_t time )
+{
+  GetImplementation( gesture ).SetTime( time );
+}
+
+void SetVelocity( Dali::PanGesture& gesture, const Vector2& velocity)
+{
+  GetImplementation( gesture ).SetVelocity( velocity );
+}
+
+void SetDisplacement( Dali::PanGesture& gesture, const Vector2& displacement)
+{
+  GetImplementation( gesture ).SetDisplacement( displacement );
+}
+
+void SetPosition( Dali::PanGesture& gesture, const Vector2& position)
+{
+  GetImplementation( gesture ).SetPosition( position );
+}
+
+void SetScreenVelocity( Dali::PanGesture& gesture, const Vector2& screenVelocity)
+{
+  GetImplementation( gesture ).SetScreenVelocity( screenVelocity );
+}
+
+void SetScreenDisplacement( Dali::PanGesture& gesture, const Vector2& screenDisplacement)
+{
+  GetImplementation( gesture ).SetScreenDisplacement( screenDisplacement );
+}
+
+void SetScreenPosition( Dali::PanGesture& gesture, const Vector2& screenPosition)
+{
+  GetImplementation( gesture ).SetScreenPosition( screenPosition );
+}
+
+void SetNumberOfTouches( Dali::PanGesture& gesture, uint32_t numberOfTouches )
+{
+  GetImplementation( gesture ).SetNumberOfTouches( numberOfTouches );
+}
+
+} // namespace DevelPanGesture
+
+} // namespace Dali
diff --git a/dali/devel-api/events/pan-gesture-devel.h b/dali/devel-api/events/pan-gesture-devel.h
new file mode 100644 (file)
index 0000000..f204fcb
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef DALI_PAN_GESTURE_DEVEL_H
+#define DALI_PAN_GESTURE_DEVEL_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/events/pan-gesture.h>
+
+namespace Dali
+{
+
+namespace DevelPanGesture
+{
+
+/**
+ * @brief Create a PanGeture for internal.
+ * @param[in] state The state of the PanGesture
+ */
+DALI_CORE_API Dali::PanGesture New(GestureState state);
+
+/**
+ * @brief Set the time the gesture took place.
+ * @param[in] gesture The PanGesture to set
+ * @param[in] time The time the gesture took place
+ */
+DALI_CORE_API void SetTime(Dali::PanGesture& gesture, uint32_t time);
+
+/**
+ * @brief Set the velocity at which the user is moving their fingers.
+ * @param[in] gesture The PanGesture to set
+ * @param[in] velocity The Vector2 in local coordinates to set
+ */
+DALI_CORE_API void SetVelocity(Dali::PanGesture& gesture, const Vector2& velocity);
+
+/**
+ * @brief Set the displacement.
+ * @param[in] gesture The PanGesture to set
+ * @param[in] displacement The Vector2 in local coordinates to set
+ */
+DALI_CORE_API void SetDisplacement(Dali::PanGesture& gesture, const Vector2& displacement);
+
+/**
+ * @brief Set the current touch position of the primary touch point in local actor coordinates.
+ * @param[in] gesture The PanGesture to set.
+ * @param[in] position The current touch position to set.
+ */
+DALI_CORE_API void SetPosition(Dali::PanGesture& gesture, const Vector2& position);
+
+/**
+ * @brief Set the velocity at which the user is moving their fingers.
+ * @param[in] gesture The PanGesture to set
+ * @param[in] screenVelocity The Vector2 in screen coordinates to set
+ */
+DALI_CORE_API void SetScreenVelocity(Dali::PanGesture& gesture, const Vector2& screenVelocity);
+
+/**
+ * @brief Set the screen displacement.
+ * @param[in] gesture The PanGesture to set
+ * @param[in] screenDisplacement The Vector2 in screen coordinates to set
+ */
+DALI_CORE_API void SetScreenDisplacement(Dali::PanGesture& gesture, const Vector2& screenDisplacement);
+
+/**
+ * @brief Set the current touch position of the primary touch point in screen coordinates.
+ * @param[in] gesture The PanGesture to set.
+ * @param[in] screenPosition The Vector2 in screen coordinates to set.
+ */
+DALI_CORE_API void SetScreenPosition(Dali::PanGesture& gesture, const Vector2& screenPosition);
+
+/**
+ * @brief Set the total number of fingers touching the screen in a pan gesture.
+ * @param[in] gesture The PanGesture to set
+ * @param[in] numberOfTouches The total number of fingers touching the screen to set
+ */
+DALI_CORE_API void SetNumberOfTouches(Dali::PanGesture& gesture, uint32_t numberOfTouches);
+
+} // namespace DevelPanGesture
+
+} // namespace Dali
+
+#endif // DALI_PAN_GESTURE_DEVEL_H
similarity index 73%
rename from dali/public-api/events/touch-point.cpp
rename to dali/devel-api/events/touch-point.cpp
index 41a3785..bcfbea2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * 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.
  */
 
 // CLASS HEADER
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 
 namespace Dali
 {
 
-TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY)
+TouchPoint::TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY)
 : deviceId(id),
   state(state),
   local(screenX, screenY),
@@ -29,7 +29,7 @@ TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY)
 {
 }
 
-TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY)
+TouchPoint::TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY, float localX, float localY)
 : deviceId(id),
   state(state),
   local(localX, localY),
similarity index 73%
rename from dali/public-api/events/touch-point.h
rename to dali/devel-api/events/touch-point.h
index ce6f371..3cda040 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOUCH_POINT_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -24,6 +24,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/actors/actor.h>
+#include <dali/public-api/events/point-state.h>
 #include <dali/public-api/math/vector2.h>
 
 namespace Dali
@@ -40,44 +41,23 @@ namespace Dali
  */
 struct DALI_CORE_API TouchPoint
 {
-  // Enumerations
-
-  /**
-   * @brief Enumeration for Touch state.
-   * @SINCE_1_0.0
-   */
-  enum State
-  {
-    Started,        /**< Touch or hover started */
-    Finished,       /**< Touch or hover finished */
-    Down = Started, /**< Screen touched */
-    Up = Finished,  /**< Touch stopped */
-    Motion,         /**< Finger dragged or hovered */
-    Leave,          /**< Leave the boundary of an actor */
-    Stationary,     /**< No change from last event.  Useful when a multi-point event occurs where
-                         all points are sent but indicates that this particular point has not changed
-                         since the last time */
-    Interrupted,    /**< A system event has occurred which has interrupted the touch or hover event sequence. */
-    Last            /**< Number of states. */
-  };
-
   // Construction & Destruction
 
   /**
    * @brief Constructor.
    *
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] id      The touch device ID
    * @param[in] state   The state
    * @param[in] screenX The X co-ordinate relative to the screen's origin
    * @param[in] screenY The Y co-ordinate relative to the screen's origin
    */
-  TouchPoint(int32_t id, State state, float screenX, float screenY);
+  TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY);
 
   /**
    * @brief Constructor.
    *
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] id      The touch device ID
    * @param[in] state   The state
    * @param[in] screenX The X co-ordinate relative to the screen's origin
@@ -85,7 +65,7 @@ struct DALI_CORE_API TouchPoint
    * @param[in] localX  The X co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
    * @param[in] localY  The Y co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
    */
-  TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY);
+  TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY, float localX, float localY);
 
   /**
    * @brief Destructor.
@@ -103,9 +83,9 @@ struct DALI_CORE_API TouchPoint
   /**
    * @brief State of the point.
    *
-   * @see State
+   * @see Dali::PointState::Type
    */
-  State state;
+  PointState::Type state;
 
   /**
    * @brief The actor that was underneath the touch point.
index 5ae82c1..6f83f08 100644 (file)
@@ -14,8 +14,11 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/common/stage-devel.cpp
   ${devel_api_src_dir}/common/stage.cpp
   ${devel_api_src_dir}/events/hit-test-algorithm.cpp
-  ${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
+  ${devel_api_src_dir}/events/hover-event-devel.cpp
   ${devel_api_src_dir}/events/key-event-devel.cpp
+  ${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
+  ${devel_api_src_dir}/events/pan-gesture-devel.cpp
+  ${devel_api_src_dir}/events/touch-point.cpp
   ${devel_api_src_dir}/events/wheel-event-devel.cpp
   ${devel_api_src_dir}/images/distance-field.cpp
   ${devel_api_src_dir}/images/pixel-data-devel.cpp
@@ -70,8 +73,11 @@ SET( devel_api_core_common_header_files
 
 SET( devel_api_core_events_header_files
   ${devel_api_src_dir}/events/hit-test-algorithm.h
-  ${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
+  ${devel_api_src_dir}/events/hover-event-devel.h
   ${devel_api_src_dir}/events/key-event-devel.h
+  ${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
+  ${devel_api_src_dir}/events/pan-gesture-devel.h
+  ${devel_api_src_dir}/events/touch-point.h
   ${devel_api_src_dir}/events/wheel-event-devel.h
 )
 
index 2349f02..ee61baf 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
@@ -26,7 +26,7 @@ namespace Integration
 {
 
 Point::Point()
-: mTouchPoint( 0, TouchPoint::Started, 0.0f, 0.0f ),
+: mTouchPoint( 0, PointState::STARTED, 0.0f, 0.0f ),
   mEllipseRadius(),
   mAngle( 0.0f ),
   mDeviceClass( Device::Class::NONE ),
@@ -60,7 +60,7 @@ void Point::SetDeviceId( int32_t deviceId )
 
 void Point::SetState( PointState::Type state )
 {
-  mTouchPoint.state = static_cast< TouchPoint::State >( state );
+  mTouchPoint.state = static_cast< PointState::Type >( state );
 }
 
 void Point::SetScreenPosition( const Vector2& screenPosition )
index 29498d7..f1e9112 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_POINT_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -22,7 +22,7 @@
 #include <dali/public-api/events/point-state.h>
 #include <dali/public-api/math/degree.h>
 #include <dali/public-api/math/vector2.h>
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/events/device.h>
 #include <dali/public-api/events/mouse-button.h>
 
index 768b741..d73291b 100644 (file)
@@ -86,7 +86,7 @@ TouchEventCombiner::~TouchEventCombiner()
 
 TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent( const Point& point, uint32_t time, TouchEvent& touchEvent, HoverEvent& hoverEvent )
 {
-  TouchEventCombiner::EventDispatchType dispatchEvent( TouchEventCombiner::DispatchNone );
+  TouchEventCombiner::EventDispatchType dispatchEvent( TouchEventCombiner::DISPATCH_NONE );
   const PointState::Type state = point.GetState();
   const int deviceId = point.GetDeviceId();
 
@@ -121,7 +121,7 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent( con
       {
         mPressedPoints.push_back( PointInfo( point, time ) );
         touchEvent.AddPoint( point );
-        dispatchEvent = TouchEventCombiner::DispatchTouch; // Only dispatch touch event if just added to container
+        dispatchEvent = TouchEventCombiner::DISPATCH_TOUCH; // Only dispatch touch event if just added to container
 
         // Check whether hover event was dispatched previously
         if ( !mHoveredPoints.empty() )
@@ -148,7 +148,7 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent( con
           if ( match != mHoveredPoints.end() )
           {
             mHoveredPoints.erase( match );
-            dispatchEvent = TouchEventCombiner::DispatchBoth; // We should only dispatch hover events if the point was actually hovered in this window
+            dispatchEvent = TouchEventCombiner::DISPATCH_BOTH; // We should only dispatch hover events if the point was actually hovered in this window
           }
         }
       }
@@ -181,7 +181,7 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent( con
       if ( match != mPressedPoints.end() )
       {
         mPressedPoints.erase( match );
-        dispatchEvent = TouchEventCombiner::DispatchTouch; // We should only dispatch touch events if the point was actually pressed in this window
+        dispatchEvent = TouchEventCombiner::DISPATCH_TOUCH; // We should only dispatch touch events if the point was actually pressed in this window
 
         // Iterate through already stored touch points for HoverEvent and delete them
         for ( PointInfoContainer::iterator iter = mHoveredPoints.begin(), endIter = mHoveredPoints.end(); iter != endIter; ++iter )
@@ -245,7 +245,7 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent( con
           PointInfo matchedPoint( point, time );
           std::swap( *match, matchedPoint );
 
-          dispatchEvent = TouchEventCombiner::DispatchTouch; // Dispatch touch event
+          dispatchEvent = TouchEventCombiner::DISPATCH_TOUCH; // Dispatch touch event
         }
         else if(!ignore)
         {
@@ -312,13 +312,13 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent( con
             std::swap( *match, matchedPoint );
           }
 
-          if(dispatchEvent == TouchEventCombiner::DispatchTouch)
+          if(dispatchEvent == TouchEventCombiner::DISPATCH_TOUCH)
           {
-            dispatchEvent = TouchEventCombiner::DispatchBoth;
+            dispatchEvent = TouchEventCombiner::DISPATCH_BOTH;
           }
           else
           {
-            dispatchEvent = TouchEventCombiner::DispatchHover;
+            dispatchEvent = TouchEventCombiner::DISPATCH_HOVER;
           }
         }
       }
@@ -332,7 +332,7 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent( con
       // We should still tell core about the interruption.
       touchEvent.AddPoint( point );
       hoverEvent.AddPoint( point );
-      dispatchEvent = TouchEventCombiner::DispatchBoth;
+      dispatchEvent = TouchEventCombiner::DISPATCH_BOTH;
       break;
     }
 
index 2849380..6ed9402 100644 (file)
@@ -54,10 +54,10 @@ public:
 
   enum EventDispatchType
   {
-    DispatchTouch,      ///< The touch event should be dispatched.
-    DispatchHover,      ///< The hover event should be dispatched.
-    DispatchBoth,       ///< Both touch event and hover event should be dispatched.
-    DispatchNone        ///< Neither touch event nor hover event should be dispatched.
+    DISPATCH_TOUCH,      ///< The touch event should be dispatched.
+    DISPATCH_HOVER,      ///< The hover event should be dispatched.
+    DISPATCH_BOTH,       ///< Both touch event and hover event should be dispatched.
+    DISPATCH_NONE        ///< Neither touch event nor hover event should be dispatched.
   };
 
   /**
index 4499472..3f48898 100644 (file)
@@ -20,7 +20,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/events/touch-event.h>
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 
 namespace Dali
 {
index 4ab7dbf..b40c303 100644 (file)
@@ -184,9 +184,9 @@ Scene::KeyEventGeneratedSignalType& Scene::KeyEventGeneratedSignal()
   return GetImplementation(*this).KeyEventGeneratedSignal();
 }
 
-Scene::TouchSignalType& Scene::TouchSignal()
+Scene::TouchEventSignalType& Scene::TouchedSignal()
 {
-  return GetImplementation(*this).TouchSignal();
+  return GetImplementation(*this).TouchedSignal();
 }
 
 Scene::WheelEventSignalType& Scene::WheelEventSignal()
index b69eb10..cced7dd 100755 (executable)
@@ -59,8 +59,8 @@ public:
   typedef Signal< void () > EventProcessingFinishedSignalType; ///< Event Processing finished signal type
   typedef Signal< void (const Dali::KeyEvent&) > KeyEventSignalType; ///< Key event signal type
   typedef Signal< bool (const Dali::KeyEvent&) > KeyEventGeneratedSignalType; ///< key event generated signal type
-  typedef Signal< void (const Dali::TouchEvent&) > TouchSignalType; ///< Touch signal type
-  typedef Signal< void (const Dali::WheelEvent&) > WheelEventSignalType; ///< Touched signal type
+  typedef Signal< void (const Dali::TouchEvent&) > TouchEventSignalType; ///< Touch signal type
+  typedef Signal< void (const Dali::WheelEvent&) > WheelEventSignalType; ///< WheelEvent signal type
 
   using FrameCallbackContainer = std::vector< std::pair< std::unique_ptr< CallbackBase >, int32_t > >;
 
@@ -334,7 +334,7 @@ public:
    * @return The touch signal to connect to
    * @note Motion events are not emitted.
    */
-  TouchSignalType& TouchSignal();
+  TouchEventSignalType& TouchedSignal();
 
   /**
    * @brief This signal is emitted when wheel event is received.
index 91f19d9..70fce36 100644 (file)
@@ -230,7 +230,7 @@ const char* const SIGNAL_WHEEL_EVENT = "wheelEvent";
 const char* const SIGNAL_ON_SCENE = "onScene";
 const char* const SIGNAL_OFF_SCENE = "offScene";
 const char* const SIGNAL_ON_RELAYOUT = "onRelayout";
-const char* const SIGNAL_TOUCH = "touch";
+const char* const SIGNAL_TOUCHED = "touched";
 const char* const SIGNAL_VISIBILITY_CHANGED = "visibilityChanged";
 const char* const SIGNAL_LAYOUT_DIRECTION_CHANGED = "layoutDirectionChanged";
 const char* const SIGNAL_CHILD_ADDED = "childAdded";
@@ -253,7 +253,7 @@ SignalConnectorType signalConnector3( mType, SIGNAL_WHEEL_EVENT, &Actor::DoConne
 SignalConnectorType signalConnector4( mType, SIGNAL_ON_SCENE, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector5( mType, SIGNAL_OFF_SCENE, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector6( mType, SIGNAL_ON_RELAYOUT, &Actor::DoConnectSignal );
-SignalConnectorType signalConnector7( mType, SIGNAL_TOUCH, &Actor::DoConnectSignal );
+SignalConnectorType signalConnector7( mType, SIGNAL_TOUCHED, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector8( mType, SIGNAL_VISIBILITY_CHANGED, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector9( mType, SIGNAL_LAYOUT_DIRECTION_CHANGED, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector10( mType, SIGNAL_CHILD_ADDED, &Actor::DoConnectSignal );
@@ -1788,17 +1788,17 @@ bool Actor::IsKeyboardFocusable() const
 
 bool Actor::GetTouchRequired() const
 {
-  return !mTouchSignal.Empty() || mDerivedRequiresTouch;
+  return !mTouchedSignal.Empty();
 }
 
 bool Actor::GetHoverRequired() const
 {
-  return !mHoveredSignal.Empty() || mDerivedRequiresHover;
+  return !mHoveredSignal.Empty();
 }
 
 bool Actor::GetWheelEventRequired() const
 {
-  return !mWheelEventSignal.Empty() || mDerivedRequiresWheelEvent;
+  return !mWheelEventSignal.Empty();
 }
 
 bool Actor::IsHittable() const
@@ -1817,19 +1817,19 @@ ActorGestureData& Actor::GetGestureData()
   return *mGestureData;
 }
 
-bool Actor::IsGestureRequred( Gesture::Type type ) const
+bool Actor::IsGestureRequired( GestureType::Value type ) const
 {
-  return mGestureData && mGestureData->IsGestureRequred( type );
+  return mGestureData && mGestureData->IsGestureRequired( type );
 }
 
 bool Actor::EmitTouchEventSignal( const Dali::TouchEvent& touch )
 {
   bool consumed = false;
 
-  if( !mTouchSignal.Empty() )
+  if( !mTouchedSignal.Empty() )
   {
     Dali::Actor handle( this );
-    consumed = mTouchSignal.Emit( handle, touch );
+    consumed = mTouchedSignal.Emit( handle, touch );
   }
 
   return consumed;
@@ -1845,12 +1845,6 @@ bool Actor::EmitHoverEventSignal( const Dali::HoverEvent& event )
     consumed = mHoveredSignal.Emit( handle, event );
   }
 
-  if( !consumed )
-  {
-    // Notification for derived classes
-    consumed = OnHoverEvent( event );
-  }
-
   return consumed;
 }
 
@@ -1864,12 +1858,6 @@ bool Actor::EmitWheelEventSignal( const Dali::WheelEvent& event )
     consumed = mWheelEventSignal.Emit( handle, event );
   }
 
-  if( !consumed )
-  {
-    // Notification for derived classes
-    consumed = OnWheelEvent( event );
-  }
-
   return consumed;
 }
 
@@ -1909,9 +1897,9 @@ void Actor::EmitChildRemovedSignal( Actor& child )
   }
 }
 
-Dali::Actor::TouchEventSignalType& Actor::TouchSignal()
+Dali::Actor::TouchEventSignalType& Actor::TouchedSignal()
 {
-  return mTouchSignal;
+  return mTouchedSignal;
 }
 
 Dali::Actor::HoverSignalType& Actor::HoveredSignal()
@@ -1989,9 +1977,9 @@ bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   {
     actor->OnRelayoutSignal().Connect( tracker, functor );
   }
-  else if( 0 == signalName.compare( SIGNAL_TOUCH ) )
+  else if( 0 == signalName.compare( SIGNAL_TOUCHED ) )
   {
-    actor->TouchSignal().Connect( tracker, functor );
+    actor->TouchedSignal().Connect( tracker, functor );
   }
   else if( 0 == signalName.compare( SIGNAL_VISIBILITY_CHANGED ) )
   {
@@ -2028,7 +2016,7 @@ Actor::Actor( DerivedType derivedType, const SceneGraph::Node& node )
   mAnchorPoint( NULL ),
   mRelayoutData( NULL ),
   mGestureData( NULL ),
-  mTouchSignal(),
+  mTouchedSignal(),
   mHoveredSignal(),
   mWheelEventSignal(),
   mOnSceneSignal(),
@@ -2055,9 +2043,6 @@ Actor::Actor( DerivedType derivedType, const SceneGraph::Node& node )
   mSensitive( true ),
   mLeaveRequired( false ),
   mKeyboardFocusable( false ),
-  mDerivedRequiresTouch( false ),
-  mDerivedRequiresHover( false ),
-  mDerivedRequiresWheelEvent( false ),
   mOnSceneSignalled( false ),
   mInsideOnSizeSet( false ),
   mInheritPosition( true ),
index 4b65bb6..7b83acf 100644 (file)
@@ -1399,7 +1399,7 @@ public:
    * @param[in] type The gesture type.
    * @return True if the gesture is required, false otherwise.
    */
-  bool IsGestureRequred( Gesture::Type type ) const;
+  bool IsGestureRequired( GestureType::Value type ) const;
 
   // Signals
 
@@ -1450,9 +1450,9 @@ public:
   void EmitChildRemovedSignal( Actor& child );
 
   /**
-   * @copydoc Dali::Actor::TouchEventSignal()
+   * @copydoc Dali::Actor::TouchedSignal()
    */
-  Dali::Actor::TouchEventSignalType& TouchSignal();
+  Dali::Actor::TouchEventSignalType& TouchedSignal();
 
   /**
    * @copydoc Dali::Actor::HoveredSignal()
@@ -1830,28 +1830,6 @@ private:
   }
 
   /**
-   * 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.
-   */
-  virtual bool OnHoverEvent( const HoverEvent& event )
-  {
-    return false;
-  }
-
-  /**
-   * For use in derived classes.
-   * This is only called if the wheel signal was not consumed.
-   * @param[in] event The wheel event.
-   * @return True if the event should be consumed.
-   */
-  virtual bool OnWheelEvent( const WheelEvent& event )
-  {
-    return false;
-  }
-
-  /**
    * @brief Retrieves the cached event side value of a default property.
    * @param[in]  index  The index of the property
    * @param[out] value  Is set with the cached value of the property if found.
@@ -1966,7 +1944,7 @@ protected:
   ActorGestureData* mGestureData;   ///< Optional Gesture data. Only created when actor requires gestures
 
   // Signals
-  Dali::Actor::TouchEventSignalType         mTouchSignal;
+  Dali::Actor::TouchEventSignalType        mTouchedSignal;
   Dali::Actor::HoverSignalType             mHoveredSignal;
   Dali::Actor::WheelEventSignalType        mWheelEventSignal;
   Dali::Actor::OnSceneSignalType           mOnSceneSignal;
@@ -1996,9 +1974,6 @@ protected:
   bool mSensitive                                  : 1; ///< Whether the actor emits touch event signals
   bool mLeaveRequired                              : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
   bool mKeyboardFocusable                          : 1; ///< Whether the actor should be focusable by keyboard navigation
-  bool mDerivedRequiresTouch                       : 1; ///< Whether the derived actor type requires touch event signals
-  bool mDerivedRequiresHover                       : 1; ///< Whether the derived actor type requires hover event signals
-  bool mDerivedRequiresWheelEvent                  : 1; ///< Whether the derived actor type requires wheel event signals
   bool mOnSceneSignalled                           : 1; ///< Set to true before OnSceneConnection signal is emitted, and false before OnSceneDisconnection
   bool mInsideOnSizeSet                            : 1; ///< Whether we are inside OnSizeSet
   bool mInheritPosition                            : 1; ///< Cached: Whether the parent's position should be inherited.
index eb6549e..f85f07b 100644 (file)
@@ -40,9 +40,6 @@ CustomActor::CustomActor( const SceneGraph::Node& node, CustomActorImpl& extensi
 : Actor( Actor::BASIC, node ),
   mImpl( &extension )
 {
-  mDerivedRequiresTouch = extension.RequiresTouchEvents();
-  mDerivedRequiresHover = extension.RequiresHoverEvents();
-  mDerivedRequiresWheelEvent = extension.RequiresWheelEvents();
   SetRelayoutEnabled( extension.IsRelayoutEnabled() );
 }
 
index c2a42be..a6363ba 100644 (file)
@@ -111,7 +111,7 @@ private:
   /**
    * @copydoc Internal::Actor::OnPropertySet
    */
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue )
+  virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue )
   {
     mImpl->OnPropertySet(index, propertyValue);
   }
@@ -134,30 +134,6 @@ private:
   }
 
   /**
-   * @copydoc Internal::Actor::OnHoverEvent
-   */
-  virtual bool OnHoverEvent(const HoverEvent& event)
-  {
-    return mImpl->OnHoverEvent(event);
-  }
-
-  /**
-   * @copydoc Internal::Actor::OnKeyEvent
-   */
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  {
-    return mImpl->OnKeyEvent(event);
-  }
-
-  /**
-   * @copydoc Internal::Actor::OnWheelEvent
-   */
-  virtual bool OnWheelEvent(const WheelEvent& event)
-  {
-    return mImpl->OnWheelEvent(event);
-  }
-
-  /**
    * @copydoc Internal::Actor::OnRelayout
    */
   virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
index b346519..c357e41 100644 (file)
@@ -143,7 +143,7 @@ void LinearConstrainer::Apply( Property target, Property source, const Vector2&
   constraint.AddSource( Dali::Source(source.object, source.propertyIndex ) );
 
   constraint.SetTag( static_cast<uint32_t>( reinterpret_cast<uintptr_t>( this ) ) ); // taking 32bits of this as tag
-  constraint.SetRemoveAction( Dali::Constraint::Discard );
+  constraint.SetRemoveAction( Dali::Constraint::DISCARD );
   constraint.Apply();
 
   //Start observing the object
index 877a938..63eb9f7 100644 (file)
@@ -166,7 +166,7 @@ void PathConstrainer::Apply( Property target, Property source, const Vector2& ra
     constraint.AddSource( Dali::Source(source.object, source.propertyIndex ) );
 
     constraint.SetTag( static_cast<uint32_t>( reinterpret_cast<uintptr_t>( this ) ) ); // taking 32bits of this as tag
-    constraint.SetRemoveAction( Dali::Constraint::Discard );
+    constraint.SetRemoveAction( Dali::Constraint::DISCARD );
     constraint.Apply();
   }
   else if( propertyType == Dali::Property::ROTATION )
@@ -176,7 +176,7 @@ void PathConstrainer::Apply( Property target, Property source, const Vector2& ra
     constraint.AddSource( Dali::Source(source.object, source.propertyIndex ) );
 
     constraint.SetTag( static_cast<uint32_t>( reinterpret_cast<uintptr_t>( this ) ) ); // taking 32bits of this as tag
-    constraint.SetRemoveAction( Dali::Constraint::Discard );
+    constraint.SetRemoveAction( Dali::Constraint::DISCARD );
     constraint.Apply();
   }
 
index 8bdc264..a7bac60 100644 (file)
@@ -392,7 +392,7 @@ protected:
    * @param [in] index The index of the property.
    * @param [in] propertyValue The value of the property.
    */
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue ) {}
+  virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue ) {}
 
   /**
    * Retrieves the TypeInfo for this object. Only retrieves it from the type-registry once and then stores a pointer
index ab1260e..33222bf 100644 (file)
@@ -68,7 +68,7 @@ PropertyNotification::PropertyNotification( UpdateManager& updateManager,
   mPropertyType( Property::NONE ),
   mComponentIndex( componentIndex ),
   mCondition( condition ),
-  mNotifyMode( Dali::PropertyNotification::NotifyOnTrue ),
+  mNotifyMode( Dali::PropertyNotification::NOTIFY_ON_TRUE ),
   mNotifyResult( false ),
   mCompare( false )
 {
index 54980c8..45cec79 100644 (file)
@@ -61,7 +61,7 @@ void PropertyNotificationManager::NotifyProperty( SceneGraph::PropertyNotificati
     // found one with the matching SceneGraph::PropertyNotification?
     if( (*iter)->CompareSceneObject( propertyNotification ) )
     {
-      // allow application to access the value that triggered this emit incase of NotifyOnChanged mode
+      // allow application to access the value that triggered this emit incase of NOTIFY_ON_CHANGED mode
       (*iter)->SetNotifyResult(validity);
       // yes..emit signal
       (*iter)->EmitSignalNotify();
index 4b44566..7f85aa1 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/internal/update/nodes/node.h>
 #include <dali/internal/update/manager/update-manager.h>
 #include <dali/internal/update/common/scene-graph-scene.h>
+#include <dali/public-api/common/constants.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/internal/event/rendering/frame-buffer-impl.h>
@@ -42,13 +43,6 @@ namespace Dali
 namespace Internal
 {
 
-namespace
-{
-
-const Vector4 DEFAULT_BACKGROUND_COLOR(0.0f, 0.0f, 0.0f, 1.0f); // Default background color
-
-} //Unnamed namespace
-
 ScenePtr Scene::New( Size size )
 {
   ScenePtr scene = new Scene;
@@ -319,9 +313,9 @@ void Scene::EmitEventProcessingFinishedSignal()
 void Scene::EmitTouchedSignal( const Dali::TouchEvent& touch )
 {
   Dali::Integration::Scene handle( this );
-  if ( !mTouchSignal.Empty() )
+  if ( !mTouchedSignal.Empty() )
   {
-    mTouchSignal.Emit( touch );
+    mTouchedSignal.Emit( touch );
   }
 }
 
@@ -371,9 +365,9 @@ Integration::Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFin
   return mEventProcessingFinishedSignal;
 }
 
-Integration::Scene::TouchSignalType& Scene::TouchSignal()
+Integration::Scene::TouchEventSignalType& Scene::TouchedSignal()
 {
-  return mTouchSignal;
+  return mTouchedSignal;
 }
 
 Integration::Scene::WheelEventSignalType& Scene::WheelEventSignal()
index a271761..09d6369 100644 (file)
@@ -251,9 +251,9 @@ public:
   Integration::Scene::EventProcessingFinishedSignalType& EventProcessingFinishedSignal();
 
   /**
-    * @copydoc Integration::Scene::TouchSignal()
+    * @copydoc Integration::Scene::TouchedSignal()
     */
-  Integration::Scene::TouchSignalType& TouchSignal();
+  Integration::Scene::TouchEventSignalType& TouchedSignal();
 
   /**
    * @copydoc Integration::Scene::sWheelEventSignal()
@@ -323,7 +323,7 @@ private:
   Integration::Scene::EventProcessingFinishedSignalType mEventProcessingFinishedSignal;
 
   // The touch signal
-  Integration::Scene::TouchSignalType mTouchSignal;
+  Integration::Scene::TouchEventSignalType mTouchedSignal;
 
   // The wheel event signal
   Integration::Scene::WheelEventSignalType mWheelEventSignal;
index 106c58f..f05b3f5 100644 (file)
@@ -40,6 +40,7 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/rendering/frame-buffer.h>
+#include <dali/public-api/common/constants.h>
 
 using Dali::Internal::SceneGraph::Node;
 
@@ -64,7 +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_TOUCH =                     "touch";
+const char* const SIGNAL_TOUCHED =                   "touched";
 const char* const SIGNAL_WHEEL_EVENT =               "wheelEvent";
 const char* const SIGNAL_CONTEXT_LOST =              "contextLost";
 const char* const SIGNAL_CONTEXT_REGAINED =          "contextRegained";
@@ -79,7 +80,7 @@ SignalConnectorType signalConnector5( mType, SIGNAL_CONTEXT_LOST,              &
 SignalConnectorType signalConnector6( mType, SIGNAL_CONTEXT_REGAINED,          &Stage::DoConnectSignal );
 SignalConnectorType signalConnector7( mType, SIGNAL_SCENE_CREATED,             &Stage::DoConnectSignal );
 SignalConnectorType signalConnector8( mType, SIGNAL_KEY_EVENT_GENERATED,       &Stage::DoConnectSignal );
-SignalConnectorType signalConnector9( mType, SIGNAL_TOUCH,                     &Stage::DoConnectSignal );
+SignalConnectorType signalConnector9( mType, SIGNAL_TOUCHED,                   &Stage::DoConnectSignal );
 
 } // unnamed namespace
 
@@ -91,10 +92,10 @@ StagePtr Stage::New( SceneGraph::UpdateManager& updateManager )
 void Stage::Initialize( Scene& scene )
 {
   mScene = &scene;
-  mScene->SetBackgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR );
+  mScene->SetBackgroundColor( Dali::DEFAULT_BACKGROUND_COLOR );
   mScene->EventProcessingFinishedSignal().Connect( this, &Stage::OnEventProcessingFinished );
   mScene->KeyEventSignal().Connect( this, &Stage::OnKeyEvent );
-  mScene->TouchSignal().Connect( this, &Stage::OnTouchEvent );
+  mScene->TouchedSignal().Connect( this, &Stage::OnTouchEvent );
   mScene->WheelEventSignal().Connect( this, &Stage::OnWheelEvent );
 }
 
@@ -230,9 +231,9 @@ bool Stage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   {
     stage->EventProcessingFinishedSignal().Connect( tracker, functor );
   }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_TOUCH ) )
+  else if( 0 == strcmp( signalName.c_str(), SIGNAL_TOUCHED ) )
   {
-    stage->TouchSignal().Connect( tracker, functor );
+    stage->TouchedSignal().Connect( tracker, functor );
   }
   else if( 0 == strcmp( signalName.c_str(), SIGNAL_WHEEL_EVENT ) )
   {
@@ -275,7 +276,7 @@ void Stage::OnKeyEvent( const Dali::KeyEvent& event )
 
 void Stage::OnTouchEvent( const Dali::TouchEvent& touch )
 {
-  mTouchSignal.Emit( touch );
+  EmitTouchedSignal( touch );
 }
 
 void Stage::OnWheelEvent( const Dali::WheelEvent& event )
@@ -299,12 +300,12 @@ bool Stage::EmitKeyEventGeneratedSignal(const KeyEvent& event)
 
 void Stage::EmitEventProcessingFinishedSignal()
 {
-   mEventProcessingFinishedSignal.Emit();
+  mEventProcessingFinishedSignal.Emit();
 }
 
 void Stage::EmitTouchedSignal( const Dali::TouchEvent& touch )
 {
-  mTouchSignal.Emit( touch );
+  mTouchedSignal.Emit( touch );
 }
 
 void Stage::EmitWheelEventSignal( const WheelEvent& event )
@@ -350,9 +351,9 @@ Dali::Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSi
   return mEventProcessingFinishedSignal;
 }
 
-Dali::Stage::TouchSignalType& Stage::TouchSignal()
+Dali::Stage::TouchEventSignalType& Stage::TouchedSignal()
 {
-  return mTouchSignal;
+  return mTouchedSignal;
 }
 
 Dali::Stage::WheelEventSignalType& Stage::WheelEventSignal()
@@ -390,7 +391,7 @@ Stage::Stage( SceneGraph::UpdateManager& updateManager )
   mKeyEventSignal(),
   mKeyEventGeneratedSignal(),
   mEventProcessingFinishedSignal(),
-  mTouchSignal(),
+  mTouchedSignal(),
   mWheelEventSignal(),
   mContextLostSignal(),
   mContextRegainedSignal(),
index 4ce80b0..734a2d6 100644 (file)
@@ -206,7 +206,7 @@ public:
   void OnKeyEvent( const Dali::KeyEvent& event );
 
   /**
-   * Callback for Internal::Scene TouchSignal signal
+   * Callback for Internal::Scene TouchedSignal signal
    */
   void OnTouchEvent( const Dali::TouchEvent& touch );
 
@@ -263,9 +263,9 @@ public:
   Dali::Stage::EventProcessingFinishedSignalType& EventProcessingFinishedSignal();
 
   /**
-    * @copydoc Dali::Stage::TouchSignal()
+    * @copydoc Dali::Stage::TouchedSignal()
     */
-  Dali::Stage::TouchSignalType& TouchSignal();
+  Dali::Stage::TouchEventSignalType& TouchedSignal();
 
   /**
    * @copydoc Dali::Stage::WheelEventSignal()
@@ -351,7 +351,7 @@ private:
   Dali::Stage::EventProcessingFinishedSignalType  mEventProcessingFinishedSignal;
 
   // The touched signal
-  Dali::Stage::TouchSignalType                    mTouchSignal;
+  Dali::Stage::TouchEventSignalType               mTouchedSignal;
 
   // The wheel event signal
   Dali::Stage::WheelEventSignalType               mWheelEventSignal;
index 1967bac..24cc051 100644 (file)
@@ -25,7 +25,7 @@ namespace Internal
 {
 
 ActorGestureData::ActorGestureData()
-: gesturesRequired( Gesture::Type( 0 ) ),
+: gesturesRequired( GestureType::Value( 0 ) ),
   panDetectors( nullptr ),
   pinchDetectors( nullptr ),
   longPressDetectors( nullptr ),
@@ -45,7 +45,7 @@ ActorGestureData::~ActorGestureData()
 
 void ActorGestureData::AddGestureDetector( GestureDetector& detector )
 {
-  const Gesture::Type type( detector.GetType() );
+  const GestureType::Value type( detector.GetType() );
 
   GestureDetectorContainer*& containerPtr( GetContainerPtr( type ) );
   if ( NULL == containerPtr )
@@ -54,12 +54,12 @@ void ActorGestureData::AddGestureDetector( GestureDetector& detector )
   }
   containerPtr->push_back( &detector );
 
-  gesturesRequired = Gesture::Type( gesturesRequired | type );
+  gesturesRequired = GestureType::Value( gesturesRequired | type );
 }
 
 void ActorGestureData::RemoveGestureDetector( GestureDetector& detector )
 {
-  const Gesture::Type type( detector.GetType() );
+  const GestureType::Value type( detector.GetType() );
 
   GestureDetectorContainer*& containerPtr( GetContainerPtr( type ) );
   DALI_ASSERT_DEBUG( containerPtr && "Container had not been created" );
@@ -71,42 +71,42 @@ void ActorGestureData::RemoveGestureDetector( GestureDetector& detector )
 
   if ( container.empty() )
   {
-    gesturesRequired = Gesture::Type( gesturesRequired & ~type );
+    gesturesRequired = GestureType::Value( gesturesRequired & ~type );
     delete containerPtr;
     containerPtr = NULL;
   }
 }
 
-GestureDetectorContainer& ActorGestureData::GetGestureDetectorContainer( Gesture::Type type )
+GestureDetectorContainer& ActorGestureData::GetGestureDetectorContainer( GestureType::Value type )
 {
   return *GetContainerPtr( type );
 }
 
-GestureDetectorContainer*& ActorGestureData::GetContainerPtr( Gesture::Type type )
+GestureDetectorContainer*& ActorGestureData::GetContainerPtr( GestureType::Value type )
 {
   switch ( type )
   {
-    case Gesture::Pan:
+    case GestureType::PAN:
     {
       return panDetectors;
     }
 
-    case Gesture::Pinch:
+    case GestureType::PINCH:
     {
       return pinchDetectors;
     }
 
-    case Gesture::LongPress:
+    case GestureType::LONG_PRESS:
     {
       return longPressDetectors;
     }
 
-    case Gesture::Tap:
+    case GestureType::TAP:
     {
       return tapDetectors;
     }
 
-    case Gesture::Rotation:
+    case GestureType::ROTATION:
     {
       return rotationDetectors;
     }
index 55cfb99..b7e2eea 100644 (file)
@@ -66,7 +66,7 @@ public:
    * @param[in] type The gesture type.
    * @return true if the gesture is required, false otherwise.
    */
-  inline bool IsGestureRequred( Gesture::Type type ) const
+  inline bool IsGestureRequired( GestureType::Value type ) const
   {
     return type & gesturesRequired;
   }
@@ -76,7 +76,7 @@ public:
    * @param[in] type The container type required
    * @pre Ensure IsGestureRequired() is used to check if the container is actually available.
    */
-  GestureDetectorContainer& GetGestureDetectorContainer( Gesture::Type type );
+  GestureDetectorContainer& GetGestureDetectorContainer( GestureType::Value type );
 
 private:
 
@@ -84,11 +84,11 @@ private:
    * Helper to retrieve the appropriate container type.
    * @param[in] type The container type required.
    */
-  inline GestureDetectorContainer*& GetContainerPtr( Gesture::Type type );
+  inline GestureDetectorContainer*& GetContainerPtr( GestureType::Value type );
 
 private:
 
-  Gesture::Type gesturesRequired; ///< Stores which gestures are required
+  GestureType::Value gesturesRequired; ///< Stores which gestures are required
 
   GestureDetectorContainer* panDetectors;       ///< Pointer to a container of pan-detectors
   GestureDetectorContainer* pinchDetectors;     ///< Pointer to a container of pinch-detectors
index 8d84221..8f2b0d0 100644 (file)
@@ -34,7 +34,7 @@ namespace Dali
 namespace Internal
 {
 
-GestureDetector::GestureDetector( Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject )
+GestureDetector::GestureDetector( GestureType::Value type, const SceneGraph::PropertyOwner* sceneObject )
 : Object( sceneObject ),
   mType( type ),
   mGestureEventProcessor( ThreadLocalStorage::Get().GetGestureEventProcessor() )
index ba8e71f..66c9a53 100644 (file)
@@ -98,7 +98,7 @@ public:
    * Retrieves the type of GestureDetector
    * @return The GestureDetector Type
    */
-  Gesture::Type GetType() const
+  GestureType::Value GetType() const
   {
     return mType;
   }
@@ -118,7 +118,7 @@ protected: // Creation & Destruction
    * @param pointer to the scene object, nullptr if none
    * by default GestureDetectors don't have our own scene object
    */
-  GestureDetector( Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject  = nullptr );
+  GestureDetector( GestureType::Value type, const SceneGraph::PropertyOwner* sceneObject = nullptr );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -169,7 +169,7 @@ private:
 
 protected:
 
-  Gesture::Type                 mType;                  ///< The gesture detector will detect this type of gesture.
+  GestureType::Value            mType;                  ///< The gesture detector will detect this type of gesture.
   GestureDetectorActorContainer mAttachedActors;        ///< Object::Observer is used to provide weak-pointer behaviour
   GestureDetectorActorContainer mPendingAttachActors;   ///< Object::Observer is used to provide weak-pointer behaviour
   GestureEventProcessor&        mGestureEventProcessor; ///< A reference to the gesture event processor.
index e6eb904..5c9be29 100644 (file)
@@ -27,7 +27,7 @@
 #include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/events/pinch-gesture/pinch-gesture-detector-impl.h>
 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
-#include <dali/public-api/events/pan-gesture.h>
+#include <dali/internal/event/events/pan-gesture/pan-gesture-impl.h>
 #include <dali/integration-api/debug.h>
 
 
@@ -65,35 +65,35 @@ void GestureEventProcessor::AddGestureDetector(GestureDetector* gestureDetector,
 {
   switch (gestureDetector->GetType())
   {
-    case Gesture::LongPress:
+    case GestureType::LONG_PRESS:
     {
       LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
       mLongPressGestureProcessor.AddGestureDetector(longPress, scene);
       break;
     }
 
-    case Gesture::Pan:
+    case GestureType::PAN:
     {
       PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
       mPanGestureProcessor.AddGestureDetector(pan, scene, envOptionMinimumPanDistance, envOptionMinimumPanEvents);
       break;
     }
 
-    case Gesture::Pinch:
+    case GestureType::PINCH:
     {
       PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
       mPinchGestureProcessor.AddGestureDetector(pinch, scene);
       break;
     }
 
-    case Gesture::Tap:
+    case GestureType::TAP:
     {
       TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
       mTapGestureProcessor.AddGestureDetector(tap, scene);
       break;
     }
 
-    case Gesture::Rotation:
+    case GestureType::ROTATION:
     {
       RotationGestureDetector* rotation = static_cast<RotationGestureDetector*>(gestureDetector);
       mRotationGestureProcessor.AddGestureDetector(rotation, scene);
@@ -106,35 +106,35 @@ void GestureEventProcessor::RemoveGestureDetector(GestureDetector* gestureDetect
 {
   switch (gestureDetector->GetType())
   {
-    case Gesture::LongPress:
+    case GestureType::LONG_PRESS:
     {
       LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
       mLongPressGestureProcessor.RemoveGestureDetector(longPress);
       break;
     }
 
-    case Gesture::Pan:
+    case GestureType::PAN:
     {
       PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
       mPanGestureProcessor.RemoveGestureDetector(pan);
       break;
     }
 
-    case Gesture::Pinch:
+    case GestureType::PINCH:
     {
       PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
       mPinchGestureProcessor.RemoveGestureDetector(pinch);
       break;
     }
 
-    case Gesture::Tap:
+    case GestureType::TAP:
     {
       TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
       mTapGestureProcessor.RemoveGestureDetector(tap);
       break;
     }
 
-    case Gesture::Rotation:
+    case GestureType::ROTATION:
     {
       RotationGestureDetector* rotation = static_cast<RotationGestureDetector*>(gestureDetector);
       mRotationGestureProcessor.RemoveGestureDetector(rotation);
@@ -147,35 +147,35 @@ void GestureEventProcessor::GestureDetectorUpdated(GestureDetector* gestureDetec
 {
   switch (gestureDetector->GetType())
   {
-    case Gesture::LongPress:
+    case GestureType::LONG_PRESS:
     {
       LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
       mLongPressGestureProcessor.GestureDetectorUpdated(longPress);
       break;
     }
 
-    case Gesture::Pan:
+    case GestureType::PAN:
     {
       PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
       mPanGestureProcessor.GestureDetectorUpdated(pan);
       break;
     }
 
-    case Gesture::Pinch:
+    case GestureType::PINCH:
     {
       PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
       mPinchGestureProcessor.GestureDetectorUpdated(pinch);
       break;
     }
 
-    case Gesture::Tap:
+    case GestureType::TAP:
     {
       TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
       mTapGestureProcessor.GestureDetectorUpdated(tap);
       break;
     }
 
-    case Gesture::Rotation:
+    case GestureType::ROTATION:
     {
       // Nothing to do
       break;
@@ -183,11 +183,11 @@ void GestureEventProcessor::GestureDetectorUpdated(GestureDetector* gestureDetec
   }
 }
 
-void GestureEventProcessor::SetGestureProperties( const Gesture& gesture )
+void GestureEventProcessor::SetGestureProperties( const Dali::Gesture& gesture )
 {
-  DALI_ASSERT_DEBUG( gesture.type == Gesture::Pan && "Only PanGesture has a scene object\n" );
+  DALI_ASSERT_DEBUG( gesture.GetType() == GestureType::PAN && "Only PanGesture has a scene object\n" );
 
-  const PanGesture& pan = static_cast< const PanGesture& >( gesture );
+  const Dali::PanGesture& pan = static_cast< const Dali::PanGesture& >( gesture );
   if( mPanGestureProcessor.SetPanGestureProperties( pan ) )
   {
     // We may not be updating so we need to ask the render controller for an update.
index 58083f3..d1d6355 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/actors/actor.h>
+#include <dali/public-api/events/gesture.h>
 #include <dali/internal/event/events/gesture-detector-impl.h>
 #include <dali/internal/event/events/long-press-gesture/long-press-gesture-processor.h>
 #include <dali/internal/event/events/pan-gesture/pan-gesture-processor.h>
@@ -30,8 +31,6 @@
 namespace Dali
 {
 
-struct Gesture;
-
 namespace Integration
 {
 
@@ -105,7 +104,7 @@ public: // To be called by gesture detectors
    * @param[in]  gesture  The gesture whose values will be used in the Update object.
    * @note If we are in the middle of processing the gesture being set, then this call is ignored.
    */
-  void SetGestureProperties( const Gesture& gesture );
+  void SetGestureProperties( const Dali::Gesture& gesture );
 
 public: // Called by Core
 
index 571c28d..9591ac3 100644 (file)
@@ -28,7 +28,7 @@ GestureEvent::~GestureEvent()
 {
 }
 
-GestureEvent::GestureEvent( Gesture::Type gesture, Gesture::State gestureState )
+GestureEvent::GestureEvent( GestureType::Value gesture, GestureState gestureState )
 : gestureType( gesture ),
   state( gestureState ),
   time( 0 )
index 952fbad..ef7982f 100644 (file)
@@ -19,8 +19,8 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/events/gesture.h>
 #include <dali/integration-api/events/event.h>
+#include <dali/internal/event/events/gesture-impl.h>
 
 namespace Dali
 {
@@ -46,12 +46,12 @@ struct GestureEvent
   /**
    * Gesture Type.
    */
-  Gesture::Type gestureType;
+  GestureType::Value gestureType;
 
   /**
    * The state of the gesture.
    */
-  Gesture::State state;
+  GestureState state;
 
   /**
    * The time the gesture took place.
@@ -65,7 +65,7 @@ protected:  // Constructors only to be used by derived structures.
    * @param[in] gesture       The type of gesture event.
    * @param[in] gestureState  The state of the gesture event.
    */
-  GestureEvent( Gesture::Type gesture, Gesture::State gestureState);
+  GestureEvent( GestureType::Value gesture, GestureState gestureState);
 };
 
 } // namespace Internal
diff --git a/dali/internal/event/events/gesture-impl.h b/dali/internal/event/events/gesture-impl.h
new file mode 100644 (file)
index 0000000..8e521db
--- /dev/null
@@ -0,0 +1,147 @@
+#ifndef DALI_INTERNAL_GESTURE_H
+#define DALI_INTERNAL_GESTURE_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/events/gesture.h>
+#include <dali/integration-api/events/event.h>
+#include <dali/public-api/object/base-object.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+class Gesture;
+typedef IntrusivePtr<Gesture> GesturePtr;
+
+/**
+ * This is the abstract base structure for any gestures that the adaptor detects and wishes to send
+ * to the Core.
+ */
+class Gesture : public BaseObject
+{
+public:
+
+  /**
+   * @brief Get the gesture type.
+   *
+   * @return The gesture type.
+   */
+  inline GestureType::Value GetType() const
+  {
+    return mGestureType;
+  }
+
+  /**
+   * @brief Set the state of the gesture.
+   * @param[in] state The state of the gesture to set
+   */
+  inline void SetState( GestureState state )
+  {
+    mState = state;
+  }
+
+   /**
+   * @brief Get the state of the gesture.
+   *
+   * @return The state of the gesture.
+   */
+  inline GestureState GetState() const
+  {
+    return mState;
+  }
+
+  /**
+   * @brief Set The time the gesture took place.
+   * @param[in] time The time the gesture took place. to set
+   */
+  inline void SetTime( uint32_t time )
+  {
+    mTime = time;
+  }
+
+  /**
+   * @brief Get the time the gesture took place.
+   *
+   * @return The time the gesture took place.
+   */
+  inline uint32_t GetTime() const
+  {
+    return mTime;
+  }
+
+  Gesture(const Gesture&) = delete; ///< Deleted copy constructor
+  Gesture(Gesture&&) = delete; ///< Deleted move constructor
+  Gesture& operator=(const Gesture&) = delete; ///< Deleted copy assignment operator
+  Gesture& operator=(Gesture&&) = delete; ///< Deleted move assignment operator
+
+protected:
+
+  /**
+   * This constructor is only used by derived classes.
+   * @param[in] gestureType   The type of gesture event.
+   * @param[in] gestureState  The state of the gesture event.
+   */
+  Gesture(GestureType::Value gestureType, GestureState gestureState)
+  : mGestureType( gestureType ),
+    mState( gestureState )
+  {
+  }
+
+  /**
+   * @brief Virtual destructor.
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~Gesture() = default;
+
+private:
+  GestureType::Value mGestureType;
+  GestureState mState;
+  uint32_t mTime{0u};
+};
+
+} // namespace Internal
+
+/**
+ * Helper methods for public API.
+ */
+inline Internal::Gesture& GetImplementation(Dali::Gesture& gesture)
+{
+  DALI_ASSERT_ALWAYS( gesture && "gesture handle is empty" );
+
+  BaseObject& handle = gesture.GetBaseObject();
+
+  return static_cast<Internal::Gesture&>(handle);
+}
+
+inline const Internal::Gesture& GetImplementation(const Dali::Gesture& gesture)
+{
+  DALI_ASSERT_ALWAYS( gesture && "gesture handle is empty" );
+
+  const BaseObject& handle = gesture.GetBaseObject();
+
+  return static_cast<const Internal::Gesture&>(handle);
+}
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_GESTURE_H
index f18671b..dab221d 100644 (file)
@@ -41,15 +41,15 @@ namespace
  */
 struct GestureHitTestCheck : public HitTestAlgorithm::HitTestInterface
 {
-  GestureHitTestCheck( Gesture::Type type )
+  GestureHitTestCheck( GestureType::Value type )
   : mType( type )
   {
   }
 
   virtual bool IsActorHittable( Actor* actor )
   {
-    return actor->IsGestureRequred( mType ) && // Does the Application or derived actor type require the gesture?
-           actor->IsHittable();                // Is actor sensitive, visible and on the scene?
+    return actor->IsGestureRequired( mType ) && // Does the Application or derived actor type require the gesture?
+           actor->IsHittable();                 // Is actor sensitive, visible and on the scene?
   }
 
   virtual bool DescendActorHierarchy( Actor* actor )
@@ -63,13 +63,13 @@ struct GestureHitTestCheck : public HitTestAlgorithm::HitTestInterface
     return layer->IsTouchConsumed();
   }
 
-  Gesture::Type mType;
+  GestureType::Value mType;
 };
 
 } // unnamed namespace
 
 
-GestureProcessor::GestureProcessor( Gesture::Type type )
+GestureProcessor::GestureProcessor( GestureType::Value type )
 : mGestureRecognizer(),
   mNeedsUpdate( false ),
   mType( type ),
@@ -96,7 +96,7 @@ void GestureProcessor::GetGesturedActor( Actor*& actor, GestureDetectorContainer
   while ( actor )
   {
     // We may be checking a parent so ensure the parent requires this gesture (and do not unintentionally create the gesture data for the parent)
-    if ( actor->IsGestureRequred( mType ) )
+    if ( actor->IsGestureRequired( mType ) )
     {
       // Retrieve the actor's detectors and check if they satisfy current gesture
       const GestureDetectorContainer& connectedDetectors( actor->GetGestureData().GetGestureDetectorContainer( mType ) );
index 47e5dab..7131b2f 100644 (file)
@@ -64,7 +64,7 @@ protected:
   /**
    * Protected constructor.  Cannot create an instance of GestureProcessor
    */
-  GestureProcessor( Gesture::Type type );
+  GestureProcessor( GestureType::Value type );
 
   /**
    * Virtual protected destructor.
@@ -190,7 +190,7 @@ protected:  //Data
 
 private: // Data
 
-  Gesture::Type mType;                 ///< Type of GestureProcessor
+  GestureType::Value mType;            ///< Type of GestureProcessor
   Actor* mCurrentGesturedActor;        ///< The current actor that has been gestured.
   bool   mGesturedActorDisconnected:1; ///< Indicates whether the gestured actor has been disconnected from the scene
 };
index d616647..f76326d 100644 (file)
@@ -75,7 +75,7 @@ public:
    * Returns the type of gesture detector.
    * @return Type of gesture detector.
    */
-  Gesture::Type GetType() const { return mType; }
+  GestureType::Value GetType() const { return mType; }
 
   /**
    * Called when we get a touch event.
@@ -95,7 +95,7 @@ protected:
    * @param[in]  screenSize    The size of the screen.
    * @param[in]  detectorType  The type of gesture detector.
    */
-  GestureRecognizer( Vector2 screenSize, Gesture::Type detectorType )
+  GestureRecognizer( Vector2 screenSize, GestureType::Value detectorType )
   : mScreenSize( screenSize ),
     mType( detectorType ),
     mScene( nullptr )
@@ -108,7 +108,7 @@ protected:
    * Use this constructor with the screen size is not used in the dereived class.
    * @param[in]  detectorType  The type of gesture detector.
    */
-  GestureRecognizer( Gesture::Type detectorType )
+  GestureRecognizer( GestureType::Value detectorType )
   : GestureRecognizer( Vector2::ZERO, detectorType )
   {
   }
@@ -120,7 +120,7 @@ protected:
 
 protected:
   Vector2 mScreenSize;
-  Gesture::Type mType;
+  GestureType::Value mType;
   Scene* mScene;
 };
 
index 85fbf68..c01c3d5 100644 (file)
@@ -38,7 +38,7 @@ struct GestureRequest
    * Default Constructor
    * @param[in]  typeRequired  The gesture type required
    */
-  GestureRequest( Gesture::Type typeRequired )
+  GestureRequest( GestureType::Value typeRequired )
   : type( typeRequired )
   {
   }
@@ -50,7 +50,7 @@ struct GestureRequest
 
   // Data Members
 
-  Gesture::Type type; ///< The type of gesture required.
+  GestureType::Value type; ///< The type of gesture required.
 };
 
 /**
@@ -64,7 +64,7 @@ struct PanGestureRequest : public GestureRequest
    * Default Constructor
    */
   PanGestureRequest()
-  : GestureRequest(Gesture::Pan),
+  : GestureRequest(GestureType::PAN),
     minTouches(1),
     maxTouches(1)
   {
@@ -94,7 +94,7 @@ struct TapGestureRequest : public GestureRequest
    * Default Constructor
    */
   TapGestureRequest()
-  : GestureRequest(Gesture::Tap),
+  : GestureRequest(GestureType::TAP),
     minTaps(1),
     maxTaps(1),
     minTouches(1),
@@ -128,7 +128,7 @@ struct LongPressGestureRequest : public GestureRequest
    * Default Constructor
    */
   LongPressGestureRequest()
-  : GestureRequest(Gesture::LongPress),
+  : GestureRequest(GestureType::LONG_PRESS),
     minTouches(1),
     maxTouches(1)
   {
index 5f6f191..3c200c7 100755 (executable)
@@ -44,10 +44,6 @@ HoverEventPtr HoverEvent::Clone( const HoverEvent& rhs )
   return hoverEvent;
 }
 
-HoverEvent::~HoverEvent()
-{
-}
-
 unsigned long HoverEvent::GetTime() const
 {
   return mTime;
index 36c9725..bf105b3 100755 (executable)
@@ -21,7 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/events/hover-event.h>
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/integration-api/events/point.h>
 
@@ -63,11 +63,6 @@ public:
    */
   static HoverEventPtr Clone( const HoverEvent& rhs );
 
-  /**
-   * @brief Destructor
-   */
-  ~HoverEvent();
-
   // Getters
 
   /**
@@ -137,6 +132,13 @@ public:
 
 private:
 
+  /**
+   * @brief Destructor
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~HoverEvent() = default;
+
   // Not copyable or movable
 
   HoverEvent( const HoverEvent& rhs ) = delete;             ///< Deleted copy constructor
index 84b6ffb..64e969f 100644 (file)
@@ -46,14 +46,14 @@ namespace
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_HOVER_PROCESSOR" );
 
-const char * TOUCH_POINT_STATE[TouchPoint::Last] =
+const char * TOUCH_POINT_STATE[PointState::INTERRUPTED + 1] =
 {
-  "Started",
-  "Finished",
-  "Motion",
-  "Leave",
-  "Stationary",
-  "Interrupted",
+  "STARTED",
+  "FINISHED",
+  "MOTION",
+  "LEAVE",
+  "STATIONARY",
+  "INTERRUPTED",
 };
 
 #endif // defined(DEBUG_ENABLED)
@@ -176,7 +176,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
   DALI_LOG_TRACE_METHOD( gLogFilter );
   DALI_ASSERT_ALWAYS( !event.points.empty() && "Empty HoverEvent sent from Integration\n" );
 
-  TouchPoint::State state = static_cast< TouchPoint::State >( event.points[0].GetState() );
+  PointState::Type state = static_cast< PointState::Type >( event.points[0].GetState() );
 
   PRINT_HIERARCHY(gLogFilter);
 
@@ -186,7 +186,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
   // 1) Check if it is an interrupted event - we should inform our last primary hit actor about this
   //    and emit the stage signal as well.
 
-  if ( state == TouchPoint::Interrupted )
+  if ( state == PointState::INTERRUPTED )
   {
     Dali::Actor consumingActor;
     Integration::Point currentPoint( event.points[0] );
@@ -350,7 +350,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
     }
   }
 
-  // 5) If our primary point is an Finished event, then the primary point (in multi-touch) will change next
+  // 5) If our primary point is a FINISHED event, then the primary point (in multi-touch) will change next
   //    time so set our last primary actor to NULL.  Do the same to the last consumed actor as well.
 
   if ( primaryPointState == PointState::FINISHED )
@@ -386,7 +386,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
     }
   }
 
-  // 6) Emit an interrupted event to the hover-started actor if it hasn't consumed the Finished.
+  // 6) Emit an interrupted event to the hover-started actor if it hasn't consumed the FINISHED.
 
   if ( hoverEvent->GetPointCount() == 1 ) // Only want the first hover started
   {
index f8c1fa8..452379b 100755 (executable)
@@ -75,10 +75,6 @@ KeyEvent::KeyEvent( const std::string& keyName,
 {
 }
 
-KeyEvent::~KeyEvent()
-{
-}
-
 KeyEventPtr KeyEvent::New( const std::string& keyName,
                            const std::string& logicalKey,
                            const std::string& keyString,
index 8b8f7d4..863e244 100755 (executable)
@@ -71,11 +71,6 @@ public:
             const Device::Subclass::Type deviceSubclass );
 
   /**
-   * @brief Destructor.
-   */
-  ~KeyEvent();
-
-  /**
    * Create a new KeyEvent.
    *
    * @param[in]  keyName         The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
@@ -217,6 +212,13 @@ public:
 
 private:
 
+  /**
+   * @brief Destructor.
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~KeyEvent() = default;
+
   // Not copyable or movable
 
   KeyEvent( const KeyEvent& rhs ) = delete;             ///< Deleted copy constructor
index 21adbe5..3c832a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -22,7 +22,7 @@
 #include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
-#include <dali/public-api/events/long-press-gesture.h>
+
 #include <dali/public-api/object/type-registry.h>
 #include <dali/internal/event/events/gesture-event-processor.h>
 
@@ -72,14 +72,14 @@ LongPressGestureDetectorPtr LongPressGestureDetector::New(unsigned int minTouche
 }
 
 LongPressGestureDetector::LongPressGestureDetector()
-: GestureDetector(Gesture::LongPress),
+: GestureDetector(GestureType::LONG_PRESS),
   mMinimumTouchesRequired(DEFAULT_TOUCHES_REQUIRED),
   mMaximumTouchesRequired(DEFAULT_TOUCHES_REQUIRED)
 {
 }
 
 LongPressGestureDetector::LongPressGestureDetector(unsigned int minTouches, unsigned int maxTouches)
-: GestureDetector(Gesture::LongPress),
+: GestureDetector(GestureType::LONG_PRESS),
   mMinimumTouchesRequired(minTouches),
   mMaximumTouchesRequired(maxTouches)
 {
@@ -132,7 +132,7 @@ unsigned int LongPressGestureDetector::GetMaximumTouchesRequired() const
   return mMaximumTouchesRequired;
 }
 
-void LongPressGestureDetector::EmitLongPressGestureSignal(Dali::Actor pressedActor, const LongPressGesture& longPress)
+void LongPressGestureDetector::EmitLongPressGestureSignal(Dali::Actor pressedActor, const Dali::LongPressGesture& longPress)
 {
   // Guard against destruction during signal emission
   Dali::LongPressGestureDetector handle( this );
index 561012b..3a57574 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_IMPL_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -25,8 +25,6 @@
 namespace Dali
 {
 
-struct LongPressGesture;
-
 namespace Internal
 {
 
@@ -110,7 +108,7 @@ public:
    * @param[in]  pressedActor  The pressed actor.
    * @param[in]  longPress     The long press
    */
-  void EmitLongPressGestureSignal(Dali::Actor pressedActor, const LongPressGesture& longPress);
+  void EmitLongPressGestureSignal(Dali::Actor pressedActor, const Dali::LongPressGesture& longPress);
 
 public: // Signals
 
index c707f05..1dae742 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -24,8 +24,8 @@ namespace Dali
 namespace Internal
 {
 
-LongPressGestureEvent::LongPressGestureEvent( Gesture::State state )
-: GestureEvent( Gesture::LongPress, state ),
+LongPressGestureEvent::LongPressGestureEvent( GestureState state )
+: GestureEvent( GestureType::LONG_PRESS, state ),
   numberOfTouches(1)
 {
 }
index 4dc0539..2c4e7a3 100644 (file)
@@ -33,10 +33,10 @@ namespace Internal
  * send it to the Core.
  *
  * This gesture can be in four states:
- * - Possible:  When the user first puts their finger down - Core needs to hit test the down point.
- * - Started:   When the long-press gesture is actually detected.
- * - Finished:  When the user finally lifts all touches.
- * - Cancelled: If, after a down event, no long press is detected, or a system interruption.
+ * - POSSIBLE:  When the user first puts their finger down - Core needs to hit test the down point.
+ * - STARTED:   When the long-press gesture is actually detected.
+ * - FINISHED:  When the user finally lifts all touches.
+ * - CANCELLED: If, after a down event, no long press is detected, or a system interruption.
  */
 struct LongPressGestureEvent : public GestureEvent
 {
@@ -44,10 +44,10 @@ struct LongPressGestureEvent : public GestureEvent
 
   /**
    * Default Constructor
-   * @param[in]  state  Started, when we detect a long press.
-   *                    Finished, when all touches are finished.
+   * @param[in]  state  STARTED, when we detect a long press.
+   *                    FINISHED, when all touches are finished.
    */
-  LongPressGestureEvent( Gesture::State state );
+  LongPressGestureEvent( GestureState state );
 
   /**
    * Virtual destructor
diff --git a/dali/internal/event/events/long-press-gesture/long-press-gesture-impl.h b/dali/internal/event/events/long-press-gesture/long-press-gesture-impl.h
new file mode 100644 (file)
index 0000000..651aad2
--- /dev/null
@@ -0,0 +1,147 @@
+#ifndef DALI_INTERNAL_LONG_PRESS_GESTURE_H
+#define DALI_INTERNAL_LONG_PRESS_GESTURE_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/event/events/gesture-impl.h>
+#include <dali/public-api/events/long-press-gesture.h>
+#include <dali/public-api/math/vector2.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+class LongPressGesture;
+typedef IntrusivePtr< LongPressGesture > LongPressGesturePtr;
+
+/**
+ * @copydoc Dali::LongPressGesture
+ */
+class LongPressGesture final : public Gesture
+{
+public:
+
+  /**
+   * Default Constructor
+   * @param[in]  state  STARTED, when we detect a long press.
+   *                    FINISHED, when all touches are finished.
+   */
+  LongPressGesture( GestureState state )
+  : Gesture( GestureType::LONG_PRESS, state )
+  {
+  }
+
+  LongPressGesture(const LongPressGesture&) = delete; ///< Deleted copy constructor
+  LongPressGesture(LongPressGesture&&) = delete; ///< Deleted move constructor
+  LongPressGesture& operator=(const LongPressGesture&) = delete; ///< Deleted copy assignment operator
+  LongPressGesture& operator=(LongPressGesture&&) = delete; ///< Deleted move assignment operator
+
+  /**
+   * @brief Set the number of touch points.
+   * @param[in] numberOfTouches The number of touch points to set.
+   */
+  inline void SetNumberOfTouches( uint32_t numberOfTouches )
+  {
+    mNumberOfTouches = numberOfTouches;
+  }
+
+  /**
+   * @copydoc Dali::LongPressGesture::GetNumberOfTouches()
+   */
+  inline uint32_t GetNumberOfTouches() const
+  {
+    return mNumberOfTouches;
+  }
+
+  /**
+   * @brief Set This is the point, in screen coordinates.
+   * @param[in] screenPoint The point in screen coordinates to set.
+   */
+  inline void SetScreenPoint( const Vector2& screenPoint )
+  {
+    mScreenPoint = screenPoint;
+  }
+
+  /**
+   * @copydoc Dali::LongPressGesture::GetScreenPoint()
+   */
+  inline const Vector2& GetScreenPoint() const
+  {
+    return mScreenPoint;
+  }
+
+  /**
+   * @brief Set This is the point, in local actor coordinates.
+   * @param[in] localPoint The point in local actor coordinates to set.
+   */
+  inline void SetLocalPoint( const Vector2& localPoint )
+  {
+    mLocalPoint = localPoint;
+  }
+
+  /**
+   * @copydoc Dali::LongPressGesture::GetLocalPoint()
+   */
+  inline const Vector2& GetLocalPoint() const
+  {
+    return mLocalPoint;
+  }
+
+private:
+
+  /**
+   * @brief Virtual destructor
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~LongPressGesture() = default;
+
+private:
+  Vector2 mScreenPoint;
+  Vector2 mLocalPoint;
+  uint32_t mNumberOfTouches{1u};
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::LongPressGesture& GetImplementation( Dali::LongPressGesture& longPressGesture )
+{
+  DALI_ASSERT_ALWAYS( longPressGesture && "longPressGesture handle is empty" );
+
+  BaseObject& object = longPressGesture.GetBaseObject();
+
+  return static_cast< Internal::LongPressGesture& >( object );
+}
+
+inline const Internal::LongPressGesture& GetImplementation( const Dali::LongPressGesture& longPressGesture )
+{
+  DALI_ASSERT_ALWAYS( longPressGesture && "longPressGesture handle is empty" );
+
+  const BaseObject& object = longPressGesture.GetBaseObject();
+
+  return static_cast< const Internal::LongPressGesture& >( object );
+}
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_LONG_PRESS_GESTURE_H
index b754301..e52e3ea 100644 (file)
@@ -24,7 +24,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/events/long-press-gesture.h>
+#include <dali/internal/event/events/long-press-gesture/long-press-gesture-impl.h>
 #include <dali/internal/event/events/long-press-gesture/long-press-gesture-event.h>
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/actors/actor-impl.h>
@@ -57,17 +57,17 @@ void EmitLongPressSignal(
     const LongPressGestureEvent& longPressEvent,
     Vector2 localPoint)
 {
-  LongPressGesture longPress(longPressEvent.state);
-  longPress.time = longPressEvent.time;
-  longPress.numberOfTouches = longPressEvent.numberOfTouches;
-  longPress.screenPoint = longPressEvent.point;
-  longPress.localPoint = localPoint;
+  Internal::LongPressGesturePtr longPress( new Internal::LongPressGesture(longPressEvent.state ) );
+  longPress->SetTime( longPressEvent.time );
+  longPress->SetNumberOfTouches( longPressEvent.numberOfTouches );
+  longPress->SetScreenPoint( longPressEvent.point );
+  longPress->SetLocalPoint( localPoint );
 
   Dali::Actor actorHandle( actor );
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
   for ( GestureDetectorContainer::const_iterator iter = gestureDetectors.begin(); iter != endIter; ++iter )
   {
-    static_cast< LongPressGestureDetector* >( *iter )->EmitLongPressGestureSignal( actorHandle, longPress );
+    static_cast< LongPressGestureDetector* >( *iter )->EmitLongPressGestureSignal( actorHandle, Dali::LongPressGesture( longPress.Get() ) );
   }
 }
 
@@ -102,7 +102,7 @@ struct IsNotAttachedFunctor
 } // unnamed namespace
 
 LongPressGestureProcessor::LongPressGestureProcessor()
-: GestureProcessor( Gesture::LongPress ),
+: GestureProcessor( GestureType::LONG_PRESS ),
   mLongPressGestureDetectors(),
   mCurrentEmitters(),
   mCurrentRenderTask(),
@@ -121,7 +121,7 @@ void LongPressGestureProcessor::Process( Scene& scene, const LongPressGestureEve
 {
   switch ( longPressEvent.state )
   {
-    case Gesture::Possible:
+    case GestureState::POSSIBLE:
     {
       mCurrentEmitters.clear();
       ResetActor();
@@ -134,7 +134,7 @@ void LongPressGestureProcessor::Process( Scene& scene, const LongPressGestureEve
       break;
     }
 
-    case Gesture::Started:
+    case GestureState::STARTED:
     {
       Actor* currentGesturedActor = GetCurrentGesturedActor();
       if ( currentGesturedActor )
@@ -161,7 +161,7 @@ void LongPressGestureProcessor::Process( Scene& scene, const LongPressGestureEve
       break;
     }
 
-    case Gesture::Finished:
+    case GestureState::FINISHED:
     {
       // The gesture should only be sent to the gesture detector which first received it so that it
       // can be told when the gesture ends as well.
@@ -195,22 +195,22 @@ void LongPressGestureProcessor::Process( Scene& scene, const LongPressGestureEve
       break;
     }
 
-    case Gesture::Cancelled:
+    case GestureState::CANCELLED:
     {
       mCurrentEmitters.clear();
       ResetActor();
       break;
     }
 
-    case Gesture::Continuing:
+    case GestureState::CONTINUING:
     {
-      DALI_ABORT( "Incorrect state received from Integration layer: Continuing\n" );
+      DALI_ABORT( "Incorrect state received from Integration layer: CONTINUING\n" );
       break;
     }
 
-    case Gesture::Clear:
+    case GestureState::CLEAR:
     {
-      DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
+      DALI_ABORT( "Incorrect state received from Integration layer: CLEAR\n" );
       break;
     }
   }
index 8713045..d547853 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/math/vector2.h>
 
 #include <dali/internal/event/common/thread-local-storage.h>
@@ -43,9 +43,9 @@ const float MAXIMUM_MOTION_ALLOWED = 60.0f;
 } // unnamed namespace
 
 LongPressGestureRecognizer::LongPressGestureRecognizer(Observer& observer, Vector2 screenSize, const LongPressGestureRequest& request, uint32_t minimumHoldingTime )
-: GestureRecognizer( screenSize, Gesture::LongPress ),
+: GestureRecognizer( screenSize, GestureType::LONG_PRESS ),
   mObserver( observer ),
-  mState( Clear ),
+  mState( CLEAR ),
   mMinimumTouchesRequired( request.minTouches ),
   mMaximumTouchesRequired( request.maxTouches ),
   mTouchTime( 0 ),
@@ -71,8 +71,8 @@ void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
 
   switch (mState)
   {
-    // Clear: Wait till one point touches the screen before starting timer.
-    case Clear:
+    // CLEAR: Wait till one point touches the screen before starting timer.
+    case CLEAR:
     {
       const Integration::Point& point = event.points[0];
 
@@ -89,25 +89,25 @@ void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
         }
         mTimerId = platformAbstraction.StartTimer( mMinimumHoldingTime, MakeCallback( this, &LongPressGestureRecognizer::TimerCallback ) );
 
-        // A long press gesture may be possible, tell Core about this and change state to Touched.
-        mState = Touched;
-        EmitGesture( Gesture::Possible );
+        // A long press gesture may be possible, tell Core about this and change state to TOUCHED.
+        mState = TOUCHED;
+        EmitGesture( GestureState::POSSIBLE );
       }
 
       break;
     }
 
-    // Touched: Monitor movement and addition/removal of points.
-    case Touched:
+    // TOUCHED: Monitor movement and addition/removal of points.
+    case TOUCHED:
     {
       if (pointCount > mMaximumTouchesRequired)
       {
-        // A long press did not occur, tell Core that it was cancelled and change state to Failed.
-        EmitGesture( Gesture::Cancelled );
+        // A long press did not occur, tell Core that it was cancelled and change state to FAILED.
+        EmitGesture( GestureState::CANCELLED );
         mTouchPositions.clear();
         platformAbstraction.CancelTimer(mTimerId);
         mTimerId = 0;
-        mState = Failed;
+        mState = FAILED;
         break;
       }
 
@@ -130,11 +130,11 @@ void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
           case PointState::INTERRUPTED:
           {
             // System has interrupted us, long press is not possible, inform Core
-            EmitGesture( Gesture::Cancelled );
+            EmitGesture( GestureState::CANCELLED );
             mTouchPositions.clear();
             platformAbstraction.CancelTimer(mTimerId);
             mTimerId = 0;
-            mState = ( pointCount == 1 ) ? Clear : Failed; // Change state to Clear if only one point, Failed otherwise.
+            mState = ( pointCount == 1 ) ? CLEAR : FAILED; // Change state to CLEAR if only one point, FAILED otherwise.
             endLoop = true;
             break;
           }
@@ -146,11 +146,11 @@ void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
 
             if (distanceSquared > ( MAXIMUM_MOTION_ALLOWED * MAXIMUM_MOTION_ALLOWED ) )
             {
-              // We have moved more than the allowable motion for a long press gesture. Inform Core and change state to Failed.
-              EmitGesture( Gesture::Cancelled );
+              // We have moved more than the allowable motion for a long press gesture. Inform Core and change state to FAILED.
+              EmitGesture( GestureState::CANCELLED );
               platformAbstraction.CancelTimer(mTimerId);
               mTimerId = 0;
-              mState = Failed;
+              mState = FAILED;
               endLoop = true;
             }
             break;
@@ -166,9 +166,9 @@ void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
       break;
     }
 
-    // Failed/Finished: Monitor the touches, waiting for all touches to be released.
-    case Failed:
-    case Finished:
+    // FAILED/FINISHED: Monitor the touches, waiting for all touches to be released.
+    case FAILED:
+    case FINISHED:
     {
       // eventually the final touch point will be removed, marking the end of this gesture.
       if ( pointCount == 1 )
@@ -177,13 +177,13 @@ void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
 
         if ( (primaryPointState == PointState::UP) || (primaryPointState == PointState::INTERRUPTED) )
         {
-          if(mState == Finished)
+          if(mState == FINISHED)
           {
             // When the last touch point is lifted, we should inform the Core that the Long press has finished.
-            EmitGesture(Gesture::Finished);
+            EmitGesture(GestureState::FINISHED);
           }
           mTouchPositions.clear();
-          mState = Clear; // Reset state to clear when last touch point is lifted.
+          mState = CLEAR; // Reset state to clear when last touch point is lifted.
         }
       }
       break;
@@ -207,22 +207,22 @@ void LongPressGestureRecognizer::SetMinimumHoldingTime( uint32_t time )
 
 bool LongPressGestureRecognizer::TimerCallback()
 {
-  EmitGesture(Gesture::Started);
+  EmitGesture(GestureState::STARTED);
 
-  mState = Finished;
+  mState = FINISHED;
 
   mTimerId = 0;
 
   return false;
 }
 
-void LongPressGestureRecognizer::EmitGesture(Gesture::State state)
+void LongPressGestureRecognizer::EmitGesture(GestureState state)
 {
   unsigned int touchPoints ( static_cast<unsigned int>( mTouchPositions.size() ) );
 
-  // We should tell Core about the Possible and Cancelled states regardless of whether we have satisfied long press requirements.
-  if ( (state == Gesture::Possible) ||
-       (state == Gesture::Cancelled) ||
+  // We should tell Core about the POSSIBLE and CANCELLED states regardless of whether we have satisfied long press requirements.
+  if ( (state == GestureState::POSSIBLE) ||
+       (state == GestureState::CANCELLED) ||
        (touchPoints >= mMinimumTouchesRequired) )
   {
     LongPressGestureEvent longPress( state );
@@ -236,7 +236,7 @@ void LongPressGestureRecognizer::EmitGesture(Gesture::State state)
     longPress.point /= static_cast<float>( touchPoints );
 
     longPress.time = mTouchTime;
-    if ( state != Gesture::Possible )
+    if ( state != GestureState::POSSIBLE )
     {
       longPress.time += mMinimumHoldingTime;
     }
index cb2cbfa..5480ca6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_LONG_PRESS_GESTURE_RECOGNIZER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -42,8 +42,8 @@ class CoreEventInterface;
 
 /**
  * When given a set of touch events, this detector attempts to determine if a long press gesture has taken place.
- * Emits a LongPressGestureEvent (state = Started) when a long press has been detected (Touch held down for more than duration).
- * Emits a further LongPressGestureEvent (state = Finished) when a long press has been completed (Touch Release).
+ * Emits a LongPressGestureEvent (state = GestureState::STARTED) when a long press has been detected (Touch held down for more than duration).
+ * Emits a further LongPressGestureEvent (state = GestureState::FINISHED) when a long press has been completed (Touch Release).
  */
 class LongPressGestureRecognizer : public GestureRecognizer
 {
@@ -96,7 +96,7 @@ private:
    * Emits the long press gesture if all conditions are applicable.
    * @param[in] state The state of this gesture event.
    */
-  void EmitGesture(Gesture::State state);
+  void EmitGesture( GestureState state );
 
 private:
 
@@ -108,10 +108,10 @@ private:
    */
   enum State
   {
-    Clear,      ///< No gesture detected.
-    Touched,    ///< User is touching the screen.
-    Failed,     ///< Gesture has failed.
-    Finished    ///< Gesture has been detected and sent.
+    CLEAR,      ///< No gesture detected.
+    TOUCHED,    ///< User is touching the screen.
+    FAILED,     ///< Gesture has failed.
+    FINISHED    ///< Gesture has been detected and sent.
   };
 
   State mState; ///< The current state of the detector.
index d29befc..bc1e201 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -259,7 +259,7 @@ bool PanGestureDetector::CheckAngleAllowed( Radian angle ) const
   return allowed;
 }
 
-void PanGestureDetector::EmitPanGestureSignal(Dali::Actor actor, const PanGesture& pan)
+void PanGestureDetector::EmitPanGestureSignal(Dali::Actor actor, const Dali::PanGesture& pan)
 {
   if ( !mDetectedSignal.Empty() )
   {
@@ -290,13 +290,13 @@ bool PanGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerI
   return connected;
 }
 
-void PanGestureDetector::SetPanGestureProperties( const PanGesture& pan )
+void PanGestureDetector::SetPanGestureProperties( const Dali::PanGesture& pan )
 {
   ThreadLocalStorage::Get().GetGestureEventProcessor().SetGestureProperties( pan );
 }
 
 PanGestureDetector::PanGestureDetector( const SceneGraph::PanGesture& sceneObject )
-: GestureDetector(Gesture::Pan, &sceneObject ),
+: GestureDetector( GestureType::PAN, &sceneObject ),
   mMinimumTouches(1),
   mMaximumTouches(1)
 {
index 03aa7e2..39d5d9d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_PAN_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,6 +23,7 @@
 #include <dali/public-api/events/pan-gesture-detector.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/internal/event/events/gesture-detector-impl.h>
+#include <dali/public-api/events/pan-gesture.h>
 
 namespace Dali
 {
@@ -137,7 +138,7 @@ public:
    * @param[in]  actor  The panned actor.
    * @param[in]  pan    The pan gesture.
    */
-  void EmitPanGestureSignal(Dali::Actor actor, const PanGesture& pan);
+  void EmitPanGestureSignal(Dali::Actor actor, const Dali::PanGesture& pan);
 
 public: // Signals
 
@@ -165,7 +166,7 @@ public: // Override Pan Gesture
   /**
    * @copydoc Dali::PanGestureDetector::SetPanGestureProperties()
    */
-  static void SetPanGestureProperties( const PanGesture& pan );
+  static void SetPanGestureProperties( const Dali::PanGesture& pan );
 
 protected:
 
index cc1bd1c..fa17b11 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -25,8 +25,8 @@ namespace Internal
 {
 
 
-PanGestureEvent::PanGestureEvent(Gesture::State state)
-: GestureEvent(Gesture::Pan, state),
+PanGestureEvent::PanGestureEvent(GestureState state)
+: GestureEvent(GestureType::PAN, state),
   timeDelta(0),
   numberOfTouches(1)
 {
index 9baca2d..6f7695c 100644 (file)
@@ -33,14 +33,14 @@ namespace Internal
  * send it to the Core.
  *
  * A Pan Gesture event should be in one of five states:
- * - Possible:   When the user first puts their finger down - Core needs to hit test the down point.
- * - Started:    If a pan is detected.
- * - Continuing: If after a pan is detected, it continues.
- * - Finished:   If after a pan, the user lifts their finger(s).
- * - Cancelled:  If, after a down event, no pan is detected or a system interruption.
+ * - POSSIBLE:   When the user first puts their finger down - Core needs to hit test the down point.
+ * - STARTED:    If a pan is detected.
+ * - CONTINUING: If after a pan is detected, it continues.
+ * - FINISHED:   If after a pan, the user lifts their finger(s).
+ * - CANCELLED:  If, after a down event, no pan is detected or a system interruption.
  *
- * A Started state will be ignored if a Possible state does not precede it.
- * Likewise, a Continuing or Finished state will be ignored if a Started state does not precede it.
+ * A STARTED state will be ignored if a POSSIBLE state does not precede it.
+ * Likewise, a CONTINUING or FINISHED state will be ignored if a STARTED state does not precede it.
  */
 struct PanGestureEvent: public GestureEvent
 {
@@ -50,7 +50,7 @@ struct PanGestureEvent: public GestureEvent
    * Default Constructor
    * @param[in]  state  The state of the gesture
    */
-  PanGestureEvent(Gesture::State state);
+  PanGestureEvent(GestureState state);
 
   /**
    * Virtual destructor
diff --git a/dali/internal/event/events/pan-gesture/pan-gesture-impl.h b/dali/internal/event/events/pan-gesture/pan-gesture-impl.h
new file mode 100644 (file)
index 0000000..2f77ecc
--- /dev/null
@@ -0,0 +1,252 @@
+#ifndef DALI_INTERNAL_PAN_GESTURE_H
+#define DALI_INTERNAL_PAN_GESTURE_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/events/pan-gesture.h>
+#include <dali/internal/event/events/gesture-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+class PanGesture;
+typedef IntrusivePtr< PanGesture > PanGesturePtr;
+
+/**
+ * @copydoc Dali::PanGesture
+ */
+class PanGesture final : public Gesture
+{
+public:
+
+  /**
+   * @brief Default constructor
+   */
+  PanGesture(GestureState state)
+  : Gesture(GestureType::PAN, state)
+  {
+  }
+
+  PanGesture(const PanGesture&) = delete; ///< Deleted copy constructor
+  PanGesture(PanGesture&&) = delete; ///< Deleted move constructor
+  PanGesture& operator=(const PanGesture&) = delete; ///< Deleted copy assignment operator
+  PanGesture& operator=(PanGesture&&) = delete; ///< Deleted move assignment operator
+
+  /**
+   * @brief Set The velocity at which the user is moving their fingers.
+   * @param[in] velocity The Vector2 in local coordinates to set.
+   */
+  inline void SetVelocity(const Vector2& velocity)
+  {
+    mVelocity = velocity;
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetVelocity()
+   */
+  inline const Vector2& GetVelocity() const
+  {
+    return mVelocity;
+  }
+
+  /**
+   * @brief Set This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
+   * if the gesture has just started, then the amount panned since the user touched the screen.
+   * @param[in] displacement The Vector2 in local coordinates to set.
+   */
+  inline void SetDisplacement(const Vector2& displacement)
+  {
+    mDisplacement = displacement;
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetDisplacement()
+   */
+  inline const Vector2& GetDisplacement() const
+  {
+    return mDisplacement;
+  }
+
+  /**
+   * @brief Set This current touch position of the primary touch point in local actor coordinates.
+   * @param[in] velocity The current touch position to set.
+   */
+  inline void SetPosition(const Vector2& position)
+  {
+    mPosition = position;
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetPosition()
+   */
+  inline const Vector2& GetPosition() const
+  {
+    return mPosition;
+  }
+
+  /**
+   * @brief Set The velocity at which the user is moving their fingers.
+   * @param[in] screenVelocity The Vector2 in screen coordinates to set.
+   */
+  inline void SetScreenVelocity(const Vector2& screenVelocity)
+  {
+    mScreenVelocity = screenVelocity;
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetScreenVelocity()
+   */
+  inline const Vector2& GetScreenVelocity() const
+  {
+    return mScreenVelocity;
+  }
+
+  /**
+   * @brief Set This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
+   * if the gesture has just started, then the amount panned since the user touched the screen.
+   * @param[in] screenDisplacement The Vector2 in screen coordinates to set.
+   */
+  inline void SetScreenDisplacement(const Vector2& screenDisplacement)
+  {
+    mScreenDisplacement = screenDisplacement;
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetScreenDisplacement()
+   */
+  inline const Vector2& GetScreenDisplacement() const
+  {
+    return mScreenDisplacement;
+  }
+
+  /**
+   * @brief Set This current touch position of the primary touch point in screen coordinates.
+   * @param[in] screenPosition The Vector2 in screen coordinates to set.
+   */
+  inline void SetScreenPosition(const Vector2& screenPosition)
+  {
+    mScreenPosition = screenPosition;
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetScreenPosition()
+   */
+  inline const Vector2& GetScreenPosition() const
+  {
+    return mScreenPosition;
+  }
+
+  /**
+   * @brief The total number of fingers touching the screen in a pan gesture.
+   * @param[in] numberOfTouches The total number of fingers touching the screen to set.
+   */
+  inline void SetNumberOfTouches(uint32_t numberOfTouches)
+  {
+    mNumberOfTouches = numberOfTouches;
+  }
+
+  /**
+   * @brief The total number of fingers touching the screen in a pan gesture.
+   */
+  inline uint32_t GetNumberOfTouches() const
+  {
+    return mNumberOfTouches;
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetSpeed()
+   */
+  inline float GetSpeed() const
+  {
+    return mVelocity.Length();
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetDistance()
+   */
+  inline float GetDistance() const
+  {
+    return mDisplacement.Length();
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetScreenSpeed()
+   */
+  inline float GetScreenSpeed() const
+  {
+    return mScreenVelocity.Length();
+  }
+
+  /**
+   * @copydoc Dali::PanGesture::GetScreenDistance()
+   */
+  inline float GetScreenDistance() const
+  {
+    return mScreenDisplacement.Length();
+  }
+
+private:
+
+  /**
+   * @brief Virtual destructor
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~PanGesture() = default;
+
+private:
+  Vector2 mVelocity;
+  Vector2 mDisplacement;
+  Vector2 mPosition;
+  Vector2 mScreenVelocity;
+  Vector2 mScreenDisplacement;
+  Vector2 mScreenPosition;
+  uint32_t mNumberOfTouches{1u};
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::PanGesture& GetImplementation( Dali::PanGesture& panGesture )
+{
+  DALI_ASSERT_ALWAYS( panGesture && "panGesture handle is empty" );
+
+  BaseObject& object = panGesture.GetBaseObject();
+
+  return static_cast< Internal::PanGesture& >( object );
+}
+
+inline const Internal::PanGesture& GetImplementation( const Dali::PanGesture& panGesture )
+{
+  DALI_ASSERT_ALWAYS( panGesture && "panGesture handle is empty" );
+
+  const BaseObject& object = panGesture.GetBaseObject();
+
+  return static_cast< const Internal::PanGesture& >( object );
+}
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_PAN_GESTURE_H
index 92154aa..370a29d 100644 (file)
@@ -37,6 +37,7 @@
 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
 #include <dali/internal/event/events/multi-point-event-util.h>
 #include <dali/internal/event/events/pan-gesture/pan-gesture-recognizer.h>
+#include <dali/internal/event/events/pan-gesture/pan-gesture-impl.h>
 #include <dali/internal/event/events/gesture-requests.h>
 
 namespace Dali
@@ -53,12 +54,12 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_PAN
 
 const char * GESTURE_STATES[ 6 ] =
 {
-  "Clear",
-  "Started",
-  "Continuing",
-  "Finished",
-  "Cancelled",
-  "Possible"
+  "CLEAR",
+  "STARTED",
+  "CONTINUING",
+  "FINISHED",
+  "CANCELLED",
+  "POSSIBLE"
 };
 
 #endif // defined(DEBUG_ENABLED)
@@ -123,7 +124,7 @@ struct IsNotAttachedAndOutsideTouchesRangeFunctor
 } // unnamed namespace
 
 PanGestureProcessor::PanGestureProcessor( SceneGraph::UpdateManager& updateManager )
-: GestureProcessor( Gesture::Pan ),
+: GestureProcessor( GestureType::PAN ),
   mPanGestureDetectors(),
   mCurrentPanEmitters(),
   mCurrentRenderTask(),
@@ -149,14 +150,14 @@ void PanGestureProcessor::Process( Scene& scene, const PanGestureEvent& panEvent
 
   DALI_LOG_INFO( gLogFilter, Debug::General, "    Pan Event\n");
   DALI_LOG_INFO( gLogFilter, Debug::General, "      State: %s  Touches: %d  Time: %d  TimeDelta: %d\n",
-                                             GESTURE_STATES[panEvent.state], panEvent.numberOfTouches, panEvent.time, panEvent.timeDelta);
+                                             GESTURE_STATES[static_cast<uint8_t>(panEvent.state)], panEvent.numberOfTouches, panEvent.time, panEvent.timeDelta);
   DALI_LOG_INFO( gLogFilter, Debug::General, "      Positions: Current: (%.0f, %.0f), Previous: (%.0f, %.0f)\n",
                                              panEvent.currentPosition.x, panEvent.currentPosition.y, panEvent.previousPosition.x, panEvent.previousPosition.y);
 #endif
 
   switch( panEvent.state )
   {
-    case Gesture::Possible:
+    case GestureState::POSSIBLE:
     {
       mCurrentPanEmitters.clear();
       ResetActor();
@@ -170,7 +171,7 @@ void PanGestureProcessor::Process( Scene& scene, const PanGestureEvent& panEvent
       break;
     }
 
-    case Gesture::Started:
+    case GestureState::STARTED:
     {
       // Requires a core update
       mNeedsUpdate = true;
@@ -206,7 +207,7 @@ void PanGestureProcessor::Process( Scene& scene, const PanGestureEvent& panEvent
       break;
     }
 
-    case Gesture::Continuing:
+    case GestureState::CONTINUING:
     {
       // Requires a core update
       mNeedsUpdate = true;
@@ -214,8 +215,8 @@ void PanGestureProcessor::Process( Scene& scene, const PanGestureEvent& panEvent
       DALI_FALLTHROUGH;
     }
 
-    case Gesture::Finished:
-    case Gesture::Cancelled:
+    case GestureState::FINISHED:
+    case GestureState::CANCELLED:
     {
       // Only send subsequent pan gesture signals if we processed the pan gesture when it started.
       // Check if actor is still touchable.
@@ -240,7 +241,7 @@ void PanGestureProcessor::Process( Scene& scene, const PanGestureEvent& panEvent
             currentGesturedActor->ScreenToLocal( *mCurrentRenderTask.Get(), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y );
 
             // EmitPanSignal checks whether we have a valid actor and whether the container we are passing in has emitters before it emits the pan.
-            EmitPanSignal( currentGesturedActor, outsideTouchesRangeEmitters, panEvent, actorCoords, Gesture::Finished, mCurrentRenderTask);
+            EmitPanSignal( currentGesturedActor, outsideTouchesRangeEmitters, panEvent, actorCoords, GestureState::FINISHED, mCurrentRenderTask);
             EmitPanSignal( currentGesturedActor, mCurrentPanEmitters, panEvent, actorCoords, panEvent.state, mCurrentRenderTask);
           }
 
@@ -251,7 +252,7 @@ void PanGestureProcessor::Process( Scene& scene, const PanGestureEvent& panEvent
           }
 
           // Clear current gesture detectors if pan gesture has ended or been cancelled.
-          if ( ( panEvent.state == Gesture::Finished ) || ( panEvent.state == Gesture::Cancelled ) )
+          if ( ( panEvent.state == GestureState::FINISHED ) || ( panEvent.state == GestureState::CANCELLED ) )
           {
             mCurrentPanEmitters.clear();
             ResetActor();
@@ -266,9 +267,9 @@ void PanGestureProcessor::Process( Scene& scene, const PanGestureEvent& panEvent
       break;
     }
 
-    case Gesture::Clear:
+    case GestureState::CLEAR:
     {
-      DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
+      DALI_ABORT( "Incorrect state received from Integration layer: CLEAR\n" );
       break;
     }
   }
@@ -337,16 +338,18 @@ void PanGestureProcessor::GestureDetectorUpdated( PanGestureDetector* gestureDet
   UpdateDetection();
 }
 
-bool PanGestureProcessor::SetPanGestureProperties( const PanGesture& pan )
+bool PanGestureProcessor::SetPanGestureProperties( const Dali::PanGesture& pan )
 {
   // If we are currently processing a pan gesture then just ignore
   if ( mCurrentPanEmitters.empty() && mSceneObject )
   {
+    const PanGesture& panImpl( GetImplementation(pan) );
+
     // We update the scene object directly rather than sending a message.
     // Sending a message could cause unnecessary delays, the scene object ensure thread safe behaviour.
-    mSceneObject->AddGesture( pan );
+    mSceneObject->AddGesture( panImpl );
 
-    if( Gesture::Started == pan.state || Gesture::Continuing == pan.state )
+    if( GestureState::STARTED == panImpl.GetState() || GestureState::CONTINUING == panImpl.GetState() )
     {
       mNeedsUpdate = true;
     }
@@ -495,62 +498,67 @@ void PanGestureProcessor::EmitPanSignal( Actor* actor,
                                          const GestureDetectorContainer& gestureDetectors,
                                          const PanGestureEvent& panEvent,
                                          Vector2 localCurrent,
-                                         Gesture::State state,
+                                         GestureState state,
                                          RenderTaskPtr renderTask )
 {
   if ( actor && !gestureDetectors.empty() )
   {
-    PanGesture pan(state);
-    pan.time = panEvent.time;
+    Internal::PanGesturePtr pan( new Internal::PanGesture(state ) );
+
+    pan->SetTime( panEvent.time );
 
-    pan.numberOfTouches = panEvent.numberOfTouches;
-    pan.screenPosition = panEvent.currentPosition;
-    pan.position = localCurrent;
+    pan->SetNumberOfTouches( panEvent.numberOfTouches );
+    pan->SetScreenPosition( panEvent.currentPosition );
+    pan->SetPosition( localCurrent );
 
     RenderTask& renderTaskImpl( *renderTask.Get() );
 
     Vector2 localPrevious;
     actor->ScreenToLocal( renderTaskImpl, localPrevious.x, localPrevious.y, panEvent.previousPosition.x, panEvent.previousPosition.y );
 
-    pan.displacement = localCurrent - localPrevious;
+    pan->SetDisplacement( localCurrent - localPrevious );
     Vector2 previousPos( panEvent.previousPosition );
-    if ( state == Gesture::Started )
+    if ( state == GestureState::STARTED )
     {
       previousPos = mPossiblePanPosition;
     }
 
-    pan.screenDisplacement = panEvent.currentPosition - previousPos;
+    pan->SetScreenDisplacement( panEvent.currentPosition - previousPos );
 
     // Avoid dividing by 0
     if ( panEvent.timeDelta > 0 )
     {
-      pan.velocity.x = pan.displacement.x / static_cast<float>( panEvent.timeDelta );
-      pan.velocity.y = pan.displacement.y / static_cast<float>( panEvent.timeDelta );
-
-      pan.screenVelocity.x = pan.screenDisplacement.x / static_cast<float>( panEvent.timeDelta );
-      pan.screenVelocity.y = pan.screenDisplacement.y / static_cast<float>( panEvent.timeDelta );
+      Vector2 velocity;
+      velocity.x = pan->GetDisplacement().x / static_cast<float>( panEvent.timeDelta );
+      velocity.y = pan->GetDisplacement().y / static_cast<float>( panEvent.timeDelta );
+      pan->SetVelocity( velocity );
+
+      Vector2 screenVelocity;
+      screenVelocity.x = pan->GetScreenDisplacement().x / static_cast<float>( panEvent.timeDelta );
+      screenVelocity.y = pan->GetScreenDisplacement().y / static_cast<float>( panEvent.timeDelta );
+      pan->SetScreenVelocity( screenVelocity );
     }
 
     // When the gesture ends, we may incorrectly get a ZERO velocity (as we have lifted our finger without any movement)
     // so we should use the last recorded velocity instead in this scenario.
-    if ( ( state == Gesture::Finished ) && ( pan.screenVelocity == Vector2::ZERO ) &&
+    if ( ( state == GestureState::FINISHED ) && ( pan->GetScreenVelocity() == Vector2::ZERO ) &&
          ( panEvent.timeDelta < MAXIMUM_TIME_WITH_VALID_LAST_VELOCITY ) )
     {
-      pan.velocity = mLastVelocity;
-      pan.screenVelocity = mLastScreenVelocity;
+      pan->SetVelocity( mLastVelocity );
+      pan->SetScreenVelocity( mLastScreenVelocity );
     }
     else
     {
       // Store the current velocity for future iterations.
-      mLastVelocity = pan.velocity;
-      mLastScreenVelocity = pan.screenVelocity;
+      mLastVelocity = pan->GetVelocity();
+      mLastScreenVelocity = pan->GetScreenVelocity();
     }
 
     if ( mSceneObject )
     {
       // We update the scene object directly rather than sending a message.
       // Sending a message could cause unnecessary delays, the scene object ensure thread safe behaviour.
-      mSceneObject->AddGesture( pan );
+      mSceneObject->AddGesture( *pan.Get() );
     }
 
     Dali::Actor actorHandle( actor );
@@ -558,7 +566,7 @@ void PanGestureProcessor::EmitPanSignal( Actor* actor,
     const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
     for ( GestureDetectorContainer::const_iterator iter = gestureDetectors.begin(); iter != endIter; ++iter )
     {
-      static_cast< PanGestureDetector* >( *iter )->EmitPanGestureSignal( actorHandle, pan );
+      static_cast< PanGestureDetector* >( *iter )->EmitPanGestureSignal( actorHandle, Dali::PanGesture( pan.Get() ) );
     }
   }
 }
index f831d8a..80439bf 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_PAN_GESTURE_EVENT_PROCESSOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -102,7 +102,7 @@ public: // To be called by GestureEventProcessor
    * @return true if Core::Update required
    * @note If we are already processing a normal pan, then this call is ignored.
    */
-  bool SetPanGestureProperties( const PanGesture& pan );
+  bool SetPanGestureProperties( const Dali::PanGesture& pan );
 
   /**
    * Called to provide pan-gesture profiling information.
@@ -254,7 +254,7 @@ private:
                       const GestureDetectorContainer& gestureDetectors,
                       const PanGestureEvent& panEvent,
                       Vector2 localCurrent,
-                      Gesture::State state,
+                      GestureState state,
                       RenderTaskPtr renderTask );
 
   // GestureProcessor overrides
index 51a91a5..be9b307 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 
 #include <dali/integration-api/events/touch-event-integ.h>
 
@@ -46,9 +46,9 @@ const unsigned int MINIMUM_MOTION_EVENTS_BEFORE_PAN(2);
 } // unnamed namespace
 
 PanGestureRecognizer::PanGestureRecognizer( Observer& observer, Vector2 screenSize, const PanGestureRequest& request, int32_t minimumDistance, int32_t minimumPanEvents )
-: GestureRecognizer( screenSize, Gesture::Pan ),
+: GestureRecognizer( screenSize, GestureType::PAN ),
   mObserver( observer ),
-  mState( Clear ),
+  mState( CLEAR ),
   mThresholdAdjustmentsRemaining( 0 ),
   mThresholdTotalAdjustments( static_cast<unsigned int>( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO ) ),
   mPrimaryTouchDownTime( 0 ),
@@ -85,20 +85,20 @@ void PanGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
 
   if (primaryPointState == PointState::INTERRUPTED)
   {
-    if ( ( mState == Started ) || ( mState == Possible ) )
+    if ( ( mState == STARTED ) || ( mState == POSSIBLE ) )
     {
       // If our pan had started and we are interrupted, then tell Core that pan is cancelled.
       mTouchEvents.push_back(event);
-      SendPan(Gesture::Cancelled, event);
+      SendPan(GestureState::CANCELLED, event);
     }
-    mState = Clear; // We should change our state to Clear.
+    mState = CLEAR; // We should change our state to CLEAR.
     mTouchEvents.clear();
   }
   else
   {
     switch (mState)
     {
-      case Clear:
+      case CLEAR:
       {
         if ( ( primaryPointState == PointState::DOWN ) || ( primaryPointState == PointState::STATIONARY ) || ( primaryPointState == PointState::MOTION ))
         {
@@ -108,8 +108,8 @@ void PanGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
           if (event.GetPointCount() == mMinimumTouchesRequired)
           {
             // We have satisfied the minimum touches required for a pan, tell core that a gesture may be possible and change our state accordingly.
-            mState = Possible;
-            SendPan(Gesture::Possible, event);
+            mState = POSSIBLE;
+            SendPan(GestureState::POSSIBLE, event);
           }
 
           mTouchEvents.push_back(event);
@@ -117,7 +117,7 @@ void PanGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
         break;
       }
 
-      case Possible:
+      case POSSIBLE:
       {
         unsigned int pointCount(event.GetPointCount());
         if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
@@ -133,8 +133,8 @@ void PanGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
                  ( delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) ) )
             {
               // If the touch point(s) have moved enough distance to be considered a pan, then tell Core that the pan gesture has started and change our state accordingly.
-              mState = Started;
-              SendPan(Gesture::Started, event);
+              mState = STARTED;
+              SendPan(GestureState::STARTED, event);
             }
           }
           else if (primaryPointState == PointState::UP)
@@ -142,40 +142,40 @@ void PanGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
             Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
             if (delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) )
             {
-              SendPan(Gesture::Started, event);
+              SendPan(GestureState::STARTED, event);
               mTouchEvents.push_back(event);
-              SendPan(Gesture::Finished, event);
+              SendPan(GestureState::FINISHED, event);
             }
             else
             {
-              // If we have lifted the primary touch point then tell core the pan is cancelled and change our state to Clear.
-              SendPan(Gesture::Cancelled, event);
+              // If we have lifted the primary touch point then tell core the pan is cancelled and change our state to CLEAR.
+              SendPan(GestureState::CANCELLED, event);
             }
-            mState = Clear;
+            mState = CLEAR;
             mTouchEvents.clear();
           }
         }
         else
         {
           // We do not satisfy pan conditions, tell Core our Gesture has been cancelled.
-          SendPan(Gesture::Cancelled, event);
+          SendPan(GestureState::CANCELLED, event);
 
           if (pointCount == 1 && primaryPointState == PointState::UP)
           {
-            // If we have lifted the primary touch point, then change our state to Clear...
-            mState = Clear;
+            // If we have lifted the primary touch point, then change our state to CLEAR...
+            mState = CLEAR;
             mTouchEvents.clear();
           }
           else
           {
-            // ...otherwise change it to Failed.
-            mState = Failed;
+            // ...otherwise change it to FAILED.
+            mState = FAILED;
           }
         }
         break;
       }
 
-      case Started:
+      case STARTED:
       {
         mTouchEvents.push_back(event);
 
@@ -186,13 +186,13 @@ void PanGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
           {
             case PointState::MOTION:
               // Pan is continuing, tell Core.
-              SendPan(Gesture::Continuing, event);
+              SendPan(GestureState::CONTINUING, event);
               break;
 
             case PointState::UP:
-              // Pan is finally finished when our primary point is lifted, tell Core and change our state to Clear.
-              mState = Clear;
-              SendPan(Gesture::Finished, event);
+              // Pan is finally finished when our primary point is lifted, tell Core and change our state to CLEAR.
+              mState = CLEAR;
+              SendPan(GestureState::FINISHED, event);
               mTouchEvents.clear();
               break;
 
@@ -204,9 +204,9 @@ void PanGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
                 {
                   if(iter->GetState() == PointState::UP)
                   {
-                    // The number of touch points will be less than the minimum required.  Inform core and change our state to Finished.
-                    SendPan(Gesture::Finished, event);
-                    mState = Finished;
+                    // The number of touch points will be less than the minimum required.  Inform core and change our state to FINISHED.
+                    SendPan(GestureState::FINISHED, event);
+                    mState = FINISHED;
                     break;
                   }
                 }
@@ -220,30 +220,30 @@ void PanGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
         else
         {
           // We have gone outside of the pan requirements, inform Core that the gesture is finished.
-          SendPan(Gesture::Finished, event);
+          SendPan(GestureState::FINISHED, event);
 
           if (pointCount == 1 && primaryPointState == PointState::UP)
           {
-            // If this was the primary point being released, then we change our state back to Clear...
-            mState = Clear;
+            // If this was the primary point being released, then we change our state back to CLEAR...
+            mState = CLEAR;
             mTouchEvents.clear();
           }
           else
           {
-            // ...otherwise we change it to Finished.
-            mState = Finished;
+            // ...otherwise we change it to FINISHED.
+            mState = FINISHED;
           }
         }
         break;
       }
 
-      case Finished:
-      case Failed:
+      case FINISHED:
+      case FAILED:
       {
         if (primaryPointState == PointState::UP)
         {
           // Change our state back to clear when the primary touch point is released.
-          mState = Clear;
+          mState = CLEAR;
           mTouchEvents.clear();
         }
         break;
@@ -260,7 +260,7 @@ void PanGestureRecognizer::Update(const GestureRequest& request)
   mMaximumTouchesRequired = pan.maxTouches;
 }
 
-void PanGestureRecognizer::SendPan(Gesture::State state, const Integration::TouchEvent& currentEvent)
+void PanGestureRecognizer::SendPan(GestureState state, const Integration::TouchEvent& currentEvent)
 {
   PanGestureEvent gesture(state);
   gesture.currentPosition = currentEvent.points[0].GetScreenPosition();
@@ -275,7 +275,7 @@ void PanGestureRecognizer::SendPan(Gesture::State state, const Integration::Touc
     uint32_t previousTime( previousEvent.time );
 
     // If we've just started then we want to remove the threshold from Core calculations.
-    if ( state == Gesture::Started )
+    if ( state == GestureState::STARTED )
     {
       previousPosition = mPrimaryTouchDownLocation;
       previousTime = mPrimaryTouchDownTime;
index 3a74263..17ad5e3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_PAN_GESTURE_RECOGNIZER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -81,7 +81,7 @@ private:
    * @param[in]  state         The state of the pan.
    * @param[in]  currentEvent  The latest touch event.
    */
-  void SendPan(Gesture::State state, const Integration::TouchEvent& currentEvent);
+  void SendPan(GestureState state, const Integration::TouchEvent& currentEvent);
 
 private:
 
@@ -93,11 +93,11 @@ private:
    */
   enum State
   {
-    Clear,    ///< No gesture detected.
-    Possible, ///< The current touch event data suggests that a gesture is possible.
-    Started,  ///< A gesture has been detected.
-    Finished, ///< A previously started pan gesture has finished.
-    Failed,   ///< Current touch event data suggests a pan gesture is not possible.
+    CLEAR,    ///< No gesture detected.
+    POSSIBLE, ///< The current touch event data suggests that a gesture is possible.
+    STARTED,  ///< A gesture has been detected.
+    FINISHED, ///< A previously started pan gesture has finished.
+    FAILED,   ///< Current touch event data suggests a pan gesture is not possible.
   };
 
   State mState; ///< The current state of the detector.
index 0369322..6584d2d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -58,7 +58,7 @@ PinchGestureDetectorPtr PinchGestureDetector::New()
 }
 
 PinchGestureDetector::PinchGestureDetector()
-: GestureDetector(Gesture::Pinch)
+: GestureDetector(GestureType::PINCH)
 {
 }
 
@@ -66,7 +66,7 @@ PinchGestureDetector::~PinchGestureDetector()
 {
 }
 
-void PinchGestureDetector::EmitPinchGestureSignal(Dali::Actor actor, const PinchGesture& pinch)
+void PinchGestureDetector::EmitPinchGestureSignal(Dali::Actor actor, const Dali::PinchGesture& pinch)
 {
   // Guard against destruction during signal emission
   Dali::PinchGestureDetector handle( this );
index 41113a3..72aab7f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
 
 // INTERNAL INCLUDES
 #include <dali/public-api/events/pinch-gesture-detector.h>
+#include <dali/public-api/events/pinch-gesture.h>
 #include <dali/internal/event/events/gesture-detector-impl.h>
 
 namespace Dali
 {
 
-struct PinchGesture;
-
 namespace Internal
 {
 
@@ -61,7 +60,7 @@ public:
    * @param[in]  actor  The pinched actor.
    * @param[in]  pinch  The pinch gesture.
    */
-  void EmitPinchGestureSignal(Dali::Actor actor, const PinchGesture& pinch);
+  void EmitPinchGestureSignal(Dali::Actor actor, const Dali::PinchGesture& pinch);
 
 public: // Signals
 
index 161ddca..fa9841b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -27,8 +27,8 @@ namespace Dali
 namespace Internal
 {
 
-PinchGestureEvent::PinchGestureEvent(Gesture::State state)
-: GestureEvent(Gesture::Pinch, state),
+PinchGestureEvent::PinchGestureEvent(GestureState state)
+: GestureEvent(GestureType::PINCH, state),
   scale(0.0f),
   speed(0.0f),
   centerPoint()
index 3aaf3e5..204f9ef 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_PINCH_GESTURE_EVENT_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -33,10 +33,10 @@ namespace Internal
  * send it to the Core.
  *
  * A Pinch Gesture event should be in one of four states:
- * - Started:    If a pinch is detected.
- * - Continuing: If after a pinch is detected, it continues.
- * - Finished:   If after a pinch, the user lifts their finger(s).
- * - Cancelled:  If there is a system interruption.
+ * - STARTED:    If a pinch is detected.
+ * - CONTINUING: If after a pinch is detected, it continues.
+ * - FINISHED:   If after a pinch, the user lifts their finger(s).
+ * - CANCELLED:  If there is a system interruption.
  */
 struct PinchGestureEvent : public GestureEvent
 {
@@ -46,7 +46,7 @@ struct PinchGestureEvent : public GestureEvent
    * Default Constructor
    * @param[in]  state  The state of the gesture
    */
-  PinchGestureEvent(Gesture::State state);
+  PinchGestureEvent(GestureState state);
 
   /**
    * Virtual destructor
diff --git a/dali/internal/event/events/pinch-gesture/pinch-gesture-impl.h b/dali/internal/event/events/pinch-gesture/pinch-gesture-impl.h
new file mode 100644 (file)
index 0000000..287756e
--- /dev/null
@@ -0,0 +1,164 @@
+#ifndef DALI_INTERNAL_PINCH_GESTURE_H
+#define DALI_INTERNAL_PINCH_GESTURE_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/events/pinch-gesture.h>
+#include <dali/internal/event/events/gesture-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+class PinchGesture;
+typedef IntrusivePtr< PinchGesture > PinchGesturePtr;
+
+/**
+ * @copydoc Dali::PinchGesture
+ */
+class PinchGesture final : public Gesture
+{
+public:
+
+  /**
+   * @brief Default constructor
+   */
+  PinchGesture( GestureState state )
+  : Gesture(GestureType::PINCH, state)
+  {
+  }
+
+  PinchGesture(const PinchGesture&) = delete; ///< Deleted copy constructor
+  PinchGesture(PinchGesture&&) = delete; ///< Deleted move constructor
+  PinchGesture& operator=(const PinchGesture&) = delete; ///< Deleted copy assignment operator
+  PinchGesture& operator=(PinchGesture&&) = delete; ///< Deleted move assignment operator
+
+  /**
+   * @brief The scale factor from the start of the pinch gesture till the latest pinch gesture.
+   * @param[in] scale The scale to set.
+   */
+  inline void SetScale( float scale )
+  {
+    mScale = scale;
+  }
+
+  /**
+   * @copydoc Dali::PinchGesture::GetScale()
+   */
+  inline float GetScale() const
+  {
+    return mScale;
+  }
+
+  /**
+   * @brief The speed at which the user is moving their fingers.
+   * @param[in] speed The speed to set.
+   */
+  inline void SetSpeed( float speed )
+  {
+    mSpeed = speed;
+  }
+
+  /**
+   * @copydoc Dali::PinchGesture::GetSpeed()
+   */
+  inline float GetSpeed() const
+  {
+    return mSpeed;
+  }
+
+  /**
+   * @brief The center point of the two points that caused the pinch gesture in screen coordinates.
+   * @param[in] screenCenterPoint The point in screen coordinates to set.
+   */
+  inline void SetScreenCenterPoint( const Vector2& screenCenterPoint )
+  {
+    mScreenCenterPoint = screenCenterPoint;
+  }
+
+  /**
+   * @copydoc Dali::PinchGesture::GetScreenCenterPoint()
+   */
+  inline const Vector2& GetScreenCenterPoint() const
+  {
+    return mScreenCenterPoint;
+  }
+
+  /**
+   * @brief The center point of the two points that caused the pinch gesture in local actor coordinates.
+   * @param[in] localCenterPoint The point in local actor coordinates to set.
+   */
+  inline void SetLocalCenterPoint( const Vector2& localCenterPoint )
+  {
+    mLocalCenterPoint = localCenterPoint;
+  }
+
+  /**
+   * @copydoc Dali::PinchGesture::GetLocalCenterPoint()
+   */
+  inline const Vector2& GetLocalCenterPoint() const
+  {
+    return mLocalCenterPoint;
+  }
+
+private:
+
+  /**
+   * @brief Virtual destructor
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~PinchGesture() = default;
+
+private:
+  Vector2 mScreenCenterPoint;
+  Vector2 mLocalCenterPoint;
+  float mScale{0.0f};
+  float mSpeed{0.0f};
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::PinchGesture& GetImplementation( Dali::PinchGesture& pinchGesture )
+{
+  DALI_ASSERT_ALWAYS( pinchGesture && "pinchGesture handle is empty" );
+
+  BaseObject& object = pinchGesture.GetBaseObject();
+
+  return static_cast< Internal::PinchGesture& >( object );
+}
+
+inline const Internal::PinchGesture& GetImplementation( const Dali::PinchGesture& pinchGesture )
+{
+  DALI_ASSERT_ALWAYS( pinchGesture && "pinchGesture handle is empty" );
+
+  const BaseObject& object = pinchGesture.GetBaseObject();
+
+  return static_cast< const Internal::PinchGesture& >( object );
+}
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_PINCH_GESTURE_H
index 73e7b37..9d5af7b 100644 (file)
@@ -30,6 +30,7 @@
 #include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 #include <dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.h>
+#include <dali/internal/event/events/pinch-gesture/pinch-gesture-impl.h>
 #include <dali/internal/event/events/gesture-requests.h>
 
 namespace Dali
@@ -56,20 +57,20 @@ void EmitPinchSignal(
     const PinchGestureEvent& pinchEvent,
     Vector2 localCenter)
 {
-  PinchGesture pinch(pinchEvent.state);
-  pinch.time = pinchEvent.time;
+  Internal::PinchGesturePtr pinch( new Internal::PinchGesture(pinchEvent.state ) );
+  pinch->SetTime( pinchEvent.time );
 
-  pinch.scale = pinchEvent.scale;
-  pinch.speed = pinchEvent.speed;
-  pinch.screenCenterPoint = pinchEvent.centerPoint;
+  pinch->SetScale( pinchEvent.scale );
+  pinch->SetSpeed( pinchEvent.speed );
+  pinch->SetScreenCenterPoint( pinchEvent.centerPoint );
 
-  pinch.localCenterPoint = localCenter;
+  pinch->SetLocalCenterPoint( localCenter );
 
   Dali::Actor actorHandle( actor );
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
   for ( GestureDetectorContainer::const_iterator iter = gestureDetectors.begin(); iter != endIter; ++iter )
   {
-    static_cast< PinchGestureDetector* >( *iter )->EmitPinchGestureSignal( actorHandle, pinch );
+    static_cast< PinchGestureDetector* >( *iter )->EmitPinchGestureSignal( actorHandle, Dali::PinchGesture( pinch.Get() ) );
   }
 }
 
@@ -104,7 +105,7 @@ struct IsNotAttachedFunctor
 } // unnamed namespace
 
 PinchGestureProcessor::PinchGestureProcessor()
-: GestureProcessor( Gesture::Pinch ),
+: GestureProcessor( GestureType::PINCH ),
   mPinchGestureDetectors(),
   mCurrentPinchEmitters(),
   mCurrentPinchEvent(NULL),
@@ -170,7 +171,7 @@ void PinchGestureProcessor::Process( Scene& scene, const PinchGestureEvent& pinc
 {
   switch ( pinchEvent.state )
   {
-    case Gesture::Started:
+    case GestureState::STARTED:
     {
       // The pinch gesture should only be sent to the gesture detector which first received it so that
       // it can be told when the gesture ends as well.
@@ -192,9 +193,9 @@ void PinchGestureProcessor::Process( Scene& scene, const PinchGestureEvent& pinc
       break;
     }
 
-    case Gesture::Continuing:
-    case Gesture::Finished:
-    case Gesture::Cancelled:
+    case GestureState::CONTINUING:
+    case GestureState::FINISHED:
+    case GestureState::CANCELLED:
     {
       // Only send subsequent pinch gesture signals if we processed the pinch gesture when it started.
       // Check if actor is still touchable.
@@ -223,7 +224,7 @@ void PinchGestureProcessor::Process( Scene& scene, const PinchGestureEvent& pinc
           }
 
           // Clear current emitters if pinch gesture has ended or been cancelled.
-          if ( pinchEvent.state == Gesture::Finished || pinchEvent.state == Gesture::Cancelled )
+          if ( pinchEvent.state == GestureState::FINISHED || pinchEvent.state == GestureState::CANCELLED )
           {
             mCurrentPinchEmitters.clear();
             ResetActor();
@@ -238,14 +239,14 @@ void PinchGestureProcessor::Process( Scene& scene, const PinchGestureEvent& pinc
       break;
     }
 
-    case Gesture::Clear:
+    case GestureState::CLEAR:
     {
-      DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
+      DALI_ABORT( "Incorrect state received from Integration layer: CLEAR\n" );
       break;
     }
-    case Gesture::Possible:
+    case GestureState::POSSIBLE:
     {
-      DALI_ABORT( "Incorrect state received from Integration layer: Possible\n" );
+      DALI_ABORT( "Incorrect state received from Integration layer: POSSIBLE\n" );
       break;
     }
   }
index de2bd4f..134dee4 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/math/vector2.h>
 
 #include <dali/internal/event/events/pinch-gesture/pinch-gesture-event.h>
@@ -66,9 +66,9 @@ inline float GetDefaultMinimumPinchDistance( const Vector2& dpi )
 } // unnamed namespace
 
 PinchGestureRecognizer::PinchGestureRecognizer( Observer& observer, Vector2 screenSize, Vector2 screenDpi, float minimumPinchDistance, uint32_t minimumTouchEvents, uint32_t minimumTouchEventsAfterStart )
-: GestureRecognizer( screenSize, Gesture::Pinch ),
+: GestureRecognizer( screenSize, GestureType::PINCH ),
   mObserver( observer ),
-  mState( Clear ),
+  mState( CLEAR ),
   mTouchEvents(),
   mDefaultMinimumDistanceDelta( GetDefaultMinimumPinchDistance( screenDpi ) ),
   mStartingDistance( 0.0f ),
@@ -94,23 +94,23 @@ void PinchGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
 
   switch (mState)
   {
-    case Clear:
+    case CLEAR:
     {
       if (pointCount == 2)
       {
         // Change state to possible as we have two touch points.
-        mState = Possible;
+        mState = POSSIBLE;
         mTouchEvents.push_back(event);
       }
       break;
     }
 
-    case Possible:
+    case POSSIBLE:
     {
       if (pointCount != 2)
       {
-        // We no longer have two touch points so change state back to Clear.
-        mState = Clear;
+        // We no longer have two touch points so change state back to CLEAR.
+        mState = CLEAR;
         mTouchEvents.clear();
       }
       else
@@ -120,8 +120,8 @@ void PinchGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
 
         if (currentPoint1.GetState() == PointState::UP || currentPoint2.GetState() == PointState::UP || currentPoint1.GetState() == PointState::INTERRUPTED)
         {
-          // One of our touch points has an Up event so change our state back to Clear.
-          mState = Clear;
+          // One of our touch points has an Up event so change our state back to CLEAR.
+          mState = CLEAR;
           mTouchEvents.clear();
         }
         else
@@ -149,18 +149,18 @@ void PinchGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
                 mStartingDistance = GetDistance(mTouchEvents.begin()->points[0], mTouchEvents.begin()->points[1]);
 
                 // Send pinch started
-                SendPinch(Gesture::Started, event);
+                SendPinch(GestureState::STARTED, event);
 
-                mState = Started;
+                mState = STARTED;
               }
 
               mTouchEvents.clear();
             }
 
-            if (mState == Possible)
+            if (mState == POSSIBLE)
             {
               // No pinch, so restart detection
-              mState = Clear;
+              mState = CLEAR;
               mTouchEvents.clear();
             }
           }
@@ -169,22 +169,22 @@ void PinchGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
       break;
     }
 
-    case Started:
+    case STARTED:
     {
       if(event.points[0].GetState() == PointState::INTERRUPTED)
       {
         // System interruption occurred, pinch should be cancelled
         mTouchEvents.clear();
-        SendPinch(Gesture::Cancelled, event);
-        mState = Clear;
+        SendPinch(GestureState::CANCELLED, event);
+        mState = CLEAR;
         mTouchEvents.clear();
       }
       else if (pointCount != 2)
       {
         // Send pinch finished event
-        SendPinch(Gesture::Finished, event);
+        SendPinch(GestureState::FINISHED, event);
 
-        mState = Clear;
+        mState = CLEAR;
         mTouchEvents.clear();
       }
       else
@@ -196,9 +196,9 @@ void PinchGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
         {
           mTouchEvents.push_back(event);
           // Send pinch finished event
-          SendPinch(Gesture::Finished, event);
+          SendPinch(GestureState::FINISHED, event);
 
-          mState = Clear;
+          mState = CLEAR;
           mTouchEvents.clear();
         }
         else
@@ -208,7 +208,7 @@ void PinchGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
           if( mTouchEvents.size() >= mMinimumTouchEventsAfterStart )
           {
             // Send pinch continuing
-            SendPinch(Gesture::Continuing, event);
+            SendPinch(GestureState::CONTINUING, event);
 
             mTouchEvents.clear();
           }
@@ -224,7 +224,7 @@ void PinchGestureRecognizer::Update(const GestureRequest& request)
   // Nothing to do.
 }
 
-void PinchGestureRecognizer::SendPinch(Gesture::State state, const Integration::TouchEvent& currentEvent)
+void PinchGestureRecognizer::SendPinch(GestureState state, const Integration::TouchEvent& currentEvent)
 {
   PinchGestureEvent gesture(state);
 
@@ -261,7 +261,7 @@ void PinchGestureRecognizer::SendPinch(Gesture::State state, const Integration::
   else
   {
     // Something has gone wrong, just cancel the gesture.
-    gesture.state = Gesture::Cancelled;
+    gesture.state = GestureState::CANCELLED;
   }
 
   gesture.time = currentEvent.time;
index 7bc429d..235a38b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_PINCH_GESTURE_RECOGNIZER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -93,7 +93,7 @@ private:
    * @param[in]  state         The state of the pinch (whether it's starting, continuing or finished).
    * @param[in]  currentEvent  The latest touch event.
    */
-  void SendPinch(Gesture::State state, const Integration::TouchEvent& currentEvent);
+  void SendPinch(GestureState state, const Integration::TouchEvent& currentEvent);
 
 private:
 
@@ -105,9 +105,9 @@ private:
    */
   enum State
   {
-    Clear,    ///< No gesture detected.
-    Possible, ///< The current touch event data suggests that a gesture is possible.
-    Started,  ///< A gesture has been detected.
+    CLEAR,    ///< No gesture detected.
+    POSSIBLE, ///< The current touch event data suggests that a gesture is possible.
+    STARTED,  ///< A gesture has been detected.
   };
 
   State mState; ///< The current state of the detector.
index debf1d0..7ca2101 100644 (file)
@@ -58,11 +58,11 @@ RotationGestureDetectorPtr RotationGestureDetector::New()
 }
 
 RotationGestureDetector::RotationGestureDetector()
-: GestureDetector( Gesture::Rotation )
+: GestureDetector( GestureType::ROTATION )
 {
 }
 
-void RotationGestureDetector::EmitRotationGestureSignal( Dali::Actor actor, const RotationGesture& rotation )
+void RotationGestureDetector::EmitRotationGestureSignal( Dali::Actor actor, const Dali::RotationGesture& rotation )
 {
   // Guard against destruction during signal emission
   Dali::RotationGestureDetector handle( this );
index 8af877a..dca87d8 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/public-api/events/rotation-gesture-detector.h>
+#include <dali/public-api/events/rotation-gesture.h>
 #include <dali/internal/event/events/gesture-detector-impl.h>
 
 namespace Dali
 {
 
-struct RotationGesture;
-
 namespace Internal
 {
 
@@ -66,7 +65,7 @@ public:
    * @param[in]  actor     The rotated actor
    * @param[in]  rotation  The rotation gesture
    */
-  void EmitRotationGestureSignal( Dali::Actor actor, const RotationGesture& rotation );
+  void EmitRotationGestureSignal( Dali::Actor actor, const Dali::RotationGesture& rotation );
 
 public: // Signals
 
index 436c7cd..4a651ff 100644 (file)
@@ -32,11 +32,11 @@ namespace Internal
 /**
  * When a rotation gesture is detected, this structure holds information regarding the gesture.
  *
- * A Rotation Gesture event should be in one of four states:
- * - Started:    If a rotation is detected.
- * - Continuing: If after a rotation is detected, it continues.
- * - Finished:   If after a rotation, the user lifts their finger(s).
- * - Cancelled:  If there is a system interruption.
+ * A ROTATION Gesture event should be in one of four states:
+ * - STARTED:    If a rotation is detected.
+ * - CONTINUING: If after a rotation is detected, it continues.
+ * - FINISHED:   If after a rotation, the user lifts their finger(s).
+ * - CANCELLED:  If there is a system interruption.
  */
 struct RotationGestureEvent : public GestureEvent
 {
@@ -46,8 +46,8 @@ struct RotationGestureEvent : public GestureEvent
    * Default Constructor
    * @param[in]  state  The state of the gesture
    */
-  RotationGestureEvent( Gesture::State state )
-  : GestureEvent( Gesture::Rotation, state )
+  RotationGestureEvent( GestureState state )
+  : GestureEvent( GestureType::ROTATION, state )
   {
   }
 
diff --git a/dali/internal/event/events/rotation-gesture/rotation-gesture-impl.h b/dali/internal/event/events/rotation-gesture/rotation-gesture-impl.h
new file mode 100644 (file)
index 0000000..0b3edff
--- /dev/null
@@ -0,0 +1,146 @@
+#ifndef DALI_INTERNAL_ROTATION_GESTURE_H
+#define DALI_INTERNAL_ROTATION_GESTURE_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/events/rotation-gesture.h>
+#include <dali/internal/event/events/gesture-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+class RotationGesture;
+typedef IntrusivePtr< RotationGesture > RotationGesturePtr;
+
+/**
+ * @copydoc Dali::RotationGesture
+ */
+class RotationGesture final : public Gesture
+{
+public:
+
+  /**
+   * @brief Default constructor
+   */
+  RotationGesture( GestureState state )
+  : Gesture( GestureType::ROTATION, state )
+  {
+  }
+
+  RotationGesture(const RotationGesture&) = delete; ///< Deleted copy constructor
+  RotationGesture(RotationGesture&&) = delete; ///< Deleted move constructor
+  RotationGesture& operator=(const RotationGesture&) = delete; ///< Deleted copy assignment operator
+  RotationGesture& operator=(RotationGesture&&) = delete; ///< Deleted move assignment operator
+
+  /**
+   * @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
+   * @param[in] rotation The rotation to set.
+   */
+  inline void SetRotation( const Radian& rotation )
+  {
+    mRotation = rotation;
+  }
+
+  /**
+   * @copydoc Dali::RotationGesture::GetRotation()
+   */
+  inline const Radian& GetRotation() const
+  {
+    return mRotation;
+  }
+
+  /**
+   * @brief The center point of the two points that caused the rotation gesture in screen coordinates.
+   * @param[in] screenCenterPoint The point in screen coordinates to set.
+   */
+  inline void SetScreenCenterPoint( const Vector2& screenCenterPoint )
+  {
+    mScreenCenterPoint = screenCenterPoint;
+  }
+
+  /**
+   * @copydoc Dali::RotationGesture::GetScreenCenterPoint()
+   */
+  inline const Vector2& GetScreenCenterPoint() const
+  {
+    return mScreenCenterPoint;
+  }
+
+  /**
+   * @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
+   * @param[in] localCenterPoint The point in local actor coordinates to set.
+   */
+  inline void SetLocalCenterPoint( const Vector2& localCenterPoint )
+  {
+    mLocalCenterPoint = localCenterPoint;
+  }
+
+  /**
+   * @copydoc Dali::RotationGesture::GetLocalCenterPoint()
+   */
+  inline const Vector2& GetLocalCenterPoint() const
+  {
+    return mLocalCenterPoint;
+  }
+
+private:
+
+  /**
+   * @brief Virtual destructor
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~RotationGesture() = default;
+
+private:
+  Radian mRotation;
+  Vector2 mScreenCenterPoint;
+  Vector2 mLocalCenterPoint;
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::RotationGesture& GetImplementation( Dali::RotationGesture& rotationGesture )
+{
+  DALI_ASSERT_ALWAYS( rotationGesture && "rotationGesture handle is empty" );
+
+  BaseObject& object = rotationGesture.GetBaseObject();
+
+  return static_cast< Internal::RotationGesture& >( object );
+}
+
+inline const Internal::RotationGesture& GetImplementation( const Dali::RotationGesture& rotationGesture )
+{
+  DALI_ASSERT_ALWAYS( rotationGesture && "rotationGesture handle is empty" );
+
+  const BaseObject& object = rotationGesture.GetBaseObject();
+
+  return static_cast< const Internal::RotationGesture& >( object );
+}
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_ROTATION_GESTURE_H
index 45a7719..9c6df9a 100644 (file)
@@ -31,6 +31,7 @@
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 #include <dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.h>
 #include <dali/internal/event/events/gesture-requests.h>
+#include <dali/internal/event/events/rotation-gesture/rotation-gesture-impl.h>
 
 namespace Dali
 {
@@ -56,17 +57,17 @@ void EmitRotationSignal(
     const RotationGestureEvent& rotationEvent,
     Vector2 localCenter)
 {
-  RotationGesture rotation(rotationEvent.state);
-  rotation.time = rotationEvent.time;
-  rotation.rotation = rotationEvent.rotation;
-  rotation.screenCenterPoint = rotationEvent.centerPoint;
-  rotation.localCenterPoint = localCenter;
+  Internal::RotationGesturePtr rotation( new Internal::RotationGesture(rotationEvent.state ) );
+  rotation->SetTime( rotationEvent.time );
+  rotation->SetRotation( rotationEvent.rotation );
+  rotation->SetScreenCenterPoint( rotationEvent.centerPoint );
+  rotation->SetLocalCenterPoint( localCenter );
 
   Dali::Actor actorHandle( actor );
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
   for ( GestureDetectorContainer::const_iterator iter = gestureDetectors.begin(); iter != endIter; ++iter )
   {
-    static_cast< RotationGestureDetector* >( *iter )->EmitRotationGestureSignal( actorHandle, rotation );
+    static_cast< RotationGestureDetector* >( *iter )->EmitRotationGestureSignal( actorHandle, Dali::RotationGesture( rotation.Get() ) );
   }
 }
 
@@ -101,7 +102,7 @@ struct IsNotAttachedFunctor
 } // unnamed namespace
 
 RotationGestureProcessor::RotationGestureProcessor()
-: GestureProcessor( Gesture::Rotation ),
+: GestureProcessor( GestureType::ROTATION ),
   mRotationGestureDetectors(),
   mCurrentRotationEmitters(),
   mCurrentRotationEvent( nullptr ),
@@ -114,7 +115,7 @@ void RotationGestureProcessor::Process( Scene& scene, const RotationGestureEvent
 {
   switch ( rotationEvent.state )
   {
-    case Gesture::Started:
+    case GestureState::STARTED:
     {
       // The rotation gesture should only be sent to the gesture detector which first received it so that
       // it can be told when the gesture ends as well.
@@ -136,9 +137,9 @@ void RotationGestureProcessor::Process( Scene& scene, const RotationGestureEvent
       break;
     }
 
-    case Gesture::Continuing:
-    case Gesture::Finished:
-    case Gesture::Cancelled:
+    case GestureState::CONTINUING:
+    case GestureState::FINISHED:
+    case GestureState::CANCELLED:
     {
       // Only send subsequent rotation gesture signals if we processed the rotation gesture when it started.
       // Check if actor is still touchable.
@@ -167,7 +168,7 @@ void RotationGestureProcessor::Process( Scene& scene, const RotationGestureEvent
           }
 
           // Clear current emitters if rotation gesture has ended or been cancelled.
-          if ( rotationEvent.state == Gesture::Finished || rotationEvent.state == Gesture::Cancelled )
+          if ( rotationEvent.state == GestureState::FINISHED || rotationEvent.state == GestureState::CANCELLED )
           {
             mCurrentRotationEmitters.clear();
             ResetActor();
@@ -182,8 +183,8 @@ void RotationGestureProcessor::Process( Scene& scene, const RotationGestureEvent
       break;
     }
 
-    case Gesture::Clear:
-    case Gesture::Possible:
+    case GestureState::CLEAR:
+    case GestureState::POSSIBLE:
     {
       // Nothing to do
       break;
index 2873612..6f85907 100644 (file)
@@ -22,7 +22,7 @@
 #include <cmath>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/internal/event/events/rotation-gesture/rotation-gesture-event.h>
@@ -55,9 +55,9 @@ inline Vector2 GetCenterPoint( const Integration::Point& point1, const Integrati
 } // unnamed namespace
 
 RotationGestureRecognizer::RotationGestureRecognizer( Observer& observer, uint32_t minimumTouchEvents, uint32_t minimumTouchEventsAfterStart )
-: GestureRecognizer( Gesture::Rotation ),
+: GestureRecognizer( GestureType::ROTATION ),
   mObserver( observer ),
-  mState( Clear ),
+  mState( CLEAR ),
   mTouchEvents(),
   mStartingAngle( 0.0f ),
   mMinimumTouchEvents( minimumTouchEvents ),
@@ -72,23 +72,23 @@ void RotationGestureRecognizer::SendEvent( const Integration::TouchEvent& event
 
   switch( mState )
   {
-    case Clear:
+    case CLEAR:
     {
       if( pointCount == 2 )
       {
         // Change state to possible as we have two touch points.
-        mState = Possible;
+        mState = POSSIBLE;
         mTouchEvents.push_back( event );
       }
       break;
     }
 
-    case Possible:
+    case POSSIBLE:
     {
       if ( pointCount != 2 )
       {
-        // We no longer have two touch points so change state back to Clear.
-        mState = Clear;
+        // We no longer have two touch points so change state back to CLEAR.
+        mState = CLEAR;
         mTouchEvents.clear();
       }
       else
@@ -98,8 +98,8 @@ void RotationGestureRecognizer::SendEvent( const Integration::TouchEvent& event
 
         if( currentPoint1.GetState() == PointState::UP || currentPoint2.GetState() == PointState::UP || currentPoint1.GetState() == PointState::INTERRUPTED )
         {
-          // One of our touch points has an Up event so change our state back to Clear.
-          mState = Clear;
+          // One of our touch points has an Up event so change our state back to CLEAR.
+          mState = CLEAR;
           mTouchEvents.clear();
         }
         else
@@ -117,17 +117,17 @@ void RotationGestureRecognizer::SendEvent( const Integration::TouchEvent& event
               mStartingAngle = GetAngle( mTouchEvents.begin()->points[0], mTouchEvents.begin()->points[1] );
 
               // Send rotation started
-              SendRotation( Gesture::Started, event );
+              SendRotation( GestureState::STARTED, event );
 
-              mState = Started;
+              mState = STARTED;
             }
 
             mTouchEvents.clear();
 
-            if( mState == Possible )
+            if( mState == POSSIBLE )
             {
               // No rotation, so restart detection
-              mState = Clear;
+              mState = CLEAR;
               mTouchEvents.clear();
             }
           }
@@ -136,22 +136,22 @@ void RotationGestureRecognizer::SendEvent( const Integration::TouchEvent& event
       break;
     }
 
-    case Started:
+    case STARTED:
     {
       if(event.points[0].GetState() == PointState::INTERRUPTED)
       {
         // System interruption occurred, rotation should be cancelled
         mTouchEvents.clear();
-        SendRotation(Gesture::Cancelled, event);
-        mState = Clear;
+        SendRotation(GestureState::CANCELLED, event);
+        mState = CLEAR;
         mTouchEvents.clear();
       }
       else if( pointCount != 2 )
       {
         // Send rotation finished event
-        SendRotation( Gesture::Finished, event );
+        SendRotation( GestureState::FINISHED, event );
 
-        mState = Clear;
+        mState = CLEAR;
         mTouchEvents.clear();
       }
       else
@@ -164,9 +164,9 @@ void RotationGestureRecognizer::SendEvent( const Integration::TouchEvent& event
         {
           mTouchEvents.push_back( event );
           // Send rotation finished event
-          SendRotation( Gesture::Finished, event );
+          SendRotation( GestureState::FINISHED, event );
 
-          mState = Clear;
+          mState = CLEAR;
           mTouchEvents.clear();
         }
         else
@@ -176,7 +176,7 @@ void RotationGestureRecognizer::SendEvent( const Integration::TouchEvent& event
           if( mTouchEvents.size() >= mMinimumTouchEventsAfterStart )
           {
             // Send rotation continuing
-            SendRotation( Gesture::Continuing, event );
+            SendRotation( GestureState::CONTINUING, event );
 
             mTouchEvents.clear();
           }
@@ -197,10 +197,9 @@ void RotationGestureRecognizer::SetMinimumTouchEventsAfterStart( uint32_t value
   mMinimumTouchEventsAfterStart = value;
 }
 
-void RotationGestureRecognizer::SendRotation( Gesture::State state, const Integration::TouchEvent& currentEvent )
+void RotationGestureRecognizer::SendRotation( GestureState state, const Integration::TouchEvent& currentEvent )
 {
   RotationGestureEvent gesture( state );
-
   if( !mTouchEvents.empty() )
   {
     // Assert if we have been holding TouchEvents that do not have 2 points
@@ -223,7 +222,7 @@ void RotationGestureRecognizer::SendRotation( Gesture::State state, const Integr
   else
   {
     // Something has gone wrong, just cancel the gesture.
-    gesture.state = Gesture::Cancelled;
+    gesture.state = GestureState::CANCELLED;
   }
 
   gesture.time = currentEvent.time;
index 0890f2c..a96d980 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_ROTATION_GESTURE_RECOGNIZER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -89,7 +89,7 @@ private:
    * @param[in]  state         The state of the rotation (whether it's starting, continuing or finished).
    * @param[in]  currentEvent  The latest touch event.
    */
-  void SendRotation( Gesture::State state, const Integration::TouchEvent& currentEvent );
+  void SendRotation( GestureState state, const Integration::TouchEvent& currentEvent );
 
 private:
 
@@ -101,9 +101,9 @@ private:
    */
   enum State
   {
-    Clear,    ///< No gesture detected.
-    Possible, ///< The current touch event data suggests that a gesture is possible.
-    Started,  ///< A gesture has been detected.
+    CLEAR,    ///< No gesture detected.
+    POSSIBLE, ///< The current touch event data suggests that a gesture is possible.
+    STARTED,  ///< A gesture has been detected.
   };
 
   State mState; ///< The current state of the detector.
index 93c4712..bdca9c6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -64,7 +64,7 @@ TapGestureDetectorPtr TapGestureDetector::New( unsigned int tapsRequired )
 }
 
 TapGestureDetector::TapGestureDetector()
-: GestureDetector( Gesture::Tap ),
+: GestureDetector( GestureType::TAP ),
   mMinimumTapsRequired( DEFAULT_TAPS_REQUIRED ),
   mMaximumTapsRequired( DEFAULT_TAPS_REQUIRED ),
   mTouchesRequired( DEFAULT_TOUCHES_REQUIRED )
@@ -72,7 +72,7 @@ TapGestureDetector::TapGestureDetector()
 }
 
 TapGestureDetector::TapGestureDetector( unsigned int tapsRequired )
-: GestureDetector( Gesture::Tap ),
+: GestureDetector( GestureType::TAP ),
   mMinimumTapsRequired( tapsRequired ),
   mMaximumTapsRequired( tapsRequired ),
   mTouchesRequired( DEFAULT_TOUCHES_REQUIRED )
@@ -137,7 +137,7 @@ unsigned int TapGestureDetector::GetTouchesRequired() const
   return mTouchesRequired;
 }
 
-void TapGestureDetector::EmitTapGestureSignal(Dali::Actor tappedActor, const TapGesture& tap)
+void TapGestureDetector::EmitTapGestureSignal(Dali::Actor tappedActor, const Dali::TapGesture& tap)
 {
   // Guard against destruction during signal emission
   Dali::TapGestureDetector handle( this );
index 5d368b2..77fa988 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TAP_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
 
 // INTERNAL INCLUDES
 #include <dali/public-api/events/tap-gesture-detector.h>
+#include <dali/public-api/events/tap-gesture.h>
 #include <dali/internal/event/events/gesture-detector-impl.h>
 
 namespace Dali
 {
 
-struct TapGesture;
-
 namespace Internal
 {
 
@@ -106,7 +105,7 @@ public:
    * @param[in]  tappedActor  The tapped actor.
    * @param[in]  tap          The tap gesture.
    */
-  void EmitTapGestureSignal(Dali::Actor tappedActor, const TapGesture& tap);
+  void EmitTapGestureSignal(Dali::Actor tappedActor, const Dali::TapGesture& tap);
 
 public: // Signals
 
index d9f5171..405a906 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -24,8 +24,8 @@ namespace Dali
 namespace Internal
 {
 
-TapGestureEvent::TapGestureEvent( Gesture::State state )
-: GestureEvent(Gesture::Tap, state),
+TapGestureEvent::TapGestureEvent( GestureState state )
+: GestureEvent(GestureType::TAP, state),
   numberOfTaps(1),
   numberOfTouches(1)
 {
index ee84e60..6576974 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_TAP_GESTURE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -33,12 +33,12 @@ namespace Internal
  * send it to the Core.
  *
  * A Tap Gesture event should be in one of three states:
- * - Possible:  When the user first puts their finger down - Core needs to hit test the down point so
+ * - POSSIBLE:  When the user first puts their finger down - Core needs to hit test the down point so
  *              that a tap (down and up quickly) is also on the same actor.
- * - Started:   If a tap is detected (No Finished state is expected).
- * - Cancelled: If, after a down event, no tap is detected, or a system interruption.
+ * - STARTED:   If a tap is detected (No FINISHED state is expected).
+ * - CANCELLED: If, after a down event, no tap is detected, or a system interruption.
  *
- * A Started state will be ignored if a Possible state does not precede it.
+ * A STARTED state will be ignored if a POSSIBLE state does not precede it.
  */
 struct TapGestureEvent : public GestureEvent
 {
@@ -46,11 +46,11 @@ struct TapGestureEvent : public GestureEvent
 
   /**
    * Default Constructor
-   * @param[in]  state  Possible, denotes down press;
-   *                    Started, of a tap occurs; and
-   *                    Cancelled, when tap does not occur.
+   * @param[in]  state  POSSIBLE, denotes down press;
+   *                    STARTED, of a tap occurs; and
+   *                    CANCELLED, when tap does not occur.
    */
-  TapGestureEvent( Gesture::State state );
+  TapGestureEvent( GestureState state );
 
   /**
    * Virtual destructor
diff --git a/dali/internal/event/events/tap-gesture/tap-gesture-impl.h b/dali/internal/event/events/tap-gesture/tap-gesture-impl.h
new file mode 100644 (file)
index 0000000..a317ca7
--- /dev/null
@@ -0,0 +1,164 @@
+#ifndef DALI_INTERNAL_TAP_GESTURE_H
+#define DALI_INTERNAL_TAP_GESTURE_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/events/tap-gesture.h>
+#include <dali/internal/event/events/gesture-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+class TapGesture;
+typedef IntrusivePtr< TapGesture > TapGesturePtr;
+
+/**
+ * @copydoc Dali::TapGesture
+ */
+class TapGesture final : public Gesture
+{
+public:
+
+  /**
+   * @brief Default constructor
+   */
+  TapGesture( GestureState state )
+  : Gesture(GestureType::TAP, state)
+  {
+  }
+
+  TapGesture(const TapGesture&) = delete; ///< Deleted copy constructor
+  TapGesture(TapGesture&&) = delete; ///< Deleted move constructor
+  TapGesture& operator=(const TapGesture&) = delete; ///< Deleted copy assignment operator
+  TapGesture& operator=(TapGesture&&) = delete; ///< Deleted move assignment operator
+
+  /**
+   * @brief The number of taps in this tap gesture.
+   * @param[in] numberOfTaps The number of taps to set.
+   */
+  inline void SetNumberOfTaps( uint32_t numberOfTaps )
+  {
+    mNumberOfTaps = numberOfTaps;
+  }
+
+  /**
+   * @copydoc Dali::TapGesture::GetNumberOfTaps()
+   */
+  inline uint32_t GetNumberOfTaps() const
+  {
+    return mNumberOfTaps;
+  }
+
+  /**
+   * @brief The number of touch points in this tap gesture, i.e. the number of fingers the user had on the screen to generate the tap gesture.
+   * @param[in] numberOfTouches The number of touch points in this tap gesture to set.
+   */
+  inline void SetNumberOfTouches( uint32_t numberOfTouches )
+  {
+    mNumberOfTouches = numberOfTouches;
+  }
+
+  /**
+   * @copydoc Dali::TapGesture::GetPointCount()
+   */
+  inline uint32_t GetNumberOfTouches() const
+  {
+    return mNumberOfTouches;
+  }
+
+  /**
+   * @brief This is the point, in screen coordinates, where the tap occurred.
+   * @param[in] screenPoint The point in screen coordinates to set.
+   */
+  inline void SetScreenPoint( const Vector2& screenPoint )
+  {
+    mScreenPoint = screenPoint;
+  }
+
+  /**
+   * @copydoc Dali::TapGesture::GetDeviceId()
+   */
+  inline const Vector2& GetScreenPoint() const
+  {
+    return mScreenPoint;
+  }
+
+  /**
+   * @brief This is the point, in local actor coordinates, where the tap occurred.
+   * @param[in] localPoint The point in local actor coordinates to set.
+   */
+  inline void SetLocalPoint( const Vector2& localPoint )
+  {
+    mLocalPoint = localPoint;
+  }
+
+  /**
+   * @copydoc Dali::TapGesture::GetGetState()
+   */
+  inline const Vector2& GetLocalPoint() const
+  {
+    return mLocalPoint;
+  }
+
+private:
+
+  /**
+   * @brief Virtual destructor
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~TapGesture() = default;
+
+private:
+  Vector2 mScreenPoint;
+  Vector2 mLocalPoint;
+  uint32_t mNumberOfTaps{1u};
+  uint32_t mNumberOfTouches{1u};
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::TapGesture& GetImplementation( Dali::TapGesture& tapGesture )
+{
+  DALI_ASSERT_ALWAYS( tapGesture && "TapGesture handle is empty" );
+
+  BaseObject& object = tapGesture.GetBaseObject();
+
+  return static_cast< Internal::TapGesture& >( object );
+}
+
+inline const Internal::TapGesture& GetImplementation( const Dali::TapGesture& tapGesture )
+{
+  DALI_ASSERT_ALWAYS( tapGesture && "TapGesture handle is empty" );
+
+  const BaseObject& object = tapGesture.GetBaseObject();
+
+  return static_cast< const Internal::TapGesture& >( object );
+}
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_TAP_GESTURE_H
index cf74b6f..13a1427 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -31,6 +31,7 @@
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 #include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/events/tap-gesture/tap-gesture-recognizer.h>
+#include <dali/internal/event/events/tap-gesture/tap-gesture-impl.h>
 #include <dali/internal/event/events/gesture-requests.h>
 #include <dali/internal/event/events/tap-gesture/tap-gesture-event.h>
 
@@ -56,25 +57,25 @@ void EmitTapSignal(
   const TapGestureEvent& tapEvent,
   Vector2 localPoint)
 {
-  TapGesture tap;
-  tap.time = tapEvent.time;
-  tap.numberOfTaps = tapEvent.numberOfTaps;
-  tap.numberOfTouches = tapEvent.numberOfTouches;
-  tap.screenPoint = tapEvent.point;
-  tap.localPoint = localPoint;
+  Internal::TapGesturePtr tap( new Internal::TapGesture(tapEvent.state) );
+  tap->SetTime( tapEvent.time );
+  tap->SetNumberOfTaps(tapEvent.numberOfTaps);
+  tap->SetNumberOfTouches(tapEvent.numberOfTouches);
+  tap->SetScreenPoint(tapEvent.point);
+  tap->SetLocalPoint(localPoint);
 
   Dali::Actor actorHandle( actor );
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
   for ( GestureDetectorContainer::const_iterator iter = gestureDetectors.begin(); iter != endIter; ++iter )
   {
-    static_cast< TapGestureDetector* >( *iter )->EmitTapGestureSignal( actorHandle, tap );
+    static_cast< TapGestureDetector* >( *iter )->EmitTapGestureSignal( actorHandle, Dali::TapGesture( tap.Get() ) );
   }
 }
 
 } // unnamed namespace
 
 TapGestureProcessor::TapGestureProcessor()
-: GestureProcessor( Gesture::Tap ),
+: GestureProcessor( GestureType::TAP ),
   mTapGestureDetectors(),
   mMinTapsRequired( 1 ),
   mMaxTapsRequired( 1 ),
@@ -93,7 +94,7 @@ void TapGestureProcessor::Process( Scene& scene, const TapGestureEvent& tapEvent
 {
   switch ( tapEvent.state )
   {
-    case Gesture::Possible:
+    case GestureState::POSSIBLE:
     {
       // Do a hit test and if an actor has been hit then save to see if tap event is still valid on a tap( same actor being hit )
       HitTestAlgorithm::Results hitTestResults;
@@ -112,7 +113,7 @@ void TapGestureProcessor::Process( Scene& scene, const TapGestureEvent& tapEvent
       break;
     }
 
-    case Gesture::Started:
+    case GestureState::STARTED:
     {
       // Ensure that we're processing a hit on the current actor and that we've already processed a touch down
       HitTestAlgorithm::Results hitTestResults;
@@ -130,26 +131,26 @@ void TapGestureProcessor::Process( Scene& scene, const TapGestureEvent& tapEvent
       break;
     }
 
-    case Gesture::Cancelled:
+    case GestureState::CANCELLED:
     {
       mPossibleProcessed = false;
       ResetActor();
       break;
     }
 
-    case Gesture::Continuing:
+    case GestureState::CONTINUING:
     {
-      DALI_ABORT( "Incorrect state received from Integration layer: Continuing\n" );
+      DALI_ABORT( "Incorrect state received from Integration layer: CONTINUING\n" );
       break;
     }
-    case Gesture::Finished:
+    case GestureState::FINISHED:
     {
-      DALI_ABORT( "Incorrect state received from Integration layer: Finished\n" );
+      DALI_ABORT( "Incorrect state received from Integration layer: FINISHED\n" );
       break;
     }
-    case Gesture::Clear:
+    case GestureState::CLEAR:
     {
-      DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
+      DALI_ABORT( "Incorrect state received from Integration layer: CLEAR\n" );
       break;
     }
   }
index c8707dc..5daa963 100644 (file)
@@ -43,9 +43,9 @@ const unsigned long MAXIMUM_TIME_ALLOWED = 500u;
 } // unnamed namespace
 
 TapGestureRecognizer::TapGestureRecognizer( Observer& observer, Vector2 screenSize, const TapGestureRequest& request)
-: GestureRecognizer( screenSize, Gesture::Tap ),
+: GestureRecognizer( screenSize, GestureType::TAP ),
   mObserver(observer),
-  mState(Clear),
+  mState(CLEAR),
   mMinimumTapsRequired(request.minTaps),
   mMaximumTapsRequired(request.maxTaps),
   mTapsRegistered(0),
@@ -70,7 +70,7 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
 
     switch (mState)
     {
-      case Clear:
+      case CLEAR:
       {
         if (pointState == PointState::DOWN)
         {
@@ -79,7 +79,7 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
         break;
       }
 
-      case Touched:
+      case TOUCHED:
       {
         uint32_t deltaBetweenTouchDownTouchUp = event.time - mTouchTime;
 
@@ -89,21 +89,21 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
           {
             mLastTapTime = mTouchTime;
             EmitSingleTap( event.time, point );
-            mState = Registered;
+            mState = REGISTERED;
           }
           else
           {
-            mState = Clear;
+            mState = CLEAR;
           }
         }
         else if (pointState == PointState::INTERRUPTED)
         {
-          mState = Clear;
+          mState = CLEAR;
         }
         break;
       }
 
-      case Registered:
+      case REGISTERED:
       {
         if ( pointState == PointState::UP )
         {
@@ -117,18 +117,18 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
             {
               mLastTapTime = event.time;
               EmitSingleTap(event.time, point);
-              mState = Registered;
+              mState = REGISTERED;
             }
             else
             {
               ++mTapsRegistered;
-              EmitGesture( Gesture::Started, event.time );
-              mState = Clear;
+              EmitGesture( GestureState::STARTED, event.time );
+              mState = CLEAR;
             }
           }
-          else // Delta between touch down and touch up too long to be considered a Tap event
+          else // Delta between touch down and touch up too long to be considered a TAP event
           {
-            mState = Clear;
+            mState = CLEAR;
           }
         }
         else if (pointState == PointState::DOWN)
@@ -153,20 +153,20 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
         break;
       }
 
-      case Failed:
+      case FAILED:
       default:
       {
-        mState = Clear;
+        mState = CLEAR;
         break;
       }
     }
   }
   else
   {
-    mState = Failed;
+    mState = FAILED;
 
     // We have entered a multi-touch event so emit registered gestures if required.
-    EmitGesture(Gesture::Started, event.time);
+    EmitGesture(GestureState::STARTED, event.time);
   }
 }
 
@@ -176,13 +176,13 @@ void TapGestureRecognizer::SetupForTouchDown( const Integration::TouchEvent& eve
   mTouchTime = event.time;
   mLastTapTime = 0u;
   mTapsRegistered = 0;
-  mState = Touched;
+  mState = TOUCHED;
   EmitPossibleState( event );
 }
 
 void TapGestureRecognizer::EmitPossibleState( const Integration::TouchEvent& event )
 {
-  TapGestureEvent tapEvent( Gesture::Possible );
+  TapGestureEvent tapEvent( GestureState::POSSIBLE );
   tapEvent.point = mTouchPosition;
   tapEvent.time = event.time;
 
@@ -198,9 +198,9 @@ void TapGestureRecognizer::Update(const GestureRequest& request)
   mMaximumTapsRequired = tap.maxTaps;
 }
 
-void TapGestureRecognizer::EmitGesture( Gesture::State state, uint32_t time )
+void TapGestureRecognizer::EmitGesture( GestureState state, uint32_t time )
 {
-  if ( (state == Gesture::Cancelled) ||
+  if ( (state == GestureState::CANCELLED) ||
        (mTapsRegistered >= mMinimumTapsRequired && mTapsRegistered <= mMaximumTapsRequired) )
 
   {
@@ -211,7 +211,7 @@ void TapGestureRecognizer::EmitGesture( Gesture::State state, uint32_t time )
 
 void TapGestureRecognizer::EmitSingleTap( uint32_t time, const Integration::Point& point )
 {
-  TapGestureEvent event( Gesture::Started );
+  TapGestureEvent event( GestureState::STARTED );
   const Vector2& screen( point.GetScreenPosition() );
   Vector2 distanceDelta(std::abs(mTouchPosition.x - screen.x),
                         std::abs(mTouchPosition.y - screen.y));
@@ -219,7 +219,7 @@ void TapGestureRecognizer::EmitSingleTap( uint32_t time, const Integration::Poin
   if (distanceDelta.x > MAXIMUM_MOTION_ALLOWED ||
       distanceDelta.y > MAXIMUM_MOTION_ALLOWED )
   {
-    event.state = Gesture::Cancelled;
+    event.state = GestureState::CANCELLED;
   }
   mTapsRegistered = 1u;
   EmitTap( time, event );
index be4a002..c277c6d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_EVENTS_TAP_GESTURE_RECOGNIZER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -82,7 +82,7 @@ private:
    * @param[in] state current state of incomplete gesture
    * @param[in] time time of this latest touch event
    */
-  void EmitGesture( Gesture::State state, uint32_t time );
+  void EmitGesture( GestureState state, uint32_t time );
 
   /**
    * Initialises tap gesture detector for next tap sequence
@@ -132,10 +132,10 @@ private:
    */
   enum State
   {
-    Clear,      ///< No gesture detected.
-    Touched,    ///< User is touching the screen.
-    Registered, ///< At least one tap has been registered.
-    Failed,     ///< Gesture has failed.
+    CLEAR,      ///< No gesture detected.
+    TOUCHED,    ///< User is touching the screen.
+    REGISTERED, ///< At least one tap has been registered.
+    FAILED,     ///< Gesture has failed.
   };
 
   State mState; ///< Current state of the detector.
index 12e21bf..d7bfe4c 100644 (file)
@@ -27,18 +27,6 @@ namespace Dali
 namespace Internal
 {
 
-TouchEvent::TouchEvent()
-: mPoints(),
-  mTime( 0 )
-{
-}
-
-TouchEvent::TouchEvent( unsigned long time )
-: mPoints(),
-  mTime( time )
-{
-}
-
 TouchEventPtr TouchEvent::Clone( const TouchEvent& other )
 {
   TouchEventPtr touchEvent( new TouchEvent );
@@ -47,20 +35,6 @@ TouchEventPtr TouchEvent::Clone( const TouchEvent& other )
   return touchEvent;
 }
 
-TouchEvent::~TouchEvent()
-{
-}
-
-unsigned long TouchEvent::GetTime() const
-{
-  return mTime;
-}
-
-std::size_t TouchEvent::GetPointCount() const
-{
-  return mPoints.size();
-}
-
 int32_t TouchEvent::GetDeviceId( std::size_t point ) const
 {
   if( point < mPoints.size() )
@@ -154,11 +128,6 @@ Integration::Point& TouchEvent::GetPoint( std::size_t point )
   return mPoints[ point ];
 }
 
-void TouchEvent::AddPoint( const Integration::Point& point )
-{
-  mPoints.push_back( point );
-}
-
 Device::Class::Type TouchEvent::GetDeviceClass( std::size_t point ) const
 {
   if( point < mPoints.size() )
@@ -186,6 +155,11 @@ MouseButton::Type TouchEvent::GetMouseButton( std::size_t point ) const
   return MouseButton::INVALID;
 }
 
+void TouchEvent::AddPoint( const Integration::Point& point )
+{
+  mPoints.push_back( point );
+}
+
 } // namsespace Internal
 
 } // namespace Dali
index 3018763..01bdb7c 100644 (file)
@@ -49,13 +49,16 @@ public:
   /**
    * @brief Default constructor
    */
-  TouchEvent();
+  TouchEvent() = default;
 
   /**
    * @brief Constructor
    * @param[in]  time  The time the event occurred
    */
-  TouchEvent( unsigned long time );
+  TouchEvent( unsigned long time )
+  : mTime( time )
+  {
+  }
 
   /**
    * @brief Clones the TouchEvent object.
@@ -66,22 +69,28 @@ public:
    */
   static TouchEventPtr Clone( const TouchEvent& other );
 
-  /**
-   * @brief Destructor
-   */
-  ~TouchEvent();
+  TouchEvent( const TouchEvent& other ) = delete; ///< Deleted copy constructor.
+  TouchEvent( TouchEvent&& other ) = delete; ///< Deleted move constructor.
+  TouchEvent& operator=( const TouchEvent& other ) = delete; ///< Deleted copy assignment operator.
+  TouchEvent& operator=( TouchEvent&& other ) = delete; ///< Deleted move assignment operator.
 
   // Getters
 
   /**
    * @copydoc Dali::TouchEvent::GetTime()
    */
-  unsigned long GetTime() const;
+  inline unsigned long GetTime() const
+  {
+    return mTime;
+  }
 
   /**
    * @copydoc Dali::TouchEvent::GetPointCount()
    */
-  std::size_t GetPointCount() const;
+  inline std::size_t GetPointCount() const
+  {
+    return mPoints.size();
+  }
 
   /**
    * @copydoc Dali::TouchEvent::GetDeviceId()
@@ -150,14 +159,6 @@ public:
    */
   Integration::Point& GetPoint( std::size_t point );
 
-  // Setters
-
-  /**
-   * @brief Adds a point to this touch event handler.
-   * @param[in]  point  The point to add to the touch event handler.
-   */
-  void AddPoint( const Integration::Point& point );
-
   /**
    * @brief Get the device class the mouse/touch event originated from
    *
@@ -179,19 +180,27 @@ public:
    */
   MouseButton::Type GetMouseButton( std::size_t point ) const;
 
+  // Setters
 
-private:
+  /**
+   * @brief Adds a point to this touch event handler.
+   * @param[in]  point  The point to add to the touch event handler.
+   */
+  void AddPoint( const Integration::Point& point );
 
-  /// Undefined Copy constructor
-  TouchEvent( const TouchEvent& other );
+private:
 
-  /// Undefined
-  TouchEvent& operator=( const TouchEvent& other );
+  /**
+   * @brief Virtual Destructor
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~TouchEvent() = default;
 
 private:
 
   std::vector< Integration::Point > mPoints; ///< Container of the points for this touch event.
-  unsigned long mTime; ///< The time (in ms) that the touch event occurred.
+  unsigned long mTime{0u}; ///< The time (in ms) that the touch event occurred.
 };
 
 } // namespace Internal
index 2508796..6cc3d62 100755 (executable)
@@ -51,10 +51,6 @@ WheelEvent::WheelEvent( Dali::WheelEvent::Type type, int32_t direction, uint32_t
 {
 }
 
-WheelEvent::~WheelEvent()
-{
-}
-
 WheelEventPtr WheelEvent::New( Dali::WheelEvent::Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t delta, uint32_t timeStamp )
 {
   WheelEventPtr wheelEvent = new WheelEvent( type, direction, modifiers, point, delta, timeStamp );
index 91c8152..17fcb35 100755 (executable)
@@ -58,11 +58,6 @@ public:
   WheelEvent( Dali::WheelEvent::Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t delta, uint32_t timeStamp );
 
   /**
-   * @brief Destructor
-   */
-  ~WheelEvent();
-
-  /**
    * Create a new WheelEvent.
    *
    * @param[in] type      The type of the wheel event
@@ -124,6 +119,13 @@ public:
 
 private:
 
+  /**
+   * @brief Destructor
+   *
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~WheelEvent() = default;
+
   // Not copyable or movable
 
   WheelEvent( const WheelEvent& rhs ) = delete;             ///< Deleted copy constructor
index 19149b3..ef12cb7 100644 (file)
@@ -89,7 +89,7 @@ public:
         mFunc->Apply( updateBufferIndex, current );
 
         // Optionally bake the final value
-        if ( Dali::Constraint::Bake == mRemoveAction )
+        if ( Dali::Constraint::BAKE == mRemoveAction )
         {
           mTargetProperty.Bake( updateBufferIndex, current );
         }
index 57a78eb..d2d32f3 100644 (file)
@@ -62,7 +62,7 @@ PropertyNotification::PropertyNotification(Object& object,
   mConditionType(condition),
   mArguments(arguments),
   mValid(false),
-  mNotifyMode( Dali::PropertyNotification::Disabled ),
+  mNotifyMode( Dali::PropertyNotification::DISABLED ),
   mConditionFunction(NULL)
 {
   SetNotifyMode(notifyMode);
@@ -163,22 +163,22 @@ bool PropertyNotification::Check( BufferIndex bufferIndex )
     //  means don't notify so notifyRequired stays false
     switch( mNotifyMode )
     {
-      case Dali::PropertyNotification::Disabled:
+      case Dali::PropertyNotification::DISABLED:
       {
         // notify never, already initialized to false
         break;
       }
-      case Dali::PropertyNotification::NotifyOnTrue:
+      case Dali::PropertyNotification::NOTIFY_ON_TRUE:
       {
         notifyRequired = mValid; // notify if value is true
         break;
       }
-      case Dali::PropertyNotification::NotifyOnFalse:
+      case Dali::PropertyNotification::NOTIFY_ON_FALSE:
       {
         notifyRequired = !mValid; // notify when its false
         break;
       }
-      case Dali::PropertyNotification::NotifyOnChanged:
+      case Dali::PropertyNotification::NOTIFY_ON_CHANGED:
       {
         notifyRequired = true; // notify whenever changed
         break;
index 1b01aa2..72664a4 100644 (file)
@@ -21,6 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/events/gesture-enumerations.h>
 
 namespace Dali
 {
@@ -32,7 +33,7 @@ struct PanGestureProfiling
 {
   struct Position
   {
-    Position( unsigned int time, Vector2 position, Vector2 displacement, Vector2 velocity, int state )
+    Position( unsigned int time, Vector2 position, Vector2 displacement, Vector2 velocity, GestureState state )
     : time( time ), position( position ), displacement( displacement ), velocity( velocity ), state( state )
     {
     }
@@ -41,7 +42,7 @@ struct PanGestureProfiling
     Vector2 position;
     Vector2 displacement;
     Vector2 velocity;
-    int state;
+    GestureState state;
   };
 
   typedef std::vector< PanGestureProfiling::Position > PanPositionContainer;
index 217b78a..f689501 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * 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.
@@ -86,7 +86,7 @@ PanGesture::~PanGesture()
   delete mProfiling;
 }
 
-void PanGesture::AddGesture( const Dali::PanGesture& gesture )
+void PanGesture::AddGesture( const Internal::PanGesture& gesture )
 {
   Dali::Mutex::ScopedLock lock( mMutex );
   mGestures[ mWritePosition ] = gesture;
@@ -267,13 +267,13 @@ bool PanGesture::ReadGestures( FrameGestureInfo& info, unsigned int currentTimes
 
     // add event to history
     mPanHistory.push_back( currentGesture );
-    if( currentGesture.state == Gesture::Started )
+    if( currentGesture.state == GestureState::STARTED )
     {
       info.justStarted = true;
       // clear just finished as we have started new pan
       info.justFinished = false;
     }
-    info.justFinished |= ( currentGesture.state == Gesture::Finished || currentGesture.state == Gesture::Cancelled );
+    info.justFinished |= ( currentGesture.state == GestureState::FINISHED || currentGesture.state == GestureState::CANCELLED );
 
     // Update our read position.
     previousReadPosition = mReadPosition;
@@ -304,7 +304,7 @@ bool PanGesture::ReadAndResampleGestures( FrameGestureInfo& info, unsigned int c
     info.frameGesture.screen.velocity += lastReadGesture.screen.velocity;
     info.frameGesture.local.velocity += lastReadGesture.local.velocity;
 
-    if( lastReadGesture.state == Gesture::Started )
+    if( lastReadGesture.state == GestureState::STARTED )
     {
       // Clear just finished as we have started new pan.
       info.justFinished = false;
@@ -312,7 +312,7 @@ bool PanGesture::ReadAndResampleGestures( FrameGestureInfo& info, unsigned int c
     }
     else
     {
-      info.justFinished |= ( lastReadGesture.state == Gesture::Finished || lastReadGesture.state == Gesture::Cancelled );
+      info.justFinished |= ( lastReadGesture.state == GestureState::FINISHED || lastReadGesture.state == GestureState::CANCELLED );
     }
 
     // Add event to history
@@ -759,7 +759,7 @@ bool PanGesture::InputRateConversion( PanInfo& rateConvertedGesture, unsigned in
           readGesture.screen.displacement, readGesture.screen.velocity, readGesture.state ) );
     }
 
-    if( readGesture.state == Gesture::Started )
+    if( readGesture.state == GestureState::STARTED )
     {
       // Clear pan data.
       mPanHistory.clear();
@@ -792,7 +792,7 @@ bool PanGesture::InputRateConversion( PanInfo& rateConvertedGesture, unsigned in
     }
     else
     {
-      justFinished |= ( readGesture.state == Gesture::Finished || readGesture.state == Gesture::Cancelled );
+      justFinished |= ( readGesture.state == GestureState::FINISHED || readGesture.state == GestureState::CANCELLED );
     }
 
     rateConvertedGesture.screen.position += readGesture.screen.position;
index 70ebdfb..c2a2d69 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
 // INTERNAL INCLUDES
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/events/pan-gesture.h>
+#include <dali/internal/event/events/pan-gesture/pan-gesture-impl.h>
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/gestures/gesture-properties.h>
 
 namespace Dali
 {
 
-struct PanGesture;
+class PanGesture;
 
 namespace Internal
 {
@@ -118,7 +118,7 @@ public:
      */
     PanInfo()
     : time( 0u ),
-      state( Gesture::Clear ),
+      state( GestureState::CLEAR ),
       read( true )
     {
     }
@@ -156,25 +156,25 @@ public:
      * Assignment operator
      * @param[in] gesture A Dali::Gesture
      */
-    PanInfo& operator=( const Dali::PanGesture& rhs )
+    PanInfo& operator=( const Internal::PanGesture& rhs )
     {
-      time = rhs.time;
-      state = rhs.state;
+      time = rhs.GetTime();
+      state = rhs.GetState();
 
-      local.velocity = rhs.velocity;
-      local.displacement = rhs.displacement;
-      local.position = rhs.position;
+      local.velocity = rhs.GetVelocity();
+      local.displacement = rhs.GetDisplacement();
+      local.position = rhs.GetPosition();
 
-      screen.velocity = rhs.screenVelocity;
-      screen.displacement = rhs.screenDisplacement;
-      screen.position = rhs.screenPosition;
+      screen.velocity = rhs.GetScreenVelocity();
+      screen.displacement = rhs.GetScreenDisplacement();
+      screen.position = rhs.GetScreenPosition();
 
       return *this;
     }
 
     // Data
     unsigned int time;
-    Gesture::State state;
+    GestureState state;
     Info local;
     Info screen;
     volatile bool read;
@@ -203,7 +203,7 @@ public:
    * Adds a PanGesture to the internal circular-buffer waiting to be handled by UpdateProperties.
    * @param[in]  gesture  The latest pan gesture.
    */
-  void AddGesture( const Dali::PanGesture& gesture );
+  void AddGesture( const Internal::PanGesture& gesture );
 
   /**
    * @brief Removes pan events from the history that are older than maxAge, leaving at least minEvents
@@ -561,7 +561,7 @@ private:
   volatile unsigned int mWritePosition;       ///< The next PanInfo buffer to write to. (starts at 0).
   unsigned int mReadPosition;                 ///< The next PanInfo buffer to read. (starts at 0).
   bool mNotAtTarget;                          ///< Keeps track of if the last gesture used was the most recent received.
-  bool mInGesture;                            ///< True if the gesture is currently being handled i.e. between Started <-> Finished/Cancelled.
+  bool mInGesture;                            ///< True if the gesture is currently being handled i.e. between STARTED <-> FINISHED/CANCELLED.
   bool mPredictionAmountOverridden;
   bool mSmoothingAmountOverridden;
 
index b0a3787..2a7ce73 100644 (file)
@@ -174,7 +174,7 @@ struct UpdateManager::Impl
     renderManager( renderManager ),
     renderQueue( renderQueue ),
     renderTaskProcessor( renderTaskProcessor ),
-    backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
+    backgroundColor( Dali::DEFAULT_BACKGROUND_COLOR ),
     renderers(),
     textureSets(),
     shaders(),
index bdec7c3..b3e8cf7 100644 (file)
@@ -202,9 +202,9 @@ float Actor::GetRelayoutSize( Dimension::Type dimension ) const
   return GetImplementation(*this).GetRelayoutSize( dimension );
 }
 
-Actor::TouchEventSignalType& Actor::TouchSignal()
+Actor::TouchEventSignalType& Actor::TouchedSignal()
 {
-  return GetImplementation( *this ).TouchSignal();
+  return GetImplementation( *this ).TouchedSignal();
 }
 
 Actor::HoverSignalType& Actor::HoveredSignal()
index d556600..7970256 100644 (file)
@@ -65,7 +65,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 +220,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,7 +730,7 @@ public:
 
   // Typedefs
 
-  typedef Signal< bool (Actor, const TouchEvent&) >  TouchEventSignalType;    ///< Touch signal type @SINCE_1_1.37
+  typedef Signal< bool (Actor, const TouchEvent&) > TouchEventSignalType;   ///< 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
   typedef Signal< void (Actor) > OnSceneSignalType;                         ///< Scene connection signal type @SINCE_1_9.24
@@ -1170,11 +1170,11 @@ public: // Signals
    * The return value of True, indicates that the touch event has been consumed.
    * Otherwise the signal will be emitted on the next sensitive parent of the actor.
    * A true return will also cancel any ongoing gestures.
-   * @SINCE_1_1.37
+   * @SINCE_1_9.28
    * @return The signal to connect to
    * @pre The Actor has been initialized.
    */
-  TouchEventSignalType& TouchSignal();
+  TouchEventSignalType& TouchedSignal();
 
   /**
    * @brief This signal is emitted when hover input is received.
index 5170eba..19f03e9 100644 (file)
@@ -30,7 +30,7 @@ CustomActor CustomActorImpl::Self() const
   return CustomActor(mOwner);
 }
 
-void CustomActorImpl::OnPropertySet( Property::Index index, Property::Value propertyValue )
+void CustomActorImpl::OnPropertySet( Property::Index index, const Property::Value& propertyValue )
 {
 }
 
@@ -56,21 +56,6 @@ Internal::CustomActor* CustomActorImpl::GetOwner() const
   return mOwner;
 }
 
-bool CustomActorImpl::RequiresTouchEvents() const
-{
-  return ( mFlags & REQUIRES_TOUCH_EVENTS );
-}
-
-bool CustomActorImpl::RequiresHoverEvents() const
-{
-  return ( mFlags & REQUIRES_HOVER_EVENTS );
-}
-
-bool CustomActorImpl::RequiresWheelEvents() const
-{
-  return ( mFlags & REQUIRES_WHEEL_EVENTS );
-}
-
 bool CustomActorImpl::IsRelayoutEnabled() const
 {
   return ( mFlags & DISABLE_SIZE_NEGOTIATION ) == 0;
index 4714bc2..9a978bc 100644 (file)
@@ -155,7 +155,7 @@ public:
    * @param[in] index The Property index that was set
    * @param[in] propertyValue The value to set
    */
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue );
+  virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue );
 
   /**
    * @brief Called when the owning actor's size is set e.g. using Actor::SetSize().
@@ -175,35 +175,6 @@ public:
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize) = 0;
 
   /**
-   * @brief Called after a hover-event is received by the owning actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] event The hover event
-   * @return True if the event should be consumed
-   * @note CustomActorImpl::REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ).
-   */
-  virtual bool OnHoverEvent(const HoverEvent& event) = 0;
-
-  /**
-   * @brief Called after a key-event is received by the actor that has had its focus set.
-   *
-   * @SINCE_1_0.0
-   * @param[in] event The Key Event
-   * @return True if the event should be consumed
-   */
-  virtual bool OnKeyEvent(const KeyEvent& event) = 0;
-
-  /**
-   * @brief Called after a wheel-event is received by the owning actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] event The wheel event
-   * @return True if the event should be consumed
-   * @note CustomActorImpl::REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ).
-   */
-  virtual bool OnWheelEvent(const WheelEvent& event) = 0;
-
-  /**
    * @brief Called after the size negotiation has been finished for this control.
    *
    * The control is expected to assign this given size to itself/its children.
@@ -319,9 +290,6 @@ protected: // For derived classes
   {
     ACTOR_BEHAVIOUR_DEFAULT       = 0,          ///< Use to provide default behaviour (size negotiation is on, event callbacks are not called). @SINCE_1_2_10
     DISABLE_SIZE_NEGOTIATION      = 1 << 0,     ///< True if control does not need size negotiation, i.e. it can be skipped in the algorithm @SINCE_1_0.0
-    REQUIRES_TOUCH_EVENTS         = 1 << 1,     ///< True if the OnTouchEvent() callback is required. @SINCE_1_0.0
-    REQUIRES_HOVER_EVENTS         = 1 << 2,     ///< True if the OnHoverEvent() callback is required. @SINCE_1_0.0
-    REQUIRES_WHEEL_EVENTS   = 1 << 3,     ///< True if the OnWheelEvent() callback is required. @SINCE_1_0.0
 
     LAST_ACTOR_FLAG                             ///< Special marker for last actor flag @SINCE_1_0.0
   };
@@ -408,30 +376,6 @@ public: // Not intended for application developers
   Internal::CustomActor* GetOwner() const;
 
   /**
-   * @brief Returns whether the OnTouchEvent() callback is required.
-   * @SINCE_1_0.0
-   * @return True if the OnTouchEvent() callback is required
-   * @note Called when ownership of the CustomActorImpl is passed to a CustomActor.
-   */
-  bool RequiresTouchEvents() const;
-
-  /**
-   * @brief Returns whether the OnHoverEvent() callback is required.
-   * @SINCE_1_0.0
-   * @return True if the OnHoverEvent() callback is required
-   * @note Called when ownership of the CustomActorImpl is passed to a CustomActor.
-   */
-  bool RequiresHoverEvents() const;
-
-  /**
-   * @brief Returns whether the OnWheelEvent() callback is required.
-   * @SINCE_1_0.0
-   * @return True if the OnWheelEvent() callback is required
-   * @note Called when ownership of the CustomActorImpl is passed to a CustomActor.
-   */
-  bool RequiresWheelEvents() const;
-
-  /**
    * @brief Returns whether relayout is enabled.
    * @SINCE_1_0.0
    * @return Return true if relayout is enabled on the custom actor
@@ -442,7 +386,7 @@ public: // Not intended for application developers
 private:
 
   Internal::CustomActor* mOwner;        ///< Internal owner of this custom actor implementation
-  ActorFlags mFlags :ACTOR_FLAG_COUNT;  ///< ActorFlags flags to determine behaviour
+  ActorFlags mFlags;  ///< ActorFlags flags to determine behaviour
 };
 
 /**
index 1302ab7..8c2648d 100644 (file)
@@ -38,7 +38,7 @@ Internal::PropertyConstraint< P >* CreatePropertyConstraint( CallbackBase* func
 
 } // unnamed namespace
 
-const Constraint::RemoveAction Constraint::DEFAULT_REMOVE_ACTION  = Constraint::Bake;
+const Constraint::RemoveAction Constraint::DEFAULT_REMOVE_ACTION = Constraint::BAKE;
 
 Constraint::Constraint()
 {
index 57c0aa3..8dc25ea 100644 (file)
@@ -276,11 +276,11 @@ public:
    */
   enum RemoveAction
   {
-    Bake,   ///< When the constraint is fully-applied, the constrained value is saved. @SINCE_1_0.0
-    Discard ///< When the constraint is removed, the constrained value is discarded. @SINCE_1_0.0
+    BAKE,   ///< When the constraint is fully-applied, the constrained value is saved. @SINCE_1_9.28
+    DISCARD ///< When the constraint is removed, the constrained value is discarded. @SINCE_1_9.28
   };
 
-  static const RemoveAction  DEFAULT_REMOVE_ACTION;  ///< Bake
+  static const RemoveAction  DEFAULT_REMOVE_ACTION;  ///< BAKE
 
   /**
    * @brief Creates an uninitialized Constraint; this can be initialized with Constraint::New().
@@ -489,10 +489,10 @@ public:
   Dali::Property::Index GetTargetProperty();
 
   /**
-   * @brief Sets the remove action. Constraint::Bake will "bake" a value when fully-applied.
+   * @brief Sets the remove action. Constraint::BAKE will "bake" a value when fully-applied.
    *
-   * In case of Constraint::Discard, the constrained value will be discarded, when the constraint is removed.
-   * The default value is Constraint::Bake.
+   * In case of Constraint::DISCARD, the constrained value will be discarded, when the constraint is removed.
+   * The default value is Constraint::BAKE.
    * @SINCE_1_0.0
    * @param[in] action The remove-action
    */
index f2a7007..d8e7515 100644 (file)
@@ -126,6 +126,10 @@ static constexpr float ONE80_OVER_PI = 180.0f/Dali::Math::PI; ///< Constant used
 
 } // namespace Math
 
+// background colors
+static constexpr Vector4 DEFAULT_BACKGROUND_COLOR = Color::BLACK;
+static constexpr Vector4 DEBUG_BACKGROUND_COLOR(0.2f, 0.5f, 0.2f, 1.0f); ///< Dark green, useful for debugging visuals (texture / shader issues / culling etc.).
+
 /**
  * @}
  */
index 9cee3fd..0898bec 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const uint32_t CORE_MAJOR_VERSION = 1;
 const uint32_t CORE_MINOR_VERSION = 9;
-const uint32_t CORE_MICRO_VERSION = 27;
+const uint32_t CORE_MICRO_VERSION = 28;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index a53cb12..7e97f2d 100644 (file)
@@ -45,6 +45,7 @@
 #include <dali/public-api/common/vector-wrapper.h>
 
 #include <dali/public-api/events/gesture-detector.h>
+#include <dali/public-api/events/gesture-enumerations.h>
 #include <dali/public-api/events/gesture.h>
 #include <dali/public-api/events/hover-event.h>
 #include <dali/public-api/events/key-event.h>
@@ -61,7 +62,6 @@
 #include <dali/public-api/events/tap-gesture-detector.h>
 #include <dali/public-api/events/tap-gesture.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>
 #include <dali/public-api/images/pixel.h>
diff --git a/dali/public-api/events/gesture-enumerations.h b/dali/public-api/events/gesture-enumerations.h
new file mode 100644 (file)
index 0000000..4d30123
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef DALI_GESTURE_ENUMERATIONS_H
+#define DALI_GESTURE_ENUMERATIONS_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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <cstdint>
+
+namespace Dali
+{
+
+/**
+ * @brief Enumeration for type of gesture.
+ * @SINCE_1_9.28
+ */
+namespace GestureType
+{
+enum Value : uint8_t
+{
+  PINCH      = 1 << 0, ///< When two touch points move away or towards each other. @SINCE_1_9.28
+  PAN        = 1 << 1, ///< When the user drags their finger(s) in a particular direction. @SINCE_1_9.28
+  TAP        = 1 << 2, ///< When the user taps the screen. @SINCE_1_9.28
+  LONG_PRESS = 1 << 3, ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_9.28
+  ROTATION   = 1 << 4, ///< When the user rotates two fingers around a particular ares of the screen. @SINCE_1_9.28
+};
+} // namespace GestureType
+
+/**
+ * @brief Enumeration for state of the gesture.
+ * @SINCE_1_9.28
+ */
+enum class GestureState : uint8_t
+{
+  CLEAR,      ///< There is no state associated with this gesture. @SINCE_1_9.28
+  STARTED,    ///< The touched points on the screen have moved enough to be considered a gesture. @SINCE_1_9.28
+  CONTINUING, ///< The gesture is continuing. @SINCE_1_9.28
+  FINISHED,   ///< The user has lifted a finger or touched an additional point on the screen. @SINCE_1_9.28
+  CANCELLED,  ///< The gesture has been cancelled. @SINCE_1_9.28
+  POSSIBLE    ///< A gesture is possible. @SINCE_1_9.28
+};
+
+} // namespace Dali
+
+#endif // DALI_GESTURE_ENUMERATIONS_H
index 0ceaadf..11b124c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
 // CLASS HEADER
 #include <dali/public-api/events/gesture.h>
 
+// INTERNAL INCLUDES
+#include <dali/internal/event/events/gesture-impl.h>
+
 namespace Dali
 {
 
-Gesture::Gesture( const Gesture& rhs )
-: type(rhs.type),
-  state(rhs.state),
-  time(rhs.time)
+Gesture::Gesture()
 {
 }
 
-Gesture& Gesture::operator=( const Gesture& rhs )
+Gesture::Gesture(Internal::Gesture* internal)
+: BaseHandle(internal)
 {
-  if( this != &rhs )
-  {
-    type = rhs.type;
-    state = rhs.state;
-    time = rhs.time;
-  }
-
-  return *this;
 }
 
+Gesture::Gesture( const Gesture& rhs ) = default;
+
+Gesture::Gesture( Gesture&& rhs ) = default;
+
+Gesture& Gesture::operator=( const Gesture& rhs ) = default;
+
+Gesture& Gesture::operator=( Gesture&& rhs ) = default;
+
 Gesture::~Gesture()
 {
 }
 
-Gesture::Gesture(Type gestureType, State gestureState)
-: type(gestureType),
-  state(gestureState),
-  time(0)
+GestureType::Value Gesture::GetType() const
+{
+  return GetImplementation(*this).GetType();
+}
+
+GestureState Gesture::GetState() const
+{
+  return GetImplementation(*this).GetState();
+}
+
+uint32_t Gesture::GetTime() const
 {
+  return GetImplementation(*this).GetTime();
 }
 
 } // namespace Dali
index 0e9a6ff..8f407d2 100644 (file)
@@ -23,6 +23,8 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/events/gesture-enumerations.h>
 
 namespace Dali
 {
@@ -31,6 +33,11 @@ namespace Dali
  * @{
  */
 
+namespace Internal DALI_INTERNAL
+{
+class Gesture;
+}
+
 /**
  * @brief Base structure for different gestures that an application can receive.
  *
@@ -41,94 +48,93 @@ namespace Dali
  * To receive a particular gesture, the application has to create and connect to the appropriate
  * GestureDetector.
  *
- * @SINCE_1_0.0
+ * @SINCE_1_9.28
  * @note An instance of this class cannot be created.
  * @see GestureDetector
  *
  */
-struct DALI_CORE_API Gesture
+class DALI_CORE_API Gesture : public BaseHandle
 {
+public:
+
+  /**
+   * @brief Creates an uninitialized Gesture handle.
+   *
+   * Calling member functions with an uninitialized Actor handle is not allowed.
+   * @SINCE_1_9.28
+   */
+  Gesture();
+
   /**
    * @brief Copy constructor.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    */
   Gesture( const Gesture& rhs );
 
   /**
+   * @brief Move constructor.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the handle to move
+   */
+  Gesture( Gesture&& rhs );
+
+  /**
    * @brief Assignment operator.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    * @return A reference to this
    */
   Gesture& operator=( const Gesture& rhs );
 
-  // Destruction
-
-  /**
-   * @brief Virtual destructor.
-   * @SINCE_1_0.0
-   */
-  virtual ~Gesture();
-
   /**
-   * @brief Enumeration for type of gesture.
-   * @SINCE_1_0.0
+   * @brief Move assignment operator.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the handle to move
+   * @return A reference to this
    */
-  enum Type
-  {
-    Pinch      = 1 << 0, ///< When two touch points move away or towards each other. @SINCE_1_0.0
-    Pan        = 1 << 1, ///< When the user drags their finger(s) in a particular direction. @SINCE_1_0.0
-    Tap        = 1 << 2, ///< When the user taps the screen. @SINCE_1_0.0
-    LongPress  = 1 << 3, ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_0.0
-    Rotation   = 1 << 4, ///< When the user rotates two fingers around a particular ares of the screen. @SINCE_1_9.27
-  };
+  Gesture& operator=( Gesture&& rhs );
 
   /**
-   * @brief Enumeration for state of the gesture.
-   * @SINCE_1_0.0
+   * @brief Non virtual destructor.
+   * @SINCE_1_9.28
    */
-  enum State
-  {
-    Clear,      ///< There is no state associated with this gesture. @SINCE_1_0.0
-    Started,    ///< The touched points on the screen have moved enough to be considered a gesture. @SINCE_1_0.0
-    Continuing, ///< The gesture is continuing. @SINCE_1_0.0
-    Finished,   ///< The user has lifted a finger or touched an additional point on the screen. @SINCE_1_0.0
-    Cancelled,  ///< The gesture has been cancelled. @SINCE_1_0.0
-    Possible    ///< A gesture is possible. @SINCE_1_0.0
-  };
-
-  // Data
+  ~Gesture();
 
   /**
    * @brief The gesture type.
+   * @SINCE_1_9.28
+   * @return The gesture type
    */
-  Type type;
+  GestureType::Value GetType() const;
 
   /**
    * @brief The gesture state.
    *
    * Please see the description in the sub-classes to see the states
    * used by the actual gesture.
+   * @SINCE_1_9.28
+   * @return The state of the gesture
    */
-  State state;
+  GestureState GetState() const;
 
   /**
    * @brief The time the gesture took place.
+   * @SINCE_1_9.28
+   * @return The time the gesture took place
    */
-  uint32_t time;
+  uint32_t GetTime() const;
 
-protected: // Creation
+public: // Not intended for application developers
 
+  /// @cond internal
   /**
-   * @brief This constructor is only used by derived classes.
-   *
-   * @SINCE_1_0.0
-   * @param[in] gestureType   The type of gesture event.
-   * @param[in] gestureState  The state of the gesture event.
+   * @brief Internal constructor.
+   * @SINCE_1_9.28
+   * @param[in] gesture Pointer to internal gesture
    */
-  Gesture(Type gestureType, State gestureState);
-
+  explicit DALI_INTERNAL Gesture(Internal::Gesture* gesture);
+  /// @endcond
 };
 
 /**
index 97049c9..5265842 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_LONG_PRESS_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -37,15 +37,15 @@ namespace Internal DALI_INTERNAL
 class LongPressGestureDetector;
 }
 
-struct LongPressGesture;
+class LongPressGesture;
 
 /**
  * @brief This class emits a signals when a long press gesture occurs that meets the requirements set by the application.
  * @SINCE_1_0.0
  *
  * For any valid long press, two signals will be emitted:
- * - First identifying the beginning (state = Started) i.e. when fingers held down for the required time.
- * - Second identifying the ending (state = Finished) i.e. when fingers are released.
+ * - First identifying the beginning (state = GestureState::STARTED) i.e. when fingers held down for the required time.
+ * - Second identifying the ending (state = GestureState::FINISHED) i.e. when fingers are released.
  *
  * The application programmer can use this gesture detector as follows:
  * @code
index e329c82..1b99fce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
 // CLASS HEADER
 #include <dali/public-api/events/long-press-gesture.h>
 
+// INTERNAL INCLUDES
+#include <dali/internal/event/events/long-press-gesture/long-press-gesture-impl.h>
+
 namespace Dali
 {
 
-LongPressGesture::LongPressGesture(Gesture::State state)
-: Gesture( Gesture::LongPress, state ),
-  numberOfTouches( 1 )
+LongPressGesture::LongPressGesture( Internal::LongPressGesture* internal )
+: Gesture( internal )
 {
 }
 
-LongPressGesture::LongPressGesture( const LongPressGesture& rhs )
-: Gesture( rhs ),
-  numberOfTouches( rhs.numberOfTouches ),
-  screenPoint( rhs.screenPoint ),
-  localPoint( rhs.localPoint )
+LongPressGesture::LongPressGesture() = default;
+
+LongPressGesture::LongPressGesture( const LongPressGesture& rhs ) = default;
+
+LongPressGesture::LongPressGesture( LongPressGesture&& rhs ) = default;
+
+LongPressGesture& LongPressGesture::operator=( const LongPressGesture& rhs ) = default;
+
+LongPressGesture& LongPressGesture::operator=( LongPressGesture&& rhs ) = default;
+
+LongPressGesture::~LongPressGesture() = default;
+
+uint32_t LongPressGesture::GetNumberOfTouches() const
 {
+  return GetImplementation( *this ).GetNumberOfTouches();
 }
 
-LongPressGesture& LongPressGesture::operator=( const LongPressGesture& rhs )
+const Vector2& LongPressGesture::GetScreenPoint() const
 {
-  if( this != &rhs )
-  {
-    Gesture::operator=(rhs);
-    numberOfTouches = rhs.numberOfTouches;
-    screenPoint = rhs.screenPoint;
-    localPoint = rhs.localPoint;
-  }
-
-  return *this;
+  return GetImplementation( *this ).GetScreenPoint();
 }
 
-LongPressGesture::~LongPressGesture()
+const Vector2& LongPressGesture::GetLocalPoint() const
 {
+  return GetImplementation( *this ).GetLocalPoint();
 }
 
 } // namespace Dali
index 893bcaf..82355fd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_LONG_PRESS_GESTURE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
 
 namespace Dali
 {
+
+namespace Internal DALI_INTERNAL
+{
+class LongPressGesture;
+}
+
 /**
  * @addtogroup dali_core_events
  * @{
@@ -32,69 +38,101 @@ namespace Dali
 /**
  * @brief A LongPressGesture is emitted when the user touches and holds the screen with the stated number of fingers.
  *
- * This gesture can be in one of two states, when the long-press gesture is first detected: Gesture::Started
- * and when the long-press gesture ends: Gesture::Finished.
+ * This gesture can be in one of two states, when the long-press gesture is first detected: GestureState::STARTED
+ * and when the long-press gesture ends: GestureState::FINISHED.
  *
  * Long press gesture finishes when all touches have been released.
  *
- * @SINCE_1_0.0
+ * @SINCE_1_9.28
  * @see LongPressGestureDetector
  */
-struct DALI_CORE_API LongPressGesture : public Gesture
+class DALI_CORE_API LongPressGesture : public Gesture
 {
-  // Construction & Destruction
+public:
 
   /**
-   * @brief Constructor.
+   * @brief Creates an uninitialized LongPressGesture handle.
    *
-   * @SINCE_1_0.0
-   * @param[in] state The state of the gesture
+   * Calling member functions with an uninitialized Actor handle is not allowed.
+   * @SINCE_1_9.28
    */
-  LongPressGesture(Gesture::State state);
+  LongPressGesture();
 
   /**
    * @brief Copy constructor.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    */
   LongPressGesture( const LongPressGesture& rhs );
 
   /**
+   * @brief Move constructor.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the handle to move
+   */
+  LongPressGesture( LongPressGesture&& rhs );
+
+  /**
    * @brief Assignment operator.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    * @return A reference to this
    */
   LongPressGesture& operator=( const LongPressGesture& rhs );
 
   /**
-   * @brief Virtual destructor.
-   * @SINCE_1_0.0
+   * @brief Move assignment operator.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
    */
-  virtual ~LongPressGesture();
+  LongPressGesture& operator=( LongPressGesture&& rhs );
 
-  // Data
+  /**
+   * @brief Non virtual destructor.
+   * @SINCE_1_9.28
+   */
+  ~LongPressGesture();
 
   /**
-   * @brief The number of touch points in this long press gesture, i.e. the number of fingers the user had
-   * on the screen to generate the long press gesture.
+   * @brief The number of touch points in this long press gesture.
+   *
+   * In other words, the number of fingers the user had on the screen to generate the long press gesture.
+   * @SINCE_1_9.28
+   * @return The number of touch points
    */
-  uint32_t numberOfTouches;
+  uint32_t GetNumberOfTouches() const;
 
   /**
    * @brief This is the point, in screen coordinates, where the long press occurred.
    *
    * If a multi-touch long press, then this is the centroid of all the touch points.
+   * @SINCE_1_9.28
+   * @return The point where the long press occurred (in screen coordinates)
    */
-  Vector2 screenPoint;
+  const Vector2& GetScreenPoint() const;
 
   /**
    * @brief This is the point, in local actor coordinates, where the long press occurred.
    *
    * If a multi-touch long press, then this is the centroid of all the touch points.
+   * @SINCE_1_9.28
    * @return The point where tap has occurred (in local actor coordinates)
    */
-  Vector2 localPoint;
+  const Vector2& GetLocalPoint() const;
+
+public: // Not intended for application developers
+
+  /// @cond internal
+  /**
+   * @brief This constructor is used internally to Create an initialized LongPressGesture handle.
+   *
+   * @param[in] longPressGesture A pointer to a newly allocated Dali resource
+   * @SINCE_1_9.28
+   */
+  explicit DALI_INTERNAL LongPressGesture( Internal::LongPressGesture* longPressGesture );
+  /// @endcond
+
 };
 
 /**
index 637c76c..8accd54 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -128,7 +128,7 @@ PanGestureDetector::DetectedSignalType& PanGestureDetector::DetectedSignal()
   return GetImplementation(*this).DetectedSignal();
 }
 
-void PanGestureDetector::SetPanGestureProperties( const PanGesture& pan )
+void PanGestureDetector::SetPanGestureProperties( const Dali::PanGesture& pan )
 {
   Internal::PanGestureDetector::SetPanGestureProperties( pan );
 }
index 024e8ec..ec687d3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PAN_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/events/gesture-detector.h>
+#include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/object/property-index-ranges.h>
 #include <dali/public-api/signals/dali-signal.h>
 
@@ -36,8 +37,6 @@ namespace Internal DALI_INTERNAL
 class PanGestureDetector;
 }
 
-struct PanGesture;
-
 /**
  * @addtogroup dali_core_events
  * @{
index a2a8f44..0550f54 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
+#include <dali/internal/event/events/pan-gesture/pan-gesture-impl.h>
 
 namespace Dali
 {
 
-PanGesture::PanGesture()
-: Gesture(Gesture::Pan, Gesture::Clear),
-  numberOfTouches(1)
+PanGesture::PanGesture( Internal::PanGesture* internal )
+: Gesture( internal )
 {
 }
 
-PanGesture::PanGesture(Gesture::State state)
-: Gesture(Gesture::Pan, state),
-  numberOfTouches(1)
+PanGesture::PanGesture() = default;
+
+PanGesture::PanGesture( const PanGesture& rhs ) = default;
+
+PanGesture::PanGesture( PanGesture&& rhs ) = default;
+
+PanGesture& PanGesture::operator=( const PanGesture& rhs ) = default;
+
+PanGesture& PanGesture::operator=( PanGesture&& rhs ) = default;
+
+PanGesture::~PanGesture() = default;
+
+const Vector2& PanGesture::GetVelocity() const
+{
+  return GetImplementation( *this ).GetVelocity();
+}
+
+const Vector2& PanGesture::GetDisplacement() const
+{
+  return GetImplementation( *this ).GetDisplacement();
+}
+
+const Vector2& PanGesture::GetPosition() const
+{
+  return GetImplementation( *this ).GetPosition();
+}
+
+const Vector2& PanGesture::GetScreenVelocity() const
 {
+  return GetImplementation( *this ).GetScreenVelocity();
 }
 
-PanGesture::PanGesture( const PanGesture& rhs )
-: Gesture( rhs ),
-  velocity( rhs.velocity ),
-  displacement( rhs.displacement ),
-  position( rhs.position ),
-  screenVelocity( rhs.screenVelocity ),
-  screenDisplacement( rhs.screenDisplacement ),
-  screenPosition( rhs.screenPosition ),
-  numberOfTouches( rhs.numberOfTouches )
+const Vector2& PanGesture::GetScreenDisplacement() const
 {
+  return GetImplementation( *this ).GetScreenDisplacement();
 }
 
-PanGesture& PanGesture::operator=( const PanGesture& rhs )
+const Vector2& PanGesture::GetScreenPosition() const
 {
-  if( this != &rhs )
-  {
-    Gesture::operator=(rhs);
-    velocity = rhs.velocity;
-    displacement = rhs.displacement;
-    position = rhs.position;
-    screenVelocity = rhs.screenVelocity;
-    screenDisplacement = rhs.screenDisplacement;
-    screenPosition = rhs.screenPosition;
-    numberOfTouches = rhs.numberOfTouches;
-  }
-
-  return *this;
+  return GetImplementation( *this ).GetScreenPosition();
 }
 
-PanGesture::~PanGesture()
+uint32_t PanGesture::GetNumberOfTouches() const
 {
+  return GetImplementation( *this ).GetNumberOfTouches();
 }
 
 float PanGesture::GetSpeed() const
 {
-  return velocity.Length();
+  return GetImplementation( *this ).GetSpeed();
 }
 
 float PanGesture::GetDistance() const
 {
-  return displacement.Length();
+  return GetImplementation( *this ).GetDistance();
 }
 
 float PanGesture::GetScreenSpeed() const
 {
-  return screenVelocity.Length();
+  return GetImplementation( *this ).GetScreenSpeed();
 }
 
 float PanGesture::GetScreenDistance() const
 {
-  return screenDisplacement.Length();
+  return GetImplementation( *this ).GetScreenDistance();
 }
 
 } // namespace Dali
index 8c2432b..3c79a5f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PAN_GESTURE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
 
 namespace Dali
 {
+
+namespace Internal DALI_INTERNAL
+{
+class PanGesture;
+}
+
 /**
  * @addtogroup dali_core_events
  * @{
@@ -32,9 +38,9 @@ namespace Dali
 /**
  * @brief A PanGesture is emitted when the user moves one or more fingers in a particular direction.
  *
- * This gesture can be in one of three states, when the pan gesture is first detected: Gesture::Started
- * when the pan gesture is continuing: Gesture::Continuing and finally, when the pan gesture ends:
- * Gesture::Finished.
+ * This gesture can be in one of three states, when the pan gesture is first detected: GestureState::STARTED
+ * when the pan gesture is continuing: GestureState::CONTINUING and finally, when the pan gesture ends:
+ * GestureState::FINISHED.
  *
  * A pan gesture will end in the following ways:
  * - User releases the primary finger (the first touch).
@@ -43,48 +49,55 @@ namespace Dali
  * - Cancelled by the system.
  *
  * A pan gesture will continue to be sent to the actor under than initial pan until it ends.
- * @SINCE_1_0.0
+ * @SINCE_1_9.28
  */
-struct DALI_CORE_API PanGesture: public Gesture
+class DALI_CORE_API PanGesture: public Gesture
 {
-  // Construction & Destruction
-
-  /**
-   * @brief Default Constructor.
-   * @SINCE_1_0.0
-   */
-  PanGesture();
+public:
 
   /**
-   * @brief Constructor.
+   * @brief Creates an uninitialized PanGesture handle.
    *
-   * @SINCE_1_0.0
-   * @param[in] state The state of the gesture
+   * Calling member functions with an uninitialized Actor handle is not allowed.
+   * @SINCE_1_9.28
    */
-  PanGesture(Gesture::State state);
+  PanGesture();
 
   /**
    * @brief Copy constructor.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    */
   PanGesture( const PanGesture& rhs );
 
   /**
+   * @brief Move constructor.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the moved handle
+   */
+  PanGesture( PanGesture&& rhs );
+
+  /**
    * @brief Assignment operator.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    * @return A reference to this
    */
   PanGesture& operator=( const PanGesture& rhs );
 
   /**
-   * @brief Virtual destructor.
-   * @SINCE_1_0.0
+   * @brief Move assignment operator.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
    */
-  virtual ~PanGesture();
+  PanGesture& operator=( PanGesture&& rhs );
 
-  // Data
+  /**
+   * @brief Non virtual destructor.
+   * @SINCE_1_9.28
+   */
+  ~PanGesture();
 
   /**
    * @brief The velocity at which the user is moving their fingers.
@@ -93,8 +106,10 @@ struct DALI_CORE_API PanGesture: public Gesture
    * A positive x value shows that the user is panning to the right, a negative x value means the opposite.
    * A positive y value shows that the user is panning downwards, a negative y values means upwards.
    * This value represents the local coordinates of the actor attached to the PanGestureDetector.
+   * @SINCE_1_9.28
+   * @return The velocity of the pan
    */
-  Vector2 velocity;
+  const Vector2& GetVelocity() const;
 
   /**
    * @brief This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
@@ -104,13 +119,17 @@ struct DALI_CORE_API PanGesture: public Gesture
    * A positive y value shows that the user is panning downwards, a negative y value means upwards.
    * This value is in local actor coordinates, the actor being the one attached to the
    * PanGestureDetector.
+   * @SINCE_1_9.28
+   * @return The displacement of the pan
    */
-  Vector2 displacement;
+  const Vector2& GetDisplacement() const;
 
   /**
    * @brief This current touch position of the primary touch point in local actor coordinates.
+   * @SINCE_1_9.28
+   * @return The current position of the pan (in local actor coordinates)
    */
-  Vector2 position;
+  const Vector2& GetPosition() const;
 
   /**
    * @brief The velocity at which the user is moving their fingers.
@@ -119,8 +138,10 @@ struct DALI_CORE_API PanGesture: public Gesture
    * A positive x value shows that the user is panning to the right, a negative x value means the opposite.
    * A positive y value shows that the user is panning downwards, a negative y values means upwards.
    * This value represents the screen coordinates.
+   * @SINCE_1_9.28
+   * @return The velocity of the pan (in screen coordinates)
    */
-  Vector2 screenVelocity;
+  const Vector2& GetScreenVelocity() const;
 
   /**
    * @brief This is a Vector2 showing how much the user has panned (dragged) since the last pan gesture or,
@@ -129,18 +150,24 @@ struct DALI_CORE_API PanGesture: public Gesture
    * A positive x value shows that the user is panning to the right, a negative x value means the opposite.
    * A positive y value shows that the user is panning downwards, a negative y value means upwards.
    * This value is in screen coordinates.
+   * @SINCE_1_9.28
+   * @return The displacement of the pan (in screen coordinates)
    */
-  Vector2 screenDisplacement;
+  const Vector2& GetScreenDisplacement() const;
 
   /**
    * @brief This current touch position of the primary touch point in screen coordinates.
+   * @SINCE_1_9.28
+   * @return The current position of the pan (in screen coordinates)
    */
-  Vector2 screenPosition;
+  const Vector2& GetScreenPosition() const;
 
   /**
    * @brief The total number of fingers touching the screen in a pan gesture.
+   * @SINCE_1_9.28
+   * @return The number of touches in the pan
    */
-  uint32_t numberOfTouches;
+  uint32_t GetNumberOfTouches() const;
 
   // Convenience Methods
 
@@ -148,7 +175,7 @@ struct DALI_CORE_API PanGesture: public Gesture
    * @brief Returns the speed at which the user is moving their fingers.
    *
    * This is the pixel movement per millisecond.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @return The speed of the pan (in pixels per millisecond)
    */
   float GetSpeed() const;
@@ -158,7 +185,7 @@ struct DALI_CORE_API PanGesture: public Gesture
    * if the gesture has just started, then the distance moved since the user touched the screen.
    *
    * This is always a positive value.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @return The distance, as a float, a user's finger has panned
    */
   float GetDistance() const;
@@ -167,7 +194,7 @@ struct DALI_CORE_API PanGesture: public Gesture
    * @brief Returns the speed at which the user is moving their fingers relative to screen coordinates.
    *
    * This is the pixel movement per millisecond.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @return The speed of the pan (in pixels per millisecond)
    */
   float GetScreenSpeed() const;
@@ -178,10 +205,23 @@ struct DALI_CORE_API PanGesture: public Gesture
    * since the user touched the screen.
    *
    * This is always a positive value.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @return The distance, as a float, a user's finger has panned
    */
   float GetScreenDistance() const;
+
+public: // Not intended for application developers
+
+  /// @cond internal
+  /**
+   * @brief This constructor is used internally to Create an initialized PanGesture handle.
+   *
+   * @param[in] panGesture A pointer to a newly allocated Dali resource
+   * @SINCE_1_9.28
+   */
+  explicit DALI_INTERNAL PanGesture( Internal::PanGesture* panGesture );
+  /// @endcond
+
 };
 
 /**
index db06235..9daf911 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PINCH_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -34,7 +34,7 @@ namespace Internal DALI_INTERNAL
 class PinchGestureDetector;
 }
 
-struct PinchGesture;
+class PinchGesture;
 
 /**
  * @brief This class looks for pinching gestures involving two touches.
index 9c72c25..4281665 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
+#include <dali/internal/event/events/pinch-gesture/pinch-gesture-impl.h>
 
 namespace Dali
 {
 
-PinchGesture::PinchGesture(Gesture::State state)
-: Gesture(Gesture::Pinch, state),
-  scale(0.0f),
-  speed(0.0f)
+PinchGesture::PinchGesture( Internal::PinchGesture* internal )
+: Gesture( internal )
 {
 }
 
-PinchGesture::PinchGesture( const PinchGesture& rhs )
-: Gesture( rhs ),
-  scale( rhs.scale ),
-  speed( rhs.speed ),
-  screenCenterPoint( rhs.screenCenterPoint ),
-  localCenterPoint( rhs.localCenterPoint )
+PinchGesture::PinchGesture() = default;
+
+PinchGesture::PinchGesture( const PinchGesture& rhs ) = default;
+
+PinchGesture::PinchGesture( PinchGesture&& rhs ) = default;
+
+PinchGesture& PinchGesture::operator=( const PinchGesture& rhs ) = default;
+
+PinchGesture& PinchGesture::operator=( PinchGesture&& rhs ) = default;
+
+PinchGesture::~PinchGesture() = default;
+
+float PinchGesture::GetScale() const
+{
+  return GetImplementation( *this ).GetScale();
+}
+
+float PinchGesture::GetSpeed() const
 {
+  return GetImplementation( *this ).GetSpeed();
 }
 
-PinchGesture& PinchGesture::operator=( const PinchGesture& rhs )
+const Vector2& PinchGesture::GetScreenCenterPoint() const
 {
-  if( this != &rhs )
-  {
-    Gesture::operator=(rhs);
-    scale = rhs.scale;
-    speed = rhs.speed;
-    screenCenterPoint = rhs.screenCenterPoint;
-    localCenterPoint = rhs.localCenterPoint;
-  }
-
-  return *this;
+  return GetImplementation( *this ).GetScreenCenterPoint();
 }
 
-PinchGesture::~PinchGesture()
+const Vector2& PinchGesture::GetLocalCenterPoint() const
 {
+  return GetImplementation( *this ).GetLocalCenterPoint();
 }
 
 } // namespace Dali
index 9125b5e..aacbffa 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PINCH_GESTURE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
 
 namespace Dali
 {
+
+namespace Internal DALI_INTERNAL
+{
+class PinchGesture;
+}
+
 /**
  * @addtogroup dali_core_events
  * @{
@@ -33,74 +39,108 @@ namespace Dali
  * @brief A PinchGesture is emitted when the user moves two fingers towards or away from each other.
  *
  * This gesture can be in one of three states; when the pinch gesture is first detected, its
- * state is set to Gesture::Started.  After this, if there is change in the gesture, the state will
- * be Gesture::Continuing. Finally, when the gesture ends, the state of the gesture changes to
- * Gesture::Finished.
+ * state is set to GestureState::STARTED.  After this, if there is change in the gesture, the state will
+ * be GestureState::CONTINUING. Finally, when the gesture ends, the state of the gesture changes to
+ * GestureState::FINISHED.
  *
  * A pinch gesture will continue to be sent to the actor under the center point of the pinch
  * until the pinch ends.
- * @SINCE_1_0.0
+ * @SINCE_1_9.28
  */
-struct DALI_CORE_API PinchGesture: public Gesture
+class DALI_CORE_API PinchGesture: public Gesture
 {
-  // Construction & Destruction
+public:
 
   /**
-   * @brief Default Constructor.
+   * @brief Creates an uninitialized PinchGesture handle.
    *
-   * @SINCE_1_0.0
-   * @param[in] state The state of the gesture
+   * Calling member functions with an uninitialized Actor handle is not allowed.
+   * @SINCE_1_9.28
    */
-  PinchGesture(Gesture::State state);
+  PinchGesture();
 
   /**
    * @brief Copy constructor.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    */
   PinchGesture( const PinchGesture& rhs );
 
   /**
+   * @brief Move constructor.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the moved handle
+   */
+  PinchGesture( PinchGesture&& rhs );
+
+  /**
    * @brief Assignment operator.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    * @return A reference to this
    */
   PinchGesture& operator=( const PinchGesture& rhs );
 
   /**
-   * @brief Virtual destructor.
-   * @SINCE_1_0.0
+   * @brief Assignment operator.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
    */
-  virtual ~PinchGesture();
+  PinchGesture& operator=( PinchGesture&& rhs );
 
-  // Data
+  /**
+   * @brief Non virtual destructor.
+   * @SINCE_1_9.28
+   */
+  ~PinchGesture();
 
   /**
    * @brief The scale factor from the start of the pinch gesture till the latest pinch gesture.
    *
-   * If the user is moving their fingers away from each other, then
-   * this value increases.  Conversely, if the user is moving their
-   * fingers towards each other, this value will decrease.
+   * If the user is moving their fingers away from each other, then this value increases.
+   * Conversely, if the user is moving their fingers towards each other, this value will
+   * decrease.
+   * @SINCE_1_9.28
+   * @return The scale of the pinch (from the pinch start)
    */
-  float scale;
+  float GetScale() const;
 
   /**
    * @brief The speed at which the user is moving their fingers.
    *
    * This is the pixel movement per second.
+   * @SINCE_1_9.28
+   * @return The speed of the pinch (pixels per second)
    */
-  float speed;
+  float GetSpeed() const;
 
   /**
    * @brief The center point of the two points that caused the pinch gesture in screen coordinates.
+   * @SINCE_1_9.28
+   * @return The current center point of the pinch (in screen coordinates)
    */
-  Vector2 screenCenterPoint;
+  const Vector2& GetScreenCenterPoint() const;
 
   /**
    * @brief The center point of the two points that caused the pinch gesture in local actor coordinates.
+   * @SINCE_1_9.28
+   * @return The current center point of the pinch (in local actor coordinates)
+   */
+  const Vector2& GetLocalCenterPoint() const;
+
+public: // Not intended for application developers
+
+  /// @cond internal
+  /**
+   * @brief This constructor is used internally to Create an initialized PinchGesture handle.
+   *
+   * @param[in] PinchGesture A pointer to a newly allocated Dali resource
+   * @SINCE_1_9.28
    */
-  Vector2 localCenterPoint;
+  explicit DALI_INTERNAL PinchGesture( Internal::PinchGesture* pinchGesture );
+  /// @endcond
+
 };
 
 /**
index eab0de2..4647801 100644 (file)
@@ -30,7 +30,7 @@ namespace Internal DALI_INTERNAL
 class RotationGestureDetector;
 }
 
-struct RotationGesture;
+class RotationGesture;
 
 /**
  * @brief This class looks for a rotation gesture involving two touches.
index 03d6d81..a4a4637 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
+#include <dali/internal/event/events/rotation-gesture/rotation-gesture-impl.h>
 
 namespace Dali
 {
 
-RotationGesture::RotationGesture( Gesture::State state )
-: Gesture( Gesture::Rotation, state )
+RotationGesture::RotationGesture( Internal::RotationGesture* internal )
+: Gesture( internal )
 {
 }
 
-RotationGesture::RotationGesture( const RotationGesture& rhs )
-: Gesture( rhs ),
-  rotation( rhs.rotation ),
-  screenCenterPoint( rhs.screenCenterPoint ),
-  localCenterPoint( rhs.localCenterPoint )
+RotationGesture::RotationGesture() = default;
+
+RotationGesture::RotationGesture( const RotationGesture& rhs ) = default;
+
+RotationGesture::RotationGesture( RotationGesture&& rhs ) = default;
+
+RotationGesture& RotationGesture::operator=( const RotationGesture& rhs ) = default;
+
+RotationGesture& RotationGesture::operator=( RotationGesture&& rhs ) = default;
+
+RotationGesture::~RotationGesture() = default;
+
+const Radian& RotationGesture::GetRotation() const
 {
+  return GetImplementation( *this ).GetRotation();
 }
 
-RotationGesture& RotationGesture::operator=( const RotationGesture& rhs )
+const Vector2& RotationGesture::GetScreenCenterPoint() const
 {
-  if( this != &rhs )
-  {
-    Gesture::operator=( rhs );
-    rotation = rhs.rotation;
-    screenCenterPoint = rhs.screenCenterPoint;
-    localCenterPoint = rhs.localCenterPoint;
-  }
-
-  return *this;
+  return GetImplementation( *this ).GetScreenCenterPoint();
 }
 
-RotationGesture::~RotationGesture()
+const Vector2& RotationGesture::GetLocalCenterPoint() const
 {
+  return GetImplementation( *this ).GetLocalCenterPoint();
 }
 
 } // namespace Dali
index fa3894f..e3020f6 100644 (file)
 namespace Dali
 {
 
+namespace Internal DALI_INTERNAL
+{
+class RotationGesture;
+}
+
 /**
  * @brief A RotationGesture is emitted when the user moves two fingers that are opposite each other
  * in a rotational/circular gesture.
  *
  * This gesture can be in one of three states; when the rotation gesture is first detected, its
- * state is set to Gesture::Started.  After this, if there is change in the gesture, the state will
- * be Gesture::Continuing. Finally, when the gesture ends, the state of the gesture changes to
- * Gesture::Finished.
+ * state is set to GestureState::STARTED.  After this, if there is change in the gesture, the state will
+ * be GestureState::CONTINUING. Finally, when the gesture ends, the state of the gesture changes to
+ * GestureState::FINISHED.
  *
  * A rotation gesture will continue to be sent to the actor under the center point of the rotation
  * until the rotation ends.
- * @SINCE_1_9.27
+ * @SINCE_1_9.28
  */
-struct DALI_CORE_API RotationGesture: public Gesture
+class DALI_CORE_API RotationGesture: public Gesture
 {
-  // Construction & Destruction
+public:
 
   /**
-   * @brief Default Constructor.
-   * @SINCE_1_9.27
-   * @param[in] state The state of the gesture
+   * @brief Creates an uninitialized RotationGesture handle.
+   *
+   * Calling member functions with an uninitialized Actor handle is not allowed.
+   * @SINCE_1_9.28
    */
-  RotationGesture( Gesture::State state );
+  RotationGesture();
 
   /**
    * @brief Copy constructor.
-   * @SINCE_1_9.27
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    */
   RotationGesture( const RotationGesture& rhs );
 
   /**
+   * @brief Move constructor.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the moved handle
+   */
+  RotationGesture( RotationGesture&& rhs );
+
+  /**
    * @brief Assignment operator.
-   * @SINCE_1_9.27
+   * @SINCE_1_9.28
    * @param[in] rhs A reference to the copied handle
    * @return A reference to this
    */
   RotationGesture& operator=( const RotationGesture& rhs );
 
   /**
-   * @brief Virtual destructor.
-   * @SINCE_1_9.27
+   * @brief Move assignment operator.
+   * @SINCE_1_9.28
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
    */
-  virtual ~RotationGesture();
+  RotationGesture& operator=( RotationGesture&& rhs );
 
-  // Data
+  /**
+   * @brief Non virtual destructor.
+   * @SINCE_1_9.28
+   */
+  ~RotationGesture();
 
   /**
    * @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
-   * @SINCE_1_9.27
+   * @SINCE_1_9.28
+   * @return The rotation from the start of the rotation gesture till the latest rotation gesture.
    */
-  Radian rotation;
+  const Radian& GetRotation() const;
 
   /**
    * @brief The center point of the two points that caused the rotation gesture in screen coordinates.
-   * @SINCE_1_9.27
+   * @SINCE_1_9.28
+   * @return The center point in screen coordinates
    */
-  Vector2 screenCenterPoint;
+  const Vector2& GetScreenCenterPoint() const;
 
   /**
    * @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
-   * @SINCE_1_9.27
+   * @SINCE_1_9.28
+   * @return The center point in local actor coordinates
+   */
+  const Vector2& GetLocalCenterPoint() const;
+
+public: // Not intended for application developers
+
+  /// @cond internal
+  /**
+   * @brief This constructor is used internally to Create an initialized RotationGesture handle.
+   *
+   * @param[in] rotationGesture A pointer to a newly allocated Dali resource
+   * @SINCE_1_9.28
    */
-  Vector2 localCenterPoint;
+  explicit DALI_INTERNAL RotationGesture( Internal::RotationGesture* rotationGesture );
+  /// @endcond
 };
 
 } // namespace Dali
index 02406c2..2c17c4e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TAP_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
@@ -37,7 +37,7 @@ namespace Internal DALI_INTERNAL
 class TapGestureDetector;
 }
 
-struct TapGesture;
+class TapGesture;
 
 /**
  * @brief This class emits a signal when a tap gesture occurs that meets the requirements set by the
index d20afc4..0dbefb6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
 // CLASS HEADER
 #include <dali/public-api/events/tap-gesture.h>
 
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+#include <dali/internal/event/events/tap-gesture/tap-gesture-impl.h>
+
 namespace Dali
 {
 
-TapGesture::TapGesture()
-: Gesture(Gesture::Tap, Gesture::Clear),
-  numberOfTaps(1),
-  numberOfTouches(1)
+TapGesture::TapGesture( Internal::TapGesture* internal )
+: Gesture( internal )
+{
+}
+
+TapGesture::TapGesture() = default;
+
+TapGesture::TapGesture( const TapGesture& rhs ) = default;
+
+TapGesture::TapGesture( TapGesture&& rhs ) = default;
+
+TapGesture& TapGesture::operator=( const TapGesture& rhs ) = default;
+
+TapGesture& TapGesture::operator=( TapGesture&& rhs ) = default;
+
+TapGesture::~TapGesture() = default;
+
+uint32_t TapGesture::GetNumberOfTaps() const
 {
+  return GetImplementation( *this ).GetNumberOfTaps();
 }
 
-TapGesture::TapGesture( const TapGesture& rhs )
-: Gesture( rhs ),
-  numberOfTaps( rhs.numberOfTaps ),
-  numberOfTouches( rhs.numberOfTouches ),
-  screenPoint( rhs.screenPoint ),
-  localPoint( rhs.localPoint )
+uint32_t TapGesture::GetNumberOfTouches() const
 {
+  return GetImplementation( *this ).GetNumberOfTouches();
 }
 
-TapGesture& TapGesture::operator=( const TapGesture& rhs )
+const Vector2& TapGesture::GetScreenPoint() const
 {
-  if( this != &rhs )
-  {
-    Gesture::operator=(rhs);
-    numberOfTaps = rhs.numberOfTaps;
-    numberOfTouches = rhs.numberOfTouches;
-    screenPoint = rhs.screenPoint;
-    localPoint = rhs.localPoint;
-  }
-
-  return *this;
+  return GetImplementation( *this ).GetScreenPoint();
 }
 
-TapGesture::~TapGesture()
+const Vector2& TapGesture::GetLocalPoint() const
 {
+  return GetImplementation( *this ).GetLocalPoint();
 }
 
 } // namespace Dali
index 3584c26..6fa0a08 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TAP_GESTURE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * 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.
 
 namespace Dali
 {
+
+namespace Internal DALI_INTERNAL
+{
+class TapGesture;
+}
+
 /**
  * @addtogroup dali_core_events
  * @{
@@ -33,67 +39,100 @@ namespace Dali
  * @brief A TapGesture is emitted when the user taps the screen with the stated number of fingers a stated number of times.
  *
  * This is a discrete gesture so does not have any state information.
- * @SINCE_1_0.0
+ * @SINCE_1_9.28
  * @see TapGestureDetector
  */
-struct DALI_CORE_API TapGesture : public Gesture
+class DALI_CORE_API TapGesture : public Gesture
 {
-  // Construction & Destruction
+public:
 
   /**
-   * @brief Default Constructor.
-   * @SINCE_1_0.0
+   * @brief Creates an uninitialized TapGesture handle.
+   *
+   * Calling member functions with an uninitialized Actor handle is not allowed.
+   * @SINCE_1_9.28
    */
   TapGesture();
 
   /**
    * @brief Copy constructor.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param rhs A reference to the copied handle
    */
   TapGesture( const TapGesture& rhs );
 
   /**
+   * @brief Move constructor.
+   * @SINCE_1_9.28
+   * @param rhs The handle to move.
+   */
+  TapGesture( TapGesture&& rhs );
+
+  /**
    * @brief Assignment operator.
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param rhs A reference to the copied handle
    * @return A reference to this
    */
   TapGesture& operator=( const TapGesture& rhs );
 
   /**
-   * @brief Virtual destructor.
-   * @SINCE_1_0.0
+   * @brief Move assignment operator.
+   * @SINCE_1_9.28
+   * @param rhs The handle to move.
    */
-  virtual ~TapGesture();
+  TapGesture& operator=( TapGesture&& rhs );
 
-  // Data
+  /**
+   * @brief Non virtual destructor.
+   * @SINCE_1_9.28
+   */
+  ~TapGesture();
 
   /**
    * @brief The number of taps in this tap gesture.
+   * @SINCE_1_9.28
+   * @return The number of taps
    */
-  uint32_t numberOfTaps;
+  uint32_t GetNumberOfTaps() const;
 
   /**
    * @brief The number of touch points in this tap gesture, i.e. the number of fingers the user had on the
    * screen to generate the tap gesture.
+   * @SINCE_1_9.28
+   * @return The number of touchs
    */
-  uint32_t numberOfTouches;
+  uint32_t GetNumberOfTouches() const;
 
   /**
    * @brief This is the point, in screen coordinates, where the tap occurred.
    *
    * If a multi-touch tap, then this is the centroid of all the touch points.
+   * @SINCE_1_9.28
+   * @return The point where tap has occurred( in screen coordinates)
    */
-  Vector2 screenPoint;
+  const Vector2& GetScreenPoint() const;
 
   /**
    * @brief This is the point, in local actor coordinates, where the tap occurred.
    *
    * If a multi-touch tap, then this is the centroid of all the touch points.
+   * @SINCE_1_9.28
    * @return The point where tap has occurred (in local actor coordinates)
    */
-  Vector2 localPoint;
+  const Vector2& GetLocalPoint() const;
+
+public: // Not intended for application developers
+
+  /// @cond internal
+  /**
+   * @brief This constructor is used internally to Create an initialized TapGesture handle.
+   *
+   * @param[in] tapGesture A pointer to a newly allocated Dali resource
+   * @SINCE_1_9.28
+   */
+  explicit DALI_INTERNAL TapGesture( Internal::TapGesture* tapGesture );
+  /// @endcond
 };
 
 /**
index 8239d79..d5cc27b 100755 (executable)
 namespace Dali
 {
 
-TouchEvent::TouchEvent()
-: BaseHandle()
-{
-}
+TouchEvent::TouchEvent() = default;
 
-TouchEvent::TouchEvent( const TouchEvent& other )
-: BaseHandle( other )
-{
-}
+TouchEvent::TouchEvent( const TouchEvent& other ) = default;
 
-TouchEvent::~TouchEvent()
-{
-}
+TouchEvent::TouchEvent( TouchEvent&& other ) = default;
 
-TouchEvent& TouchEvent::operator=( const TouchEvent& other )
-{
-  BaseHandle::operator=( other );
-  return *this;
-}
+TouchEvent::~TouchEvent() = default;
+
+TouchEvent& TouchEvent::operator=( const TouchEvent& other ) = default;
+
+TouchEvent& TouchEvent::operator=( TouchEvent&& other ) = default;
 
 unsigned long TouchEvent::GetTime() const
 {
index 64ae48f..59ee042 100644 (file)
@@ -82,6 +82,14 @@ public:
   TouchEvent( const TouchEvent& other );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.28
+   * @param[in] other The TouchEvent to move
+   */
+  TouchEvent( TouchEvent&& other );
+
+  /**
    * @brief Destructor.
    *
    * @SINCE_1_9.26
@@ -99,6 +107,15 @@ public:
    */
   TouchEvent& operator=( const TouchEvent& other );
 
+  /**
+   * @brief Move assignment Operator.
+   *
+   * @SINCE_1_9.28
+   * @param[in] other The TouchEvent to move
+   * @return A reference to this
+   */
+  TouchEvent& operator=( TouchEvent&& other );
+
   // Getters
 
   /**
index 9675830..43b1478 100644 (file)
@@ -34,7 +34,6 @@ SET( public_api_src_files
   ${public_api_src_dir}/events/rotation-gesture-detector.cpp
   ${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}/images/pixel.cpp
   ${public_api_src_dir}/images/pixel-data.cpp
@@ -134,6 +133,7 @@ SET( public_api_core_events_header_files
   ${public_api_src_dir}/events/device.h
   ${public_api_src_dir}/events/gesture.h
   ${public_api_src_dir}/events/gesture-detector.h
+  ${public_api_src_dir}/events/gesture-enumerations.h
   ${public_api_src_dir}/events/hover-event.h
   ${public_api_src_dir}/events/key-event.h
   ${public_api_src_dir}/events/long-press-gesture.h
@@ -148,7 +148,6 @@ SET( public_api_core_events_header_files
   ${public_api_src_dir}/events/rotation-gesture-detector.h
   ${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/mouse-button.h
 )
index c0e01c5..8178a14 100644 (file)
@@ -52,10 +52,10 @@ public:
    */
   enum NotifyMode
   {
-    Disabled,                             ///< Don't notify, regardless of result of Condition @SINCE_1_0.0
-    NotifyOnTrue,                         ///< Notify whenever condition changes from false to true. @SINCE_1_0.0
-    NotifyOnFalse,                        ///< Notify whenever condition changes from true to false. @SINCE_1_0.0
-    NotifyOnChanged                       ///< Notify whenever condition changes (false to true, and true to false) @SINCE_1_0.0
+    DISABLED,                             ///< Don't notify, regardless of result of Condition @SINCE_1_9.28
+    NOTIFY_ON_TRUE,                       ///< Notify whenever condition changes from false to true. @SINCE_1_9.28
+    NOTIFY_ON_FALSE,                      ///< Notify whenever condition changes from true to false. @SINCE_1_9.28
+    NOTIFY_ON_CHANGED                     ///< Notify whenever condition changes (false to true, and true to false) @SINCE_1_9.28
   };
 
 public:
@@ -162,7 +162,7 @@ public:
    * notification should respond to the result of a condition.
    *
    * @SINCE_1_0.0
-   * @param[in] mode Notification mode (Default is PropertyNotification::NotifyOnTrue)
+   * @param[in] mode Notification mode (Default is PropertyNotification::NOTIFY_ON_TRUE)
    */
   void SetNotifyMode( NotifyMode mode );
 
@@ -176,7 +176,7 @@ public:
 
   /**
    * @brief Gets the result of the last condition check that caused a signal emit,
-   * useful when using NotifyOnChanged mode and need to know what it changed to.
+   * useful when using NOTIFY_ON_CHANGED mode and need to know what it changed to.
    *
    * @SINCE_1_0.0
    * @return whether condition result that triggered last emit was true or false
index ec789c4..4812ca9 100644 (file)
@@ -40,7 +40,7 @@
  *   {
  *     Actor actor = Actor::New();
  *
- *     actor.TouchSignal().Connect( this, &MyClass::Callback );
+ *     actor.TouchedSignal().Connect( this, &MyClass::Callback );
  *   }
  *
  *   ~MyClass()
index 145430d..26a71e9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2
 Summary:    DALi 3D Engine
-Version:    1.9.27
+Version:    1.9.28
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT