2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include "environment-options.h"
30 EnvironmentOptions::EnvironmentOptions()
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),
49 EnvironmentOptions::~EnvironmentOptions()
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 )
59 mLogFunction = logFunction;
60 mFpsFrequency = logFrameRateFrequency;
61 mUpdateStatusFrequency = logupdateStatusFrequency;
62 mPerformanceLoggingLevel = logPerformanceLevel;
63 mPanGestureLoggingLevel = logPanGestureLevel;
66 void EnvironmentOptions::InstallLogFunction() const
68 Dali::Integration::Log::InstallLogFunction( mLogFunction );
71 void EnvironmentOptions::UnInstallLogFunction() const
73 Dali::Integration::Log::UninstallLogFunction();
76 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
81 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
83 return mUpdateStatusFrequency;
86 unsigned int EnvironmentOptions::GetPerformanceLoggingLevel() const
88 return mPerformanceLoggingLevel;
91 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
93 return mPanGestureLoggingLevel;
96 int EnvironmentOptions::GetPanGesturePredictionMode() const
98 return mPanGesturePredictionMode;
101 int EnvironmentOptions::GetPanGesturePredictionAmount() const
103 return mPanGesturePredictionAmount;
106 int EnvironmentOptions::GetPanGestureMaximumPredictionAmount() const
108 return mPanGestureMaxPredictionAmount;
111 int EnvironmentOptions::GetPanGestureMinimumPredictionAmount() const
113 return mPanGestureMinPredictionAmount;
116 int EnvironmentOptions::GetPanGesturePredictionAmountAdjustment() const
118 return mPanGesturePredictionAmountAdjustment;
121 int EnvironmentOptions::GetPanGestureSmoothingMode() const
123 return mPanGestureSmoothingMode;
126 float EnvironmentOptions::GetPanGestureSmoothingAmount() const
128 return mPanGestureSmoothingAmount;
131 int EnvironmentOptions::GetMinimumPanDistance() const
133 return mPanMinimumDistance;
136 int EnvironmentOptions::GetMinimumPanEvents() const
138 return mPanMinimumEvents;
141 void EnvironmentOptions::SetPanGesturePredictionMode( unsigned int mode )
143 mPanGesturePredictionMode = mode;
146 void EnvironmentOptions::SetPanGesturePredictionAmount( unsigned int amount )
148 mPanGesturePredictionAmount = amount;
151 void EnvironmentOptions::SetPanGestureMaximumPredictionAmount( unsigned int amount )
153 mPanGestureMaxPredictionAmount = amount;
156 void EnvironmentOptions::SetPanGestureMinimumPredictionAmount( unsigned int amount )
158 mPanGestureMinPredictionAmount = amount;
161 void EnvironmentOptions::SetPanGesturePredictionAmountAdjustment( unsigned int amount )
163 mPanGesturePredictionAmountAdjustment = amount;
166 void EnvironmentOptions::SetPanGestureSmoothingMode( unsigned int mode )
168 mPanGestureSmoothingMode = mode;
171 void EnvironmentOptions::SetPanGestureSmoothingAmount( float amount )
173 mPanGestureSmoothingAmount = amount;
176 void EnvironmentOptions::SetMinimumPanDistance( int distance )
178 mPanMinimumDistance = distance;
181 void EnvironmentOptions::SetMinimumPanEvents( int events )
183 mPanMinimumEvents = events;
186 void EnvironmentOptions::SetGlesCallTime( int time )
188 mGlesCallTime = time;
191 int EnvironmentOptions::GetGlesCallTime()
193 return mGlesCallTime;