Revert "Removing Dali::TouchEvent" accepted/tizen/unified/20200820.034739 submit/tizen/20200819.064657
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 19 Aug 2020 05:22:55 +0000 (14:22 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Wed, 19 Aug 2020 05:22:55 +0000 (14:22 +0900)
This reverts commit 56085602bdee7f591588f962117338b8c5b94092.

automated-tests/src/dali-adaptor/dali-test-suite-utils/test-touch-utils.h [new file with mode: 0644]
dali/devel-api/adaptor-framework/accessibility-action-handler.h
dali/devel-api/adaptor-framework/accessibility-adaptor.h
dali/devel-api/adaptor-framework/window-devel.cpp
dali/integration-api/adaptor-framework/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

diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-touch-utils.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-touch-utils.h
new file mode 100644 (file)
index 0000000..3a623cb
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef TEST_TOUCH_UTILS_H
+#define TEST_TOUCH_UTILS_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/public-api/actors/actor.h>
+
+namespace Dali
+{
+
+// Data for touch events
+struct TouchEventData
+{
+  TouchEventData()
+  : functorCalled(false),
+    receivedTouch(),
+    touchActor()
+  {
+  }
+
+  void Reset()
+  {
+    functorCalled = false;
+
+    receivedTouch.points.clear();
+    receivedTouch.time = 0;
+
+    touchActor.Reset();
+  }
+
+  bool functorCalled;
+  TouchEvent receivedTouch;
+  Actor touchActor;
+};
+
+// Functor that sets the data when called
+struct TouchEventDataFunctor
+{
+  TouchEventDataFunctor(TouchEventData& data) : touchEventData(data) { }
+
+  bool operator()(Actor actor, const TouchEvent& touch)
+  {
+    touchEventData.functorCalled = true;
+    touchEventData.touchActor = actor;
+    touchEventData.receivedTouch = touch;
+    return false;
+  }
+
+  // Generate a touch-event
+  Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition ) const
+  {
+    Integration::TouchEvent touchEvent;
+    Integration::Point point;
+    point.SetState( state );
+    point.SetScreenPosition( screenPosition );
+    touchEvent.points.push_back( point );
+    return touchEvent;
+  }
+
+  TouchEventData& touchEventData;
+};
+
+
+} // namespace Dali
+
+#endif // TEST_TOUCH_UTILS_H
index b4eb77f..a23620d 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/dali-adaptor-common.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
 
 namespace Dali
 {
@@ -47,10 +47,10 @@ public:
 
   /**
    * Perform the accessibility action associated with a scroll event.
-   * @param touchData The touch point (and time) of the event.
+   * @param touchEvent The touch point (and time) of the event.
    * @return whether the focus is cleared or not.
    */
-  virtual bool AccessibilityActionScroll( Dali::TouchData& touchData ) = 0;
+  virtual bool AccessibilityActionScroll( Dali::TouchEvent& touchEvent ) = 0;
 
   /**
    * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
@@ -200,10 +200,10 @@ public:
 
   /**
    * Perform the accessibility action to mouse move (by one finger tap & hold and move).
-   * @param touchData touch data
+   * @param touchEvent touch event structure
    * @return whether the accessibility action is performed or not.
    */
-  virtual bool AccessibilityActionTouch(const Dali::TouchData& touchData) = 0;
+  virtual bool AccessibilityActionTouch(const Dali::TouchEvent& touchEvent) = 0;
 
 }; // class AccessibilityActionHandler
 
index 14b856b..251f591 100755 (executable)
@@ -20,7 +20,7 @@
 
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/events/touch-point.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/dali-adaptor-common.h>
 
index c3c8c18..3cd89e2 100644 (file)
@@ -17,6 +17,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/events/key-event.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/events/wheel-event.h>
 
 // INTERNAL INCLUDES
index 94c5f81..4f708e4 100644 (file)
@@ -23,8 +23,8 @@
 #include <dali/public-api/signals/dali-signal.h>
 #include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/math/rect.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/any.h>
-#include <dali/public-api/events/touch-point.h>
 #include <dali/integration-api/processor-interface.h>
 
 // INTERNAL INCLUDES
index 4276737..d3eb43b 100644 (file)
@@ -22,7 +22,6 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-data-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 
 // INTERNAL INCLUDES
@@ -250,8 +249,9 @@ bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, uint
   // so always send the action to the action handler.
   if( mActionHandler )
   {
-    Dali::TouchData touchData = Integration::NewTouchData( timeStamp, point );
-    ret = mActionHandler->AccessibilityActionScroll( touchData );
+    Dali::TouchEvent event(timeStamp);
+    event.points.push_back(point);
+    ret = mActionHandler->AccessibilityActionScroll( event );
   }
 
   Integration::TouchEvent touchEvent;
@@ -274,11 +274,12 @@ bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, uint3
 {
   bool ret = false;
 
-  Dali::TouchData touchData = Integration::NewTouchData( timeStamp, point );
+  Dali::TouchEvent touchEvent(timeStamp);
+  touchEvent.points.push_back(point);
 
   if( mActionHandler )
   {
-    ret = mActionHandler->AccessibilityActionTouch( touchData );
+    ret = mActionHandler->AccessibilityActionTouch(touchEvent);
   }
   return ret;
 }
index 5a7fd8d..b872077 100644 (file)
@@ -20,6 +20,9 @@
 
 // EXTERNAL INCLUDES
 #include <cmath>
+
+#include <dali/public-api/events/touch-point.h>
+
 #include <dali/integration-api/events/touch-event-integ.h>
 
 
index 520b3f6..616d76e 100644 (file)
@@ -24,6 +24,7 @@
 #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
 {