Move TouchPoint to Devel API 73/242673/2
authorRichard Huang <r.huang@samsung.com>
Fri, 28 Aug 2020 15:27:05 +0000 (16:27 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 28 Aug 2020 16:39:55 +0000 (17:39 +0100)
Change-Id: I8c9bc63e159f64593998281e1cff85ef83c13752

15 files changed:
automated-tests/src/dali/utc-Dali-TouchProcessing.cpp
dali/devel-api/events/touch-point.cpp [moved from dali/public-api/events/touch-point.cpp with 73% similarity]
dali/devel-api/events/touch-point.h [moved from dali/public-api/events/touch-point.h with 73% similarity]
dali/devel-api/file.list
dali/integration-api/events/point.cpp
dali/integration-api/events/point.h
dali/integration-api/events/touch-integ.h
dali/internal/event/events/hover-event-impl.h
dali/internal/event/events/hover-event-processor.cpp
dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp
dali/internal/event/events/pan-gesture/pan-gesture-recognizer.cpp
dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.cpp
dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.cpp
dali/public-api/dali-core.h
dali/public-api/file.list

index 8cdf264..9d2f437 100644 (file)
@@ -2065,11 +2065,11 @@ int UtcDaliTouchEventCapturePropertySet(void)
 int UtcDaliTouchEventIntegNewTouchEvent(void)
 {
   uint32_t timestamp = 92858u;
-  TouchPoint tp(1, TouchPoint::State::Started, 34.4f, 123.89f, 5.0f, 7.0f);
+  TouchPoint tp(1, PointState::STARTED, 34.4f, 123.89f, 5.0f, 7.0f);
   Dali::TouchEvent touchEvent = Integration::NewTouchEvent(timestamp, tp);
 
   DALI_TEST_EQUALS(touchEvent.GetPointCount(), 1u, TEST_LOCATION);
-  DALI_TEST_EQUALS(touchEvent.GetState(0), PointState::Type::STARTED, TEST_LOCATION );
+  DALI_TEST_EQUALS(touchEvent.GetState(0), PointState::STARTED, TEST_LOCATION );
   DALI_TEST_EQUALS(touchEvent.GetLocalPosition(0), Vector2(5.0f, 7.0f), TEST_LOCATION );
   DALI_TEST_EQUALS(touchEvent.GetScreenPosition(0), Vector2(34.4f, 123.89f), TEST_LOCATION );
 
similarity index 73%
rename from dali/public-api/events/touch-point.cpp
rename to dali/devel-api/events/touch-point.cpp
index 41a3785..bcfbea2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // CLASS HEADER
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 
 namespace Dali
 {
 
-TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY)
+TouchPoint::TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY)
 : deviceId(id),
   state(state),
   local(screenX, screenY),
@@ -29,7 +29,7 @@ TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY)
 {
 }
 
-TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY)
+TouchPoint::TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY, float localX, float localY)
 : deviceId(id),
   state(state),
   local(localX, localY),
similarity index 73%
rename from dali/public-api/events/touch-point.h
rename to dali/devel-api/events/touch-point.h
index ce6f371..3cda040 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOUCH_POINT_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/actors/actor.h>
+#include <dali/public-api/events/point-state.h>
 #include <dali/public-api/math/vector2.h>
 
 namespace Dali
@@ -40,44 +41,23 @@ namespace Dali
  */
 struct DALI_CORE_API TouchPoint
 {
-  // Enumerations
-
-  /**
-   * @brief Enumeration for Touch state.
-   * @SINCE_1_0.0
-   */
-  enum State
-  {
-    Started,        /**< Touch or hover started */
-    Finished,       /**< Touch or hover finished */
-    Down = Started, /**< Screen touched */
-    Up = Finished,  /**< Touch stopped */
-    Motion,         /**< Finger dragged or hovered */
-    Leave,          /**< Leave the boundary of an actor */
-    Stationary,     /**< No change from last event.  Useful when a multi-point event occurs where
-                         all points are sent but indicates that this particular point has not changed
-                         since the last time */
-    Interrupted,    /**< A system event has occurred which has interrupted the touch or hover event sequence. */
-    Last            /**< Number of states. */
-  };
-
   // Construction & Destruction
 
   /**
    * @brief Constructor.
    *
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] id      The touch device ID
    * @param[in] state   The state
    * @param[in] screenX The X co-ordinate relative to the screen's origin
    * @param[in] screenY The Y co-ordinate relative to the screen's origin
    */
-  TouchPoint(int32_t id, State state, float screenX, float screenY);
+  TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY);
 
   /**
    * @brief Constructor.
    *
-   * @SINCE_1_0.0
+   * @SINCE_1_9.28
    * @param[in] id      The touch device ID
    * @param[in] state   The state
    * @param[in] screenX The X co-ordinate relative to the screen's origin
@@ -85,7 +65,7 @@ struct DALI_CORE_API TouchPoint
    * @param[in] localX  The X co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
    * @param[in] localY  The Y co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
    */
-  TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY);
+  TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY, float localX, float localY);
 
   /**
    * @brief Destructor.
@@ -103,9 +83,9 @@ struct DALI_CORE_API TouchPoint
   /**
    * @brief State of the point.
    *
-   * @see State
+   * @see Dali::PointState::Type
    */
