[4.0] pan-gesture code refactor and environment variables
[platform/core/uifw/dali-core.git] / dali / internal / event / events / gesture-event-processor.cpp
index 1b6c4c6..2d91ac2 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+/*
+ * Copyright (c) 2017 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.
+ *
+ */
 
 // CLASS HEADER
 #include <dali/internal/event/events/gesture-event-processor.h>
@@ -27,6 +28,7 @@
 #include <dali/integration-api/render-controller.h>
 #include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/events/pinch-gesture-detector-impl.h>
+#include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
 #include <dali/public-api/events/pan-gesture.h>
 
 namespace Dali
@@ -35,14 +37,14 @@ namespace Dali
 namespace Internal
 {
 
-GestureEventProcessor::GestureEventProcessor(Stage& stage, Integration::GestureManager& gestureManager, Integration::RenderController& renderController)
-: mStage(stage),
-  mGestureManager(gestureManager),
-  mLongPressGestureProcessor(stage, gestureManager),
-  mPanGestureProcessor(stage, gestureManager),
-  mPinchGestureProcessor(stage, gestureManager),
-  mTapGestureProcessor(stage, gestureManager),
-  mRenderController(renderController),
+GestureEventProcessor::GestureEventProcessor( Stage& stage, SceneGraph::UpdateManager& updateManager, Integration::GestureManager& gestureManager, Integration::RenderController& renderController )
+: mStage( stage ),
+  mGestureManager( gestureManager ),
+  mLongPressGestureProcessor( stage, gestureManager ),
+  mPanGestureProcessor( stage, gestureManager, updateManager ),
+  mPinchGestureProcessor( stage, gestureManager ),
+  mTapGestureProcessor( stage, gestureManager ),
+  mRenderController( renderController ),
   mUpdateRequired( false )
 {
 }
@@ -192,7 +194,7 @@ void GestureEventProcessor::SetGestureProperties( const Gesture& gesture )
     SetUpdateRequired();
 
     // We may not be updating so we need to ask the render controller for an update.
-    mRenderController.RequestUpdate();
+    mRenderController.RequestUpdate( false );
   }
 
   switch ( gesture.type )
@@ -228,6 +230,82 @@ void GestureEventProcessor::EnablePanGestureProfiling()
   mPanGestureProcessor.EnableProfiling();
 }
 
+void GestureEventProcessor::SetPanGesturePredictionMode(int mode)
+{
+  mPanGestureProcessor.SetPredictionMode(mode);
+}
+
+void GestureEventProcessor::SetPanGesturePredictionAmount( unsigned int amount )
+{
+  mPanGestureProcessor.SetPredictionAmount(amount);
+}
+
+void GestureEventProcessor::SetPanGestureMaximumPredictionAmount( unsigned int amount )
+{
+  mPanGestureProcessor.SetMaximumPredictionAmount(amount);
+}
+
+void GestureEventProcessor::SetPanGestureMinimumPredictionAmount( unsigned int amount )
+{
+  mPanGestureProcessor.SetMinimumPredictionAmount(amount);
+}
+
+void GestureEventProcessor::SetPanGesturePredictionAmountAdjustment( unsigned int amount )
+{
+  mPanGestureProcessor.SetPredictionAmountAdjustment(amount);
+}
+
+void GestureEventProcessor::SetPanGestureSmoothingMode(int mode)
+{
+  mPanGestureProcessor.SetSmoothingMode(mode);
+}
+
+void GestureEventProcessor::SetPanGestureSmoothingAmount( float amount )
+{
+  mPanGestureProcessor.SetSmoothingAmount(amount);
+}
+
+void GestureEventProcessor::SetPanGestureUseActualTimes( bool value )
+{
+  mPanGestureProcessor.SetUseActualTimes( value );
+}
+
+void GestureEventProcessor::SetPanGestureInterpolationTimeRange( int value )
+{
+  mPanGestureProcessor.SetInterpolationTimeRange( value );
+}
+
+void GestureEventProcessor::SetPanGestureScalarOnlyPredictionEnabled( bool value )
+{
+  mPanGestureProcessor.SetScalarOnlyPredictionEnabled( value );
+}
+
+void GestureEventProcessor::SetPanGestureTwoPointPredictionEnabled( bool value )
+{
+  mPanGestureProcessor.SetTwoPointPredictionEnabled( value );
+}
+
+void GestureEventProcessor::SetPanGestureTwoPointInterpolatePastTime( int value )
+{
+  mPanGestureProcessor.SetTwoPointInterpolatePastTime( value );
+}
+
+void GestureEventProcessor::SetPanGestureTwoPointVelocityBias( float value )
+{
+  mPanGestureProcessor.SetTwoPointVelocityBias( value );
+}
+
+void GestureEventProcessor::SetPanGestureTwoPointAccelerationBias( float value )
+{
+  mPanGestureProcessor.SetTwoPointAccelerationBias( value );
+}
+
+void GestureEventProcessor::SetPanGestureMultitapSmoothingRange( int value )
+{
+  mPanGestureProcessor.SetMultitapSmoothingRange( value );
+}
+
+
 } // namespace Internal
 
 } // namespace Dali