Move TouchPoint to Devel API 75/242675/1
authorRichard Huang <r.huang@samsung.com>
Fri, 28 Aug 2020 15:31:26 +0000 (16:31 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 28 Aug 2020 15:31:26 +0000 (16:31 +0100)
Change-Id: I0117ed93c0fc2f89757c221ad048b90cc544ccef

automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp
automated-tests/src/dali-toolkit/utc-Dali-Tooltip.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp

index fde3214..ad275ca 100644 (file)
@@ -2256,7 +2256,7 @@ int UtcDaliAccessibilityManagerActionScrollSignalP(void)
 
   Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
 
-  TouchPoint point( 0, TouchPoint::Started, 100.0f, 200.0f );
+  TouchPoint point( 0, PointState::STARTED, 100.0f, 200.0f );
   accessibilityAdaptor.HandleActionScrollEvent( point, 0u );
 
   DALI_TEST_EQUALS( callback.GetCalls(), 1u, TEST_LOCATION );
index ef92ce4..9f41ad8 100644 (file)
@@ -81,7 +81,7 @@ namespace
     bool returnValue;
     };
 
-  Integration::TouchEvent GenerateSingleTouch(TouchPoint::State state, const Vector2& screenPosition)
+  Integration::TouchEvent GenerateSingleTouch(PointState::Type state, const Vector2& screenPosition)
   {
     Integration::TouchEvent touchEvent;
     Integration::Point point;
@@ -327,7 +327,7 @@ int UtcDaliDragAndDropDetectorEnteredSignal(void)
   TestGenerateMiniPan(application);
 
   Vector2 screenCoordinates(10.0f, 110.0f);
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, screenCoordinates));
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(control2, data.control, TEST_LOCATION);
@@ -370,11 +370,11 @@ int UtcDaliDragAndDropDetectorMovedSignal(void)
   TestGenerateMiniPan(application);
 
   Vector2 screenCoordinates(10.0f, 110.0f);
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, screenCoordinates));
 
   screenCoordinates.x = 10.0f;
   screenCoordinates.y = 120.0f;
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, screenCoordinates));
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(Vector2(10.0f, 120.0f), data.detector.GetCurrentScreenPosition(), TEST_LOCATION);
@@ -420,11 +420,11 @@ int UtcDaliDragAndDropDetectorExitedSignal(void)
   TestGenerateMiniPan(application);
 
   Vector2 screenCoordinates(10.0f, 110.0f);
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, screenCoordinates));
 
   screenCoordinates.x = 20.0f;
   screenCoordinates.y = 20.0f;
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, screenCoordinates));
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(control2, data.control, TEST_LOCATION);
 
@@ -465,11 +465,11 @@ int UtcDaliDragAndDropDetectorDroppedSignal(void)
   TestGenerateMiniPan(application);
 
   Vector2 screenCoordinates(10.0f, 110.0f);
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, screenCoordinates));
 
   screenCoordinates.x = 10.0f;
   screenCoordinates.y = 112.0f;
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Up, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::UP, screenCoordinates));
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(control2, data.control, TEST_LOCATION);
@@ -512,7 +512,7 @@ int UtcDaliDragAndDropDetectorEndedSignal(void)
 
   TestGenerateMiniPan(application);
 
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Down, Vector2(10.0f, 10.0f)));
+  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(10.0f, 10.0f)));
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(control1, data.control, TEST_LOCATION);
@@ -555,11 +555,11 @@ int UtcDaliDragAndDropDetectorGetContent(void)
   TestGenerateMiniPan(application);
 
   Vector2 screenCoordinates(10.0f, 110.0f);
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Motion, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, screenCoordinates));
 
   screenCoordinates.x = 10.0f;
   screenCoordinates.y = 112.0f;
-  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Up, screenCoordinates));
+  application.ProcessEvent(GenerateSingleTouch(PointState::UP, screenCoordinates));
 
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(control2, data.control, TEST_LOCATION);
index b83a7b1..b1cf510 100644 (file)
@@ -50,7 +50,7 @@ void utc_dali_toolkit_tooltip_cleanup(void)
 namespace
 {
 
-Integration::HoverEvent GenerateSingleHover( TouchPoint::State state, const Vector2& screenPosition )
+Integration::HoverEvent GenerateSingleHover( PointState::Type state, const Vector2& screenPosition )
 {
   Integration::HoverEvent hoverEvent;
   Integration::Point point;
@@ -521,7 +521,7 @@ int UtcDaliTooltipDisplay(void)
   int rootChildCount = rootActor.GetChildCount();
 
   Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -533,7 +533,7 @@ int UtcDaliTooltipDisplay(void)
   ++rootChildCount;
   DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
 
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Stationary, centerPoint ) ); // Emit for code coverage, will have no effect
+  application.ProcessEvent( GenerateSingleHover( PointState::STATIONARY, centerPoint ) ); // Emit for code coverage, will have no effect
 
   END_TEST;
 }
