3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Flora License, Version 1.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license/
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 * @defgroup setting-debug
19 * setting debug utility
22 #ifndef _SETTING_DEBUG_H_
23 #define _SETTING_DEBUG_H_
26 /*#define MTRACE_ENABLED*/
28 #define DISABLED_CODE 0
32 #define SETTING_USING_PLATFORM_DBG
33 #ifdef SETTING_USING_PLATFORM_DBG
40 #define LOG_TAG "SETTING"
44 #if !defined(LOCALEDIR)
45 #define LOCALEDIR "/usr/apps/org.tizen.setting/res/locale"
49 #define EDJDIR "/usr/apps/org.tizen.setting/res/edje"
52 #define SUPPORT_BOTTOM_BTNS 1
53 #define REMOVE_BACK_BUTTON_MAIN 0
54 #define SUPPORT_GL_ENGINE 1
57 /*macros to control program flow*/
58 #define SUPPORT_MORE_ITEM_FUNCTION 1
60 // #define SUPPORT_MDM
63 #define SUPPORT_AllShare_Memory 0
64 #define SUPPORT_FMradio 1
65 #define SUPPORT_FONT 1
66 #define SUPPORT_MENUSCREEN 1
67 #define SUPPORT_WALLPAPER 1
68 #define SUPPOR_SEPARATE_BRIGHTNESS 1
70 #define SUPPORT_RCS_FOR_DEMO 0
71 #define SUPPORT_ACCESSIBILITY 1
72 #define SUPPORT_CERTIFICATES 0
73 #define SUPPORT_MOTIONS 1
74 #define SUPPORT_POWERSAVING 1
75 #define SUPPORT_RUN_SYSTEM_COMMAND 0
76 #define SUPPORT_STORAGE 1
77 #define SUPPORT_WIFI_DIRECT 1
78 #define SUPPORT_DATA_USAGE 0
79 #define SUPPORT_SECURITY 0
80 #define SUPPORT_WEB_APPLICATION 0
84 #define SUPPORT_APP_ROATION 1
85 #define SUPPORT_LCD_TIMEOUT_KEEPING 0
86 #define USE_DEVICE_SET_DISPLAY_BRT 1
88 #define LOW_BATTERY_DO_NOTHING 1 /**< 1 : turn the low batter handlding off */
90 #define APPLIED_BACK_KEY_UG 0
92 #define APPLIED_DATATIME_FIRSTDAY_WEEK 0
93 #define SUPPORT_DATEFIELD_DATE_FORMAT_AUTOSET 0
96 #define SUPPORT_PARENTAL_MODE 0
98 #define SETTING_ENABLE_TRACE
100 #ifdef SETTING_ENABLE_TRACE
101 #ifdef SETTING_USING_PLATFORM_DBG
102 #define SETTING_TRACE_DEBUG(fmt, arg...) \
104 LOGD("\n\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
105 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
108 #define SETTING_TRACE(fmt, arg...) \
110 LOGI("\n\033[0;36m" fmt "\033[0m\t%s:%d\n", \
111 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
114 #define SETTING_TRACE_WARNING(fmt, arg...) \
116 LOGW("\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
119 #define SETTING_TRACE_ERROR(fmt, arg...) \
121 LOGE("\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
123 #define SETTING_TRACE_BEGIN do {\
125 LOGD("\n\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
126 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
130 #define SETTING_TRACE_END do {\
132 LOGD("\n\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
133 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
137 #define SETTING_TRACE(fmt, arg...) \
139 printf("\n[SETTING]\033[0;36m" fmt "\033[0m\t%s:%d\n", \
140 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
144 #define SETTING_TRACE_DEBUG(fmt, arg...) \
146 printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
147 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
150 #define SETTING_TRACE_WARNING(fmt, arg...) \
153 printf("[SETTING]\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
156 #define SETTING_TRACE_ERROR(fmt, arg...) \
158 {fprintf(stderr, "[SETTING]\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
161 #define SETTING_TRACE_BEGIN do {\
163 printf("\n[SETTING]\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
164 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
168 #define SETTING_TRACE_END do {\
170 printf("\n[SETTING]\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
171 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
176 #define SETTING_TRACE(fmt, arg...)
177 #define SETTING_TRACE_DEBUG(fmt, arg...)
178 #define SETTING_TRACE_WARNING(fmt, arg...)
179 #define SETTING_TRACE_ERROR(fmt, arg...)
180 #define SETTING_TRACE_BEGIN
181 #define SETTING_TRACE_END
184 #define setting_retvm_if(expr, val, fmt, arg...) do { \
186 SETTING_TRACE_ERROR(fmt, ##arg); \
191 #define setting_retm_if(expr, fmt, arg...) do { \
193 SETTING_TRACE_ERROR(fmt, ##arg); \
199 #define retm_if setting_retm_if
202 #define retvm_if setting_retvm_if
206 #define retv_if(expr, val) do { \
213 #define ret_if(expr) do { \
220 #define __FREE(del, arg) do { \
222 del((void *)(arg)); /*cast any argument to (void*) to avoid build warring*/\
226 #define FREE(arg) __FREE(free, arg)
227 #define G_FREE(arg) __FREE(g_free, arg)
231 //a trick:To manager back pointer. eg,
232 //For using genlist, whenever Setting side and Genlist side both keep pointers
233 //to a same block memory(here is genlis item data via calloc), must use __BACK_POINTER_SET to
234 //bind the Setting side point into the Genlist side pointer
235 #define __BACK_POINTER_SET(pData) do { \
238 pData->pBack = (void **)(&(pData));\
242 #define __BACK_POINTER_UNSET(pData) do { \
243 if (pData && pData->pBack)/*release Setting side poniter handlers*/\
245 *(pData->pBack) = NULL;\
250 #endif /* _SETTING_DEBUG_H_ */