Pan Gestures - Changed pan gesture prediction units to millis
[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   mLogFunction( NULL )
38 {
39 }
40
41 EnvironmentOptions::~EnvironmentOptions()
42 {
43 }
44
45 void EnvironmentOptions::SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
46                              unsigned int logFrameRateFrequency,
47                              unsigned int logupdateStatusFrequency,
48                              unsigned int logPerformanceLevel,
49                              unsigned int logPanGestureLevel )
50 {
51   mLogFunction = logFunction;
52   mFpsFrequency = logFrameRateFrequency;
53   mUpdateStatusFrequency = logupdateStatusFrequency;
54   mPerformanceLoggingLevel = logPerformanceLevel;
55   mPanGestureLoggingLevel = logPanGestureLevel;
56 }
57
58 void EnvironmentOptions::InstallLogFunction() const
59 {
60   Dali::Integration::Log::InstallLogFunction( mLogFunction );
61 }
62
63 void EnvironmentOptions::UnInstallLogFunction() const
64 {
65   Dali::Integration::Log::UninstallLogFunction();
66 }
67
68 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
69 {
70   return mFpsFrequency;
71 }
72
73 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
74 {
75   return mUpdateStatusFrequency;
76 }
77
78 unsigned int EnvironmentOptions::GetPerformanceLoggingLevel() const
79 {
80   return mPerformanceLoggingLevel;
81 }
82
83 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
84 {
85   return mPanGestureLoggingLevel;
86 }
87
88 unsigned int EnvironmentOptions::GetPanGestureSmoothingMode() const
89 {
90   return mPanGesturePredictionMode;
91 }
92
93 float EnvironmentOptions::GetPanGesturePredictionAmount() const
94 {
95   return mPanGesturePredictionAmount;
96 }
97
98 void EnvironmentOptions::SetPanGesturePredictionMode(unsigned int mode)
99 {
100   mPanGesturePredictionMode = mode;
101 }
102
103 void EnvironmentOptions::SetPanGesturePredictionAmount(unsigned int amount)
104 {
105   mPanGesturePredictionAmount = amount;
106 }
107
108 } // Adaptor
109
110 } // Internal
111
112 } // Dali