@@ -563,7 +563,7 @@ int UtcDaliTooltipDisplayWithTail(void)
   int rootChildCount = rootActor.GetChildCount();
 
   Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -607,7 +607,7 @@ int UtcDaliTooltipDisplayWithContentArray(void)
   int rootChildCount = rootActor.GetChildCount();
 
   Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -642,7 +642,7 @@ int UtcDaliTooltipDisplayBelow(void)
   application.Render();
 
   Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -678,7 +678,7 @@ int UtcDaliTooltipDisplayAbove(void)
   application.Render();
 
   Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -717,7 +717,7 @@ int UtcDaliTooltipDisplayAtHoverPoint(void)
   Vector2 hoverPoint = stageSize * 0.5f;
   hoverPoint.x -= 10.0f;
   hoverPoint.y -= 10.0f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -757,14 +757,14 @@ int UtcDaliTooltipExceedThreshold(void)
 
   tet_infoline( "Start hover" );
   Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
 
   application.SendNotification();
   application.Render();
 
   tet_infoline( "Emit a value which exceeds threshold, timer should start again" );
   hoverPoint.x += 10.0f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::MOTION, hoverPoint ) );
 
   application.SendNotification();
   application.Render();
@@ -803,14 +803,14 @@ int UtcDaliTooltipGoOutOfBounds(void)
 
   tet_infoline( "Start hover" );
   Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
 
   application.SendNotification();
   application.Render();
 
   tet_infoline( "Emit a value which goes out of bounds" );
   hoverPoint.x += 100.0f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::MOTION, hoverPoint ) );
 
   application.SendNotification();
   application.Render();
@@ -847,7 +847,7 @@ int UtcDaliTooltipHideTooltipWhenOutOfBounds(void)
   int rootChildCount = rootActor.GetChildCount();
 
   Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -860,7 +860,7 @@ int UtcDaliTooltipHideTooltipWhenOutOfBounds(void)
   DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
 
   hoverPoint.x += 100.0f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::MOTION, hoverPoint ) );
 
   application.SendNotification();
   application.Render();
@@ -895,7 +895,7 @@ int UtcDaliTooltipHideTooltipWhenSetToDisapperOnMovement(void)
   int rootChildCount = rootActor.GetChildCount();
 
   Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -908,7 +908,7 @@ int UtcDaliTooltipHideTooltipWhenSetToDisapperOnMovement(void)
   DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
 
   hoverPoint.x += 10.0f; // Stay within bounds but exceed threshold
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, hoverPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::MOTION, hoverPoint ) );
 
   application.SendNotification();
   application.Render();
@@ -939,7 +939,7 @@ int UtcDaliTooltipChangeContent(void)
   int rootChildCount = rootActor.GetChildCount();
 
   Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   tet_infoline( "Change content while timer is running and ensure it matches the new value" );
   control.SetProperty( DevelControl::Property::TOOLTIP, "Second Value" );
@@ -967,7 +967,7 @@ int UtcDaliTooltipChangeContent(void)
   DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
 
   tet_infoline( "More movement at same point, and emit signal, we should get the tooltip" );
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::MOTION, centerPoint ) );
   timer.MockEmitSignal();
 
   application.SendNotification();
@@ -1032,7 +1032,7 @@ int UtcDaliTooltipEnsureRemainsOnStage1(void)
   application.Render();
 
   Vector2 centerPoint = stageSize * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -1074,7 +1074,7 @@ int UtcDaliTooltipEnsureRemainsOnStage2(void)
   application.Render();
 
   Vector2 centerPoint = stageSize * 0.5f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -1119,7 +1119,7 @@ int UtcDaliTooltipEnsureRemainsOnStage3(void)
 
   Vector2 hoverPoint( centerPoint );
   hoverPoint.x = 1.0f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
@@ -1164,7 +1164,7 @@ int UtcDaliTooltipEnsureRemainsOnStage4(void)
 
   Vector2 hoverPoint( centerPoint );
   hoverPoint.x = 1.0f;
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, centerPoint ) );
+  application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
 
   Dali::Timer timer = Timer::New( 1u );
   timer.MockEmitSignal();
index a4ebfa9..2a3bbd5 100644 (file)
@@ -2096,7 +2096,7 @@ bool ScrollView::OnTouch( Actor actor, const TouchEvent& touch )
   else if( ( pointState == PointState::UP ) ||
            ( ( pointState == PointState::INTERRUPTED ) && ( touch.GetHitActor( 0 )== Self() ) ) )
   {
-    DALI_LOG_SCROLL_STATE("[0x%X] %s", this, ( ( pointState == TouchPoint::Up ) ? "Up" : "Interrupted" ) );
+    DALI_LOG_SCROLL_STATE("[0x%X] %s", this, ( ( pointState == PointState::UP ) ? "Up" : "Interrupted" ) );
 
     StopTouchDownTimer();