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 logFilterOptions bitmask of the logging options defined in intergration/debug.h (e.g.
54 * @param logFrameRateFrequency frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
55 * @param logupdateStatusFrequency frequency of how often the update status is logged in number of frames
56 * @param logPerformanceStats performance statistics logging, 0 = disabled, 1+ = enabled
57 * @param logPerformanceStatsFrequency statistics logging frequency in seconds
58 * @param performanceTimeStampOutput where to output performance related time stamps to
59 * @param logPanGestureLevel pan-gesture logging, 0 = disabled, 1 = enabled
61 void SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
62 unsigned int logFrameRateFrequency,
63 unsigned int logupdateStatusFrequency,
64 unsigned int logPerformanceStats,
65 unsigned int logPerformanceStatsFrequency,
66 unsigned int performanceTimeStampOutput,
67 unsigned int logPanGestureLevel );
70 * Install the log function for the current thread.
72 void InstallLogFunction() const;
75 * Un-install the log function for the current thread.
77 void UnInstallLogFunction() const;
80 * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
82 unsigned int GetFrameRateLoggingFrequency() const;
85 * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
87 unsigned int GetUpdateStatusLoggingFrequency() const;
90 * @return performance statistics log level ( 0 == off )
92 unsigned int GetPerformanceStatsLoggingOptions() const;
95 * @return performance statistics log frequency in seconds
97 unsigned int GetPerformanceStatsLoggingFrequency() const;
100 * @return performance time stamp output ( 0 == off)
102 unsigned int GetPerformanceTimeStampOutput() const;
105 * @return pan-gesture logging level ( 0 == off )
107 unsigned int GetPanGestureLoggingLevel() const;
110 * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
112 int GetPanGesturePredictionMode() const;
115 * @return pan-gesture prediction amount
117 int GetPanGesturePredictionAmount() const;
120 * @return maximum pan-gesture prediction amount
122 int GetPanGestureMaximumPredictionAmount() const;
125 * @return minimum pan-gesture prediction amount
127 int GetPanGestureMinimumPredictionAmount() const;
130 * @return pan-gesture prediction amount adjustment
132 int GetPanGesturePredictionAmountAdjustment() const;
135 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
137 int GetPanGestureSmoothingMode() const;
140 * @return pan-gesture smoothing amount
142 float GetPanGestureSmoothingAmount() const;
145 * @return The minimum distance before a pan can be started (-1 means it's not set)
147 int GetMinimumPanDistance() const;
150 * @return The minimum events before a pan can be started (-1 means it's not set)
152 int GetMinimumPanEvents() const;
155 * @return The width of the window
157 unsigned int GetWindowWidth() const;
160 * @return The height of the window
162 unsigned int GetWindowHeight() const;
165 * @brief Sets the mode used to predict pan gesture movement
167 * @param[in] mode The prediction mode to use
169 void SetPanGesturePredictionMode( unsigned int mode );
172 * @brief Sets the prediction amount of the pan gesture
174 * @param[in] amount The prediction amount in milliseconds
176 void SetPanGesturePredictionAmount( unsigned int amount );
179 * @brief Sets the upper bound of the prediction amount for clamping
181 * @param[in] amount The prediction amount in milliseconds
183 void SetPanGestureMaximumPredictionAmount( unsigned int amount );
186 * @brief Sets the lower bound of the prediction amount for clamping
188 * @param[in] amount The prediction amount in milliseconds
190 void SetPanGestureMinimumPredictionAmount( unsigned int amount );
193 * @brief Sets the prediction amount to adjust when the pan velocity is changed.
194 * If the pan velocity is accelerating, the prediction amount will be increased
195 * by the specified amount until it reaches the upper bound. If the pan velocity
196 * is decelerating, the prediction amount will be decreased by the specified
197 * amount until it reaches the lower bound.
199 * @param[in] amount The prediction amount in milliseconds
201 void SetPanGesturePredictionAmountAdjustment( unsigned int amount );
204 * @brief Called to set how pan gestures smooth input
206 * @param[in] mode The smoothing mode to use
208 void SetPanGestureSmoothingMode( unsigned int mode );
211 * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
213 * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
215 void SetPanGestureSmoothingAmount( float amount );
218 * @brief Sets the minimum distance required before a pan starts
220 * @param[in] distance The minimum distance before a pan starts
222 void SetMinimumPanDistance( int distance );
225 * @brief Sets the minimum number of events required before a pan starts
227 * @param[in] events The minimum events before a pan starts
229 void SetMinimumPanEvents( int events );
232 * @brief Sets how often the gles call logging occurs
234 * @param[in] time the number of seconds between logging output
236 void SetGlesCallTime( int time );
239 * @brief Get the graphics status time
241 int GetGlesCallTime() const;
244 * @brief Sets the width of the window
246 void SetWindowWidth( int width );
249 * @brief Sets the width of the window
251 void SetWindowHeight( int height );
254 * @return true if performance server is required
256 bool PerformanceServerRequired() const;
260 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
261 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
262 unsigned int mPerformanceStatsLevel; ///< performance statistics logging bitmask
263 unsigned int mPerformanceStatsFrequency; ///< performance statistics logging frequency (seconds)
264 unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
265 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
266 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
267 int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
268 int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
269 int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
270 int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
271 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
272 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
273 int mPanMinimumDistance; ///< minimum distance required before pan starts
274 int mPanMinimumEvents; ///< minimum events required before pan starts
275 int mGlesCallTime; ///< time in seconds between status updates
276 unsigned int mWindowWidth; ///< width of the window
277 unsigned int mWindowHeight; ///< height of the window
279 Dali::Integration::Log::LogFunction mLogFunction;
281 // Undefined copy constructor.
282 EnvironmentOptions( const EnvironmentOptions& );
284 // Undefined assignment operator.
285 EnvironmentOptions& operator=( const EnvironmentOptions& );
293 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__