1 #ifndef __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
2 #define __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
5 * Copyright (c) 2015 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 * This class provides the environment options which define settings as well as
33 * the ability to install a log function.
36 class EnvironmentOptions
47 * non-virtual destructor, not intended as a base class
49 ~EnvironmentOptions();
52 * @param logFunction logging function
54 void SetLogFunction( const Dali::Integration::Log::LogFunction& logFunction );
57 * Install the log function for the current thread.
59 void InstallLogFunction() const;
62 * Un-install the log function for the current thread.
64 void UnInstallLogFunction() const;
67 * @return whether network control is enabled or not ( 0 = off, 1 = on )
69 unsigned int GetNetworkControlMode() const;
72 * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
74 unsigned int GetFrameRateLoggingFrequency() const;
77 * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
79 unsigned int GetUpdateStatusLoggingFrequency() const;
82 * @return object profiler status interval ( 0 == off )
84 unsigned int GetObjectProfilerInterval() const;
87 * @return performance statistics log level ( 0 == off )
89 unsigned int GetPerformanceStatsLoggingOptions() const;
92 * @return performance statistics log frequency in seconds
94 unsigned int GetPerformanceStatsLoggingFrequency() const;
97 * @return performance time stamp output ( 0 == off)
99 unsigned int GetPerformanceTimeStampOutput() const;
102 * @return pan-gesture logging level ( 0 == off )
104 unsigned int GetPanGestureLoggingLevel() const;
107 * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
109 int GetPanGesturePredictionMode() const;
112 * @return pan-gesture prediction amount
114 int GetPanGesturePredictionAmount() const;
117 * @return maximum pan-gesture prediction amount
119 int GetPanGestureMaximumPredictionAmount() const;
122 * @return minimum pan-gesture prediction amount
124 int GetPanGestureMinimumPredictionAmount() const;
127 * @brief Gets the prediction amount to adjust when the pan velocity is changed.
129 * If the pan velocity is accelerating, the prediction amount will be increased
130 * by the specified amount until it reaches the upper bound. If the pan velocity
131 * is decelerating, the prediction amount will be decreased by the specified
132 * amount until it reaches the lower bound.
134 * @return pan-gesture prediction amount adjustment
136 int GetPanGesturePredictionAmountAdjustment() const;
139 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
141 int GetPanGestureSmoothingMode() const;
144 * @return pan-gesture smoothing amount
146 float GetPanGestureSmoothingAmount() const;
149 * @return The minimum distance before a pan can be started (-1 means it's not set)
151 int GetMinimumPanDistance() const;
154 * @return The minimum events before a pan can be started (-1 means it's not set)
156 int GetMinimumPanEvents() const;
159 * @return The width of the window
161 unsigned int GetWindowWidth() const;
164 * @return The height of the window
166 unsigned int GetWindowHeight() const;
169 * @brief Get the graphics status time
171 int GetGlesCallTime() const;
174 * @return true if performance server is required
176 bool PerformanceServerRequired() const;
179 * @return Gets the window name.
181 const std::string& GetWindowName() const;
184 * @return Gets the window class.
186 const std::string& GetWindowClassName() const;
191 * Parses the environment options.
192 * Called from the constructor
194 void ParseEnvironmentOptions();
198 std::string mWindowName; ///< name of the window
199 std::string mWindowClassName; ///< name of the class the window belongs to
200 unsigned int mNetworkControl; ///< whether network control is enabled
201 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
202 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
203 unsigned int mObjectProfilerInterval; ///< how often object counts are logged out in seconds
204 unsigned int mPerformanceStatsLevel; ///< performance statistics logging bitmask
205 unsigned int mPerformanceStatsFrequency; ///< performance statistics logging frequency (seconds)
206 unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
207 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
208 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
209 int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
210 int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
211 int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
212 int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
213 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
214 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
215 int mPanMinimumDistance; ///< minimum distance required before pan starts
216 int mPanMinimumEvents; ///< minimum events required before pan starts
217 int mGlesCallTime; ///< time in seconds between status updates
218 unsigned int mWindowWidth; ///< width of the window
219 unsigned int mWindowHeight; ///< height of the window
221 Dali::Integration::Log::LogFunction mLogFunction;
223 // Undefined copy constructor.
224 EnvironmentOptions( const EnvironmentOptions& );
226 // Undefined assignment operator.
227 EnvironmentOptions& operator=( const EnvironmentOptions& );
235 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__