Gesture event refactor 25/203325/15
authorDaniel McEwen <d.mcewen@partner.samsung.com>
Thu, 11 Apr 2019 16:26:34 +0000 (17:26 +0100)
committerDaniel McEwen <d.mcewen@partner.samsung.com>
Thu, 9 May 2019 18:13:55 +0000 (19:13 +0100)
Moving the gesture event handling into Core

Change-Id: Ie507b9005513a389a15b7fe717ea4228eb535aaa

47 files changed:
automated-tests/src/dali-adaptor-internal/CMakeLists.txt
automated-tests/src/dali-adaptor/CMakeLists.txt
automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-generator.cpp [new file with mode: 0644]
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-generator.h [new file with mode: 0644]
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-manager.cpp [deleted file]
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-manager.h [deleted file]
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.h
automated-tests/src/dali-platform-abstraction/CMakeLists.txt
dali/devel-api/adaptor-framework/accessibility-gesture-event.h [new file with mode: 0644]
dali/devel-api/adaptor-framework/accessibility-gesture-handler.h
dali/devel-api/file.list
dali/integration-api/adaptor.h
dali/internal/accessibility/common/accessibility-adaptor-impl.cpp
dali/internal/accessibility/common/accessibility-gesture-detector.cpp
dali/internal/accessibility/common/accessibility-gesture-detector.h
dali/internal/accessibility/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp
dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp
dali/internal/accessibility/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor.cpp
dali/internal/input/common/gesture-detector.h [deleted file]
dali/internal/input/common/gesture-manager.cpp [deleted file]
dali/internal/input/common/gesture-manager.h [deleted file]
dali/internal/input/common/long-press-gesture-detector.cpp [deleted file]
dali/internal/input/common/long-press-gesture-detector.h [deleted file]
dali/internal/input/common/pan-gesture-detector-base.cpp [deleted file]
dali/internal/input/common/pan-gesture-detector-base.h [deleted file]
dali/internal/input/common/pan-gesture-detector.cpp [deleted file]
dali/internal/input/common/pan-gesture-detector.h [deleted file]
dali/internal/input/common/pinch-gesture-detector.cpp [deleted file]
dali/internal/input/common/pinch-gesture-detector.h [deleted file]
dali/internal/input/common/tap-gesture-detector.cpp [deleted file]
dali/internal/input/common/tap-gesture-detector.h [deleted file]
dali/internal/input/file.list
dali/internal/legacy/common/tizen-platform-abstraction.cpp
dali/internal/legacy/common/tizen-platform-abstraction.h
dali/internal/system/common/environment-options.cpp
dali/internal/system/common/environment-options.h
dali/internal/system/common/environment-variables.h
dali/internal/window-system/common/event-handler.cpp
dali/internal/window-system/common/event-handler.h
dali/internal/window-system/common/window-impl.cpp

index ea46563..7df3c8c 100644 (file)
@@ -25,7 +25,6 @@ LIST(APPEND TC_SOURCES
     ../dali-adaptor/dali-test-suite-utils/test-actor-utils.cpp
     ../dali-adaptor/dali-test-suite-utils/test-harness.cpp
     ../dali-adaptor/dali-test-suite-utils/test-application.cpp
-    ../dali-adaptor/dali-test-suite-utils/test-gesture-manager.cpp
     ../dali-adaptor/dali-test-suite-utils/test-gl-abstraction.cpp
     ../dali-adaptor/dali-test-suite-utils/test-gl-sync-abstraction.cpp
     ../dali-adaptor/dali-test-suite-utils/test-native-image.cpp
index f2b10e6..d7414fb 100644 (file)
@@ -27,7 +27,7 @@ LIST(APPEND TC_SOURCES
     dali-test-suite-utils/test-actor-utils.cpp
     dali-test-suite-utils/test-harness.cpp
     dali-test-suite-utils/test-application.cpp
-    dali-test-suite-utils/test-gesture-manager.cpp
+    dali-test-suite-utils/test-gesture-generator.cpp
     dali-test-suite-utils/test-gl-abstraction.cpp
     dali-test-suite-utils/test-gl-sync-abstraction.cpp
     dali-test-suite-utils/test-native-image.cpp
index 70f4254..577ca36 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TEST_SUITE_UTILS_H__
-#define __DALI_TEST_SUITE_UTILS_H__
+#ifndef DALI_TEST_SUITE_UTILS_H
+#define DALI_TEST_SUITE_UTILS_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ void tet_printf(const char *format, ...);
 
 #include "test-application.h"
 #include "test-actor-utils.h"
+#include "test-gesture-generator.h"
 
 using namespace Dali;
 
@@ -442,4 +443,4 @@ private:
 
 } // namespace Test
 
-#endif // __DALI_TEST_SUITE_UTILS_H__
+#endif // DALI_TEST_SUITE_UTILS_H
index 1562d27..0b98b27 100644 (file)
@@ -47,7 +47,6 @@ void TestApplication::Initialize()
                                         mPlatformAbstraction,
                                         mGlAbstraction,
                                         mGlSyncAbstraction,
-                                        mGestureManager,
                                         mDataRetentionPolicy,
                                         Integration::RenderToFrameBuffer::FALSE,
                                         Integration::DepthBufferAvailable::TRUE,
@@ -141,11 +140,6 @@ TestGlSyncAbstraction& TestApplication::GetGlSyncAbstraction()
   return mGlSyncAbstraction;
 }
 
-TestGestureManager& TestApplication::GetGestureManager()
-{
-  return mGestureManager;
-}
-
 void TestApplication::ProcessEvent(const Integration::Event& event)
 {
   mCore->QueueEvent(event);
index fc2929c..27aafd3 100644 (file)
@@ -20,7 +20,6 @@
 
 // INTERNAL INCLUDES
 #include <test-platform-abstraction.h>
-#include "test-gesture-manager.h"
 #include "test-gl-sync-abstraction.h"
 #include "test-gl-abstraction.h"
 #include "test-render-controller.h"
@@ -68,7 +67,6 @@ public:
   TestRenderController& GetRenderController();
   TestGlAbstraction& GetGlAbstraction();
   TestGlSyncAbstraction& GetGlSyncAbstraction();
-  TestGestureManager& GetGestureManager();
   void ProcessEvent(const Integration::Event& event);
   void SendNotification();
   bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
@@ -96,7 +94,6 @@ protected:
   TestRenderController      mRenderController;
   TestGlAbstraction         mGlAbstraction;
   TestGlSyncAbstraction     mGlSyncAbstraction;
-  TestGestureManager        mGestureManager;
   TestRenderSurface*        mRenderSurface;
 
   Integration::UpdateStatus mStatus;
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-generator.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-generator.cpp
new file mode 100644 (file)
index 0000000..a0ac206
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test-gesture-generator.h"
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/events/touch-event-integ.h>
+
+namespace
+{
+const uint32_t RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
+
+Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition, uint32_t time )
+{
+  Integration::TouchEvent touchEvent;
+  Integration::Point point;
+  point.SetState( state );
+  point.SetDeviceId(4);
+  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;
+  Integration::Point point;
+  point.SetState( stateA );
+  point.SetDeviceId(4);
+  point.SetScreenPosition( screenPositionA );
+  point.SetDeviceClass( Device::Class::TOUCH );
+  point.SetDeviceSubclass( Device::Subclass::NONE );
+  touchEvent.points.push_back( point );
+  point.SetScreenPosition( screenPositionB );
+  point.SetState( stateB);
+  point.SetDeviceId(7);
+  touchEvent.points.push_back( point );
+  touchEvent.time = time;
+  return touchEvent;
+}
+} // namespace
+
+namespace Dali
+{
+uint32_t TestGetFrameInterval()
+{
+  return RENDER_FRAME_INTERVAL;
+}
+
+void TestStartLongPress( TestApplication& application, float x, float y, uint32_t time )
+{
+  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( x, y ), time ) );
+}
+
+void TestTriggerLongPress( TestApplication& application )
+{
+  application.GetPlatform().TriggerTimer();
+}
+
+void TestGenerateLongPress( TestApplication& application, float x, float y, uint32_t time )
+{
+  TestStartLongPress( application, x, y, time );
+  TestTriggerLongPress( application );
+}
+
+void TestEndLongPress( TestApplication& application, float x, float y, uint32_t time )
+{
+  application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( x, y ), time ) );
+}
+
+void TestGeneratePinch( TestApplication& application)
+{
+  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, 28.0f ), PointState::MOTION, Vector2( 20.0f, 82.0f ), 160 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 37.0f ), PointState::MOTION, Vector2( 20.0f, 74.0f ), 170 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 46.0f ), PointState::MOTION, Vector2( 20.0f, 66.0f ), 180 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 55.0f ), PointState::MOTION, Vector2( 20.0f, 58.0f ), 190 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::UP, Vector2( 20.0f, 55.0f ), PointState::UP, Vector2( 20.0f, 58.0f ), 200 ) );
+}
+
+void TestStartPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+{
+  application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, a1, PointState::DOWN, b1, time ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 50 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 150 ) );
+}
+
+void TestContinuePinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+{
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time + 50 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time +150 ) );
+}
+
+void TestEndPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+{
+  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::UP, a2, PointState::UP, b2, time +50 ) );
+}
+
+void TestGenerateMiniPan( TestApplication& application)
+{
+  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 250 ) );
+  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 251 ) );
+  application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 20.0f, 40.0f ), 255 ) );
+}
+
+void TestStartPan( TestApplication& application, Vector2 start, Vector2 end, uint32_t& time )
+{
+  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, start, time ) );
+
+  time += RENDER_FRAME_INTERVAL;
+
+  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, end, time ) );
+
+  time += RENDER_FRAME_INTERVAL;
+
+  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, end, time ) );
+
+  time += RENDER_FRAME_INTERVAL;
+}
+
+void TestMovePan( TestApplication& application, Vector2 pos, uint32_t time )
+{
+  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, pos, time ) );
+}
+
+void TestEndPan( TestApplication& application, Vector2 pos, uint32_t time )
+{
+  application.ProcessEvent( GenerateSingleTouch( PointState::UP, pos, time ) );
+}
+
+void TestGenerateTap( TestApplication& application, float x, float y, uint32_t time_down )
+{
+  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( x, y ), time_down ) );
+  application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( x, y ), time_down + 20 ) );
+}
+
+void TestGenerateTwoPointTap( TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down )
+{
+  application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( x1, y1 ), PointState::DOWN, Vector2( x2, y2 ), time_down ) );
+  application.ProcessEvent( GenerateDoubleTouch( PointState::UP, Vector2( x1, y1 ), PointState::UP, Vector2( x2, y2 ), time_down + 20 ) );
+}
+
+} // namespace Dali
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-generator.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-generator.h
new file mode 100644 (file)
index 0000000..80611a0
--- /dev/null
@@ -0,0 +1,108 @@
+#ifndef DALI_TEST_GESTURE_GENERATOR_H
+#define DALI_TEST_GESTURE_GENERATOR_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test-application.h"
+
+namespace Dali
+{
+/**
+ * These functions use touch events to trigger a gesture, assuming the default gesture parameters are used
+ */
+
+/**
+ * Returns the frame interval used in ms
+ */
+uint32_t TestGetFrameInterval();
+
+/**
+ * Produces the initial touch of a long press
+ */
+void TestStartLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+
+/**
+ * Triggers the timer to begin a long press gesture
+ */
+void TestTriggerLongPress( TestApplication& application );
+
+/**
+ * Produces the initial press and triggers the timer to begin a long press gesture
+ */
+void TestGenerateLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+
+/**
+ * End a long press by lifting the touch
+ */
+void TestEndLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+
+/**
+ * Produces a vertical pinch gesture between (20,20) and (20,90)
+ */
+void TestGeneratePinch( TestApplication& application );
+
+/**
+ * Produces the gesture started event of a pinch, using 4 touches, 50ms apart, starting with 1, ending at 2
+ */
+void TestStartPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+
+/**
+ * Produces a gesture continuing event of a pinch, using 4 touches, 50ms apart, starting with 1, ending at 2
+ */
+void TestContinuePinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+
+/**
+ * Produces a gesture finished event of a pinch, using 2 touches, 50ms apart
+ */
+void TestEndPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+
+/**
+ * Produces a pan gesture from (20,20) to (20,40)
+ */
+void TestGenerateMiniPan( TestApplication& application );
+
+/**
+ * Produces the start event of a pan gesture, assuming minimum distance moved between start and end is greater than 15
+ * in either direction or 11 in both (x&y). Time will be incremented using the standard frame interval per touch movement
+ */
+void TestStartPan( TestApplication& application, Vector2 start, Vector2 end, uint32_t& time );
+
+/**
+ * Continues a pan event by creating a single touch at pos.
+ * N.B This does not increment the time
+ */
+void TestMovePan( TestApplication& application, Vector2 pos, uint32_t time = 400);
+
+/**
+ * End a pan gesture at position pos
+ */
+void TestEndPan( TestApplication& application, Vector2 pos, uint32_t time = 500);
+
+/**
+ * Produces a single point tap gesture with a 20ms interval
+ */
+void TestGenerateTap( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time_down = 100 );
+
+/**
+ * Produce a tap gesture with two touch points and a 20ms interval
+ */
+void TestGenerateTwoPointTap( TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down );
+
+} // namespace Dali
+
+#endif // DALI_TEST_GESTURE_GENERATOR_H
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-manager.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-manager.cpp
deleted file mode 100644 (file)
index 2844ff1..0000000
+++ /dev/null
@@ -1,103 +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 "test-gesture-manager.h"
-
-namespace Dali
-{
-
-TestGestureManager::TestGestureManager()
-{
-  Initialize();
-}
-
-/**
- * Destructor
- */
-TestGestureManager::~TestGestureManager()
-{
-}
-
-/**
- * @copydoc Dali::Integration::GestureManager::Register(Gesture::Type)
- */
-void TestGestureManager::Register(const Integration::GestureRequest& request)
-{
-  mFunctionsCalled.Register = true;
-}
-
-/**
- * @copydoc Dali::Integration::GestureManager::Unregister(Gesture::Type)
- */
-void TestGestureManager::Unregister(const Integration::GestureRequest& request)
-{
-  mFunctionsCalled.Unregister = true;
-}
-
-/**
- * @copydoc Dali::Integration::GestureManager::Update(Gesture::Type)
- */
-void TestGestureManager::Update(const Integration::GestureRequest& request)
-{
-  mFunctionsCalled.Update = true;
-}
-
-
-/** Call this every test */
-void TestGestureManager::Initialize()
-{
-  mFunctionsCalled.Reset();
-}
-
-bool TestGestureManager::WasCalled(TestFuncEnum func)
-{
-  switch(func)
-  {
-    case RegisterType:             return mFunctionsCalled.Register;
-    case UnregisterType:           return mFunctionsCalled.Unregister;
-    case UpdateType:               return mFunctionsCalled.Update;
-  }
-  return false;
-}
-
-void TestGestureManager::ResetCallStatistics(TestFuncEnum func)
-{
-  switch(func)
-  {
-    case RegisterType:             mFunctionsCalled.Register = false; break;
-    case UnregisterType:           mFunctionsCalled.Unregister = false; break;
-    case UpdateType:               mFunctionsCalled.Update = false; break;
-  }
-}
-
-TestGestureManager::TestFunctions::TestFunctions()
-: Register(false),
-  Unregister(false),
-  Update(false)
-{
-}
-
-void TestGestureManager::TestFunctions::Reset()
-{
-  Register = false;
-  Unregister = false;
-  Update = false;
-}
-
-
-
-} // namespace Dali
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-manager.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gesture-manager.h
deleted file mode 100644 (file)
index 6fddd30..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef __DALI_TEST_GESTURE_MANAGER_H__
-#define __DALI_TEST_GESTURE_MANAGER_H__
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/gesture-manager.h>
-#include <dali/public-api/common/dali-common.h>
-
-namespace Dali
-{
-
-/**
- * Concrete implementation of the gesture manager class.
- */
-class DALI_CORE_API TestGestureManager : public Dali::Integration::GestureManager
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  TestGestureManager();
-
-  /**
-   * Destructor
-   */
-  virtual ~TestGestureManager();
-
-  /**
-   * @copydoc Dali::Integration::GestureManager::Register(Gesture::Type)
-   */
-  virtual void Register(const Integration::GestureRequest& request);
-
-  /**
-   * @copydoc Dali::Integration::GestureManager::Unregister(Gesture::Type)
-   */
-  virtual void Unregister(const Integration::GestureRequest& request);
-
-  /**
-   * @copydoc Dali::Integration::GestureManager::Update(Gesture::Type)
-   */
-  virtual void Update(const Integration::GestureRequest& request);
-
-public: // TEST FUNCTIONS
-
-  // Enumeration of Gesture Manager methods
-  enum TestFuncEnum
-  {
-    RegisterType,
-    UnregisterType,
-    UpdateType,
-  };
-
-  /** Call this every test */
-  void Initialize();
-  bool WasCalled(TestFuncEnum func);
-  void ResetCallStatistics(TestFuncEnum func);
-
-private:
-
-  struct TestFunctions
-  {
-    TestFunctions();
-    void Reset();
-
-    bool Register;
-    bool Unregister;
-    bool Update;
-  };
-
-  TestFunctions mFunctionsCalled;
-};
-
-} // Dali
-
-#endif // __DALI_TEST_GESTURE_MANAGER_H__
index 190aa63..3962870 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,9 @@ TestPlatformAbstraction::TestPlatformAbstraction()
   mClosestSize(),
   mLoadFileResult(),
   mSaveFileResult( false ),
