From: Adeel Kazmi Date: Wed, 4 Feb 2015 18:03:54 +0000 (-0800) Subject: Merge "Multi-profile support" into tizen X-Git-Tag: accepted/tizen/common/20150205.080850^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_3.0.2014.q4_common;hp=e4d47a42cefbfceabef3e114e8f2b47f1a60db7a;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Merge "Multi-profile support" into tizen --- diff --git a/adaptors/base/environment-options.cpp b/adaptors/base/environment-options.cpp index 936c2f4..4dc7e78 100644 --- a/adaptors/base/environment-options.cpp +++ b/adaptors/base/environment-options.cpp @@ -33,7 +33,10 @@ EnvironmentOptions::EnvironmentOptions() mPerformanceLoggingLevel(0), mPanGestureLoggingLevel(0), mPanGesturePredictionMode(-1), - mPanGesturePredictionAmount(-1.0f), ///< only sets value in pan gesture if greater than 0 + mPanGesturePredictionAmount(-1), ///< only sets value in pan gesture if greater than 0 + mPanGestureMaxPredictionAmount(-1), + mPanGestureMinPredictionAmount(-1), + mPanGesturePredictionAmountAdjustment(-1), mPanGestureSmoothingMode(-1), mPanGestureSmoothingAmount(-1.0f), mPanMinimumDistance(-1), @@ -95,11 +98,26 @@ int EnvironmentOptions::GetPanGesturePredictionMode() const return mPanGesturePredictionMode; } -float EnvironmentOptions::GetPanGesturePredictionAmount() const +int EnvironmentOptions::GetPanGesturePredictionAmount() const { return mPanGesturePredictionAmount; } +int EnvironmentOptions::GetPanGestureMaximumPredictionAmount() const +{ + return mPanGestureMaxPredictionAmount; +} + +int EnvironmentOptions::GetPanGestureMinimumPredictionAmount() const +{ + return mPanGestureMinPredictionAmount; +} + +int EnvironmentOptions::GetPanGesturePredictionAmountAdjustment() const +{ + return mPanGesturePredictionAmountAdjustment; +} + int EnvironmentOptions::GetPanGestureSmoothingMode() const { return mPanGestureSmoothingMode; @@ -130,6 +148,21 @@ void EnvironmentOptions::SetPanGesturePredictionAmount( unsigned int amount ) mPanGesturePredictionAmount = amount; } +void EnvironmentOptions::SetPanGestureMaximumPredictionAmount( unsigned int amount ) +{ + mPanGestureMaxPredictionAmount = amount; +} + +void EnvironmentOptions::SetPanGestureMinimumPredictionAmount( unsigned int amount ) +{ + mPanGestureMinPredictionAmount = amount; +} + +void EnvironmentOptions::SetPanGesturePredictionAmountAdjustment( unsigned int amount ) +{ + mPanGesturePredictionAmountAdjustment = amount; +} + void EnvironmentOptions::SetPanGestureSmoothingMode( unsigned int mode ) { mPanGestureSmoothingMode = mode; diff --git a/adaptors/base/environment-options.h b/adaptors/base/environment-options.h index 360cdfc..5d107d3 100644 --- a/adaptors/base/environment-options.h +++ b/adaptors/base/environment-options.h @@ -97,7 +97,22 @@ public: /** * @return pan-gesture prediction amount */ - float GetPanGesturePredictionAmount() const; + int GetPanGesturePredictionAmount() const; + + /** + * @return maximum pan-gesture prediction amount + */ + int GetPanGestureMaximumPredictionAmount() const; + + /** + * @return minimum pan-gesture prediction amount + */ + int GetPanGestureMinimumPredictionAmount() const; + + /** + * @return pan-gesture prediction amount adjustment + */ + int GetPanGesturePredictionAmountAdjustment() const; /** * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing ) @@ -120,9 +135,9 @@ public: int GetMinimumPanEvents() const; /** - * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread + * @brief Sets the mode used to predict pan gesture movement * - * @param[in] mode The smoothing mode to use + * @param[in] mode The prediction mode to use */ void SetPanGesturePredictionMode( unsigned int mode ); @@ -134,6 +149,31 @@ public: void SetPanGesturePredictionAmount( unsigned int 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 ); + + /** + * @brief Sets the lower bound of the prediction amount for clamping + * + * @param[in] amount The prediction amount in milliseconds + */ + void SetPanGestureMinimumPredictionAmount( unsigned int amount ); + + /** + * @brief Sets the prediction amount to adjust when the pan velocity is changed. + * If the pan velocity is accelerating, the prediction amount will be increased + * by the specified amount until it reaches the upper bound. If the pan velocity + * is decelerating, the prediction amount will be decreased by the specified + * amount until it reaches the lower bound. + * + * @param[in] amount The prediction amount in milliseconds + */ + void SetPanGesturePredictionAmountAdjustment( unsigned int amount ); + + /** * @brief Called to set how pan gestures smooth input * * @param[in] mode The smoothing mode to use @@ -141,7 +181,7 @@ public: void SetPanGestureSmoothingMode( unsigned int mode ); /** - * @brief Sets the prediction amount of the pan gesture + * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread * * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing */ @@ -181,7 +221,10 @@ private: unsigned int mPerformanceLoggingLevel; ///< performance log level unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level int mPanGesturePredictionMode; ///< prediction mode for pan gestures - float mPanGesturePredictionAmount; ///< prediction amount for pan gestures + int mPanGesturePredictionAmount; ///< prediction amount for pan gestures + int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures + int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures + int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures int mPanGestureSmoothingMode; ///< prediction mode for pan gestures float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures int mPanMinimumDistance; ///< minimum distance required before pan starts diff --git a/adaptors/base/environment-variables.h b/adaptors/base/environment-variables.h index 07b37f8..de7760f 100644 --- a/adaptors/base/environment-variables.h +++ b/adaptors/base/environment-variables.h @@ -41,6 +41,12 @@ namespace Adaptor #define DALI_ENV_PAN_PREDICTION_AMOUNT "DALI_PAN_PREDICTION_AMOUNT" +#define DALI_ENV_PAN_MAX_PREDICTION_AMOUNT "DALI_PAN_MAX_PREDICTION_AMOUNT" + +#define DALI_ENV_PAN_MIN_PREDICTION_AMOUNT "DALI_PAN_MIN_PREDICTION_AMOUNT" + +#define DALI_ENV_PAN_PREDICTION_AMOUNT_ADJUSTMENT "DALI_PAN_PREDICTION_AMOUNT_ADJUSTMENT" + #define DALI_ENV_PAN_SMOOTHING_MODE "DALI_PAN_SMOOTHING_MODE" #define DALI_ENV_PAN_SMOOTHING_AMOUNT "DALI_PAN_SMOOTHING_AMOUNT" diff --git a/adaptors/common/adaptor-impl.cpp b/adaptors/common/adaptor-impl.cpp index f91c1a6..e0982ca 100644 --- a/adaptors/common/adaptor-impl.cpp +++ b/adaptors/common/adaptor-impl.cpp @@ -141,7 +141,7 @@ void Adaptor::ParseEnvironmentOptions() { mEnvironmentOptions.SetPanGesturePredictionMode(predictionMode); } - int predictionAmount = -1; + int predictionAmount(-1); if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT, predictionAmount) ) { if( predictionAmount < 0 ) @@ -151,6 +151,36 @@ void Adaptor::ParseEnvironmentOptions() } mEnvironmentOptions.SetPanGesturePredictionAmount(predictionAmount); } + int minPredictionAmount(-1); + if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MIN_PREDICTION_AMOUNT, minPredictionAmount) ) + { + if( minPredictionAmount < 0 ) + { + // do not support times in the past + minPredictionAmount = 0; + } + mEnvironmentOptions.SetPanGestureMinimumPredictionAmount(minPredictionAmount); + } + int maxPredictionAmount(-1); + if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MAX_PREDICTION_AMOUNT, maxPredictionAmount) ) + { + if( minPredictionAmount > -1 && maxPredictionAmount < minPredictionAmount ) + { + // maximum amount should not be smaller than minimum amount + maxPredictionAmount = minPredictionAmount; + } + mEnvironmentOptions.SetPanGestureMaximumPredictionAmount(maxPredictionAmount); + } + int predictionAmountAdjustment(-1); + if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT_ADJUSTMENT, predictionAmountAdjustment) ) + { + if( predictionAmountAdjustment < 0 ) + { + // negative amount doesn't make sense + predictionAmountAdjustment = 0; + } + mEnvironmentOptions.SetPanGesturePredictionAmountAdjustment(predictionAmountAdjustment); + } int smoothingMode; if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_SMOOTHING_MODE, smoothingMode) ) { @@ -243,10 +273,22 @@ void Adaptor::Initialize(Dali::Configuration::ContextLoss configuration) { Integration::SetPanGesturePredictionMode(mEnvironmentOptions.GetPanGesturePredictionMode()); } - if( mEnvironmentOptions.GetPanGesturePredictionAmount() >= 0.0f ) + if( mEnvironmentOptions.GetPanGesturePredictionAmount() >= 0 ) { Integration::SetPanGesturePredictionAmount(mEnvironmentOptions.GetPanGesturePredictionAmount()); } + if( mEnvironmentOptions.GetPanGestureMaximumPredictionAmount() >= 0 ) + { + Integration::SetPanGestureMaximumPredictionAmount(mEnvironmentOptions.GetPanGestureMaximumPredictionAmount()); + } + if( mEnvironmentOptions.GetPanGestureMinimumPredictionAmount() >= 0 ) + { + Integration::SetPanGestureMinimumPredictionAmount(mEnvironmentOptions.GetPanGestureMinimumPredictionAmount()); + } + if( mEnvironmentOptions.GetPanGesturePredictionAmountAdjustment() >= 0 ) + { + Integration::SetPanGesturePredictionAmountAdjustment(mEnvironmentOptions.GetPanGesturePredictionAmountAdjustment()); + } if( mEnvironmentOptions.GetPanGestureSmoothingMode() >= 0 ) { Integration::SetPanGestureSmoothingMode(mEnvironmentOptions.GetPanGestureSmoothingMode());