-  State state;
+  PointState::Type state;
 
   /**
    * @brief The actor that was underneath the touch point.
index 5ae82c1..8006968 100644 (file)
@@ -16,6 +16,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/events/hit-test-algorithm.cpp
   ${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
   ${devel_api_src_dir}/events/key-event-devel.cpp
+  ${devel_api_src_dir}/events/touch-point.cpp
   ${devel_api_src_dir}/events/wheel-event-devel.cpp
   ${devel_api_src_dir}/images/distance-field.cpp
   ${devel_api_src_dir}/images/pixel-data-devel.cpp
@@ -72,6 +73,7 @@ SET( devel_api_core_events_header_files
   ${devel_api_src_dir}/events/hit-test-algorithm.h
   ${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
   ${devel_api_src_dir}/events/key-event-devel.h
+  ${devel_api_src_dir}/events/touch-point.h
   ${devel_api_src_dir}/events/wheel-event-devel.h
 )
 
index 2349f02..ee61baf 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ namespace Integration
 {
 
 Point::Point()
-: mTouchPoint( 0, TouchPoint::Started, 0.0f, 0.0f ),
+: mTouchPoint( 0, PointState::STARTED, 0.0f, 0.0f ),
   mEllipseRadius(),
   mAngle( 0.0f ),
   mDeviceClass( Device::Class::NONE ),
@@ -60,7 +60,7 @@ void Point::SetDeviceId( int32_t deviceId )
 
 void Point::SetState( PointState::Type state )
 {
-  mTouchPoint.state = static_cast< TouchPoint::State >( state );
+  mTouchPoint.state = static_cast< PointState::Type >( state );
 }
 
 void Point::SetScreenPosition( const Vector2& screenPosition )
index 29498d7..f1e9112 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_POINT_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
 #include <dali/public-api/events/point-state.h>
 #include <dali/public-api/math/degree.h>
 #include <dali/public-api/math/vector2.h>
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/events/device.h>
 #include <dali/public-api/events/mouse-button.h>
 
index 4499472..3f48898 100644 (file)
@@ -20,7 +20,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/events/touch-event.h>
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 
 namespace Dali
 {
index 36c9725..31c7392 100755 (executable)
@@ -21,7 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/events/hover-event.h>
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/integration-api/events/point.h>
 
index 84b6ffb..14b55fb 100644 (file)
@@ -46,14 +46,14 @@ namespace
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_HOVER_PROCESSOR" );
 
-const char * TOUCH_POINT_STATE[TouchPoint::Last] =
+const char * TOUCH_POINT_STATE[PointState::INTERRUPTED + 1] =
 {
-  "Started",
-  "Finished",
-  "Motion",
-  "Leave",
-  "Stationary",
-  "Interrupted",
+  "STARTED",
+  "FINISHED",
+  "MOTION",
+  "LEAVE",
+  "STATIONARY",
+  "INTERRUPTED",
 };
 
 #endif // defined(DEBUG_ENABLED)
@@ -176,7 +176,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
   DALI_LOG_TRACE_METHOD( gLogFilter );
   DALI_ASSERT_ALWAYS( !event.points.empty() && "Empty HoverEvent sent from Integration\n" );
 
-  TouchPoint::State state = static_cast< TouchPoint::State >( event.points[0].GetState() );
+  PointState::Type state = static_cast< PointState::Type >( event.points[0].GetState() );
 
   PRINT_HIERARCHY(gLogFilter);
 
@@ -186,7 +186,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
   // 1) Check if it is an interrupted event - we should inform our last primary hit actor about this
   //    and emit the stage signal as well.
 
-  if ( state == TouchPoint::Interrupted )
+  if ( state == PointState::INTERRUPTED )
   {
     Dali::Actor consumingActor;
     Integration::Point currentPoint( event.points[0] );
index 8713045..7f9a34b 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/math/vector2.h>
 
 #include <dali/internal/event/common/thread-local-storage.h>
index 51a91a5..0a0964c 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 
 #include <dali/integration-api/events/touch-event-integ.h>
 
index de2bd4f..a552ca7 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/math/vector2.h>
 
 #include <dali/internal/event/events/pinch-gesture/pinch-gesture-event.h>
index 2873612..c4911aa 100644 (file)
@@ -22,7 +22,7 @@
 #include <cmath>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/internal/event/events/rotation-gesture/rotation-gesture-event.h>
index a53cb12..d76ab2e 100644 (file)
@@ -61,7 +61,6 @@
 #include <dali/public-api/events/tap-gesture-detector.h>
 #include <dali/public-api/events/tap-gesture.h>
 #include <dali/public-api/events/touch-event.h>
-#include <dali/public-api/events/touch-point.h>
 
 #include <dali/public-api/images/native-image-interface.h>
 #include <dali/public-api/images/pixel.h>
index 9675830..f25d85f 100644 (file)
@@ -34,7 +34,6 @@ SET( public_api_src_files
   ${public_api_src_dir}/events/rotation-gesture-detector.cpp
   ${public_api_src_dir}/events/tap-gesture.cpp
   ${public_api_src_dir}/events/tap-gesture-detector.cpp
-  ${public_api_src_dir}/events/touch-point.cpp
   ${public_api_src_dir}/events/touch-event.cpp
   ${public_api_src_dir}/images/pixel.cpp
   ${public_api_src_dir}/images/pixel-data.cpp
@@ -148,7 +147,6 @@ SET( public_api_core_events_header_files
   ${public_api_src_dir}/events/rotation-gesture-detector.h
   ${public_api_src_dir}/events/tap-gesture.h
   ${public_api_src_dir}/events/tap-gesture-detector.h
-  ${public_api_src_dir}/events/touch-point.h
   ${public_api_src_dir}/events/touch-event.h
   ${public_api_src_dir}/events/mouse-button.h
 )