4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
6 * Contact: MyoungJune Park <mj2004.park@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 * @defgroup setting-debug
23 * setting debug utility
26 #ifndef _SETTING_DEBUG_H_
27 #define _SETTING_DEBUG_H_
32 #define SETTING_USING_PLATFORM_DBG
33 #ifdef SETTING_USING_PLATFORM_DBG
40 #define LOG_TAG "SETTING"
43 //#define LAUNCHING_DEBUG_LOG
46 #ifdef LAUNCHING_DEBUG_LOG
47 #define LAUNCH_SETTING_IN(fmt, arg...) LOG(LOG_DEBUG, "LAUNCH", "[setting:Application:%s:IN]" fmt, __FUNCTION__, ##arg)
48 #define LAUNCH_SETTING_OUT(fmt, arg...) LOG(LOG_DEBUG, "LAUNCH", "[setting:Application:%s:OUT]" fmt, __FUNCTION__, ##arg)
50 #define LAUNCH_SETTING_IN(fmt, arg...)
51 #define LAUNCH_SETTING_OUT(fmt, arg...)
54 #if !defined(LOCALEDIR)
55 #define LOCALEDIR "/usr/apps/org.tizen.setting/res/locale"
59 #define EDJDIR "/usr/apps/org.tizen.setting/res/edje"
62 #define SUPPORT_BOTTOM_BTNS 1
66 /*macros to control program flow*/
67 #define SUPPORT_MORE_ITEM_FUNCTION 1
69 #define SETTING_SEARCH 1
74 #define USE_RECENTLY_USED
77 #define SUPPORT_LIBEAS 0
78 #define SUPPORT_FINGERPRINT 0
81 #define SUPPORT_AllShare_Memory 0
82 #define SUPPORT_FMradio 0
83 #define SUPPORT_FONT 1
84 #define SUPPORT_WALLPAPER 0
85 #define SUPPOR_SEPARATE_BRIGHTNESS 0
86 #define SUPPORT_LEDINDICATOR 1
87 #define SUPPORT_SPLIT_DISPLAY 0
88 #define SUPPORT_HELPUI 0
90 #define SUPPORT_ACCESSIBILITY 1
93 * @todo SUPPORT_PSMODE and SUPPORT_POWERSAVING is working exclusively.
94 * need to do refactoring
96 #define SUPPORT_PSMODE 1
98 #define SUPPORT_RUN_SYSTEM_COMMAND 0
99 #define SUPPORT_STORAGE 1
100 #define SUPPORT_WIFI_DIRECT 1
101 #define SUPPORT_READY_TO_SHARE 1
102 #define SUPPORT_DATA_USAGE 1
103 #define SUPPORT_PERSONALPAGE 0
104 #define SUPPORT_AUTO_ADJUST_SCREEN_TONE 1
105 #define SUPPORT_HIGH_TOUCH_SENS 1
106 #define SUPPORT_SCREEN_CAPTURE 1
107 #define SUPPORT_HDMI_APP 0
108 #define SUPPORT_POWER_USAGE_INFO 0
109 #define SUPPORT_NFC 0
110 #define SUPPORT_TETHERING 0
111 #define SUPPORT_NETWORK_RESTRICTION 1
112 #define SUPPORT_SMARTSCREEN 0
113 #define SUPPORT_CALL 0
117 #define SUPPORT_APP_ROATION 1
118 #define SUPPORT_LCD_TIMEOUT_KEEPING 0
119 #define USE_DEVICE_SET_DISPLAY_BRT 1
121 #define LOW_BATTERY_DO_NOTHING 1 /**< 1 : turn the low batter handlding off */
123 #define APPLIED_DATATIME_FIRSTDAY_WEEK 0
124 #define SUPPORT_DATEFIELD_DATE_FORMAT_AUTOSET 0
126 #define SUPPORT_SIMLOCK 0
127 #define SUPPORT_FDN 0
128 #define SUPPORT_ENCRYPTION 0
129 #define SUPPORT_SD_ENCRYPTION 0
130 #define SUPPORT_SCREEN_SECURITY 1
131 #define SUPPORT_PARENTAL_MODE 0
133 #define SUPPORT_SECURITY_FIREWALL 1
134 #define SUPPORT_PRIVACY 1
136 #define SETTING_ENABLE_TRACE
138 #ifdef SETTING_ENABLE_TRACE
139 #ifdef SETTING_USING_PLATFORM_DBG
140 #define SETTING_TRACE_SECURE_DEBUG(fmt, arg...) \
142 SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
145 #define SETTING_TRACE_DEBUG(fmt, arg...) \
147 SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
150 #define SETTING_TRACE(fmt, arg...) \
152 SECURE_LOGI("\033[0;36m" fmt "\033[0m\n", ##arg);\
155 #define SETTING_TRACE_WARNING(fmt, arg...) \
157 SECURE_LOGI("\033[0;33mWARRING: " fmt "\033[0m\n", ##arg);\
160 #define SETTING_TRACE_ERROR(fmt, arg...) \
162 SECURE_LOGE("\033[0;31mERROR: " fmt "\033[0m\n", ##arg);\
164 #define SETTING_TRACE_BEGIN do {\
165 SECURE_LOGD("\033[0;35mENTER FUNCTION: %s. \033[0m\n", __FUNCTION__);\
168 #define SETTING_TRACE_END do {\
169 SECURE_LOGD("\033[0;35mEXIT FUNCTION: %s. \033[0m\n", __FUNCTION__);\
172 #define SETTING_TRACE(fmt, arg...) \
174 printf("\n[SETTING]\033[0;36m" fmt "\033[0m\t%s:%d\n", \
175 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
178 #define SETTING_TRACE_SECURE_DEBUG(fmt, arg...) \
180 printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
181 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
185 #define SETTING_TRACE_DEBUG(fmt, arg...) \
187 printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
188 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
191 #define SETTING_TRACE_WARNING(fmt, arg...) \
194 printf("[SETTING]\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
197 #define SETTING_TRACE_ERROR(fmt, arg...) \
199 {fprintf(stderr, "[SETTING]\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
202 #define SETTING_TRACE_BEGIN do {\
204 printf("\n[SETTING]\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
205 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
209 #define SETTING_TRACE_END do {\
211 printf("\n[SETTING]\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
212 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
217 #define SETTING_TRACE(fmt, arg...)
218 #define SETTING_TRACE_SECURE_DEBUG(fmt, arg...)
219 #define SETTING_TRACE_DEBUG(fmt, arg...)
220 #define SETTING_TRACE_WARNING(fmt, arg...)
221 #define SETTING_TRACE_ERROR(fmt, arg...)
222 #define SETTING_TRACE_BEGIN
223 #define SETTING_TRACE_END
226 #define setting_retvm_if(expr, val, fmt, arg...) do { \
228 SETTING_TRACE_ERROR(fmt, ##arg); \
233 #define setting_retm_if(expr, fmt, arg...) do { \
235 SETTING_TRACE_ERROR(fmt, ##arg); \
241 #define retm_if setting_retm_if
244 #define retvm_if setting_retvm_if
248 #define retv_if(expr, val) do { \
250 SETTING_TRACE_ERROR("(%s)", #expr); \
257 #define ret_if(expr) do { \
259 SETTING_TRACE_ERROR("(%s)", #expr); \
266 #define warn_if(expr, fmt, arg...) do { \
268 SETTING_TRACE_ERROR(fmt, ##arg); \
274 #define __FREE(del, arg) do { \
276 del((void *)(arg)); /*cast any argument to (void*) to avoid build warring*/\
280 #define FREE(arg) __FREE(free, arg)
281 #define G_FREE(arg) __FREE(g_free, arg)
285 //a trick:To manager back pointer. eg,
286 //For using genlist, whenever Setting side and Genlist side both keep pointers
287 //to a same block memory(here is genlis item data via calloc), must use __BACK_POINTER_SET to
288 //bind the Setting side point into the Genlist side pointer
289 #define __BACK_POINTER_SET(pData) do { \
292 pData->pBack = (void **)(&(pData));\
296 #define __BACK_POINTER_UNSET(pData) do { \
297 if (pData && pData->pBack)/*release Setting side poniter handlers*/\
299 *(pData->pBack) = NULL;\
304 #endif /* _SETTING_DEBUG_H_ */