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),
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;
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;
/**
* @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 )
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 );
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
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
*/
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
#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"
{
mEnvironmentOptions.SetPanGesturePredictionMode(predictionMode);
}
- int predictionAmount = -1;
+ int predictionAmount(-1);
if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT, predictionAmount) )
{
if( predictionAmount < 0 )
}
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) )
{
{
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());