1 #ifndef __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
2 #define __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/integration-api/debug.h>
32 * This class provides the environment options which define settings as well as
33 * the ability to install a log function.
36 class EnvironmentOptions
47 * non-virtual destructor, not intended as a base class
49 ~EnvironmentOptions();
52 * @param logFunction logging function
54 void SetLogFunction( const Dali::Integration::Log::LogFunction& logFunction );
57 * Install the log function for the current thread.
59 void InstallLogFunction() const;
62 * Un-install the log function for the current thread.
64 void UnInstallLogFunction() const;
67 * @return whether network control is enabled or not ( 0 = off, 1 = on )
69 unsigned int GetNetworkControlMode() const;
72 * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
74 unsigned int GetFrameRateLoggingFrequency() const;
77 * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
79 unsigned int GetUpdateStatusLoggingFrequency() const;
82 * @return performance statistics log level ( 0 == off )
84 unsigned int GetPerformanceStatsLoggingOptions() const;
87 * @return performance statistics log frequency in seconds
89 unsigned int GetPerformanceStatsLoggingFrequency() const;
92 * @return performance time stamp output ( 0 == off)
94 unsigned int GetPerformanceTimeStampOutput() const;
97 * @return pan-gesture logging level ( 0 == off )
99 unsigned int GetPanGestureLoggingLevel() const;
102 * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
104 int GetPanGesturePredictionMode() const;
107 * @return pan-gesture prediction amount
109 int GetPanGesturePredictionAmount() const;
112 * @return maximum pan-gesture prediction amount
114 int GetPanGestureMaximumPredictionAmount() const;
117 * @return minimum pan-gesture prediction amount
119 int GetPanGestureMinimumPredictionAmount() const;
122 * @return pan-gesture prediction amount adjustment
124 int GetPanGesturePredictionAmountAdjustment() const;
127 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
129 int GetPanGestureSmoothingMode() const;
132 * @return pan-gesture smoothing amount
134 float GetPanGestureSmoothingAmount() const;
137 * @return The minimum distance before a pan can be started (-1 means it's not set)
139 int GetMinimumPanDistance() const;
142 * @return The minimum events before a pan can be started (-1 means it's not set)
144 int GetMinimumPanEvents() const;
147 * @return The width of the window
149 unsigned int GetWindowWidth() const;
152 * @return The height of the window
154 unsigned int GetWindowHeight() const;
157 * @brief Sets the mode used to predict pan gesture movement
159 * @param[in] mode The prediction mode to use
161 void SetPanGesturePredictionMode( unsigned int mode );
164 * @brief Sets the prediction amount of the pan gesture
166 * @param[in] amount The prediction amount in milliseconds
168 void SetPanGesturePredictionAmount( unsigned int amount );
171 * @brief Sets the upper bound of the prediction amount for clamping
173 * @param[in] amount The prediction amount in milliseconds
175 void SetPanGestureMaximumPredictionAmount( unsigned int amount );
178 * @brief Sets the lower bound of the prediction amount for clamping
180 * @param[in] amount The prediction amount in milliseconds
182 void SetPanGestureMinimumPredictionAmount( unsigned int amount );
185 * @brief Sets the prediction amount to adjust when the pan velocity is changed.
186 * If the pan velocity is accelerating, the prediction amount will be increased
187 * by the specified amount until it reaches the upper bound. If the pan velocity
188 * is decelerating, the prediction amount will be decreased by the specified
189 * amount until it reaches the lower bound.
191 * @param[in] amount The prediction amount in milliseconds
193 void SetPanGesturePredictionAmountAdjustment( unsigned int amount );
196 * @brief Called to set how pan gestures smooth input
198 * @param[in] mode The smoothing mode to use
200 void SetPanGestureSmoothingMode( unsigned int mode );
203 * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
205 * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
207 void SetPanGestureSmoothingAmount( float amount );
210 * @brief Sets the minimum distance required before a pan starts
212 * @param[in] distance The minimum distance before a pan starts
214 void SetMinimumPanDistance( int distance );
217 * @brief Sets the minimum number of events required before a pan starts
219 * @param[in] events The minimum events before a pan starts
221 void SetMinimumPanEvents( int events );
224 * @brief Sets how often the gles call logging occurs
226 * @param[in] time the number of seconds between logging output
228 void SetGlesCallTime( int time );
231 * @brief Get the graphics status time
233 int GetGlesCallTime() const;
236 * @brief Sets the width of the window
238 void SetWindowWidth( int width );
241 * @brief Sets the width of the window
243 void SetWindowHeight( int height );
246 * @return true if performance server is required
248 bool PerformanceServerRequired() const;
253 * Parses the environment options.
254 * Called from the constructor
256 void ParseEnvironmentOptions();
260 unsigned int mNetworkControl; ///< whether network control is enabled
261 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
262 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
263 unsigned int mPerformanceStatsLevel; ///< performance statistics logging bitmask
264 unsigned int mPerformanceStatsFrequency; ///< performance statistics logging frequency (seconds)
265 unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
266 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
267 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
268 int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
269 int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
270 int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
271 int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
272 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
273 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
274 int mPanMinimumDistance; ///< minimum distance required before pan starts
275 int mPanMinimumEvents; ///< minimum events required before pan starts
276 int mGlesCallTime; ///< time in seconds between status updates
277 unsigned int mWindowWidth; ///< width of the window
278 unsigned int mWindowHeight; ///< height of the window
280 Dali::Integration::Log::LogFunction mLogFunction;
282 // Undefined copy constructor.
283 EnvironmentOptions( const EnvironmentOptions& );
285 // Undefined assignment operator.
286 EnvironmentOptions& operator=( const EnvironmentOptions& );
294 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__