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 class EnvironmentOptions
45 * non-virtual destructor, not intended as a base class
47 ~EnvironmentOptions();
50 * @param logFunction logging function
51 * @param logFilterOptions bitmask of the logging options defined in intergration/debug.h (e.g.
52 * @param logFrameRateFrequency frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
53 * @param logupdateStatusFrequency frequency of how often the update status is logged in number of frames
54 * @param logPerformanceStats performance statistics logging, 0 = disabled, 1+ = enabled
55 * @param logPerformanceStatsFrequency statistics logging frequency in seconds
56 * @param performanceTimeStampOutput where to output performance related time stamps to
57 * @param logPanGestureLevel pan-gesture logging, 0 = disabled, 1 = enabled
59 void SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
60 unsigned int logFrameRateFrequency,
61 unsigned int logupdateStatusFrequency,
62 unsigned int logPerformanceStats,
63 unsigned int logPerformanceStatsFrequency,
64 unsigned int performanceTimeStampOutput,
65 unsigned int logPanGestureLevel );
68 * Install the log function for the current thread.
70 void InstallLogFunction() const;
73 * Un-install the log function for the current thread.
75 void UnInstallLogFunction() const;
78 * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
80 unsigned int GetFrameRateLoggingFrequency() const;
83 * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
85 unsigned int GetUpdateStatusLoggingFrequency() const;
88 * @return performance statistics log level ( 0 == off )
90 unsigned int GetPerformanceStatsLoggingOptions() const;
93 * @return performance statistics log frequency in seconds
95 unsigned int GetPerformanceStatsLoggingFrequency() const;
98 * @return performance time stamp output ( 0 == off)
100 unsigned int GetPerformanceTimeStampOutput() const;
103 * @return pan-gesture logging level ( 0 == off )
105 unsigned int GetPanGestureLoggingLevel() const;
108 * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
110 int GetPanGesturePredictionMode() const;
113 * @return pan-gesture prediction amount
115 int GetPanGesturePredictionAmount() const;
118 * @return maximum pan-gesture prediction amount
120 int GetPanGestureMaximumPredictionAmount() const;
123 * @return minimum pan-gesture prediction amount
125 int GetPanGestureMinimumPredictionAmount() const;
128 * @return pan-gesture prediction amount adjustment
130 int GetPanGesturePredictionAmountAdjustment() const;
133 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
135 int GetPanGestureSmoothingMode() const;
138 * @return pan-gesture smoothing amount
140 float GetPanGestureSmoothingAmount() const;
143 * @return The minimum distance before a pan can be started (-1 means it's not set)
145 int GetMinimumPanDistance() const;
148 * @return The minimum events before a pan can be started (-1 means it's not set)
150 int GetMinimumPanEvents() const;
153 * @brief Sets the mode used to predict pan gesture movement
155 * @param[in] mode The prediction mode to use
157 void SetPanGesturePredictionMode( unsigned int mode );
160 * @brief Sets the prediction amount of the pan gesture
162 * @param[in] amount The prediction amount in milliseconds
164 void SetPanGesturePredictionAmount( unsigned int amount );
167 * @brief Sets the upper bound of the prediction amount for clamping
169 * @param[in] amount The prediction amount in milliseconds
171 void SetPanGestureMaximumPredictionAmount( unsigned int amount );
174 * @brief Sets the lower bound of the prediction amount for clamping
176 * @param[in] amount The prediction amount in milliseconds
178 void SetPanGestureMinimumPredictionAmount( unsigned int amount );
181 * @brief Sets the prediction amount to adjust when the pan velocity is changed.
182 * If the pan velocity is accelerating, the prediction amount will be increased
183 * by the specified amount until it reaches the upper bound. If the pan velocity
184 * is decelerating, the prediction amount will be decreased by the specified
185 * amount until it reaches the lower bound.
187 * @param[in] amount The prediction amount in milliseconds
189 void SetPanGesturePredictionAmountAdjustment( unsigned int amount );
192 * @brief Called to set how pan gestures smooth input
194 * @param[in] mode The smoothing mode to use
196 void SetPanGestureSmoothingMode( unsigned int mode );
199 * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
201 * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
203 void SetPanGestureSmoothingAmount( float amount );
206 * @brief Sets the minimum distance required before a pan starts
208 * @param[in] distance The minimum distance before a pan starts
210 void SetMinimumPanDistance( int distance );
213 * @brief Sets the minimum number of events required before a pan starts
215 * @param[in] events The minimum events before a pan starts
217 void SetMinimumPanEvents( int events );
220 * @brief Sets how often the gles call logging occurs
222 * @param[in] time the number of seconds between logging output
224 void SetGlesCallTime( int time );
227 * @brief Get the graphics status time
229 int GetGlesCallTime() const;
232 * @return true if performance server is required
234 bool PerformanceServerRequired() const;
238 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
239 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
240 unsigned int mPerformanceStatsLevel; ///< performance statistics logging bitmask
241 unsigned int mPerformanceStatsFrequency; ///< performance statistics logging frequency (seconds)
242 unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
243 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
244 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
245 int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
246 int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
247 int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
248 int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
249 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
250 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
251 int mPanMinimumDistance; ///< minimum distance required before pan starts
252 int mPanMinimumEvents; ///< minimum events required before pan starts
253 int mGlesCallTime; ///< time in seconds between status updates
255 Dali::Integration::Log::LogFunction mLogFunction;
257 // Undefined copy constructor.
258 EnvironmentOptions( const EnvironmentOptions& );
260 // Undefined assignment operator.
261 EnvironmentOptions& operator=( const EnvironmentOptions& );
269 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__