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 float GetPanGesturePredictionAmount() const;
103 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
105 int GetPanGestureSmoothingMode() const;
108 * @return pan-gesture smoothing amount
110 float GetPanGestureSmoothingAmount() const;
113 * @return The minimum distance before a pan can be started (-1 means it's not set)
115 int GetMinimumPanDistance() const;
118 * @return The minimum events before a pan can be started (-1 means it's not set)
120 int GetMinimumPanEvents() const;
123 * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
125 * @param[in] mode The smoothing mode to use
127 void SetPanGesturePredictionMode( unsigned int mode );
130 * @brief Sets the prediction amount of the pan gesture
132 * @param[in] amount The prediction amount in milliseconds
134 void SetPanGesturePredictionAmount( unsigned int amount );
137 * @brief Called to set how pan gestures smooth input
139 * @param[in] mode The smoothing mode to use
141 void SetPanGestureSmoothingMode( unsigned int mode );
144 * @brief Sets the prediction amount of the pan gesture
146 * @param[in] amount The smoothing amount [0.0f,1.0f] - 0.0f would be no smoothing, 1.0f maximum smoothing
148 void SetPanGestureSmoothingAmount( float amount );
151 * @brief Sets the minimum distance required before a pan starts
153 * @param[in] distance The minimum distance before a pan starts
155 void SetMinimumPanDistance( int distance );
158 * @brief Sets the minimum number of events required before a pan starts
160 * @param[in] events The minimum events before a pan starts
162 void SetMinimumPanEvents( int events );
165 * @brief Sets how often the gles call logging occurs
167 * @param[in] time the number of seconds between logging output
169 void SetGlesCallTime( int time );
172 * @brief Get the graphics status time
174 int GetGlesCallTime();
179 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
180 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
181 unsigned int mPerformanceLoggingLevel; ///< performance log level
182 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
183 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
184 float mPanGesturePredictionAmount; ///< prediction amount for pan gestures
185 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
186 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
187 int mPanMinimumDistance; ///< minimum distance required before pan starts
188 int mPanMinimumEvents; ///< minimum events required before pan starts
189 int mGlesCallTime; ///< time in seconds between status updates
191 Dali::Integration::Log::LogFunction mLogFunction;
193 // Undefined copy constructor.
194 EnvironmentOptions( const EnvironmentOptions& );
196 // Undefined assignment operator.
197 EnvironmentOptions& operator=( const EnvironmentOptions& );
205 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__