Revert "Move TouchPoint to Devel API"
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 1 Sep 2020 07:55:16 +0000 (16:55 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Tue, 1 Sep 2020 07:55:16 +0000 (16:55 +0900)
This reverts commit c226c2236a0f6fe154b5ad4090f74521013b2584.

15 files changed:
automated-tests/src/dali/utc-Dali-TouchProcessing.cpp
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/events/touch-point.cpp [moved from dali/devel-api/events/touch-point.cpp with 73% similarity]
dali/public-api/events/touch-point.h [moved from dali/devel-api/events/touch-point.h with 73% similarity]
dali/public-api/file.list

index 9d2f437..8cdf264 100644 (file)
@@ -2065,11 +2065,11 @@ int UtcDaliTouchEventCapturePropertySet(void)
 int UtcDaliTouchEventIntegNewTouchEvent(void)
 {
   uint32_t timestamp = 92858u;
-  TouchPoint tp(1, PointState::STARTED, 34.4f, 123.89f, 5.0f, 7.0f);
+  TouchPoint tp(1, TouchPoint::State::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::STARTED, TEST_LOCATION );
+  DALI_TEST_EQUALS(touchEvent.GetState(0), PointState::Type::STARTED, TEST_LOCATION );
   DALI_TEST_EQUALS(touchEvent.GetLocalPosition(0), Vector2(5.0f, 7.0f), TEST_LOCATION );
   DALI_TEST_EQUALS(touchEvent.GetScreenPosition(0), Vector2(34.4f, 123.89f), TEST_LOCATION );
 
index 8006968..5ae82c1 100644 (file)
@@ -16,7 +16,6 @@ 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
@@ -73,7 +72,6 @@ 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 ee61baf..2349f02 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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, PointState::STARTED, 0.0f, 0.0f ),
+: mTouchPoint( 0, TouchPoint::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< PointState::Type >( state );
+  mTouchPoint.state = static_cast< TouchPoint::State >( state );
 }
 
 void Point::SetScreenPosition( const Vector2& screenPosition )
index f1e9112..29498d7 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_POINT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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/devel-api/events/touch-point.h>
+#include <dali/public-api/events/touch-point.h>
 #include <dali/public-api/events/device.h>
 #include <dali/public-api/events/mouse-button.h>
 
index 3f48898..4499472 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/devel-api/events/touch-point.h>
+#include <dali/public-api/events/touch-point.h>
 
 namespace Dali
 {
index 31c7392..36c9725 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/devel-api/events/touch-point.h>
+#include <dali/public-api/events/touch-point.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/integration-api/events/point.h>
 
index 14b55fb..84b6ffb 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[PointState::INTERRUPTED + 1] =
+const char * TOUCH_POINT_STATE[TouchPoint::Last] =
 {
-  "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" );
 
-  PointState::Type state = static_cast< PointState::Type >( event.points[0].GetState() );
+  TouchPoint::State state = static_cast< TouchPoint::State >( 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 == PointState::INTERRUPTED )
+  if ( state == TouchPoint::Interrupted )
   {
     Dali::Actor consumingActor;
     Integration::Point currentPoint( event.points[0] );
index 7f9a34b..8713045 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/devel-api/events/touch-point.h>
+#include <dali/public-api/events/touch-point.h>
 #include <dali/public-api/math/vector2.h>
 
 #include <dali/internal/event/common/thread-local-storage.h>
index 0a0964c..51a91a5 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/devel-api/events/touch-point.h>
+#include <dali/public-api/events/touch-point.h>
 
 #include <dali/integration-api/events/touch-event-integ.h>
 
index 353e515..0c41120 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cmath>
 
-#include <dali/devel-api/events/touch-point.h>
+#include <dali/public-api/events/touch-point.h>
 #include <dali/public-api/math/vector2.h>
 
 #include <dali/internal/event/events/pinch-gesture/pinch-gesture-event.h>
index 806805d..6c969c4 100644 (file)
@@ -22,7 +22,7 @@
 #include <cmath>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/events/touch-point.h>
+#include <dali/public-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 d76ab2e..a53cb12 100644 (file)
@@ -61,6 +61,7 @@
 #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>
similarity index 73%
rename from dali/devel-api/events/touch-point.cpp
rename to dali/public-api/events/touch-point.cpp
index bcfbea2..41a3785 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * 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.
  */
 
 // CLASS HEADER
-#include <dali/devel-api/events/touch-point.h>
+#include <dali/public-api/events/touch-point.h>
 
 namespace Dali
 {
 
-TouchPoint::TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY)
+TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY)
 : deviceId(id),
   state(state),
   local(screenX, screenY),
@@ -29,7 +29,7 @@ TouchPoint::TouchPoint(int32_t id, PointState::Type state, float screenX, float
 {
 }
 
-TouchPoint::TouchPoint(int32_t id, PointState::Type state, float screenX, float screenY, float localX, float localY)
+TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY)
 : deviceId(id),
   state(state),
   local(localX, localY),
similarity index 73%
rename from dali/devel-api/events/touch-point.h
rename to dali/public-api/events/touch-point.h
index 3cda040..ce6f371 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOUCH_POINT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@
 // 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
@@ -41,23 +40,44 @@ 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_9.28
+   * @SINCE_1_0.0
    * @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, PointState::Type state, float screenX, float screenY);
+  TouchPoint(int32_t id, State state, float screenX, float screenY);
 
   /**
    * @brief Constructor.
    *
-   * @SINCE_1_9.28
+   * @SINCE_1_0.0
    * @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
@@ -65,7 +85,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, PointState::Type state, float screenX, float screenY, float localX, float localY);
+  TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY);
 
   /**
    * @brief Destructor.
@@ -83,9 +103,9 @@ struct DALI_CORE_API TouchPoint
   /**
    * @brief State of the point.
    *
-   * @see Dali::PointState::Type
+   * @see State
    */
-  PointState::Type state;
+  State state;
 
   /**
    * @brief The actor that was underneath the touch point.
index f25d85f..9675830 100644 (file)
@@ -34,6 +34,7 @@ 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
@@ -147,6 +148,7 @@ 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
 )