X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fevents%2Fgesture-event-processor.h;h=9ae5d6f139487e1982a16eda84b9f894312cfeed;hb=a4eb68faf1e75d213c951a7d4d1b67727247917a;hp=285a59741795a5aa190b0a38c304bca3d1d7f163;hpb=e424c13b4dd452d36ce86a29e1e3c6943cd07714;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/events/gesture-event-processor.h b/dali/internal/event/events/gesture-event-processor.h index 285a597..9ae5d6f 100644 --- a/dali/internal/event/events/gesture-event-processor.h +++ b/dali/internal/event/events/gesture-event-processor.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H__ -#define __DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H__ +#ifndef DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H +#define DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H /* - * Copyright (c) 2014 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. @@ -21,10 +21,11 @@ // INTERNAL INCLUDES #include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Dali { @@ -33,15 +34,20 @@ struct Gesture; namespace Integration { -struct GestureEvent; -class GestureManager; + class RenderController; } +namespace SceneGraph +{ +class UpdateManager; +} + namespace Internal { class Stage; +class Scene; /** * Gesture Event Processing: @@ -55,11 +61,10 @@ public: /** * Create a gesture event processor. - * @param[in] stage The stage. - * @param[in] gestureManager The gesture manager + * @param[in] updateManager The update manager * @param[in] renderController The render controller */ - GestureEventProcessor(Stage& stage, Integration::GestureManager& gestureManager, Integration::RenderController& renderController); + GestureEventProcessor( SceneGraph::UpdateManager& updateManager, Integration::RenderController& renderController ); /** * Non-virtual destructor; GestureProcessor is not a base class @@ -69,10 +74,11 @@ public: public: // To be called by EventProcessor /** - * This function is called by Core whenever a gesture event occurs. - * @param[in] event The event that has occurred. + * This function is called by Core whenever a touch event occurs + * @param[in] scene The scene + * @param[in] event The event that has occurred */ - void ProcessGestureEvent(const Integration::GestureEvent& event); + void ProcessTouchEvent( Scene& scene, const Integration::TouchEvent& event); public: // To be called by gesture detectors @@ -80,7 +86,7 @@ public: // To be called by gesture detectors * This method adds the specified gesture detector to the relevant gesture processor. * @param[in] gestureDetector The gesture detector to add */ - void AddGestureDetector(GestureDetector* gestureDetector); + void AddGestureDetector(GestureDetector* gestureDetector, Scene& scene); /** * This method removes the specified gesture detector from the relevant gesture processor. @@ -95,12 +101,6 @@ public: // To be called by gesture detectors void GestureDetectorUpdated(GestureDetector* gestureDetector); /** - * This method is called by GestureDetectors on Started or Continue state events. - * Status is queried and reset by Core in ProcessEvents - */ - void SetUpdateRequired(); - - /** * Called by GestureDetectors to set the gesture properties in the update thread. * @param[in] gesture The gesture whose values will be used in the Update object. * @note If we are in the middle of processing the gesture being set, then this call is ignored. @@ -127,28 +127,28 @@ public: // Called by Core * * @param[in] mode The prediction mode to use */ - void SetPanGesturePredictionMode( int mode ); + void SetPanGesturePredictionMode( int32_t mode ); /** * @brief Sets the prediction amount of the pan gesture * * @param[in] amount The prediction amount in milliseconds */ - void SetPanGesturePredictionAmount( unsigned int amount ); + void SetPanGesturePredictionAmount( uint32_t amount ); /** * @brief Sets the upper bound of the prediction amount for clamping * * @param[in] amount The prediction amount in milliseconds */ - void SetPanGestureMaximumPredictionAmount( unsigned int amount ); + void SetPanGestureMaximumPredictionAmount( uint32_t amount ); /** * @brief Sets the lower bound of the prediction amount for clamping * * @param[in] amount The prediction amount in milliseconds */ - void SetPanGestureMinimumPredictionAmount( unsigned int amount ); + void SetPanGestureMinimumPredictionAmount( uint32_t amount ); /** * @brief Sets the prediction amount to adjust when the pan velocity is changed. @@ -159,14 +159,14 @@ public: // Called by Core * * @param[in] amount The prediction amount in milliseconds */ - void SetPanGesturePredictionAmountAdjustment( unsigned int amount ); + void SetPanGesturePredictionAmountAdjustment( uint32_t amount ); /** * @brief Called to set how pan gestures smooth input * * @param[in] mode The smoothing mode to use */ - void SetPanGestureSmoothingMode( int mode ); + void SetPanGestureSmoothingMode( int32_t mode ); /** * @brief Sets the prediction amount of the pan gesture @@ -175,6 +175,102 @@ public: // Called by Core */ void SetPanGestureSmoothingAmount( float amount ); + /* + * @brief Sets whether to use actual times of the real gesture and frames or not. + * + * @param[in] value True = use actual times, False = use perfect values + */ + void SetPanGestureUseActualTimes( bool value ); + + /** + * @brief Sets the interpolation time range (ms) of past points to use (with weights) when interpolating. + * + * @param[in] value Time range in ms + */ + void SetPanGestureInterpolationTimeRange( int32_t value ); + + /** + * @brief Sets whether to use scalar only prediction, which when enabled, ignores acceleration. + * + * @param[in] value True = use scalar prediction only + */ + void SetPanGestureScalarOnlyPredictionEnabled( bool value ); + + /** + * @brief Sets whether to use two point prediction. This combines two interpolated points to get more steady acceleration and velocity values. + * + * @param[in] value True = use two point prediction + */ + void SetPanGestureTwoPointPredictionEnabled( bool value ); + + /** + * @brief Sets the time in the past to interpolate the second point when using two point interpolation. + * + * @param[in] value Time in past in ms + */ + void SetPanGestureTwoPointInterpolatePastTime( int32_t value ); + + /** + * @brief Sets the two point velocity bias. This is the ratio of first and second points to use for velocity. + * + * @param[in] value 0.0f = 100% first point. 1.0f = 100% of second point. + */ + void SetPanGestureTwoPointVelocityBias( float value ); + + /** + * @brief Sets the two point acceleration bias. This is the ratio of first and second points to use for acceleration. + * + * @param[in] value 0.0f = 100% first point. 1.0f = 100% of second point. + */ + void SetPanGestureTwoPointAccelerationBias( float value ); + + /** + * @brief Sets the range of time (ms) of points in the history to perform multitap smoothing with (if enabled). + * + * @param[in] value Time in past in ms + */ + void SetPanGestureMultitapSmoothingRange( int32_t value ); + + /** + * @brief Sets the minimum distance required to start a pan event + * + * @param[in] value Distance in pixels + */ + void SetPanGestureMinimumDistance( int32_t value ); + + /** + * @brief Sets the minimum number of touch events required to start a pan + * + * @param[in] value Number of touch events + */ + void SetPanGestureMinimumPanEvents( int32_t value ); + + /** + * @brief Sets the minimum distance required to start a pinch event + * + * @param[in] value Distance in pixels + */ + void SetPinchGestureMinimumDistance( float value); + + /** + * @brief Sets the minimum holding time required to be recognized as a long press gesture + * + * @param[in] value The time value in milliseconds + */ + void SetLongPressMinimumHoldingTime( uint32_t value ); + + /** + * @return The minimum holding time required to be recognized as a long press gesture in milliseconds + */ + uint32_t GetLongPressMinimumHoldingTime() const; + +public: // needed for PanGesture + + /** + * @return the pan gesture processor + */ + const PanGestureProcessor& GetPanGestureProcessor(); + private: // Undefined @@ -183,20 +279,19 @@ private: private: - Stage& mStage; - Integration::GestureManager& mGestureManager; - LongPressGestureProcessor mLongPressGestureProcessor; PanGestureProcessor mPanGestureProcessor; PinchGestureProcessor mPinchGestureProcessor; TapGestureProcessor mTapGestureProcessor; + RotationGestureProcessor mRotationGestureProcessor; Integration::RenderController& mRenderController; - bool mUpdateRequired; ///< set to true by gesture detectors if they require a Core::Update + int32_t envOptionMinimumPanDistance; + int32_t envOptionMinimumPanEvents; }; } // namespace Internal } // namespace Dali -#endif // __DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H__ +#endif // DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H