-  mSynchronouslyLoadedResource()
+  mSynchronouslyLoadedResource(),
+  mTimerId(0),
+  mCallbackFunction(nullptr)
 {
   Initialize();
 }
@@ -82,7 +84,6 @@ bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename,
   return mLoadFileResult.loadResult;
 }
 
-
 /** Call this every test */
 void TestPlatformAbstraction::Initialize()
 {
@@ -144,4 +145,24 @@ void TestPlatformAbstraction::SetDecodedBitmap( Integration::BitmapPtr bitmap )
   mDecodedBitmap = bitmap;
 }
 
+uint32_t TestPlatformAbstraction::StartTimer( uint32_t milliseconds, CallbackBase* callback )
+{
+  mCallbackFunction = callback;
+  mTimerId++;
+  return mTimerId;
+}
+
+void TestPlatformAbstraction::TriggerTimer()
+{
+  if (mCallbackFunction != nullptr)
+  {
+    CallbackBase::Execute( *mCallbackFunction );
+  }
+}
+
+void TestPlatformAbstraction::CancelTimer ( uint32_t timerId )
+{
+  mCallbackFunction = nullptr;
+}
+
 } // namespace Dali
index dfa4d6c..7c1b010 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TEST_PLATFORM_ABSTRACTION_H__
-#define __DALI_TEST_PLATFORM_ABSTRACTION_H__
+#ifndef DALI_TEST_PLATFORM_ABSTRACTION_H
+#define DALI_TEST_PLATFORM_ABSTRACTION_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -89,6 +89,15 @@ public:
    */
   virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const { return true; }
 
+  /**
+   * @copydoc PlatformAbstraction::StartTimer()
+   */
+  virtual uint32_t StartTimer( uint32_t milliseconds, CallbackBase* callback );
+
+  /*
+   * @copydoc PlatformAbstraction::CancelTimer()
+   */
+  virtual void CancelTimer ( uint32_t timerId );
 
 public: // TEST FUNCTIONS
 
@@ -156,6 +165,11 @@ public: // TEST FUNCTIONS
    */
   void SetDecodedBitmap( Integration::BitmapPtr bitmap );
 
+  /**
+   * @brief Triggers the previously stored callback function
+   */
+  void TriggerTimer();
+
 private:
 
   TestPlatformAbstraction( const TestPlatformAbstraction& ); ///< Undefined
@@ -184,8 +198,11 @@ private:
 
   Integration::ResourcePointer  mSynchronouslyLoadedResource;
   Integration::BitmapPtr        mDecodedBitmap;
+
+  uint32_t                      mTimerId;
+  CallbackBase*                 mCallbackFunction;
 };
 
 } // Dali
 
-#endif /* __DALI_TEST_PLATFORM_ABSTRACTION_H__ */
+#endif /* DALI_TEST_PLATFORM_ABSTRACTION_H */
index be00390..24dc383 100644 (file)
@@ -15,7 +15,6 @@ LIST(APPEND TC_SOURCES
     ../dali-adaptor/dali-test-suite-utils/test-actor-utils.cpp
     ../dali-adaptor/dali-test-suite-utils/test-harness.cpp
     ../dali-adaptor/dali-test-suite-utils/test-application.cpp
-    ../dali-adaptor/dali-test-suite-utils/test-gesture-manager.cpp
     ../dali-adaptor/dali-test-suite-utils/test-gl-abstraction.cpp
     ../dali-adaptor/dali-test-suite-utils/test-gl-sync-abstraction.cpp
     ../dali-adaptor/dali-test-suite-utils/test-native-image.cpp
diff --git a/dali/devel-api/adaptor-framework/accessibility-gesture-event.h b/dali/devel-api/adaptor-framework/accessibility-gesture-event.h
new file mode 100644 (file)
index 0000000..30a54f2
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
+#define DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/events/gesture.h>
+#include <dali/public-api/math/vector2.h>
+
+namespace Dali
+{
+
+struct AccessibilityGestureEvent
+{
+  // Construction & Destruction
+
+  /**
+   * Virtual destructor
+   */
+  ~AccessibilityGestureEvent()
+  {
+  }
+
+  // Data
+
+  /**
+   * The previous touch position of the primary touch point in screen coordinates.
+   */
+  Vector2 previousPosition;
+
+  /**
+   * This current touch position of the primary touch point in screen coordinates.
+   */
+  Vector2 currentPosition;
+
+  /**
+   * The time difference between the previous and latest touch motion events (in ms).
+   */
+  unsigned long timeDelta;
+
+  /**
+   * The total number of fingers touching the screen in a pan gesture.
+   */
+  unsigned int numberOfTouches;
+
+  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
+  };
+
+  State state;
+
+  uint32_t time;
+
+  /**
+   * Default Constructor
+   * @param[in]  state  The state of the gesture
+   */
+  AccessibilityGestureEvent(AccessibilityGestureEvent::State state)
+  : timeDelta( 0 ),
+  numberOfTouches( 0 ),
+  state( state ),
+  time( 0 )
+  {}
+};
+
+} // namespace Dali
+
+#endif // DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
index b525c47..4b8c859 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_ACCESSIBILITY_GESTURE_HANDLER_H__
-#define __DALI_ACCESSIBILITY_GESTURE_HANDLER_H__
+#ifndef DALI_ACCESSIBILITY_GESTURE_HANDLER_H
+#define DALI_ACCESSIBILITY_GESTURE_HANDLER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/integration-api/events/pan-gesture-event.h>
+#include <dali/devel-api/adaptor-framework/accessibility-gesture-event.h>
 
 namespace Dali
 {
@@ -37,10 +37,10 @@ public:
    * @param[in]  panEvent  The pan event to be handled.
    * @return whether the gesture is handled successfully or not.
    */
-  virtual bool HandlePanGesture( const Integration::PanGestureEvent& panEvent ) = 0;
+  virtual bool HandlePanGesture( const AccessibilityGestureEvent& panEvent ) = 0;
 
 }; // class AccessibilityGestureHandler
 
 } // namespace Dali
 
-#endif // __DALI_ACCESSIBILITY_GESTURE_HANDLER_H__
+#endif // DALI_ACCESSIBILITY_GESTURE_HANDLER_H
index 72b8645..d3c3265 100755 (executable)
@@ -37,6 +37,7 @@ devel_api_adaptor_framework_header_files = \
   $(adaptor_devel_api_dir)/adaptor-framework/accessibility-adaptor.h \
   $(adaptor_devel_api_dir)/adaptor-framework/accessibility-action-handler.h \
   $(adaptor_devel_api_dir)/adaptor-framework/accessibility-gesture-handler.h \
+  $(adaptor_devel_api_dir)/adaptor-framework/accessibility-gesture-event.h \
   $(adaptor_devel_api_dir)/adaptor-framework/application-devel.h \
   $(adaptor_devel_api_dir)/adaptor-framework/bitmap-saver.h \
   $(adaptor_devel_api_dir)/adaptor-framework/clipboard-event-notifier.h \
