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_
31 /*#define DEBUG_CODE */
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_SIMSETTING 0
101 #define SUPPORT_WIFI_DIRECT 1
102 #define SUPPORT_READY_TO_SHARE 1
103 #define SUPPORT_DATA_USAGE 1
104 #define SUPPORT_PERSONALPAGE 0
105 #define SUPPORT_AUTO_ADJUST_SCREEN_TONE 1
106 #define SUPPORT_HIGH_TOUCH_SENS 1
107 #define SUPPORT_SCREEN_CAPTURE 1
108 #define SUPPORT_HDMI_APP 0
109 #define SUPPORT_POWER_USAGE_INFO 0
110 #define SUPPORT_NFC 0
111 #define SUPPORT_TETHERING 0
112 #define SUPPORT_NETWORK_RESTRICTION 1
113 #define SUPPORT_SMARTSCREEN 0
114 #define SUPPORT_CALL 0
118 #define SUPPORT_APP_ROATION 1
119 #define SUPPORT_LCD_TIMEOUT_KEEPING 0
120 #define USE_DEVICE_SET_DISPLAY_BRT 1
122 #define LOW_BATTERY_DO_NOTHING 1 /**< 1 : turn the low batter handlding off */
124 #define APPLIED_DATATIME_FIRSTDAY_WEEK 0
125 #define SUPPORT_DATEFIELD_DATE_FORMAT_AUTOSET 0
127 #define SUPPORT_SIMLOCK 0
128 #define SUPPORT_FDN 0
129 #define SUPPORT_ENCRYPTION 0
130 #define SUPPORT_SD_ENCRYPTION 0
131 #define SUPPORT_SCREEN_SECURITY 1
132 #define SUPPORT_PARENTAL_MODE 0
134 #define SUPPORT_SECURITY_FIREWALL 1
135 #define SUPPORT_PRIVACY 1
137 #define SETTING_ENABLE_TRACE
139 #ifdef SETTING_ENABLE_TRACE
140 #ifdef SETTING_USING_PLATFORM_DBG
141 #define SETTING_TRACE_SECURE_DEBUG(fmt, arg...) \
143 SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
146 #define SETTING_TRACE_DEBUG(fmt, arg...) \
148 SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
151 #define SETTING_TRACE(fmt, arg...) \
153 SECURE_LOGI("\033[0;36m" fmt "\033[0m\n", ##arg);\
156 #define SETTING_TRACE_WARNING(fmt, arg...) \
158 SECURE_LOGI("\033[0;33mWARRING: " fmt "\033[0m\n", ##arg);\
161 #define SETTING_TRACE_ERROR(fmt, arg...) \
163 SECURE_LOGE("\033[0;31mERROR: " fmt "\033[0m\n", ##arg);\
165 #define SETTING_TRACE_BEGIN do {\
166 SECURE_LOGD("\033[0;35mENTER FUNCTION: %s. \033[0m\n", __FUNCTION__);\
169 #define SETTING_TRACE_END do {\
170 SECURE_LOGD("\033[0;35mEXIT FUNCTION: %s. \033[0m\n", __FUNCTION__);\
173 #define SETTING_TRACE(fmt, arg...) \
175 printf("\n[SETTING]\033[0;36m" fmt "\033[0m\t%s:%d\n", \
176 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
179 #define SETTING_TRACE_SECURE_DEBUG(fmt, arg...) \
181 printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
182 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
186 #define SETTING_TRACE_DEBUG(fmt, arg...) \
188 printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
189 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
192 #define SETTING_TRACE_WARNING(fmt, arg...) \
195 printf("[SETTING]\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
198 #define SETTING_TRACE_ERROR(fmt, arg...) \
200 {fprintf(stderr, "[SETTING]\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
203 #define SETTING_TRACE_BEGIN do {\
205 printf("\n[SETTING]\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
206 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
210 #define SETTING_TRACE_END do {\
212 printf("\n[SETTING]\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
213 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
218 #define SETTING_TRACE(fmt, arg...)
219 #define SETTING_TRACE_SECURE_DEBUG(fmt, arg...)
220 #define SETTING_TRACE_DEBUG(fmt, arg...)
221 #define SETTING_TRACE_WARNING(fmt, arg...)
222 #define SETTING_TRACE_ERROR(fmt, arg...)
223 #define SETTING_TRACE_BEGIN
224 #define SETTING_TRACE_END
227 #define setting_retvm_if(expr, val, fmt, arg...) do { \
229 SETTING_TRACE_ERROR(fmt, ##arg); \
234 #define setting_retm_if(expr, fmt, arg...) do { \
236 SETTING_TRACE_ERROR(fmt, ##arg); \
242 #define retm_if setting_retm_if
245 #define retvm_if setting_retvm_if
249 #define retv_if(expr, val) do { \
251 SETTING_TRACE_ERROR("(%s)", #expr); \
258 #define ret_if(expr) do { \
260 SETTING_TRACE_ERROR("(%s)", #expr); \
267 #define warn_if(expr, fmt, arg...) do { \
269 SETTING_TRACE_ERROR(fmt, ##arg); \
275 #define __FREE(del, arg) do { \
277 del((void *)(arg)); /*cast any argument to (void*) to avoid build warring*/\
281 #define FREE(arg) __FREE(free, arg)
282 #define G_FREE(arg) __FREE(g_free, arg)
286 /*a trick:To manager back pointer. eg, */
287 /*For using genlist, whenever Setting side and Genlist side both keep pointers */
288 /*to a same block memory(here is genlis item data via calloc), must use __BACK_POINTER_SET to */
289 /*bind the Setting side point into the Genlist side pointer */
290 #define __BACK_POINTER_SET(pData) do { \
293 pData->pBack = (void **)(&(pData));\
297 #define __BACK_POINTER_UNSET(pData) do { \
298 if (pData && pData->pBack)/*release Setting side poniter handlers*/\
300 *(pData->pBack) = NULL;\
305 #endif /* _SETTING_DEBUG_H_ */