Pan Gesture Cleanup Move functions from profiling.h/cpp to new files input-options... 98/24098/1
authorJulien Heanley <j.heanley@partner.samsung.com>
Wed, 2 Jul 2014 07:30:20 +0000 (08:30 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 13:19:39 +0000 (14:19 +0100)
Change-Id: I5eb2b75fce7d4f57fa0dd4e38c3c3942379ac2b2
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
dali/integration-api/file.list
dali/integration-api/input-options.cpp [new file with mode: 0644]
dali/integration-api/input-options.h [new file with mode: 0644]
dali/integration-api/profiling.cpp
dali/integration-api/profiling.h
dali/internal/event/events/pan-gesture-processor.h

index 65b2e263081cca2e4aa8e0af76ee43fa47b74324..380988a08b8d33b841cf0311c66c000d01de79b2 100644 (file)
@@ -7,6 +7,7 @@ platform_abstraction_src_files = \
    $(platform_abstraction_src_dir)/image-data.cpp \
    $(platform_abstraction_src_dir)/debug.cpp \
    $(platform_abstraction_src_dir)/profiling.cpp \
+   $(platform_abstraction_src_dir)/input-options.cpp \
    $(platform_abstraction_src_dir)/shader-data.cpp \
    $(platform_abstraction_src_dir)/system-overlay.cpp \
    $(platform_abstraction_src_dir)/common/lockless-buffer.cpp \
@@ -26,6 +27,7 @@ platform_abstraction_header_files = \
    $(platform_abstraction_src_dir)/glyph-set.h \
    $(platform_abstraction_src_dir)/debug.h \
    $(platform_abstraction_src_dir)/profiling.h \
+   $(platform_abstraction_src_dir)/input-options.h \
    $(platform_abstraction_src_dir)/bitmap.h \
    $(platform_abstraction_src_dir)/image-data.h \
    $(platform_abstraction_src_dir)/resource-types.h \
diff --git a/dali/integration-api/input-options.cpp b/dali/integration-api/input-options.cpp
new file mode 100644 (file)
index 0000000..2efe516
--- /dev/null
@@ -0,0 +1,41 @@
+#include "input-options.h"
+
+#include <dali/internal/event/common/thread-local-storage.h>
+#include <dali/internal/event/events/gesture-event-processor.h>
+
+using Dali::Internal::GestureEventProcessor;
+using Dali::Internal::ThreadLocalStorage;
+
+namespace Dali
+{
+
+namespace Integration
+{
+
+void SetPanGesturePredictionMode( int mode )
+{
+  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
+  eventProcessor.SetPanGesturePredictionMode(mode);
+}
+
+void SetPanGesturePredictionAmount(unsigned int amount)
+{
+  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
+  eventProcessor.SetPanGesturePredictionAmount(amount);
+}
+
+void SetPanGestureSmoothingMode(int mode)
+{
+  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
+  eventProcessor.SetPanGestureSmoothingMode(mode);
+}
+
+void SetPanGestureSmoothingAmount( float amount )
+{
+  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
+  eventProcessor.SetPanGestureSmoothingAmount(amount);
+}
+
+} // namespace Integration
+
+} // namespace Dali
diff --git a/dali/integration-api/input-options.h b/dali/integration-api/input-options.h
new file mode 100644 (file)
index 0000000..9b8458e
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef __DALI_INTEGRATION_INPUT_OPTIONS_H__
+#define __DALI_INTEGRATION_INPUT_OPTIONS_H__
+
+/*
+ * Copyright (c) 2014 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+
+namespace Integration
+{
+
+/**
+ * @brief Called by adaptor to set the pan gesture prediction mode from
+ * an environment variable
+ *
+ * @pre Should be called after Core creation.
+ * @param mode The pan gesture prediction mode.
+ */
+DALI_IMPORT_API void SetPanGesturePredictionMode( int mode );
+
+/**
+ * @brief Called by adaptor to set the prediction amount of the pan gesture from an environment variable
+ *
+ * @param[in] amount The prediction amount in milliseconds
+ */
+DALI_IMPORT_API void SetPanGesturePredictionAmount(unsigned int amount);
+
+/**
+ * @brief Called to set how pan gestures smooth input
+ *
+ * @param[in] mode The smoothing mode to use
+ */
+DALI_IMPORT_API void SetPanGestureSmoothingMode( int mode );
+
+/**
+ * @brief Sets the prediction amount of the pan gesture
+ *
+ * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
+ */
+DALI_IMPORT_API void SetPanGestureSmoothingAmount( float amount );
+
+} // namespace Integration
+
+} // namespace Dali
+
+#endif // __DALI_INTEGRATION_INPUT_OPTIONS_H__
index 29c4d3160fe62b9139334f5a48a1d7ed4e669132..4343fe5b398a212d6e7dd527555681d5eb6166f7 100644 (file)
@@ -105,30 +105,6 @@ void EnableProfiling( ProfilingType type )
   }
 }
 
-void SetPanGesturePredictionMode( int mode )
-{
-  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
-  eventProcessor.SetPanGesturePredictionMode(mode);
-}
-
-void SetPanGesturePredictionAmount(unsigned int amount)
-{
-  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
-  eventProcessor.SetPanGesturePredictionAmount(amount);
-}
-
-void SetPanGestureSmoothingMode(int mode)
-{
-  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
-  eventProcessor.SetPanGestureSmoothingMode(mode);
-}
-
-void SetPanGestureSmoothingAmount( float amount )
-{
-  GestureEventProcessor& eventProcessor = ThreadLocalStorage::Get().GetGestureEventProcessor();
-  eventProcessor.SetPanGestureSmoothingAmount(amount);
-}
-
 namespace Profiling
 {
 
index be348ba79c109747e09ec7b99f98ae565261dda8..464da3067f0e87c91c5648793644f4d06664f0d9 100644 (file)
@@ -44,36 +44,6 @@ enum ProfilingType
  */
 DALI_IMPORT_API void EnableProfiling( ProfilingType type );
 
-/**
- * @brief Called by adaptor to set the pan gesture prediction mode from
- * an environment variable
- *
- * @pre Should be called after Core creation.
- * @param mode The pan gesture prediction mode.
- */
-DALI_IMPORT_API void SetPanGesturePredictionMode( int mode );
-
-/**
- * @brief Called by adaptor to set the prediction amount of the pan gesture from an environment variable
- *
- * @param[in] amount The prediction amount in milliseconds
- */
-DALI_IMPORT_API void SetPanGesturePredictionAmount(unsigned int amount);
-
-/**
- * @brief Called to set how pan gestures smooth input
- *
- * @param[in] mode The smoothing mode to use
- */
-DALI_IMPORT_API void SetPanGestureSmoothingMode( int mode );
-
-/**
- * @brief Sets the prediction amount of the pan gesture
- *
- * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
- */
-DALI_IMPORT_API void SetPanGestureSmoothingAmount( float amount );
-
 
 namespace Profiling
 {
index 26914054fbe9749cc1cc4c2edfe0bfa07bcfc16c..60fab3ea762fa4935c7201e5da565a4bac316043 100644 (file)
@@ -120,9 +120,7 @@ public: // To be called by GestureEventProcessor
    *
    * Valid modes:
    * 0 - No prediction
-   * 1 - Average Smoothing (no actual prediction)
-   * 2 - Interpolation using last vsync time and event time
-   * 3 - Same as 2 for now, in progress
+   * 1 - Prediction using average acceleration
    */
   void SetPredictionMode(int mode);