Uses TextArray new type definition.
[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   mGlesCallTime(0),
42   mLogFunction( NULL )
43 {
44 }
45
46 EnvironmentOptions::~EnvironmentOptions()
47 {
48 }
49
50 void EnvironmentOptions::SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
51                              unsigned int logFrameRateFrequency,
52                              unsigned int logupdateStatusFrequency,
53                              unsigned int logPerformanceLevel,
54                              unsigned int logPanGestureLevel )
55 {
56   mLogFunction = logFunction;
57   mFpsFrequency = logFrameRateFrequency;
58   mUpdateStatusFrequency = logupdateStatusFrequency;
59   mPerformanceLoggingLevel = logPerformanceLevel;
60   mPanGestureLoggingLevel = logPanGestureLevel;
61 }
62
63 void EnvironmentOptions::InstallLogFunction() const
64 {
65   Dali::Integration::Log::InstallLogFunction( mLogFunction );
66 }
67
68 void EnvironmentOptions::UnInstallLogFunction() const
69 {
70   Dali::Integration::Log::UninstallLogFunction();
71 }
72
73 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
74 {
75   return mFpsFrequency;
76 }
77
78 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
79 {
80   return mUpdateStatusFrequency;
81 }
82
83 unsigned int EnvironmentOptions::GetPerformanceLoggingLevel() const
84 {
85   return mPerformanceLoggingLevel;
86 }
87
88 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
89 {
90   return mPanGestureLoggingLevel;
91 }
92
93 int EnvironmentOptions::GetPanGesturePredictionMode() const
94 {
95   return mPanGesturePredictionMode;
96 }
97
98 float EnvironmentOptions::GetPanGesturePredictionAmount() const
99 {
100   return mPanGesturePredictionAmount;
101 }
102
103 int EnvironmentOptions::GetPanGestureSmoothingMode() const
104 {
105   return mPanGestureSmoothingMode;
106 }
107
108 float EnvironmentOptions::GetPanGestureSmoothingAmount() const
109 {
110   return mPanGestureSmoothingAmount;
111 }
112
113 int EnvironmentOptions::GetMinimumPanDistance() const
114 {
115   return mPanMinimumDistance;
116 }
117
118 int EnvironmentOptions::GetMinimumPanEvents() const
119 {
120   return mPanMinimumEvents;
121 }
122
123 void EnvironmentOptions::SetPanGesturePredictionMode( unsigned int mode )
124 {
125   mPanGesturePredictionMode = mode;
126 }
127
128 void EnvironmentOptions::SetPanGesturePredictionAmount( unsigned int amount )
129 {
130   mPanGesturePredictionAmount = amount;
131 }
132
133 void EnvironmentOptions::SetPanGestureSmoothingMode( unsigned int mode )
134 {
135   mPanGestureSmoothingMode = mode;
136 }
137
138 void EnvironmentOptions::SetPanGestureSmoothingAmount( float amount )
139 {
140   mPanGestureSmoothingAmount = amount;
141 }
142
143 void EnvironmentOptions::SetMinimumPanDistance( int distance )
144 {
145   mPanMinimumDistance = distance;
146 }
147
148 void EnvironmentOptions::SetMinimumPanEvents( int events )
149 {
150   mPanMinimumEvents = events;
151 }
152
153 void EnvironmentOptions::SetGlesCallTime( int time )
154 {
155   mGlesCallTime = time;
156 }
157
158 int EnvironmentOptions::GetGlesCallTime()
159 {
160   return mGlesCallTime;
161 }
162
163 } // Adaptor
164
165 } // Internal
166
167 } // Dali