index 279ccb8..25b5a6b 100755 (executable)
@@ -376,14 +376,6 @@ public:
   void NotifyLanguageChanged();
 
   /**
-   * @brief Sets minimum distance in pixels that the fingers must move towards/away from each other in order to
-   * trigger a pinch gesture
-   *
-   * @param[in] distance The minimum pinch distance in pixels
-   */
-  void SetMinimumPinchDistance(float distance);
-
-  /**
    * @brief Feed a touch point to the adaptor.
    *
    * @param[in] point touch point
index 7f2aa76..d3eb43b 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
-#include <dali/integration-api/events/gesture-requests.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/adaptor-impl.h>
index 8010348..b872077 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/internal/accessibility/common/accessibility-gesture-detector.h>
 
 // EXTERNAL INCLUDES
-#include <dali/integration-api/events/gesture-requests.h>
+#include <cmath>
+
+#include <dali/public-api/events/touch-point.h>
+
+#include <dali/integration-api/events/touch-event-integ.h>
+
 
 namespace Dali
 {
@@ -30,10 +35,32 @@ namespace Internal
 namespace Adaptor
 {
 
+namespace
+{
+  const float MINIMUM_MOTION_DISTANCE_BEFORE_PAN( 15.0f );
+  const float MINIMUM_MOTION_DISTANCE_BEFORE_PAN_SQUARED( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_BEFORE_PAN );
+  const float MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO( 2.0f / 3.0f );
+  const unsigned long MAXIMUM_TIME_DIFF_ALLOWED( 500 );
+  const unsigned long MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS( 100 );
+  const unsigned int MINIMUM_MOTION_EVENTS_BEFORE_PAN(2);
+  const unsigned int MINIMUM_TOUCHES_BEFORE_PAN(1);
+  const unsigned int MAXIMUM_TOUCHES_BEFORE_PAN(1);
+} // unnamed namespace
+
+
 AccessibilityGestureDetector::AccessibilityGestureDetector()
-: PanGestureDetectorBase(Vector2::ZERO, Integration::PanGestureRequest(), NULL),
-  mGestureHandler(NULL),
-  mPanning(false)
+: mState( Clear ),
+  mScene(nullptr),
+  mGestureHandler(nullptr),
+  mPanning(false),
+  mThresholdAdjustmentsRemaining( 0 ),
+  mThresholdTotalAdjustments( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO ),
+  mPrimaryTouchDownTime( 0 ),
+  mMinimumTouchesRequired( MINIMUM_TOUCHES_BEFORE_PAN ),
+  mMaximumTouchesRequired( MAXIMUM_TOUCHES_BEFORE_PAN ),
+  mMinimumDistanceSquared( MINIMUM_MOTION_DISTANCE_BEFORE_PAN_SQUARED ),
+  mMinimumMotionEvents( MINIMUM_MOTION_EVENTS_BEFORE_PAN ),
+  mMotionEvents( 0 )
 {
 }
 
@@ -46,11 +73,11 @@ void AccessibilityGestureDetector::SetGestureHandler(AccessibilityGestureHandler
   mGestureHandler = &handler;
 }
 
-void AccessibilityGestureDetector::EmitPan(const Integration::PanGestureEvent gesture)
+void AccessibilityGestureDetector::EmitPan(const AccessibilityGestureEvent gesture)
 {
   if( mGestureHandler )
   {
-    if(gesture.state == Gesture::Started)
+    if(gesture.state == AccessibilityGestureEvent::Started)
     {
       mPanning = true;
     }
@@ -59,8 +86,8 @@ void AccessibilityGestureDetector::EmitPan(const Integration::PanGestureEvent ge
     {
       mGestureHandler->HandlePanGesture(gesture);
 
-      if( (gesture.state == Gesture::Finished) ||
-          (gesture.state == Gesture::Cancelled) )
+      if( (gesture.state == AccessibilityGestureEvent::Finished) ||
+          (gesture.state == AccessibilityGestureEvent::Cancelled) )
       {
         mPanning = false;
       }
@@ -68,6 +95,236 @@ void AccessibilityGestureDetector::EmitPan(const Integration::PanGestureEvent ge
   }
 }
 
+void AccessibilityGestureDetector::SendEvent(const Integration::TouchEvent& event)
+{
+  PointState::Type primaryPointState(event.points[0].GetState());
+
+  if (primaryPointState == PointState::INTERRUPTED)
+  {
+    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(AccessibilityGestureEvent::Cancelled, event);
+    }
+    mState = Clear; // We should change our state to Clear.
+    mTouchEvents.clear();
+  }
+  else
+  {
+    switch (mState)
+    {
+      case Clear:
+      {
+        if ( ( primaryPointState == PointState::DOWN ) || ( primaryPointState == PointState::STATIONARY ) )
+        {
+          mPrimaryTouchDownLocation = event.points[0].GetScreenPosition();
+          mPrimaryTouchDownTime = event.time;
+          mMotionEvents = 0;
+          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(AccessibilityGestureEvent::Possible, event);
+          }
+
+          mTouchEvents.push_back(event);
+        }
+        break;
+      }
+
+      case Possible:
+      {
+        unsigned int pointCount(event.GetPointCount());
+        if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
+        {
+          if (primaryPointState == PointState::MOTION)
+          {
+            mTouchEvents.push_back(event);
+            mMotionEvents++;
+
+            Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
+
+            if ( ( mMotionEvents >= mMinimumMotionEvents ) &&
+                 ( 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(AccessibilityGestureEvent::Started, event);
+            }
+          }
+          else if (primaryPointState == PointState::UP)
+          {
+            Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
+            if (delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) )
+            {
+              SendPan(AccessibilityGestureEvent::Started, event);
+              mTouchEvents.push_back(event);
+              SendPan(AccessibilityGestureEvent::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(AccessibilityGestureEvent::Cancelled, event);
+            }
+            mState = Clear;
+            mTouchEvents.clear();
+          }
+        }
+        else
+        {
+          // We do not satisfy pan conditions, tell Core our Gesture has been cancelled.
+          SendPan(AccessibilityGestureEvent::Cancelled, event);
+
+          if (pointCount == 1 && primaryPointState == PointState::UP)
+          {
+            // 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;
+          }
+        }
+        break;
+      }
+
+      case Started:
+      {
+        mTouchEvents.push_back(event);
+
+        unsigned int pointCount(event.GetPointCount());
+        if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
+        {
+          switch (primaryPointState)
+          {
+            case PointState::MOTION:
+              // Pan is continuing, tell Core.
+              SendPan(AccessibilityGestureEvent::Continuing, event);
+              break;
+
+            case PointState::UP:
+              // Pan is finally finished when our primary point is lifted, tell Core and change our state to Clear.
+              SendPan(AccessibilityGestureEvent::Finished, event);
+              mState = Clear;
+              mTouchEvents.clear();
+              break;
+
+            case PointState::STATIONARY:
+              if (pointCount == mMinimumTouchesRequired)
+              {
+                Integration::PointContainerConstIterator iter = event.points.begin() + 1; // We already know the state of the first point
+                for(; iter != event.points.end(); ++iter)
+                {
+                  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(AccessibilityGestureEvent::Finished, event);
+                    mState = Finished;
+                    break;
+                  }
+                }
+              }
+              break;
+
+            default:
+              break;
+          }
+        }
+        else
+        {
+          // We have gone outside of the pan requirements, inform Core that the gesture is finished.
+          SendPan(AccessibilityGestureEvent::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;
+            mTouchEvents.clear();
+          }
+          else
+          {
+            // ...otherwise we change it to Finished.
+            mState = Finished;
+          }
+        }
+        break;
+      }
+
+      case Finished:
+      case Failed:
+      {
+        if (primaryPointState == PointState::UP)
+        {
+          // Change our state back to clear when the primary touch point is released.
+          mState = Clear;
+          mTouchEvents.clear();
+        }
+        break;
+      }
+    }
+  }
+}
+
+void AccessibilityGestureDetector::SendPan(AccessibilityGestureEvent::State state, const Integration::TouchEvent& currentEvent)
+{
+  AccessibilityGestureEvent gesture(state);
+  gesture.currentPosition = currentEvent.points[0].GetScreenPosition();
+  gesture.numberOfTouches = currentEvent.GetPointCount();
+
+  if ( mTouchEvents.size() > 1 )
+  {
+    // Get the second last event in the queue, the last one is the current event
+    const Integration::TouchEvent& previousEvent( *( mTouchEvents.rbegin() + 1 ) );
+
+    Vector2 previousPosition( mPreviousPosition );
+    uint32_t previousTime( previousEvent.time );
+
+    // If we've just started then we want to remove the threshold from Core calculations.
+    if ( state == AccessibilityGestureEvent::Started )
+    {
+      previousPosition = mPrimaryTouchDownLocation;
+      previousTime = mPrimaryTouchDownTime;
+
+      // If it's a slow pan, we do not want to phase in the threshold over the first few pan-events
+      // A slow pan is defined as one that starts the specified number of milliseconds after the down-event
+      if ( ( currentEvent.time - previousTime ) > MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS )
+      {
+        mThresholdAdjustmentsRemaining = mThresholdTotalAdjustments;
+        mThresholdAdjustmentPerFrame = ( gesture.currentPosition - previousPosition ) / static_cast<float>( mThresholdTotalAdjustments );
+      }
+      else
+      {
+        mThresholdAdjustmentsRemaining = 0;
+        mThresholdAdjustmentPerFrame = Vector2::ZERO;
+      }
+    }
+
+    gesture.previousPosition = previousPosition;
+    gesture.timeDelta = currentEvent.time - previousTime;
+
+    // Apply the threshold with a phased approach
+    if ( mThresholdAdjustmentsRemaining > 0 )
+    {
+      --mThresholdAdjustmentsRemaining;
+      gesture.currentPosition -= mThresholdAdjustmentPerFrame * static_cast<float>( mThresholdAdjustmentsRemaining );
+    }
+
+    mPreviousPosition = gesture.currentPosition;
+  }
+  else
+  {
+    gesture.previousPosition = gesture.currentPosition;
+    gesture.timeDelta = 0;
+  }
+
+  gesture.time = currentEvent.time;
+
+  EmitPan(gesture);
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 90d23e3..616d76e 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H__
-#define __DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H__
+#ifndef DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
+#define DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // EXTERNAL INCLUDES
 
 // INTERNAL INCLUDES
-#include <dali/internal/input/common/pan-gesture-detector-base.h>
 #include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
+#include <dali/devel-api/adaptor-framework/accessibility-gesture-event.h>
+#include <dali/integration-api/scene.h>
+#include <dali/public-api/events/touch-event.h>
 
 namespace Dali
 {
 
 namespace Integration
 {
-class Core;
 struct TouchEvent;
-struct PanGestureRequest;
 }
 
 namespace Internal
@@ -43,7 +43,7 @@ namespace Adaptor
 /**
  * Detects an accessibility pan gesture and sends it to the gesture handler.
  */
-class AccessibilityGestureDetector : public PanGestureDetectorBase
+class AccessibilityGestureDetector : public RefObject
 {
 public:
 
@@ -64,18 +64,64 @@ public:
    */
   void SetGestureHandler(AccessibilityGestureHandler& handler);
 
+  void SendEvent(const Integration::TouchEvent& event);
+
+  void SendEvent(Integration::Scene& scene, const Integration::TouchEvent& event)
+  {
+    mScene = &scene;
+    SendEvent(event);
+  }
+
 private:
 
   /**
+   * Emits the pan gesture event (performs some smoothing operation).
+   * @param[in]  state         The state of the pan.
+   * @param[in]  currentEvent  The latest touch event.
+   */
+  void SendPan(AccessibilityGestureEvent::State state, const Integration::TouchEvent& currentEvent);
+
+  /**
    * Emits the pan gesture event to the gesture handler.
    * @param[in] gesture The pan gesture event.
    */
-  virtual void EmitPan(const Integration::PanGestureEvent gesture);
+  void EmitPan(const AccessibilityGestureEvent gesture);
 
 private:
 
+  /**
+   * Internal state machine.
+   */
+  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.
+  };
+
+  State mState; ///< The current state of the detector.
+
+  Integration::Scene* mScene;
   AccessibilityGestureHandler* mGestureHandler; ///< The pointer of accessibility gesture handler
   bool mPanning;    ///< Keep track of panning state, when panning is occuring, this is true.
+
+  std::vector<Integration::TouchEvent> mTouchEvents;     ///< A container of all touch events after an initial down event.
+
+  Vector2 mPrimaryTouchDownLocation;    ///< The initial touch down point.
+  Vector2 mThresholdAdjustmentPerFrame; ///< The adjustment per frame at the start of a slow pan.
+  Vector2 mPreviousPosition;            ///< The previous position.
+
+  unsigned int mThresholdAdjustmentsRemaining; ///< No. of threshold adjustments still to apply (for a slow-pan).
+  unsigned int mThresholdTotalAdjustments;     ///< The total number of adjustments required.
+
+  uint32_t mPrimaryTouchDownTime;       ///< The initial touch down time.
+  unsigned int mMinimumTouchesRequired; ///< The minimum touches required before a pan should be emitted.
+  unsigned int mMaximumTouchesRequired; ///< The maximum touches after which a pan should not be emitted.
+  unsigned int mMinimumDistanceSquared; ///< The minimum distance squared before pan should start.
+  unsigned int mMinimumMotionEvents;    ///< The minimum motion events before pan should start.
+  unsigned int mMotionEvents;           ///< The motion events received so far (before pan is emitted).
 };
 
 using AccessibilityGestureDetectorPtr = Dali::IntrusivePtr<AccessibilityGestureDetector>;
@@ -86,4 +132,4 @@ using AccessibilityGestureDetectorPtr = Dali::IntrusivePtr<AccessibilityGestureD
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H__
+#endif // DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
index b8c9e1d..f75eff9 100644 (file)
@@ -31,7 +31,6 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/debug.h>
-#include <dali/integration-api/events/gesture-requests.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/singleton-service-impl.h>
index b8c9e1d..f75eff9 100644 (file)
@@ -31,7 +31,6 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/debug.h>
-#include <dali/integration-api/events/gesture-requests.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/singleton-service-impl.h>
index c33fafd..d382759 100644 (file)
@@ -31,7 +31,6 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/debug.h>
-#include <dali/integration-api/events/gesture-requests.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/system/common/singleton-service-impl.h>
index 6899099..7907c7a 100755 (executable)
@@ -46,7 +46,6 @@
 #include <dali/internal/system/common/callback-manager.h>
 #include <dali/internal/accessibility/common/tts-player-impl.h>
 #include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
-#include <dali/internal/input/common/gesture-manager.h>
 #include <dali/internal/window-system/common/event-handler.h>
 #include <dali/internal/graphics/gles/gl-proxy-implementation.h>
 #include <dali/internal/graphics/gles/gl-implementation.h>
@@ -159,10 +158,6 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
 
   DALI_ASSERT_DEBUG( defaultWindow->GetSurface() && "Surface not initialized" );
 
-  PositionSize size = defaultWindow->GetSurface()->GetPositionSize();
-
-  mGestureManager = new GestureManager(*this, Vector2(static_cast<float>(size.width), static_cast<float>(size.height)), mCallbackManager, *mEnvironmentOptions);
-
   mGraphics = &( graphicsFactory.Create() );
   mGraphics->Initialize( mEnvironmentOptions );
 
@@ -178,7 +173,6 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
                                   *mPlatformAbstraction,
                                   mGLES,
                                   eglSyncImpl,
-                                  *mGestureManager,
                                   dataRetentionPolicy ,
                                   ( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
                                   mGraphics->GetDepthBufferRequired(),
@@ -265,6 +259,18 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
   {
     Integration::SetPanGestureMultitapSmoothingRange( mEnvironmentOptions->GetPanGestureMultitapSmoothingRange() );
   }
+  if( mEnvironmentOptions->GetMinimumPanDistance() >= 0 )
+  {
+    Integration::SetPanGestureMinimumDistance( mEnvironmentOptions->GetMinimumPanDistance() );
+  }
+  if( mEnvironmentOptions->GetMinimumPanEvents() >= 0 )
+  {
+    Integration::SetPanGestureMinimumPanEvents( mEnvironmentOptions->GetMinimumPanEvents() );
+  }
+  if( mEnvironmentOptions->GetMinimumPinchDistance() >= 0 )
+  {
+    Integration::SetPinchGestureMinimumDistance( mEnvironmentOptions->GetMinimumPinchDistance() );
+  }
 
   // Set max texture size
   if( mEnvironmentOptions->GetMaxTextureSize() > 0 )
@@ -295,7 +301,6 @@ Adaptor::~Adaptor()
 
   delete mCore;
 
-  delete mGestureManager;
   delete mDisplayConnection;
   delete mPlatformAbstraction;
   delete mCallbackManager;
@@ -715,14 +720,6 @@ void Adaptor::DestroyTtsPlayer(Dali::TtsPlayer::Mode mode)
   }
 }
 
