Pan Gesture Smoothing - Added APIs to change smoothing mode and amount
[platform/core/uifw/dali-adaptor.git] / adaptors / base / environment-options.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include "environment-options.h"
20
21 namespace Dali
22 {
23
24 namespace Internal
25 {
26
27 namespace Adaptor
28 {
29
30 EnvironmentOptions::EnvironmentOptions()
31 : mFpsFrequency(0),
32   mUpdateStatusFrequency(0),
33   mPerformanceLoggingLevel(0),
34   mPanGestureLoggingLevel(0),
35   mPanGesturePredictionMode(-1),
36   mPanGesturePredictionAmount(-1.0f), ///< only sets value in pan gesture if greater than 0
37   mPanGestureSmoothingMode(-1),
38   mPanGestureSmoothingAmount(-1.0f),
39   mPanMinimumDistance(-1),
40   mPanMinimumEvents(-1),
41   mLogFunction( NULL )
42 {
43 }
44
45 EnvironmentOptions::~EnvironmentOptions()
46 {
47 }
48
49 void EnvironmentOptions::SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
50                              unsigned int logFrameRateFrequency,
51                              unsigned int logupdateStatusFrequency,
52                              unsigned int logPerformanceLevel,
53                              unsigned int logPanGestureLevel )
54 {
55   mLogFunction = logFunction;
56   mFpsFrequency = logFrameRateFrequency;
57   mUpdateStatusFrequency = logupdateStatusFrequency;
58   mPerformanceLoggingLevel = logPerformanceLevel;
59   mPanGestureLoggingLevel = logPanGestureLevel;
60 }
61
62 void EnvironmentOptions::InstallLogFunction() const
63 {
64   Dali::Integration::Log::InstallLogFunction( mLogFunction );
65 }
66
67 void EnvironmentOptions::UnInstallLogFunction() const
68 {
69   Dali::Integration::Log::UninstallLogFunction();
70 }
71
72 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
73 {
74   return mFpsFrequency;
75 }
76
77 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
78 {
79   return mUpdateStatusFrequency;
80 }
81
82 unsigned int EnvironmentOptions::GetPerformanceLoggingLevel() const
83 {
84   return mPerformanceLoggingLevel;
85 }
86
87 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
88 {
89   return mPanGestureLoggingLevel;
90 }
91
92 int EnvironmentOptions::GetPanGesturePredictionMode() const
93 {
94   return mPanGesturePredictionMode;
95 }
96
97 float EnvironmentOptions::GetPanGesturePredictionAmount() const
98 {
99   return mPanGesturePredictionAmount;
100 }
101
102 int EnvironmentOptions::GetPanGestureSmoothingMode() const
103 {
104   return mPanGestureSmoothingMode;
105 }
106
107 float EnvironmentOptions::GetPanGestureSmoothingAmount() const
108 {
109   return mPanGestureSmoothingAmount;
110 }
111
112 int EnvironmentOptions::GetMinimumPanDistance() const
113 {
114   return mPanMinimumDistance;
115 }
116
117 int EnvironmentOptions::GetMinimumPanEvents() const
118 {
119   return mPanMinimumEvents;
120 }
121
122 void EnvironmentOptions::SetPanGesturePredictionMode( unsigned int mode )
123 {
124   mPanGesturePredictionMode = mode;
125 }
126
127 void EnvironmentOptions::SetPanGesturePredictionAmount( unsigned int amount )
128 {
129   mPanGesturePredictionAmount = amount;
130 }
131
132 void EnvironmentOptions::SetPanGestureSmoothingMode( unsigned int mode )
133 {
134   mPanGestureSmoothingMode = mode;
135 }
136
137 void EnvironmentOptions::SetPanGestureSmoothingAmount( float amount )
138 {
139   mPanGestureSmoothingAmount = amount;
140 }
141
142 void EnvironmentOptions::SetMinimumPanDistance( int distance )
143 {
144   mPanMinimumDistance = distance;
145 }
146
147 void EnvironmentOptions::SetMinimumPanEvents( int events )
148 {
149   mPanMinimumEvents = events;
150 }
151
152 } // Adaptor
153
154 } // Internal
155
156 } // Dali