Added new environment options for pan prediction
[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), ///< only sets value in pan gesture if greater than 0
37   mPanGestureMaxPredictionAmount(-1),
38   mPanGestureMinPredictionAmount(-1),
39   mPanGesturePredictionAmountAdjustment(-1),
40   mPanGestureSmoothingMode(-1),
41   mPanGestureSmoothingAmount(-1.0f),
42   mPanMinimumDistance(-1),
43   mPanMinimumEvents(-1),
44   mGlesCallTime(0),
45   mLogFunction( NULL )
46 {
47 }
48
49 EnvironmentOptions::~EnvironmentOptions()
50 {
51 }
52
53 void EnvironmentOptions::SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
54                              unsigned int logFrameRateFrequency,
55                              unsigned int logupdateStatusFrequency,
56                              unsigned int logPerformanceLevel,
57                              unsigned int logPanGestureLevel )
58 {
59   mLogFunction = logFunction;
60   mFpsFrequency = logFrameRateFrequency;
61   mUpdateStatusFrequency = logupdateStatusFrequency;
62   mPerformanceLoggingLevel = logPerformanceLevel;
63   mPanGestureLoggingLevel = logPanGestureLevel;
64 }
65
66 void EnvironmentOptions::InstallLogFunction() const
67 {
68   Dali::Integration::Log::InstallLogFunction( mLogFunction );
69 }
70
71 void EnvironmentOptions::UnInstallLogFunction() const
72 {
73   Dali::Integration::Log::UninstallLogFunction();
74 }
75
76 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
77 {
78   return mFpsFrequency;
79 }
80
81 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
82 {
83   return mUpdateStatusFrequency;
84 }
85
86 unsigned int EnvironmentOptions::GetPerformanceLoggingLevel() const
87 {
88   return mPerformanceLoggingLevel;
89 }
90
91 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
92 {
93   return mPanGestureLoggingLevel;
94 }
95
96 int EnvironmentOptions::GetPanGesturePredictionMode() const
97 {
98   return mPanGesturePredictionMode;
99 }
100
101 int EnvironmentOptions::GetPanGesturePredictionAmount() const
102 {
103   return mPanGesturePredictionAmount;
104 }
105
106 int EnvironmentOptions::GetPanGestureMaximumPredictionAmount() const
107 {
108   return mPanGestureMaxPredictionAmount;
109 }
110
111 int EnvironmentOptions::GetPanGestureMinimumPredictionAmount() const
112 {
113   return mPanGestureMinPredictionAmount;
114 }
115
116 int EnvironmentOptions::GetPanGesturePredictionAmountAdjustment() const
117 {
118   return mPanGesturePredictionAmountAdjustment;
119 }
120
121 int EnvironmentOptions::GetPanGestureSmoothingMode() const
122 {
123   return mPanGestureSmoothingMode;
124 }
125
126 float EnvironmentOptions::GetPanGestureSmoothingAmount() const
127 {
128   return mPanGestureSmoothingAmount;
129 }
130
131 int EnvironmentOptions::GetMinimumPanDistance() const
132 {
133   return mPanMinimumDistance;
134 }
135
136 int EnvironmentOptions::GetMinimumPanEvents() const
137 {
138   return mPanMinimumEvents;
139 }
140
141 void EnvironmentOptions::SetPanGesturePredictionMode( unsigned int mode )
142 {
143   mPanGesturePredictionMode = mode;
144 }
145
146 void EnvironmentOptions::SetPanGesturePredictionAmount( unsigned int amount )
147 {
148   mPanGesturePredictionAmount = amount;
149 }
150
151 void EnvironmentOptions::SetPanGestureMaximumPredictionAmount( unsigned int amount )
152 {
153   mPanGestureMaxPredictionAmount = amount;
154 }
155
156 void EnvironmentOptions::SetPanGestureMinimumPredictionAmount( unsigned int amount )
157 {
158   mPanGestureMinPredictionAmount = amount;
159 }
160
161 void EnvironmentOptions::SetPanGesturePredictionAmountAdjustment( unsigned int amount )
162 {
163   mPanGesturePredictionAmountAdjustment = amount;
164 }
165
166 void EnvironmentOptions::SetPanGestureSmoothingMode( unsigned int mode )
167 {
168   mPanGestureSmoothingMode = mode;
169 }
170
171 void EnvironmentOptions::SetPanGestureSmoothingAmount( float amount )
172 {
173   mPanGestureSmoothingAmount = amount;
174 }
175
176 void EnvironmentOptions::SetMinimumPanDistance( int distance )
177 {
178   mPanMinimumDistance = distance;
179 }
180
181 void EnvironmentOptions::SetMinimumPanEvents( int events )
182 {
183   mPanMinimumEvents = events;
184 }
185
186 void EnvironmentOptions::SetGlesCallTime( int time )
187 {
188   mGlesCallTime = time;
189 }
190
191 int EnvironmentOptions::GetGlesCallTime()
192 {
193   return mGlesCallTime;
194 }
195
196 } // Adaptor
197
198 } // Internal
199
200 } // Dali