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.
21 #include <dali/integration-api/debug.h>
31 * Contains environment options which define settings and the ability to install a log function.
33 class EnvironmentOptions
44 * non-virtual destructor, not intended as a base class
46 ~EnvironmentOptions();
49 * @param logFunction logging function
50 * @param logFilterOptions bitmask of the logging options defined in intergration/debug.h (e.g.
51 * @param logFrameRateFrequency frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
52 * @param logupdateStatusFrequency frequency of how often the update status is logged in number of frames
53 * @param logPerformanceLevel performance logging, 0 = disabled, 1+ = enabled
54 * @param logPanGestureLevel pan-gesture logging, 0 = disabled, 1 = enabled
56 void SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
57 unsigned int logFrameRateFrequency,
58 unsigned int logupdateStatusFrequency,
59 unsigned int logPerformanceLevel,
60 unsigned int logPanGestureLevel );
63 * Install the log function for the current thread.
65 void InstallLogFunction() const;
68 * Un-install the log function for the current thread.
70 void UnInstallLogFunction() const;
73 * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
75 unsigned int GetFrameRateLoggingFrequency() const;
78 * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
80 unsigned int GetUpdateStatusLoggingFrequency() const;
83 * @return logPerformanceLevel performance log level ( 0 = off )
85 unsigned int GetPerformanceLoggingLevel() const;
88 * @return pan-gesture logging level ( 0 == off )
90 unsigned int GetPanGestureLoggingLevel() const;
93 * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
95 int GetPanGesturePredictionMode() const;
98 * @return pan-gesture prediction amount
100 int GetPanGesturePredictionAmount() const;
103 * @return maximum pan-gesture prediction amount
105 int GetPanGestureMaximumPredictionAmount() const;
108 * @return minimum pan-gesture prediction amount
110 int GetPanGestureMinimumPredictionAmount() const;
113 * @return pan-gesture prediction amount adjustment
115 int GetPanGesturePredictionAmountAdjustment() const;
118 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
120 int GetPanGestureSmoothingMode() const;
123 * @return pan-gesture smoothing amount
125 float GetPanGestureSmoothingAmount() const;
128 * @return The minimum distance before a pan can be started (-1 means it's not set)
130 int GetMinimumPanDistance() const;
133 * @return The minimum events before a pan can be started (-1 means it's not set)
135 int GetMinimumPanEvents() const;
138 * @brief Sets the mode used to predict pan gesture movement
140 * @param[in] mode The prediction mode to use
142 void SetPanGesturePredictionMode( unsigned int mode );
145 * @brief Sets the prediction amount of the pan gesture
147 * @param[in] amount The prediction amount in milliseconds
149 void SetPanGesturePredictionAmount( unsigned int amount );
152 * @brief Sets the upper bound of the prediction amount for clamping
154 * @param[in] amount The prediction amount in milliseconds
156 void SetPanGestureMaximumPredictionAmount( unsigned int amount );
159 * @brief Sets the lower bound of the prediction amount for clamping
161 * @param[in] amount The prediction amount in milliseconds
163 void SetPanGestureMinimumPredictionAmount( unsigned int amount );
166 * @brief Sets the prediction amount to adjust when the pan velocity is changed.
167 * If the pan velocity is accelerating, the prediction amount will be increased
168 * by the specified amount until it reaches the upper bound. If the pan velocity
169 * is decelerating, the prediction amount will be decreased by the specified
170 * amount until it reaches the lower bound.
172 * @param[in] amount The prediction amount in milliseconds
174 void SetPanGesturePredictionAmountAdjustment( unsigned int amount );
177 * @brief Called to set how pan gestures smooth input
179 * @param[in] mode The smoothing mode to use
181 void SetPanGestureSmoothingMode( unsigned int mode );
184 * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
186 * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
188 void SetPanGestureSmoothingAmount( float amount );
191 * @brief Sets the minimum distance required before a pan starts
193 * @param[in] distance The minimum distance before a pan starts
195 void SetMinimumPanDistance( int distance );
198 * @brief Sets the minimum number of events required before a pan starts
200 * @param[in] events The minimum events before a pan starts
202 void SetMinimumPanEvents( int events );
205 * @brief Sets how often the gles call logging occurs
207 * @param[in] time the number of seconds between logging output
209 void SetGlesCallTime( int time );
212 * @brief Get the graphics status time
214 int GetGlesCallTime();
219 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
220 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
221 unsigned int mPerformanceLoggingLevel; ///< performance log level
222 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
223 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
224 int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
225 int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
226 int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
227 int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
228 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
229 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
230 int mPanMinimumDistance; ///< minimum distance required before pan starts
231 int mPanMinimumEvents; ///< minimum events required before pan starts
232 int mGlesCallTime; ///< time in seconds between status updates
234 Dali::Integration::Log::LogFunction mLogFunction;
236 // Undefined copy constructor.
237 EnvironmentOptions( const EnvironmentOptions& );
239 // Undefined assignment operator.
240 EnvironmentOptions& operator=( const EnvironmentOptions& );
248 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__