-void Adaptor::SetMinimumPinchDistance(float distance)
-{
-  if( mGestureManager )
-  {
-    mGestureManager->SetMinimumPinchDistance(distance);
-  }
-}
-
 Any Adaptor::GetNativeWindowHandle()
 {
   return mWindows.front()->GetNativeHandle();
@@ -996,7 +993,6 @@ Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor,
   mCallbackManager( nullptr ),
   mNotificationOnIdleInstalled( false ),
   mNotificationTrigger( nullptr ),
-  mGestureManager( nullptr ),
   mDaliFeedbackPlugin(),
   mFeedbackController( nullptr ),
   mTtsPlayers(),
index 32df0ed..e7e2bf9 100755 (executable)
@@ -332,14 +332,6 @@ public:
   void DestroyTtsPlayer(Dali::TtsPlayer::Mode mode);
 
   /**
-   * @brief Sets minimum distance in pixels that the fingers must move towards/away from each other in order to
-   * trigger a pinch gesture
-   *
-   * @param[in] distance The minimum pinch distance in pixels
-   */
-  void SetMinimumPinchDistance(float distance);
-
-  /**
    * Gets native window handle
    *
    * @return native window handle
@@ -511,15 +503,6 @@ public: // Signals
     return mLanguageChangedSignal;
   }
 
-  /**
-   * Gets the gesture manager.
-   * @return The GestureManager
-   */
-  GestureManager* GetGestureManager() const
-  {
-    return mGestureManager;
-  }
-
 private: // From Dali::Internal::Adaptor::CoreEventInterface
 
   /**
@@ -662,7 +645,6 @@ private: // Data
   CallbackManager*                      mCallbackManager;             ///< Used to install callbacks
   bool                                  mNotificationOnIdleInstalled; ///< whether the idle handler is installed to send an notification event
   TriggerEventInterface*                mNotificationTrigger;         ///< Notification event trigger
-  GestureManager*                       mGestureManager;              ///< Gesture manager
   FeedbackPluginProxy*                  mDaliFeedbackPlugin;          ///< Used to access feedback support
   FeedbackController*                   mFeedbackController;          ///< Plays feedback effects for Dali-Toolkit UI Controls.
   Dali::TtsPlayer                       mTtsPlayers[Dali::TtsPlayer::MODE_NUM];                   ///< Provides TTS support
index 9c7cfed..a183350 100755 (executable)
@@ -196,11 +196,6 @@ void Adaptor::NotifyLanguageChanged()
   mImpl->NotifyLanguageChanged();
 }
 
-void Adaptor::SetMinimumPinchDistance(float distance)
-{
-  mImpl->SetMinimumPinchDistance(distance);
-}
-
 void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
 {
   mImpl->FeedTouchPoint(point, timeStamp);
diff --git a/dali/internal/input/common/gesture-detector.h b/dali/internal/input/common/gesture-detector.h
deleted file mode 100644 (file)
index e4b90a4..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef DALI_INTERNAL_GESTURE_DETECTOR_H
-#define DALI_INTERNAL_GESTURE_DETECTOR_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/events/gesture.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/public-api/object/ref-object.h>
-#include <dali/integration-api/scene.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-class Core;
-class GestureRequest;
-struct TouchEvent;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * Abstract Base class for all adaptor gesture detectors.
- *
- * @note this may be replaced by gesture events sent directly from X.
- */
-class GestureDetector : public RefObject
-{
-public:
-
-  /**
-   * Called by the gesture manager when it gets a touch event.  The gesture detector should
-   * evaluate this event along with previously received events to determine whether the gesture
-   * they require has taken place.
-   * @param[in]  event  The latest touch event.
-   */
-  virtual void SendEvent(const Integration::TouchEvent& event) = 0;
-
-  /**
-   * Called by the gesture manager when Core updates the gesture's detection requirements.
-   * @param[in]  request  The updated detection requirements.
-   */
-  virtual void Update(const Integration::GestureRequest& request) = 0;
-
-  /**
-   * Returns the type of gesture detector.
-   * @return Type of gesture detector.
-   */
-  Gesture::Type GetType() const { return mType; }
-
-  void SendEvent(Integration::Scene& scene, const Integration::TouchEvent& event)
-  {
-    mScene = &scene;
-    SendEvent(event);
-  }
-
-protected:
-
-  /**
-   * Protected Constructor.  Should only be able to create derived class objects.
-   * @param[in]  screenSize    The size of the screen.
-   * @param[in]  detectorType  The type of gesture detector.
-   */
-  GestureDetector(Vector2 screenSize, Gesture::Type detectorType)
-  : mScreenSize(screenSize), mType(detectorType), mScene(nullptr) {}
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~GestureDetector() {}
-
-protected:
-
-  Vector2 mScreenSize;
-  Gesture::Type mType;
-  Integration::Scene* mScene;
-};
-
-typedef IntrusivePtr<GestureDetector> GestureDetectorPtr;
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_GESTURE_DETECTOR_H
diff --git a/dali/internal/input/common/gesture-manager.cpp b/dali/internal/input/common/gesture-manager.cpp
deleted file mode 100644 (file)
index 80da679..0000000
+++ /dev/null
@@ -1,245 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/input/common/gesture-manager.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/input/common/gesture-detector.h>
-#include <dali/internal/input/common/long-press-gesture-detector.h>
-#include <dali/internal/input/common/pan-gesture-detector.h>
-#include <dali/internal/input/common/pinch-gesture-detector.h>
-#include <dali/internal/input/common/tap-gesture-detector.h>
-#include <dali/internal/system/common/core-event-interface.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Integration::Log::Filter* gLogFilter  = Integration::Log::Filter::New( Debug::NoLogging, false, "LOG_GESTURE_MANAGER" );
-
-/**
- * Helper method to return the string representation of a gesture type.
- */
-const char * GetGestureTypeString( Gesture::Type type )
-{
-  static const char * const pinch( "Pinch" );
-  static const char * const pan( "Pan" );
-  static const char * const tap( "tap" );
-  static const char * const longPress( "LongPress" );
-  static const char * const invalid( "Invalid" );
-
-  const char * retVal( NULL );
-
-  switch ( type )
-  {
-    case Gesture::LongPress:
-    {
-      retVal = longPress;
-      break;
-    }
-
-    case Gesture::Pan:
-    {
-      retVal = pan;
-      break;
-    }
-
-    case Gesture::Pinch:
-    {
-      retVal = pinch;
-      break;
-    }
-
-    case Gesture::Tap:
-    {
-      retVal = tap;
-      break;
-    }
-
-    default:
-      retVal = invalid;
-      break;
-  }
-
-  return retVal;
-};
-#endif // DEBUG_ENABLED
-
-const float MINIMUM_DISTANCE_DELTA_DIVISOR = 85.0f;
-} // unnamed namespace
-
-GestureManager::GestureManager(CoreEventInterface& coreEventInterface, Vector2 screenSize,CallbackManager* callbackManager, EnvironmentOptions& environmentOptions)
-: mCoreEventInterface( coreEventInterface ),
-  mScreenSize( screenSize ),
-  mCallbackManager( callbackManager ),
-  mEnvironmentOptions( environmentOptions ),
-  mMinimumDistanceDelta(-1.0f),
-  mRunning( true ) // This allows gestures to be created before Adaptor::Start() is called e.g. by Indicator
-{
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Creating GestureManager\n" );
-}
-
-GestureManager::~GestureManager()
-{
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Destroying GestureManager\n" );
-}
-
-void GestureManager::SendEvent(Integration::Scene& scene, const Integration::TouchEvent& event)
-{
-  if (mRunning)
-  {
-    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "SendEvent: START\n" );
-
-    // gestures can be added / deleted during SendEvent so we make a copy of the container.
-    // the gestures are reference counted, so unused gesture detectors will be deleted when
-    // the local variable detectors goes out of scope.
-    GestureDetectorContainer detectors( mGestureDetectors );
-
-    // Send the event to all gesture detectors.
-    for ( GestureDetectorContainer::iterator iter = detectors.begin(), endIter = detectors.end(); iter != endIter; ++iter )
-    {
-      (*iter)->SendEvent(scene, event);
-    }
-    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "SendEvent: END\n" );
-  }
-}
-
-void GestureManager::Stop()
-{
-  if (mRunning)
-  {
-    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Stop\n" );
-
-    mGestureDetectors.clear();
-    mRunning = false;
-  }
-}
-
-void GestureManager::SetMinimumPinchDistance(float distance)
-{
-  mMinimumDistanceDelta = distance;
-  for( GestureDetectorContainer::iterator iter = mGestureDetectors.begin(), endIter = mGestureDetectors.end(); iter != endIter; ++iter )
-  {
-    if ( ( *iter )->GetType() == Gesture::Pinch )
-    {
-      DALI_LOG_INFO( gLogFilter, Debug::General, "Set Minimum Pinch Distance: %f\n", distance );
-      PinchGestureDetector* gestureDetector = static_cast<PinchGestureDetector*>(iter->Get());
-      gestureDetector->SetMinimumPinchDistance(distance);
-      break;
-    }
-  }
-}
-
-void GestureManager::Register(const Integration::GestureRequest& request)
-{
-  if (mRunning)
-  {
-    DALI_LOG_INFO( gLogFilter, Debug::General, "Creating %s Detector\n", GetGestureTypeString( request.type ) );
-
-    switch (request.type)
-    {
-      case Gesture::LongPress:
-      {
-        GestureDetectorPtr gesture = new LongPressGestureDetector(mCoreEventInterface, mScreenSize, static_cast<const Integration::LongPressGestureRequest&>(request));
-        mGestureDetectors.push_back(gesture);
-        break;
-      }
-
-      case Gesture::Pan:
-      {
-        GestureDetectorPtr gesture = new PanGestureDetector(mCoreEventInterface, mScreenSize, static_cast<const Integration::PanGestureRequest&>(request), mEnvironmentOptions);
-        mGestureDetectors.push_back(gesture);
-        break;
-      }
-
-      case Gesture::Pinch:
-      {
-        float minPinchDistance = mMinimumDistanceDelta >= 0.0f ? mMinimumDistanceDelta : (mScreenSize.height / MINIMUM_DISTANCE_DELTA_DIVISOR);
-        GestureDetectorPtr gesture = new PinchGestureDetector(mCoreEventInterface, mScreenSize, minPinchDistance);
-        mGestureDetectors.push_back(gesture);
-        break;
-      }
-
-      case Gesture::Tap:
-      {
-        GestureDetectorPtr gesture = new TapGestureDetector(mCoreEventInterface, mScreenSize, static_cast<const Integration::TapGestureRequest&>(request));
-        mGestureDetectors.push_back(gesture);
-        break;
-      }
-
-      default:
-        DALI_ASSERT_DEBUG(false);
-        break;
-    }
-  }
-}
-
-void GestureManager::Unregister(const Integration::GestureRequest& request)
-{
-  if ( mRunning )
-  {
-    DALI_LOG_INFO( gLogFilter, Debug::General, "Unregister: %s\n", GetGestureTypeString( request.type ) );
-
-    DeleteGestureDetector( request.type );
-
-  }
-}
-
-void GestureManager::Update(const Integration::GestureRequest& request)
-{
-  for( GestureDetectorContainer::iterator iter = mGestureDetectors.begin(), endIter = mGestureDetectors.end(); iter < endIter; ++iter )
-  {
-    if ( (*iter)->GetType() == request.type )
-    {
-      DALI_LOG_INFO( gLogFilter, Debug::General, "Update: %s\n", GetGestureTypeString( request.type ) );
-      (*iter)->Update( request );
-      break;
-    }
-  }
-}
-
-void GestureManager::DeleteGestureDetector( Gesture::Type type )
-{
-  for( GestureDetectorContainer::iterator iter = mGestureDetectors.begin(), endIter = mGestureDetectors.end(); iter != endIter; ++iter )
-  {
-    if ( ( *iter )->GetType() == type )
-    {
-      DALI_LOG_INFO( gLogFilter, Debug::General, "DeleteGestureDetector: %s\n", GetGestureTypeString( type ) );
-      mGestureDetectors.erase( iter );
-      break;
-    }
-  }
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/input/common/gesture-manager.h b/dali/internal/input/common/gesture-manager.h
deleted file mode 100644 (file)
index 82a203d..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#ifndef DALI_INTERNAL_GESTURE_MANAGER_H
-#define DALI_INTERNAL_GESTURE_MANAGER_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/integration-api/gesture-manager.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/input/common/gesture-detector.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-struct TouchEvent;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class CallbackManager;
-class CoreEventInterface;
-class EnvironmentOptions;
-
-/**
- * Implementation of the Integration::GestureManager.
- *
- * Contains a list of adaptor gesture detectors. It passes touch events to each required detector which
- * in turn process them to determine if their corresponding gesture has occurred.
- */
-class GestureManager : public Integration::GestureManager
-{
-public:
-
-  /**
-   * Constructor.
-   * @param[in] coreEventInterface Used to send events to Core.
-   * @param[in] screenSize The size of the screen.
-   * @param[in] callbackManager used to install callbacks
-   * @param[in] environmentOptions Environment Options
-   */
-  GestureManager(CoreEventInterface& coreEventInterface, Vector2 screenSize, CallbackManager* callbackManager, EnvironmentOptions& environmentOptions);
-
-  /**
-   * The destructor
-   */
-  virtual ~GestureManager();
-
-public:
-
-  /**
-   * Used by the event handler to send touch events to the Gesture Manager.
-   * @param[in]  event  The latest touch event.
-   */
-  void SendEvent(Integration::Scene& scene, const Integration::TouchEvent& event);
-
-  /**
-   * Used by the event handler to stop the GestureManager detection.
-   */
-  void Stop();
-
-  /**
-   * @brief Sets minimum distance in pixels that the fingers must move towards/away from each other in order to
-   * trigger a pinch gesture
-   *
-   * @param[in] distance The minimum pinch distance in pixels
-   */
-  void SetMinimumPinchDistance(float distance);
-
-public: // GestureManager overrides
-
-  /**
-   * copydoc Dali::Integration::GestureManager::Register(const Integration::GestureRequest&)
-   */
-  virtual void Register(const Integration::GestureRequest& request);
-
-  /**
-   * copydoc Dali::Integration::GestureManager::Unregister(const Integration::GestureRequest&)
-   */
-  virtual void Unregister(const Integration::GestureRequest& request);
-
-  /**
-   * copydoc Dali::Integration::GestureManager::Unregister(const Integration::GestureRequest&)
-   */
-  virtual void Update(const Integration::GestureRequest& request);
-
-private:
-
-  /**
-   * Used to delete the gesture detector of the given type.
-   */
-  void DeleteGestureDetector( Gesture::Type type );
-
-private:
-
-  typedef std::vector<GestureDetectorPtr> GestureDetectorContainer;
-
-  CoreEventInterface& mCoreEventInterface;
-  GestureDetectorContainer mGestureDetectors;
-  Vector2 mScreenSize;
-  CallbackManager* mCallbackManager;
-  EnvironmentOptions& mEnvironmentOptions;
-  float mMinimumDistanceDelta; ///< The minimum distance before a pinch is applicable. (-1.0f means pinch detector uses default value)
-  bool mRunning; ///< States whether the GestureManager is running or not.
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_GESTURE_MANAGER_H
diff --git a/dali/internal/input/common/long-press-gesture-detector.cpp b/dali/internal/input/common/long-press-gesture-detector.cpp
deleted file mode 100644 (file)
index 2716cf4..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/input/common/long-press-gesture-detector.h>
-
-// EXTERNAL INCLUDES
-#include <cmath>
-
-#include <dali/public-api/events/touch-point.h>
-#include <dali/public-api/math/vector2.h>
-
-#include <dali/integration-api/events/gesture-requests.h>
-#include <dali/integration-api/events/long-press-gesture-event.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-
-#include <dali/internal/system/common/system-settings.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/core-event-interface.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-// TODO: Set these according to DPI
-const float MAXIMUM_MOTION_ALLOWED = 60.0f;
-// TODO: Set this time according to system setting (vconf)
-const unsigned long LONG_PRESS_TIME = 500u;
-} // unnamed namespace
-
-LongPressGestureDetector::LongPressGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, const Integration::LongPressGestureRequest& request)
-: GestureDetector(screenSize, Gesture::LongPress),
-  mCoreEventInterface(coreEventInterface),
-  mState(Clear),
-  mMinimumTouchesRequired(request.minTouches),
-  mMaximumTouchesRequired(request.maxTouches),
-  mTouchTime(0),
-  mTimerSlot( this )
-{
-  mTimer = Dali::Timer::New(GetSystemValue());
-  mTimer.TickSignal().Connect( mTimerSlot, &LongPressGestureDetector::TimerCallback );
-}
-
-LongPressGestureDetector::~LongPressGestureDetector()
-{
-}
-
-void LongPressGestureDetector::SendEvent(const Integration::TouchEvent& event)
-{
-  unsigned int pointCount( event.GetPointCount() );
-
-  switch (mState)
-  {
-    // Clear: Wait till one point touches the screen before starting timer.
-    case Clear:
-    {
-      const Integration::Point& point = event.points[0];
-
-      if ( point.GetState() == PointState::DOWN )
-      {
-        mTouchPositions.clear();
-        mTouchPositions[point.GetDeviceId()] = point.GetScreenPosition();
-
-        mTouchTime = event.time;
-
-        mTimer.SetInterval(GetSystemValue());
-        mTimer.Start();
-
-        // A long press gesture may be possible, tell Core about this and change state to Touched.
-        mState = Touched;
-        EmitGesture( Gesture::Possible );
-      }
-
-      break;
-    }
-
-    // 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 );
-        mTouchPositions.clear();
-        mTimer.Stop();
-        mState = Failed;
-        break;
-      }
-
-      bool endLoop(false);
-
-      for ( Integration::PointContainerConstIterator iter = event.points.begin(), endIter = event.points.end();
-           iter != endIter && !endLoop; ++iter)
-      {
-        switch( iter->GetState() )
-        {
-          // add point.
-          case PointState::DOWN:
-          {
-            mTouchPositions[iter->GetDeviceId()] = iter->GetScreenPosition();
-            break;
-          }
-
-          // remove point.
-          case PointState::UP:
-          case PointState::INTERRUPTED:
-          {
-            // System has interrupted us, long press is not possible, inform Core
-            EmitGesture( Gesture::Cancelled );
-            mTouchPositions.clear();
-            mTimer.Stop();
-            mState = ( pointCount == 1 ) ? Clear : Failed; // Change state to Clear if only one point, Failed otherwise.
-            endLoop = true;
-            break;
-          }
-
-          case PointState::MOTION:
-          {
-            const Vector2 touchPosition( mTouchPositions[iter->GetDeviceId()] - iter->GetScreenPosition() );
-            float distanceSquared = touchPosition.LengthSquared();
-
-            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 );
-              mTimer.Stop();
-              mState = Failed;
-              endLoop = true;
-            }
-            break;
-          }
-
-          case PointState::STATIONARY:
-          case PointState::LEAVE:
-          {
-            break;
-          }
-        }
-      }
-      break;
-    }
-
-    // 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 )
-      {
-        PointState::Type primaryPointState = event.points[0].GetState();
-
-        if ( (primaryPointState == PointState::UP) || (primaryPointState == PointState::INTERRUPTED) )
-        {
-          if(mState == Finished)
-          {
-            // When the last touch point is lifted, we should inform the Core that the Long press has finished.
-            EmitGesture(Gesture::Finished);
-          }
-          mTouchPositions.clear();
-          mState = Clear; // Reset state to clear when last touch point is lifted.
-        }
-      }
-      break;
-    }
-  }
-}
-
-void LongPressGestureDetector::Update(const Integration::GestureRequest& request)
-{
-  const Integration::LongPressGestureRequest& longPress = static_cast<const Integration::LongPressGestureRequest&>(request);
-
-  mMinimumTouchesRequired = longPress.minTouches;
-  mMaximumTouchesRequired = longPress.maxTouches;
-}
-
-bool LongPressGestureDetector::TimerCallback()
-{
-  EmitGesture(Gesture::Started);
-
-  mState = Finished;
-
-  // There is no touch event at this time, so ProcessEvents must be called directly
-  mCoreEventInterface.ProcessCoreEvents();
-
-  return false;
-}
-
-void LongPressGestureDetector::EmitGesture(Gesture::State 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) ||
-       (touchPoints >= mMinimumTouchesRequired) )
-  {
-    Integration::LongPressGestureEvent longPress( state );
-    longPress.numberOfTouches = touchPoints;
-
-    for (std::map<int, Vector2>::iterator iter = mTouchPositions.begin(), endIter = mTouchPositions.end();
-         iter != endIter; ++iter)
-    {
-      longPress.point += iter->second;
-    }
-    longPress.point /= static_cast<float>( touchPoints );
-
-    longPress.time = mTouchTime;
-    if ( state != Gesture::Possible )
-    {
-      longPress.time += GetSystemValue();
-    }
-
-    if( mScene )
-    {
-      mScene->QueueEvent( longPress );
-    }
-  }
-}
-
-int LongPressGestureDetector::GetSystemValue()
-{
-  return GetLongPressTime( LONG_PRESS_TIME );
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/input/common/long-press-gesture-detector.h b/dali/internal/input/common/long-press-gesture-detector.h
deleted file mode 100644 (file)
index 595e0e8..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H
-#define DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <map>
-#include <dali/public-api/adaptor-framework/timer.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/input/common/gesture-detector.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-struct TouchEvent;
-struct LongPressGestureRequest;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-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).
- */
-class LongPressGestureDetector : public GestureDetector
-{
-public:
-
-  /**
-   * Constructor
-   * @param[in] coreEventInterface Used to send events to Core.
-   * @param[in] screenSize  The size of the screen.
-   * @param[in] request     The long press gesture request.
-   */
-  LongPressGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, const Integration::LongPressGestureRequest& request);
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~LongPressGestureDetector();
-
-public:
-
-  /**
-   * @copydoc Dali::Internal::GestureDetector::SendEvent(const Integration::TouchEvent&)
-   */
-  virtual void SendEvent(const Integration::TouchEvent& event);
-
-  /**
-   * @copydoc Dali::Internal::GestureDetector::Update(const Integration::GestureRequest&)
-   */
-  virtual void Update(const Integration::GestureRequest& request);
-
-private:
-
-  /**
-   * Timer Callback
-   * @return will return false; one-shot timer.
-   */
-  bool TimerCallback();
-
-  /**
-   * Emits the long press gesture if all conditions are applicable.
-   * @param[in] state The state of this gesture event.
-   */
-  void EmitGesture(Gesture::State state);
-
-  /**
-   * Get current system setting value for tap and hold gesture
-   * @return system value for tap and hold gesture [ms]
-   */
-  int GetSystemValue();
-
-private:
-
-  /**
-   * Internal state machine.
-   */
-  enum State
-  {
-    Clear,      ///< No gesture detected.
-    Touched,    ///< User is touching the screen.
-    Failed,     ///< Gesture has failed.
-    Finished    ///< Gesture has been detected and sent.
-  };
-
-  CoreEventInterface& mCoreEventInterface; ///< Used to send events to Core.
-  State mState; ///< The current state of the detector.
-
-  unsigned int mMinimumTouchesRequired;   ///< The minimum touches required before emitting a long press.
-  unsigned int mMaximumTouchesRequired;   ///< The maximum touches allowable. Any more and a long press is not emitted.
-
-  std::map<int, Vector2> mTouchPositions; ///< A map with all the touch down positions.
-  uint32_t mTouchTime;               ///< The time we first pressed down.
-
-  Dali::Timer mTimer;                     ///< The timer used to determine a long press.
-  SlotDelegate< LongPressGestureDetector > mTimerSlot;
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H
diff --git a/dali/internal/input/common/pan-gesture-detector-base.cpp b/dali/internal/input/common/pan-gesture-detector-base.cpp
deleted file mode 100644 (file)
index ad4774e..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/input/common/pan-gesture-detector-base.h>
-
-// EXTERNAL INCLUDES
-#include <cmath>
-
-#include <dali/public-api/events/touch-point.h>
-
-#include <dali/integration-api/events/gesture-requests.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/environment-options.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-const float MINIMUM_MOTION_DISTANCE_BEFORE_PAN( 15.0f );
-const float MINIMUM_MOTION_DISTANCE_BEFORE_PAN_SQUARED( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_BEFORE_PAN );
-const float MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO( 2.0f / 3.0f );
-const unsigned long MAXIMUM_TIME_DIFF_ALLOWED( 500 );
-const unsigned long MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS( 100 );
-const unsigned int MINIMUM_MOTION_EVENTS_BEFORE_PAN(2);
-} // unnamed namespace
-
-PanGestureDetectorBase::PanGestureDetectorBase(Vector2 screenSize, const Integration::PanGestureRequest& request, EnvironmentOptions* environmentOptions)
-: GestureDetector( screenSize, Gesture::Pan ),
-  mState( Clear ),
-  mThresholdAdjustmentsRemaining( 0 ),
-  mThresholdTotalAdjustments( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO ),
-  mPrimaryTouchDownTime( 0 ),
-  mMinimumTouchesRequired( request.minTouches ),
-  mMaximumTouchesRequired( request.maxTouches ),
-  mMinimumDistanceSquared( MINIMUM_MOTION_DISTANCE_BEFORE_PAN_SQUARED ),
-  mMinimumMotionEvents( MINIMUM_MOTION_EVENTS_BEFORE_PAN ),
-  mMotionEvents( 0 )
-{
-  if ( environmentOptions )
-  {
-    int minimumDistance = environmentOptions->GetMinimumPanDistance();
-    if ( minimumDistance >= 0 )
-    {
-      mMinimumDistanceSquared = minimumDistance * minimumDistance;
-
-      // Usually, we do not want to apply the threshold straight away, but phased over the first few pans
-      // Set our distance to threshold adjustments ratio here.
-      float fMinimumDistance = static_cast<float>( minimumDistance );
-      mThresholdTotalAdjustments = static_cast<unsigned int>( fMinimumDistance * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO );
-    }
-
-    int minimumEvents = environmentOptions->GetMinimumPanEvents();
-    if ( minimumEvents >= 1 )
-    {
-      mMinimumMotionEvents = minimumEvents - 1; // Down is the first event
-    }
-  }
-}
-
-PanGestureDetectorBase::~PanGestureDetectorBase()
-{
-}
-
-void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
-{
-  PointState::Type primaryPointState(event.points[0].GetState());
-
-  if (primaryPointState == PointState::INTERRUPTED)
-  {
-    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);
-    }
-    mState = Clear; // We should change our state to Clear.
-    mTouchEvents.clear();
-  }
-  else
-  {
-    switch (mState)
-    {
-      case Clear:
-      {
-        if ( ( primaryPointState == PointState::DOWN ) || ( primaryPointState == PointState::STATIONARY ) )
-        {
-          mPrimaryTouchDownLocation = event.points[0].GetScreenPosition();
-          mPrimaryTouchDownTime = event.time;
-          mMotionEvents = 0;
-          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);
-          }
-
-          mTouchEvents.push_back(event);
-        }
-        break;
-      }
-
-      case Possible:
-      {
-        unsigned int pointCount(event.GetPointCount());
-        if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
-        {
-          if (primaryPointState == PointState::MOTION)
-          {
-            mTouchEvents.push_back(event);
-            mMotionEvents++;
-
-            Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
-
-            if ( ( mMotionEvents >= mMinimumMotionEvents ) &&
-                 ( 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);
-            }
-          }
-          else if (primaryPointState == PointState::UP)
-          {
-            Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
-            if (delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) )
-            {
-              SendPan(Gesture::Started, event);
-              mTouchEvents.push_back(event);
-              SendPan(Gesture::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);
-            }
-            mState = Clear;
-            mTouchEvents.clear();
-          }
-        }
-        else
-        {
-          // We do not satisfy pan conditions, tell Core our Gesture has been cancelled.
-          SendPan(Gesture::Cancelled, event);
-
-          if (pointCount == 1 && primaryPointState == PointState::UP)
-          {
-            // 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;
-          }
-        }
-        break;
-      }
-
-      case Started:
-      {
-        mTouchEvents.push_back(event);
-
-        unsigned int pointCount(event.GetPointCount());
-        if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
-        {
-          switch (primaryPointState)
-          {
-            case PointState::MOTION:
-              // Pan is continuing, tell Core.
-              SendPan(Gesture::Continuing, event);
-              break;
-
-            case PointState::UP:
-              // Pan is finally finished when our primary point is lifted, tell Core and change our state to Clear.
-              SendPan(Gesture::Finished, event);
-              mState = Clear;
-              mTouchEvents.clear();
-              break;
-
-            case PointState::STATIONARY:
-              if (pointCount == mMinimumTouchesRequired)
-              {
-                Integration::PointContainerConstIterator iter = event.points.begin() + 1; // We already know the state of the first point
-                for(; iter != event.points.end(); ++iter)
-                {
-                  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;
-                    break;
-                  }
-                }
-              }
-              break;
-
-            default:
-              break;
-          }
-        }
-        else
-        {
-          // We have gone outside of the pan requirements, inform Core that the gesture is finished.
-          SendPan(Gesture::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;
-            mTouchEvents.clear();
-          }
-          else
-          {
-            // ...otherwise we change it to Finished.
-            mState = Finished;
-          }
-        }
-        break;
-      }
-
-      case Finished:
-      case Failed:
-      {
-        if (primaryPointState == PointState::UP)
-        {
-          // Change our state back to clear when the primary touch point is released.
-          mState = Clear;
-          mTouchEvents.clear();
-        }
-        break;
-      }
-    }
-  }
-}
-
-void PanGestureDetectorBase::Update(const Integration::GestureRequest& request)
-{
-  const Integration::PanGestureRequest& pan = static_cast<const Integration::PanGestureRequest&>(request);
-
-  mMinimumTouchesRequired = pan.minTouches;
-  mMaximumTouchesRequired = pan.maxTouches;
-}
-
-void PanGestureDetectorBase::SendPan(Gesture::State state, const Integration::TouchEvent& currentEvent)
-{
-  Integration::PanGestureEvent gesture(state);
-  gesture.currentPosition = currentEvent.points[0].GetScreenPosition();
-  gesture.numberOfTouches = currentEvent.GetPointCount();
-
-  if ( mTouchEvents.size() > 1 )
-  {
-    // Get the second last event in the queue, the last one is the current event
-    const Integration::TouchEvent& previousEvent( *( mTouchEvents.rbegin() + 1 ) );
-
-    Vector2 previousPosition( mPreviousPosition );
-    uint32_t previousTime( previousEvent.time );
-
-    // If we've just started then we want to remove the threshold from Core calculations.
-    if ( state == Gesture::Started )
-    {
-      previousPosition = mPrimaryTouchDownLocation;
-      previousTime = mPrimaryTouchDownTime;
-
-      // If it's a slow pan, we do not want to phase in the threshold over the first few pan-events
-      // A slow pan is defined as one that starts the specified number of milliseconds after the down-event
-      if ( ( currentEvent.time - previousTime ) > MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS )
-      {
-        mThresholdAdjustmentsRemaining = mThresholdTotalAdjustments;
-        mThresholdAdjustmentPerFrame = ( gesture.currentPosition - previousPosition ) / static_cast<float>( mThresholdTotalAdjustments );
-      }
-      else
-      {
-        mThresholdAdjustmentsRemaining = 0;
-        mThresholdAdjustmentPerFrame = Vector2::ZERO;
-      }
-    }
-
-    gesture.previousPosition = previousPosition;
-    gesture.timeDelta = currentEvent.time - previousTime;
-
-    // Apply the threshold with a phased approach
-    if ( mThresholdAdjustmentsRemaining > 0 )
-    {
-      --mThresholdAdjustmentsRemaining;
-      gesture.currentPosition -= mThresholdAdjustmentPerFrame * static_cast<float>( mThresholdAdjustmentsRemaining );
-    }
-
-    mPreviousPosition = gesture.currentPosition;
-  }
-  else
-  {
-    gesture.previousPosition = gesture.currentPosition;
-    gesture.timeDelta = 0;
-  }
-
-  gesture.time = currentEvent.time;
-
-  EmitPan(gesture);
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/input/common/pan-gesture-detector-base.h b/dali/internal/input/common/pan-gesture-detector-base.h
deleted file mode 100644 (file)
index ea35e6a..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#ifndef DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H
-#define DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <cstdint> // uint32_t
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/input/common/gesture-detector.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-class Core;
-struct TouchEvent;
-struct PanGestureRequest;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class EnvironmentOptions;
-
-/**
- * When given a set of touch events, this detector attempts to determine if a pan gesture has taken place.
- */
-class PanGestureDetectorBase : public GestureDetector
-{
-public:
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~PanGestureDetectorBase();
-
-public:
-
-  /**
-   * @copydoc Dali::Internal::GestureDetector::SendEvent(const Integration::TouchEvent&)
-   */
-  virtual void SendEvent(const Integration::TouchEvent& event);
-
-  /**
-   * @copydoc Dali::Internal::GestureDetector::Update(const Integration::GestureRequest&)
-   */
-  virtual void Update(const Integration::GestureRequest& request);
-
-protected:
-
-  /**
-   * Constructor
-   * @param[in]  screenSize  The size of the screen.
-   * @param[in]  request     The details of the request.
-   */
-  PanGestureDetectorBase(Vector2 screenSize, const Integration::PanGestureRequest& request, EnvironmentOptions* environmentOptions);
-
-private:
-
-  /**
-   * Emits the pan gesture event (performs some smoothing operation).
-   * @param[in]  state         The state of the pan.
-   * @param[in]  currentEvent  The latest touch event.
-   */
-  void SendPan(Gesture::State state, const Integration::TouchEvent& currentEvent);
-
-  /**
-   * Emits the pan gesture event to the core.
-   * @param[in] gesture The pan gesture event.
-   */
-  virtual void EmitPan(const Integration::PanGestureEvent gesture) = 0;
-
-private:
-
-  /**
-   * Internal state machine.
-   */
-  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.
-  };
-
-  State mState; ///< The current state of the detector.
-  std::vector<Integration::TouchEvent> mTouchEvents;     ///< A container of all touch events after an initial down event.
-
-  Vector2 mPrimaryTouchDownLocation;    ///< The initial touch down point.
-  Vector2 mThresholdAdjustmentPerFrame; ///< The adjustment per frame at the start of a slow pan.
-  Vector2 mPreviousPosition;            ///< The previous position.
-
-  unsigned int mThresholdAdjustmentsRemaining; ///< No. of threshold adjustments still to apply (for a slow-pan).
-  unsigned int mThresholdTotalAdjustments;     ///< The total number of adjustments required.
-
-  uint32_t mPrimaryTouchDownTime;       ///< The initial touch down time.
-  unsigned int mMinimumTouchesRequired; ///< The minimum touches required before a pan should be emitted.
-  unsigned int mMaximumTouchesRequired; ///< The maximum touches after which a pan should not be emitted.
-
-  unsigned int mMinimumDistanceSquared; ///< The minimum distance squared before pan should start.
-  unsigned int mMinimumMotionEvents;    ///< The minimum motion events before pan should start.
-  unsigned int mMotionEvents;           ///< The motion events received so far (before pan is emitted).
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H
diff --git a/dali/internal/input/common/pan-gesture-detector.cpp b/dali/internal/input/common/pan-gesture-detector.cpp
deleted file mode 100644 (file)
index 0f38793..0000000
+++ /dev/null
@@ -1,56 +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.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/input/common/pan-gesture-detector.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/events/gesture-requests.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/core-event-interface.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-PanGestureDetector::PanGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, const Integration::PanGestureRequest& request, EnvironmentOptions& environmentOptions)
-: PanGestureDetectorBase(screenSize, request, &environmentOptions),
-  mCoreEventInterface(coreEventInterface)
-{
-}
-
-PanGestureDetector::~PanGestureDetector()
-{
-}
-
-void PanGestureDetector::EmitPan(const Integration::PanGestureEvent event)
-{
-  mCoreEventInterface.QueueCoreEvent(event);
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/input/common/pan-gesture-detector.h b/dali/internal/input/common/pan-gesture-detector.h
deleted file mode 100644 (file)
index e64574a..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef DALI_INTERNAL_PAN_GESTURE_DETECTOR_H
-#define DALI_INTERNAL_PAN_GESTURE_DETECTOR_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/math/vector2.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/input/common/pan-gesture-detector-base.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-struct TouchEvent;
-struct PanGestureRequest;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class CoreEventInterface;
-
-/**
- * Detects a pan gesture and sends it to core.
- */
-class PanGestureDetector : public PanGestureDetectorBase
-{
-public:
-
-  /**
-   * Constructor
-   * @param[in] coreEventInterface Used to send events to Core.
-   * @param[in]  screenSize  The size of the screen.
-   * @param[in]  request     The details of the request.
-   * @param[in] environmentOptions The environmentOptions.
-   */
-  PanGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, const Integration::PanGestureRequest& request, EnvironmentOptions& environmentOptions);
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~PanGestureDetector();
-
-private:
-
-  /**
-   * Emits the pan gesture event to the core.
-   * @param[in] gesture The pan gesture event.
-   */
-  virtual void EmitPan(const Integration::PanGestureEvent gesture);
-
-private:
-
-  CoreEventInterface& mCoreEventInterface; ///< Used to send events to Core.
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_PAN_GESTURE_DETECTOR_H
diff --git a/dali/internal/input/common/pinch-gesture-detector.cpp b/dali/internal/input/common/pinch-gesture-detector.cpp
deleted file mode 100644 (file)
index 1f7732b..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/input/common/pinch-gesture-detector.h>
-
-// EXTERNAL INCLUDES
-#include <cmath>
-
-#include <dali/public-api/events/touch-point.h>
-#include <dali/public-api/math/vector2.h>
-
-#include <dali/integration-api/events/pinch-gesture-event.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/core-event-interface.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-const unsigned int MINIMUM_TOUCH_EVENTS_REQUIRED = 4;
-const unsigned int MINIMUM_TOUCH_EVENTS_REQUIRED_AFTER_START = 4;
-
-inline float GetDistance(const Integration::Point& point1, const Integration::Point& point2)
-{
-  Vector2 vector(point1.GetScreenPosition() - point2.GetScreenPosition());
-  return vector.Length();
-}
-
-inline Vector2 GetCenterPoint(const Integration::Point& point1, const Integration::Point& point2)
-{
-  return Vector2(point1.GetScreenPosition() + point2.GetScreenPosition()) * 0.5f;
-}
-
-} // unnamed namespace
-
-PinchGestureDetector::PinchGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, float minimumPinchDistance)
-: GestureDetector(screenSize, Gesture::Pinch),
-  mCoreEventInterface(coreEventInterface),
-  mState(Clear),
-  mTouchEvents(),
-  mMinimumDistanceDelta(minimumPinchDistance),
-  mStartingDistance(0.0f)
-{
-}
-
-PinchGestureDetector::~PinchGestureDetector()
-{
-}
-
-void PinchGestureDetector::SetMinimumPinchDistance(float distance)
-{
-  mMinimumDistanceDelta = distance;
-}
-
-void PinchGestureDetector::SendEvent(const Integration::TouchEvent& event)
-{
-  int pointCount = event.GetPointCount();
-
-  switch (mState)
-  {
-    case Clear:
-    {
-      if (pointCount == 2)
-      {
-        // Change state to possible as we have two touch points.
-        mState = Possible;
-        mTouchEvents.push_back(event);
-      }
-      break;
-    }
-
-    case Possible:
-    {
-      if (pointCount != 2)
-      {
-        // We no longer have two touch points so change state back to Clear.
-        mState = Clear;
-        mTouchEvents.clear();
-      }
-      else
-      {
-        const Integration::Point& currentPoint1 = event.points[0];
-        const Integration::Point& currentPoint2 = event.points[1];
-
-        if (currentPoint1.GetState() == PointState::UP || currentPoint2.GetState() == PointState::UP)
-        {
-          // One of our touch points has an Up event so change our state back to Clear.
-          mState = Clear;
-          mTouchEvents.clear();
-        }
-        else
-        {
-          mTouchEvents.push_back(event);
-
-          // We can only determine a pinch after a certain number of touch points have been collected.
-          if (mTouchEvents.size() >= MINIMUM_TOUCH_EVENTS_REQUIRED)
-          {
-            const Integration::Point& firstPoint1 = mTouchEvents[0].points[0];
-            const Integration::Point& firstPoint2 = mTouchEvents[0].points[1];
-
-            float firstDistance = GetDistance(firstPoint1, firstPoint2);
-            float currentDistance = GetDistance(currentPoint1, currentPoint2);
-            float distanceChanged = firstDistance - currentDistance;
-
-            // Check if distance has changed enough
-            if (fabsf(distanceChanged) > mMinimumDistanceDelta)
-            {
-              // Remove the first few events from the vector otherwise values are exaggerated
-              mTouchEvents.erase(mTouchEvents.begin(), mTouchEvents.end() - MINIMUM_TOUCH_EVENTS_REQUIRED_AFTER_START);
-
-              if ( !mTouchEvents.empty() )
-              {
-                mStartingDistance = GetDistance(mTouchEvents.begin()->points[0], mTouchEvents.begin()->points[1]);
-
-                // Send pinch started
-                SendPinch(Gesture::Started, event);
-
-                mState = Started;
-              }
-
-              mTouchEvents.clear();
-            }
-
-            if (mState == Possible)
-            {
-              // No pinch, so restart detection
-              mState = Clear;
-              mTouchEvents.clear();
-            }
-          }
-        }
-      }
-      break;
-    }
-
-    case Started:
-    {
-      if (pointCount != 2)
-      {
-        // Send pinch finished event
-        SendPinch(Gesture::Finished, event);
-
-        mState = Clear;
-        mTouchEvents.clear();
-      }
-      else
-      {
-        const Integration::Point& currentPoint1 = event.points[0];
-        const Integration::Point& currentPoint2 = event.points[1];
-
-        if (currentPoint1.GetState() == PointState::UP || currentPoint2.GetState() == PointState::UP)
-        {
-          mTouchEvents.push_back(event);
-          // Send pinch finished event
-          SendPinch(Gesture::Finished, event);
-
-          mState = Clear;
-          mTouchEvents.clear();
-        }
-        else
-        {
-          mTouchEvents.push_back(event);
-
-          if (mTouchEvents.size() >= MINIMUM_TOUCH_EVENTS_REQUIRED_AFTER_START)
-          {
-            // Send pinch continuing
-            SendPinch(Gesture::Continuing, event);
-
-            mTouchEvents.clear();
-          }
-        }
-      }
-      break;
-    }
-  }
-}
-
-void PinchGestureDetector::Update(const Integration::GestureRequest& request)
-{
-  // Nothing to do.
-}
-
-void PinchGestureDetector::SendPinch(Gesture::State state, const Integration::TouchEvent& currentEvent)
-{
-  Integration::PinchGestureEvent gesture(state);
-
-  if ( !mTouchEvents.empty() )
-  {
-    const Integration::TouchEvent& firstEvent = mTouchEvents[0];
-
-    // Assert if we have been holding TouchEvents that do not have 2 points
-    DALI_ASSERT_DEBUG( firstEvent.GetPointCount() == 2 );
-
-    // We should use the current event in our calculations unless it does not have two points.
-    // If it does not have two points, then we should use the last point in mTouchEvents.
-    Integration::TouchEvent event( currentEvent );
-    if ( event.GetPointCount() != 2 )
-    {
-      event = *mTouchEvents.rbegin();
-    }
-
-    const Integration::Point& firstPoint1( firstEvent.points[0] );
-    const Integration::Point& firstPoint2( firstEvent.points[1] );
-    const Integration::Point& currentPoint1( event.points[0] );
-    const Integration::Point& currentPoint2( event.points[1] );
-
-    float firstDistance = GetDistance(firstPoint1, firstPoint2);
-    float currentDistance = GetDistance(currentPoint1, currentPoint2);
-    gesture.scale = currentDistance / mStartingDistance;
-
-    float distanceDelta = fabsf(firstDistance - currentDistance);
-    float timeDelta = static_cast<float> ( currentEvent.time - firstEvent.time );
-    gesture.speed = ( distanceDelta / timeDelta ) * 1000.0f;
-
-    gesture.centerPoint = GetCenterPoint(currentPoint1, currentPoint2);
-  }
-  else
-  {
-    // Something has gone wrong, just cancel the gesture.
-    gesture.state = Gesture::Cancelled;
-  }
-
-  gesture.time = currentEvent.time;
-
-  if( mScene )
-  {
-    mScene->QueueEvent(gesture);
-  }
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/input/common/pinch-gesture-detector.h b/dali/internal/input/common/pinch-gesture-detector.h
deleted file mode 100644 (file)
index 547950f..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H
-#define DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/input/common/gesture-detector.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-struct TouchEvent;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class CoreEventInterface;
-
-/**
- * When given a set of touch events, this detector attempts to determine if a pinch gesture has taken place.
- */
-class PinchGestureDetector : public GestureDetector
-{
-public:
-
-  /**
-   * Constructor
-   * @param[in] coreEventInterface Used to send events to Core.
-   * @param[in] screenSize The size of the screen.
-   */
-  PinchGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, float minimumPinchDistance);
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~PinchGestureDetector();
-
-  /**
-   * @brief Sets minimum distance in pixels that the fingers must move towards/away from each other in order to
-   * trigger a pinch gesture
-   *
-   * @param[in] distance The minimum pinch distance in pixels
-   */
-  void SetMinimumPinchDistance(float distance);
-
-public:
-
-  /**
-   * @copydoc Dali::Internal::GestureDetector::SendEvent(const Integration::TouchEvent&)
-   */
-  virtual void SendEvent(const Integration::TouchEvent& event);
-
-  /**
-   * @copydoc Dali::Internal::GestureDetector::Update(const Integration::GestureRequest&)
-   */
-  virtual void Update(const Integration::GestureRequest& request);
-
-private:
-
-  /**
-   * Emits the pinch gesture event to the core.
-   * @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);
-
-private:
-
-  /**
-   * Internal state machine.
-   */
-  enum State
-  {
-    Clear,    ///< No gesture detected.
-    Possible, ///< The current touch event data suggests that a gesture is possible.
-    Started,  ///< A gesture has been detected.
-  };
-
-  CoreEventInterface& mCoreEventInterface; ///< Used to send events to Core.
-  State mState; ///< The current state of the detector.
-  std::vector<Integration::TouchEvent> mTouchEvents; ///< The touch events since initial touch down.
-
-  float mMinimumDistanceDelta; ///< The minimum distance before a pinch is applicable.
-
-  float mStartingDistance; ///< The distance between the two touch points when the pinch is first detected.
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H
diff --git a/dali/internal/input/common/tap-gesture-detector.cpp b/dali/internal/input/common/tap-gesture-detector.cpp
deleted file mode 100644 (file)
index 060a12d..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/input/common/tap-gesture-detector.h>
-
-// EXTERNAL INCLUDES
-#include <cmath>
-
-#include <dali/public-api/math/vector2.h>
-
-#include <dali/integration-api/events/gesture-requests.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/internal/system/common/core-event-interface.h>
-
-// INTERNAL INCLUDES
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-// TODO: Set these according to DPI
-const float MAXIMUM_MOTION_ALLOWED = 20.0f;
-const unsigned long MAXIMUM_TIME_ALLOWED = 500u;
-} // unnamed namespace
-
-TapGestureDetector::TapGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, const Integration::TapGestureRequest& request)
-: GestureDetector(screenSize, Gesture::Tap),
-  mCoreEventInterface(coreEventInterface),
-  mState(Clear),
-  mMinimumTapsRequired(request.minTaps),
-  mMaximumTapsRequired(request.maxTaps),
-  mTapsRegistered(0),
-  mTouchPosition(),
-  mTouchTime(0u),
-  mLastTapTime(0u)
-{
-}
-
-TapGestureDetector::~TapGestureDetector()
-{
-}
-
-void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
-{
-  if (event.GetPointCount() == 1)
-  {
-    const Integration::Point& point = event.points[0];
-    PointState::Type pointState = point.GetState();
-
-    switch (mState)
-    {
-      case Clear:
-      {
-        if (pointState == PointState::DOWN)
-        {
-          SetupForTouchDown( event, point );
-        }
-        break;
-      }
-
-      case Touched:
-      {
-        uint32_t deltaBetweenTouchDownTouchUp = event.time - mTouchTime;
-
-        if ( pointState == PointState::UP )
-        {
-          if ( deltaBetweenTouchDownTouchUp < MAXIMUM_TIME_ALLOWED )
-          {
-            mLastTapTime = mTouchTime;
-            EmitSingleTap( event.time, point );
-            mState = Registered;
-          }
-          else
-          {
-            mState = Clear;
-          }
-        }
-        else if (pointState == PointState::INTERRUPTED)
-        {
-          mState = Clear;
-        }
-        break;
-      }
-
-      case Registered:
-      {
-        if ( pointState == PointState::UP )
-        {
-          uint32_t deltaBetweenTouchDownTouchUp = event.time - mTouchTime;
-
-          if ( deltaBetweenTouchDownTouchUp < MAXIMUM_TIME_ALLOWED )
-          {
-            // This is a possible multiple tap, so has it been quick enough ?
-            uint32_t timeDelta = event.time - mLastTapTime;
-            if ( timeDelta > MAXIMUM_TIME_ALLOWED ) // If exceeded time between taps then just a single tap.
-            {
-              mLastTapTime = event.time;
-              EmitSingleTap( event.time, point );
-              mState = Registered;
-            }
-            else
-            {
-              ++mTapsRegistered;
-              EmitGesture( Gesture::Started, event.time );
-              mState = Clear;
-            }
-          }
-          else // Delta between touch down and touch up too long to be considered a Tap event
-          {
-            mState = Clear;
-          }
-        }
-        else if (pointState == PointState::DOWN)
-        {
-          const Vector2& screen( point.GetScreenPosition() );
-          Vector2 distanceDelta(abs(mTouchPosition.x - screen.x),
-                                abs(mTouchPosition.y - screen.y));
-
-          uint32_t timeDelta = event.time - mLastTapTime;
-
-          if (distanceDelta.x > MAXIMUM_MOTION_ALLOWED ||
-              distanceDelta.y > MAXIMUM_MOTION_ALLOWED ||
-              timeDelta > MAXIMUM_TIME_ALLOWED )
-          {
-            SetupForTouchDown( event, point );
-          }
-          else
-          {
-            EmitPossibleState( event );
-          }
-        }
-        break;
-      }
-
-      case Failed:
-      default:
-      {
-        mState = Clear;
-        break;
-      }
-    }
-  }
-  else
-  {
-    mState = Failed;
-
-    // We have entered a multi-touch event so emit registered gestures if required.
-    EmitGesture(Gesture::Started, event.time);
-  }
-}
-
-void TapGestureDetector::SetupForTouchDown( const Integration::TouchEvent& event, const Integration::Point& point )
-{
-  mTouchPosition = point.GetScreenPosition();
-  mTouchTime = event.time;
-  mLastTapTime = 0u;
-  mTapsRegistered = 0;
-  mState = Touched;
-  EmitPossibleState( event );
-}
-
-void TapGestureDetector::EmitPossibleState( const Integration::TouchEvent& event )
-{
-  Integration::TapGestureEvent tapEvent( Gesture::Possible );
-  tapEvent.point = mTouchPosition;
-  tapEvent.time = event.time;
-  if( mScene )
-  {
-    mScene->QueueEvent( tapEvent );
-  }
-}
-
-
-void TapGestureDetector::Update(const Integration::GestureRequest& request)
-{
-  const Integration::TapGestureRequest& tap = static_cast<const Integration::TapGestureRequest&>(request);
-
-  mMinimumTapsRequired = tap.minTaps;
-  mMaximumTapsRequired = tap.maxTaps;
-}
-
-void TapGestureDetector::EmitGesture( Gesture::State state, uint32_t time )
-{
-  if ( (state == Gesture::Cancelled) ||
-       (mTapsRegistered >= mMinimumTapsRequired && mTapsRegistered <= mMaximumTapsRequired) )
-
-  {
-    Integration::TapGestureEvent event( state );
-    EmitTap( time, event );
-  }
-}
-
-void TapGestureDetector::EmitSingleTap( uint32_t time, const Integration::Point& point )
-{
-  Integration::TapGestureEvent event( Gesture::Started );
-  const Vector2& screen( point.GetScreenPosition() );
-  Vector2 distanceDelta(abs(mTouchPosition.x - screen.x),
-                        abs(mTouchPosition.y - screen.y));
-
-  if (distanceDelta.x > MAXIMUM_MOTION_ALLOWED ||
-      distanceDelta.y > MAXIMUM_MOTION_ALLOWED )
-  {
-    event.state = Gesture::Cancelled;
-  }
-  mTapsRegistered = 1u;
-  EmitTap( time, event );
-}
-
-void TapGestureDetector::EmitTap( uint32_t time, Integration::TapGestureEvent& event )
-{
-  event.numberOfTaps = mTapsRegistered;
-  event.point = mTouchPosition;
-  event.time = time;
-  if( mScene )
-  {
-    mScene->QueueEvent( event );
-  }
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/input/common/tap-gesture-detector.h b/dali/internal/input/common/tap-gesture-detector.h
deleted file mode 100644 (file)
index 4dd5e55..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#ifndef DALI_INTERNAL_TAP_GESTURE_DETECTOR_H
-#define DALI_INTERNAL_TAP_GESTURE_DETECTOR_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <cstdint> // uint32_t
-#include <dali/integration-api/events/tap-gesture-event.h>
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/integration-api/events/point.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/input/common/gesture-detector.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-struct TouchEvent;
-struct TapGestureRequest;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-class CoreEventInterface;
-
-/**
- * When given a set of touch events, this detector attempts to determine if a tap gesture has taken place.
- */
-class TapGestureDetector : public GestureDetector
-{
-public:
-
-  /**
-   * Constructor
-   * @param[in] coreEventInterface Used to send events to Core.
-   * @param[in]  screenSize  The size of the screen.
-   * @param[in]  request     The tap gesture request.
-   */
-  TapGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, const Integration::TapGestureRequest& request);
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~TapGestureDetector();
-
-public:
-
-  /**
-   * @copydoc Dali::Internal::GestureDetector::SendEvent(const Integration::TouchEvent&)
-   */
-  virtual void SendEvent(const Integration::TouchEvent& event);
-
-  /**
-   * @copydoc Dali::Internal::GestureDetector::Update(const Integration::GestureRequest&)
-   */
-  virtual void Update(const Integration::GestureRequest& request);
-
-private:
-
-  /**
-   * Checks if registered taps are within required bounds and emits tap gesture if they are.
-   *
-   * @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 );
-
-  /**
-   * Initialises tap gesture detector for next tap sequence
-   *
-   * @param[in] event registered touch event
-   * @param[in] point position touch event occurred
-   */
-  void SetupForTouchDown( const Integration::TouchEvent& event, const Integration::Point& point );
-
-  /**
-   * Emit a touch down event for hit testing
-   *
-   * @param[in] event registered touch event
-   */
-  void EmitPossibleState( const Integration::TouchEvent& event );
-
-  /**
-   * Force a touch event sequence to be treated as a single tap
-   *
-   * @param[in] time time of this latest touch event
-   * @param[in] point position touch event occurred
-    */
-  void EmitSingleTap( uint32_t time, const Integration::Point& point );
-
-  /**
-   * Emit a tap event
-   *
-   * @param[in] time time of this latest touch event
-   * @param[in] event registered touch event
-   */
-  void EmitTap( uint32_t time, Integration::TapGestureEvent& event );
-
-private:
-
-  /**
-   * Internal state machine.
-   */
-  enum State
-  {
-    Clear,      ///< No gesture detected.
-    Touched,    ///< User is touching the screen.
-    Registered, ///< At least one tap has been registered.
-    Failed,     ///< Gesture has failed.
-  };
-
-  CoreEventInterface& mCoreEventInterface; ///< Used to send events to Core.
-  State mState; ///< Current state of the detector.
-
-  int mMinimumTapsRequired; ///< Minimum number of taps required.
-  int mMaximumTapsRequired; ///< Maximum number of taps required.
-  int mTapsRegistered;      ///< In current detection, the number of taps registered.
-
-  Vector2 mTouchPosition;   ///< The initial touch down position.
-  uint32_t mTouchTime;      ///< The initial touch down time.
-  uint32_t mLastTapTime;    ///< Time last tap gesture was registered
-
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_TAP_GESTURE_DETECTOR_H
index 5c90458..43b373b 100755 (executable)
@@ -2,17 +2,11 @@
 
 # module: input, backend: common
 adaptor_input_common_src_files=\
-    ${adaptor_input_dir}/common/gesture-manager.cpp \
     ${adaptor_input_dir}/common/input-method-context-impl.cpp \
     ${adaptor_input_dir}/common/key-grab.cpp \
     ${adaptor_input_dir}/common/key-impl.cpp \
     ${adaptor_input_dir}/common/keyboard.cpp \
-    ${adaptor_input_dir}/common/long-press-gesture-detector.cpp \
-    ${adaptor_input_dir}/common/pan-gesture-detector-base.cpp \
-    ${adaptor_input_dir}/common/pan-gesture-detector.cpp \
     ${adaptor_input_dir}/common/physical-keyboard-impl.cpp \
-    ${adaptor_input_dir}/common/pinch-gesture-detector.cpp \
-    ${adaptor_input_dir}/common/tap-gesture-detector.cpp \
     ${adaptor_input_dir}/tizen-wayland/ecore-virtual-keyboard.cpp
 
 # module: input, backend: tizen-wayland
index 15fb275..4d60fee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // EXTERNAL INCLUDES
 #include <dirent.h>
 #include <fstream>
+#include <algorithm>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/bitmap.h>
 #include <dali/integration-api/resource-types.h>
+#include <dali/public-api/signals/callback.h>
 
 // INTERNAL INCLUDES
+#include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/imaging/common/image-loader.h>
 #include <dali/internal/system/common/file-reader.h>
 #include <dali/internal/imaging/common/pixel-buffer-impl.h>
@@ -36,8 +39,39 @@ namespace Dali
 namespace TizenPlatform
 {
 
+struct TizenPlatformAbstraction::TimerCallback : ConnectionTracker
+{
+  Dali::Timer mTimer;
+  TizenPlatformAbstraction* mOwner;
+  CallbackBase* mCallback;
+  const uint32_t mIdNumber;
+
+  static uint32_t sNextTimerId;
+
+  TimerCallback(TizenPlatformAbstraction* owner, CallbackBase* callback, uint32_t ms)
+  : mTimer(Dali::Timer::New(ms)),
+    mOwner(owner),
+    mCallback(callback),
+    mIdNumber(sNextTimerId++)
+  {
+    mTimer.TickSignal().Connect( this, &TimerCallback::Tick );
+    mTimer.Start();
+  }
+
+  bool Tick()
+  {
+    mOwner->RunTimerFunction(*this);
+    return false;
+  }
+};
+
+uint32_t TizenPlatformAbstraction::TimerCallback::sNextTimerId = 0;
+
 TizenPlatformAbstraction::TizenPlatformAbstraction()
-: mDataStoragePath( "" )
+: mDataStoragePath( "" ),
+  mTimerPairsWaiting(),
+  mTimerPairsSpent()
+
 {
 }
 
@@ -155,6 +189,63 @@ void TizenPlatformAbstraction::SetDataStoragePath( const std::string& path )
   mDataStoragePath = path;
 }
 
+uint32_t TizenPlatformAbstraction::StartTimer( uint32_t milliseconds, CallbackBase* callback )
+{
+  TimerCallback* timerCallbackPtr = new TimerCallback(this, callback, milliseconds);
+
+  // Stick it in the list
+  mTimerPairsWaiting.push_back(timerCallbackPtr);
+
+  return timerCallbackPtr->mIdNumber;
+}
+
+void TizenPlatformAbstraction::CancelTimer ( uint32_t timerId )
+{
+  auto iter = std::remove_if(
+    mTimerPairsWaiting.begin(), mTimerPairsWaiting.end(),
+    [&timerId]( TimerCallback* timerCallbackPtr )
+    {
+      if( timerCallbackPtr->mIdNumber == timerId )
+      {
+        timerCallbackPtr->mTimer.Stop();
+        return true;
+      }
+      else
+      {
+        return false;
+      }
+    }
+  );
+
+  mTimerPairsWaiting.erase( iter, mTimerPairsWaiting.end() );
+}
+
+void TizenPlatformAbstraction::RunTimerFunction(TimerCallback& timerPtr)
+{
+  CallbackBase::Execute( *timerPtr.mCallback );
+
+  std::vector<TimerCallback*>::iterator timerIter = std::find( mTimerPairsWaiting.begin(), mTimerPairsWaiting.end(), &timerPtr );
+
+  if( timerIter == std::end(mTimerPairsWaiting) )
+  {
+    DALI_ASSERT_DEBUG(false);
+  }
+
+  // ...and move it
+  std::move(timerIter, timerIter+1, std::back_inserter(mTimerPairsSpent));
+
+  mTimerPairsWaiting.erase(timerIter, timerIter+1);
+
+  Dali::Adaptor::Get().AddIdle( MakeCallback( this, &TizenPlatformAbstraction::CleanupTimers ), false );
+}
+
+
+void TizenPlatformAbstraction::CleanupTimers()
+{
+  mTimerPairsSpent.clear();
+}
+
+
 TizenPlatformAbstraction* CreatePlatformAbstraction()
 {
   return new TizenPlatformAbstraction();
index 67b9a56..c288cd1 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
-#define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
+#ifndef DALI_TIZEN_PLATFORM_ABSTRACTION_H
+#define DALI_TIZEN_PLATFORM_ABSTRACTION_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/dali-adaptor-common.h>
 
+
 // EXTERNAL INCLUDES
+#include <cstdint>
 #include <string>
 #include <dali/integration-api/platform-abstraction.h>
 
 namespace Dali
 {
 
+class CallbackBase;
+
 namespace TizenPlatform
 {
-
 class ResourceLoader;
 
 /**
@@ -92,18 +96,42 @@ public: // PlatformAbstraction overrides
   virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
 
   /**
+   * @copydoc PlatformAbstraction::StartTimer()
+   */
+  virtual uint32_t StartTimer( uint32_t milliseconds, CallbackBase* callback );
+
+  /**
+   * @copydoc PlatformAbstraction::CancelTimer()
+   */
+  virtual void CancelTimer ( uint32_t timerId );
+
+  /**
    * Sets path for data/resource storage.
    * @param[in] path data/resource storage path
    */
   void SetDataStoragePath( const std::string& path );
 
+  /**
+   * Clears the timers that have completed
+   */
+  void CleanupTimers();
+
 private:
 
+  struct TimerCallback;
+
+  /*
+   * Executes callback function and cleans up timer
+   */
+  void RunTimerFunction(TimerCallback& timerPtr);
+
   TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
   TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
 
   std::string mDataStoragePath;
 
+  std::vector<TimerCallback*> mTimerPairsWaiting;
+  std::vector<TimerCallback*> mTimerPairsSpent;
 };
 
 /**
@@ -125,4 +153,4 @@ bool SaveFile( const std::string& filename, const unsigned char * buffer, unsign
 
 }  // namespace Dali
 
-#endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
+#endif // DALI_TIZEN_PLATFORM_ABSTRACTION_H
index 2ad946d..23bec81 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,6 +119,7 @@ EnvironmentOptions::EnvironmentOptions()
   mPanGestureMultitapSmoothingRange( -1 ),
   mPanMinimumDistance( -1 ),
   mPanMinimumEvents( -1 ),
+  mPinchMinimumDistance( -1.0f ),
   mGlesCallTime( 0 ),
   mMultiSamplingLevel( DEFAULT_MULTI_SAMPLING_LEVEL ),
   mThreadingMode( ThreadingMode::COMBINED_UPDATE_RENDER ),
@@ -283,6 +284,11 @@ int EnvironmentOptions::GetMinimumPanEvents() const
   return mPanMinimumEvents;
 }
 
+float EnvironmentOptions::GetMinimumPinchDistance() const
+{
+  return mPinchMinimumDistance;
+}
+
 unsigned int EnvironmentOptions::GetWindowWidth() const
 {
   return mWindowWidth;
@@ -498,6 +504,12 @@ void EnvironmentOptions::ParseEnvironmentOptions()
     mPanMinimumEvents = minimumEvents;
   }
 
+  float pinchMinimumDistance = -1.0f;
+  if( GetFloatEnvironmentVariable( DALI_ENV_PINCH_MINIMUM_DISTANCE, pinchMinimumDistance ) )
+  {
+    mPinchMinimumDistance = pinchMinimumDistance;
+  }
+
   int glesCallTime(0);
   if ( GetIntegerEnvironmentVariable(DALI_GLES_CALL_TIME, glesCallTime ))
   {
index 901fcbc..253ea7e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -215,6 +215,11 @@ public:
   int GetMinimumPanEvents() const;
 
   /**
+   * @return The minimum pixels before a pinch can be started (-1 means it's not set)
+   */
+  float GetMinimumPinchDistance() const;
+
+  /**
    * @return The width of the window
    */
   unsigned int GetWindowWidth() const;
@@ -341,6 +346,7 @@ private: // Data
   int mPanGestureMultitapSmoothingRange;          ///< The range in time (ms) of points in the history to smooth the final output against.
   int mPanMinimumDistance;                        ///< minimum distance required before pan starts
   int mPanMinimumEvents;                          ///< minimum events required before pan starts
+  float mPinchMinimumDistance;                    ///< minimum number of pixels moved before a pinch starts
   int mGlesCallTime;                              ///< time in seconds between status updates
   int mMultiSamplingLevel;                        ///< The number of samples required in multisample buffers
   ThreadingMode::Type mThreadingMode;             ///< threading mode
index cb13030..0947bdb 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -84,6 +84,8 @@ namespace Adaptor
 #define DALI_ENV_PAN_MINIMUM_DISTANCE                 "DALI_PAN_MINIMUM_DISTANCE"
 #define DALI_ENV_PAN_MINIMUM_EVENTS                   "DALI_PAN_MINIMUM_EVENTS"
 
+#define DALI_ENV_PINCH_MINIMUM_DISTANCE               "DALI_PINCH_MINIMUM_DISTANCE"
+
 #define DALI_GLES_CALL_TIME "DALI_GLES_CALL_TIME"
 
 #define DALI_GLES_CALL_ACCUMULATE "DALI_GLES_CALL_ACCUMULATE"
index 1cfab48..cb0ff0f 100755 (executable)
@@ -33,7 +33,6 @@
 #include <dali/integration-api/scene.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/input/common/gesture-manager.h>
 #include <dali/internal/clipboard/common/clipboard-impl.h>
 #include <dali/internal/input/common/key-impl.h>
 #include <dali/internal/input/common/physical-keyboard-impl.h>
@@ -98,10 +97,9 @@ static uint32_t GetCurrentMilliSeconds(void)
 
 } // unnamed namespace
 
-EventHandler::EventHandler( Dali::Integration::Scene scene, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver )
+EventHandler::EventHandler( Dali::Integration::Scene scene, CoreEventInterface& coreEventInterface, DamageObserver& damageObserver )
 : mScene( scene ),
   mCoreEventInterface( coreEventInterface ),
-  mGestureManager( gestureManager ),
   mStyleMonitor( StyleMonitor::Get() ),
   mDamageObserver( damageObserver ),
   mRotationObserver( NULL ),
@@ -135,7 +133,6 @@ EventHandler::EventHandler( Dali::Integration::Scene scene, CoreEventInterface&
 
 EventHandler::~EventHandler()
 {
-  mGestureManager.Stop();
 }
 
 void EventHandler::SendEvent( Integration::Point& point, uint32_t timeStamp )
@@ -157,7 +154,6 @@ void EventHandler::SendEvent( Integration::Point& point, uint32_t timeStamp )
     if( type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth )
     {
       mScene.QueueEvent( touchEvent );
-      mGestureManager.SendEvent( mScene, touchEvent );
     }
 
     if( type == Integration::TouchEventCombiner::DispatchHover || type == Integration::TouchEventCombiner::DispatchBoth )
@@ -260,8 +256,6 @@ void EventHandler::Reset()
   // First the touch event & related gesture events are queued
   mScene.QueueEvent( event );
 
-  mGestureManager.SendEvent( mScene, event );
-
   // Next the events are processed with a single call into Core
   mCoreEventInterface.ProcessCoreEvents();
 }
index 3767f10..ed5ad59 100755 (executable)
@@ -69,10 +69,9 @@ public:
    * Constructor.
    * @param[in]  scene                    The scene where events will be sent to.
    * @param[in]  coreEventInterface       Used to send events to Core.
-   * @param[in]  gestureManager           The Gesture Manager.
    * @param[in]  damageObserver           The damage observer (to pass damage events to).
    */
-  EventHandler( Dali::Integration::Scene scene, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver );
+  EventHandler( Dali::Integration::Scene scene, CoreEventInterface& coreEventInterface, DamageObserver& damageObserver );
 
   /**
    * Destructor.
@@ -234,7 +233,6 @@ private:
   Dali::Integration::Scene mScene; ///< The scene the event handler is created for.
   CoreEventInterface& mCoreEventInterface; ///< Used to send events to Core.
   Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events.
-  GestureManager& mGestureManager; ///< Reference to the GestureManager, set on construction, to send touch events to for analysis.
   Dali::StyleMonitor mStyleMonitor; ///< Handle to the style monitor, set on construction, to send font size and font change events to.
   DamageObserver& mDamageObserver; ///< Reference to the DamageObserver, set on construction, to sent damage events to.
   RotationObserver* mRotationObserver; ///< Pointer to rotation observer, if present.
index d606f10..443f86a 100644 (file)
@@ -125,8 +125,7 @@ void Window::Initialize(const PositionSize& positionSize, const std::string& nam
 
 void Window::OnAdaptorSet(Dali::Adaptor& adaptor)
 {
-  mEventHandler = EventHandlerPtr(
-      new EventHandler( mScene, *mAdaptor, *mAdaptor->GetGestureManager(), *mAdaptor ) );
+  mEventHandler = EventHandlerPtr(new EventHandler( mScene, *mAdaptor, *mAdaptor ) );
 
   // TODO: Orientation should be passed into the constructor of EventHandler
   if( mOrientation )