From 56085602bdee7f591588f962117338b8c5b94092 Mon Sep 17 00:00:00 2001 From: David Steele Date: Tue, 11 Aug 2020 16:23:49 +0100 Subject: [PATCH] Removing Dali::TouchEvent Change-Id: I5148d3bf8155da17889dffd8e809ec61c62d33e0 --- .../dali-test-suite-utils/test-touch-utils.h | 81 ---------------------- .../accessibility-action-handler.h | 10 +-- .../adaptor-framework/accessibility-adaptor.h | 2 +- dali/devel-api/adaptor-framework/window-devel.cpp | 1 - dali/integration-api/adaptor-framework/adaptor.h | 2 +- .../common/accessibility-adaptor-impl.cpp | 11 ++- .../common/accessibility-gesture-detector.cpp | 3 - .../common/accessibility-gesture-detector.h | 1 - 8 files changed, 12 insertions(+), 99 deletions(-) delete mode 100644 automated-tests/src/dali-adaptor/dali-test-suite-utils/test-touch-utils.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 deleted file mode 100644 index 3a623cb..0000000 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-touch-utils.h +++ /dev/null @@ -1,81 +0,0 @@ -#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 - -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 diff --git a/dali/devel-api/adaptor-framework/accessibility-action-handler.h b/dali/devel-api/adaptor-framework/accessibility-action-handler.h index a23620d..b4eb77f 100644 --- a/dali/devel-api/adaptor-framework/accessibility-action-handler.h +++ b/dali/devel-api/adaptor-framework/accessibility-action-handler.h @@ -20,7 +20,7 @@ // EXTERNAL INCLUDES #include -#include +#include namespace Dali { @@ -47,10 +47,10 @@ public: /** * Perform the accessibility action associated with a scroll event. - * @param touchEvent The touch point (and time) of the event. + * @param touchData The touch point (and time) of the event. * @return whether the focus is cleared or not. */ - virtual bool AccessibilityActionScroll( Dali::TouchEvent& touchEvent ) = 0; + virtual bool AccessibilityActionScroll( Dali::TouchData& touchData ) = 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 touchEvent touch event structure + * @param touchData touch data * @return whether the accessibility action is performed or not. */ - virtual bool AccessibilityActionTouch(const Dali::TouchEvent& touchEvent) = 0; + virtual bool AccessibilityActionTouch(const Dali::TouchData& touchData) = 0; }; // class AccessibilityActionHandler diff --git a/dali/devel-api/adaptor-framework/accessibility-adaptor.h b/dali/devel-api/adaptor-framework/accessibility-adaptor.h index 251f591..14b856b 100755 --- a/dali/devel-api/adaptor-framework/accessibility-adaptor.h +++ b/dali/devel-api/adaptor-framework/accessibility-adaptor.h @@ -20,7 +20,7 @@ // EXTERNAL INCLUDES -#include +#include #include #include diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 3cd89e2..c3c8c18 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -17,7 +17,6 @@ // EXTERNAL INCLUDES #include -#include #include // INTERNAL INCLUDES diff --git a/dali/integration-api/adaptor-framework/adaptor.h b/dali/integration-api/adaptor-framework/adaptor.h index 4f708e4..94c5f81 100644 --- a/dali/integration-api/adaptor-framework/adaptor.h +++ b/dali/integration-api/adaptor-framework/adaptor.h @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include #include // INTERNAL INCLUDES diff --git a/dali/internal/accessibility/common/accessibility-adaptor-impl.cpp b/dali/internal/accessibility/common/accessibility-adaptor-impl.cpp index d3eb43b..4276737 100644 --- a/dali/internal/accessibility/common/accessibility-adaptor-impl.cpp +++ b/dali/internal/accessibility/common/accessibility-adaptor-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -249,9 +250,8 @@ bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, uint // so always send the action to the action handler. if( mActionHandler ) { - Dali::TouchEvent event(timeStamp); - event.points.push_back(point); - ret = mActionHandler->AccessibilityActionScroll( event ); + Dali::TouchData touchData = Integration::NewTouchData( timeStamp, point ); + ret = mActionHandler->AccessibilityActionScroll( touchData ); } Integration::TouchEvent touchEvent; @@ -274,12 +274,11 @@ bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, uint3 { bool ret = false; - Dali::TouchEvent touchEvent(timeStamp); - touchEvent.points.push_back(point); + Dali::TouchData touchData = Integration::NewTouchData( timeStamp, point ); if( mActionHandler ) { - ret = mActionHandler->AccessibilityActionTouch(touchEvent); + ret = mActionHandler->AccessibilityActionTouch( touchData ); } return ret; } diff --git a/dali/internal/accessibility/common/accessibility-gesture-detector.cpp b/dali/internal/accessibility/common/accessibility-gesture-detector.cpp index b872077..5a7fd8d 100644 --- a/dali/internal/accessibility/common/accessibility-gesture-detector.cpp +++ b/dali/internal/accessibility/common/accessibility-gesture-detector.cpp @@ -20,9 +20,6 @@ // EXTERNAL INCLUDES #include - -#include - #include diff --git a/dali/internal/accessibility/common/accessibility-gesture-detector.h b/dali/internal/accessibility/common/accessibility-gesture-detector.h index 616d76e..520b3f6 100644 --- a/dali/internal/accessibility/common/accessibility-gesture-detector.h +++ b/dali/internal/accessibility/common/accessibility-gesture-detector.h @@ -24,7 +24,6 @@ #include #include #include -#include namespace Dali { -- 2.7.4