From: Richard Huang Date: Fri, 28 Aug 2020 15:27:05 +0000 (+0100) Subject: Move TouchPoint to Devel API X-Git-Tag: dali_1.9.28~10 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-core.git;a=commitdiff_plain;h=c226c2236a0f6fe154b5ad4090f74521013b2584 Move TouchPoint to Devel API Change-Id: I8c9bc63e159f64593998281e1cff85ef83c13752 --- diff --git a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp index 8cdf264..9d2f437 100644 --- a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp @@ -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 ); diff --git a/dali/public-api/events/touch-point.cpp b/dali/devel-api/events/touch-point.cpp 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 --- a/dali/public-api/events/touch-point.cpp +++ b/dali/devel-api/events/touch-point.cpp @@ -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. @@ -16,12 +16,12 @@ */ // CLASS HEADER -#include +#include 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), diff --git a/dali/public-api/events/touch-point.h b/dali/devel-api/events/touch-point.h 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 --- a/dali/public-api/events/touch-point.h +++ b/dali/devel-api/events/touch-point.h @@ -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 #include +#include #include 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. diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 5ae82c1..8006968 100644 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -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 ) diff --git a/dali/integration-api/events/point.cpp b/dali/integration-api/events/point.cpp index 2349f02..ee61baf 100755 --- a/dali/integration-api/events/point.cpp +++ b/dali/integration-api/events/point.cpp @@ -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 ) diff --git a/dali/integration-api/events/point.h b/dali/integration-api/events/point.h index 29498d7..f1e9112 100755 --- a/dali/integration-api/events/point.h +++ b/dali/integration-api/events/point.h @@ -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 #include #include -#include +#include #include #include diff --git a/dali/integration-api/events/touch-integ.h b/dali/integration-api/events/touch-integ.h index 4499472..3f48898 100644 --- a/dali/integration-api/events/touch-integ.h +++ b/dali/integration-api/events/touch-integ.h @@ -20,7 +20,7 @@ // INTERNAL INCLUDES #include #include -#include +#include namespace Dali { diff --git a/dali/internal/event/events/hover-event-impl.h b/dali/internal/event/events/hover-event-impl.h index 36c9725..31c7392 100755 --- a/dali/internal/event/events/hover-event-impl.h +++ b/dali/internal/event/events/hover-event-impl.h @@ -21,7 +21,7 @@ // INTERNAL INCLUDES #include #include -#include +#include #include #include diff --git a/dali/internal/event/events/hover-event-processor.cpp b/dali/internal/event/events/hover-event-processor.cpp index 84b6ffb..14b55fb 100644 --- a/dali/internal/event/events/hover-event-processor.cpp +++ b/dali/internal/event/events/hover-event-processor.cpp @@ -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] ); diff --git a/dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp b/dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp index 8713045..7f9a34b 100644 --- a/dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp +++ b/dali/internal/event/events/long-press-gesture/long-press-gesture-recognizer.cpp @@ -21,7 +21,7 @@ // EXTERNAL INCLUDES #include -#include +#include #include #include diff --git a/dali/internal/event/events/pan-gesture/pan-gesture-recognizer.cpp b/dali/internal/event/events/pan-gesture/pan-gesture-recognizer.cpp index 51a91a5..0a0964c 100644 --- a/dali/internal/event/events/pan-gesture/pan-gesture-recognizer.cpp +++ b/dali/internal/event/events/pan-gesture/pan-gesture-recognizer.cpp @@ -21,7 +21,7 @@ // EXTERNAL INCLUDES #include -#include +#include #include diff --git a/dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.cpp b/dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.cpp index de2bd4f..a552ca7 100644 --- a/dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.cpp +++ b/dali/internal/event/events/pinch-gesture/pinch-gesture-recognizer.cpp @@ -21,7 +21,7 @@ // EXTERNAL INCLUDES #include -#include +#include #include #include diff --git a/dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.cpp b/dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.cpp index 2873612..c4911aa 100644 --- a/dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.cpp +++ b/dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.cpp @@ -22,7 +22,7 @@ #include // INTERNAL INCLUDES -#include +#include #include #include #include diff --git a/dali/public-api/dali-core.h b/dali/public-api/dali-core.h index a53cb12..d76ab2e 100644 --- a/dali/public-api/dali-core.h +++ b/dali/public-api/dali-core.h @@ -61,7 +61,6 @@ #include #include #include -#include #include #include diff --git a/dali/public-api/file.list b/dali/public-api/file.list index 9675830..f25d85f 100644 --- a/dali/public-api/file.list +++ b/dali/public-api/file.list @@ -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 )