1 #ifndef __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
2 #define __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
5 * Copyright (c) 2014 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 * Contains environment options which define settings and the ability to install a log function.
34 * TODO: This file and adaptor needs cleaning up. There should not be any environment options in the adaptor class, only here!
36 class EnvironmentOptions
47 * non-virtual destructor, not intended as a base class
49 ~EnvironmentOptions();
52 * @param logFunction logging function
53 * @param networkControl whether network control is enabled
54 * @param logFilterOptions bitmask of the logging options defined in intergration/debug.h (e.g.
55 * @param logFrameRateFrequency frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
56 * @param logupdateStatusFrequency frequency of how often the update status is logged in number of frames
57 * @param logPerformanceStats performance statistics logging, 0 = disabled, 1+ = enabled
58 * @param logPerformanceStatsFrequency statistics logging frequency in seconds
59 * @param performanceTimeStampOutput where to output performance related time stamps to
60 * @param logPanGestureLevel pan-gesture logging, 0 = disabled, 1 = enabled
62 void SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
63 unsigned int networkControl,
64 unsigned int logFrameRateFrequency,
65 unsigned int logupdateStatusFrequency,
66 unsigned int logPerformanceStats,
67 unsigned int logPerformanceStatsFrequency,
68 unsigned int performanceTimeStampOutput,
69 unsigned int logPanGestureLevel );
72 * Install the log function for the current thread.
74 void InstallLogFunction() const;
77 * Un-install the log function for the current thread.
79 void UnInstallLogFunction() const;
82 * @return whether network control is enabled or not ( 0 = off, 1 = on )
84 unsigned int GetNetworkControlMode() const;
87 * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
89 unsigned int GetFrameRateLoggingFrequency() const;
92 * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
94 unsigned int GetUpdateStatusLoggingFrequency() const;
97 * @return performance statistics log level ( 0 == off )
99 unsigned int GetPerformanceStatsLoggingOptions() const;
102 * @return performance statistics log frequency in seconds
104 unsigned int GetPerformanceStatsLoggingFrequency() const;
107 * @return performance time stamp output ( 0 == off)
109 unsigned int GetPerformanceTimeStampOutput() const;
112 * @return pan-gesture logging level ( 0 == off )
114 unsigned int GetPanGestureLoggingLevel() const;
117 * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
119 int GetPanGesturePredictionMode() const;
122 * @return pan-gesture prediction amount
124 int GetPanGesturePredictionAmount() const;
127 * @return maximum pan-gesture prediction amount
129 int GetPanGestureMaximumPredictionAmount() const;
132 * @return minimum pan-gesture prediction amount
134 int GetPanGestureMinimumPredictionAmount() const;
137 * @return pan-gesture prediction amount adjustment
139 int GetPanGesturePredictionAmountAdjustment() const;
142 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
144 int GetPanGestureSmoothingMode() const;
147 * @return pan-gesture smoothing amount
149 float GetPanGestureSmoothingAmount() const;
152 * @return The minimum distance before a pan can be started (-1 means it's not set)
154 int GetMinimumPanDistance() const;
157 * @return The minimum events before a pan can be started (-1 means it's not set)
159 int GetMinimumPanEvents() const;
162 * @return The width of the window
164 unsigned int GetWindowWidth() const;
167 * @return The height of the window
169 unsigned int GetWindowHeight() const;
172 * @brief Sets the mode used to predict pan gesture movement
174 * @param[in] mode The prediction mode to use
176 void SetPanGesturePredictionMode( unsigned int mode );
179 * @brief Sets the prediction amount of the pan gesture
181 * @param[in] amount The prediction amount in milliseconds
183 void SetPanGesturePredictionAmount( unsigned int amount );
186 * @brief Sets the upper bound of the prediction amount for clamping
188 * @param[in] amount The prediction amount in milliseconds
190 void SetPanGestureMaximumPredictionAmount( unsigned int amount );
193 * @brief Sets the lower bound of the prediction amount for clamping
195 * @param[in] amount The prediction amount in milliseconds
197 void SetPanGestureMinimumPredictionAmount( unsigned int amount );
200 * @brief Sets the prediction amount to adjust when the pan velocity is changed.
201 * If the pan velocity is accelerating, the prediction amount will be increased
202 * by the specified amount until it reaches the upper bound. If the pan velocity
203 * is decelerating, the prediction amount will be decreased by the specified
204 * amount until it reaches the lower bound.
206 * @param[in] amount The prediction amount in milliseconds
208 void SetPanGesturePredictionAmountAdjustment( unsigned int amount );
211 * @brief Called to set how pan gestures smooth input
213 * @param[in] mode The smoothing mode to use
215 void SetPanGestureSmoothingMode( unsigned int mode );
218 * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
220 * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
222 void SetPanGestureSmoothingAmount( float amount );
225 * @brief Sets the minimum distance required before a pan starts
227 * @param[in] distance The minimum distance before a pan starts
229 void SetMinimumPanDistance( int distance );
232 * @brief Sets the minimum number of events required before a pan starts
234 * @param[in] events The minimum events before a pan starts
236 void SetMinimumPanEvents( int events );
239 * @brief Sets how often the gles call logging occurs
241 * @param[in] time the number of seconds between logging output
243 void SetGlesCallTime( int time );
246 * @brief Get the graphics status time
248 int GetGlesCallTime() const;
251 * @brief Sets the width of the window
253 void SetWindowWidth( int width );
256 * @brief Sets the width of the window
258 void SetWindowHeight( int height );
261 * @return true if performance server is required
263 bool PerformanceServerRequired() const;
267 unsigned int mNetworkControl; ///< whether network control is enabled
268 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
269 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
270 unsigned int mPerformanceStatsLevel; ///< performance statistics logging bitmask
271 unsigned int mPerformanceStatsFrequency; ///< performance statistics logging frequency (seconds)
272 unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
273 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
274 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
275 int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
276 int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
277 int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
278 int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
279 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
280 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
281 int mPanMinimumDistance; ///< minimum distance required before pan starts
282 int mPanMinimumEvents; ///< minimum events required before pan starts
283 int mGlesCallTime; ///< time in seconds between status updates
284 unsigned int mWindowWidth; ///< width of the window
285 unsigned int mWindowHeight; ///< height of the window
287 Dali::Integration::Log::LogFunction mLogFunction;
289 // Undefined copy constructor.
290 EnvironmentOptions( const EnvironmentOptions& );
292 // Undefined assignment operator.
293 EnvironmentOptions& operator=( const EnvironmentOptions& );
301 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__