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 1
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
97 #define SUPPORT_PRIVACY 1
99 #define SETTING_ENABLE_TRACE
101 #ifdef SETTING_ENABLE_TRACE
102 #ifdef SETTING_USING_PLATFORM_DBG
103 #define SETTING_TRACE_DEBUG(fmt, arg...) \
105 LOGD("\n\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
106 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
109 #define SETTING_TRACE(fmt, arg...) \
111 LOGI("\n\033[0;36m" fmt "\033[0m\t%s:%d\n", \
112 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
115 #define SETTING_TRACE_WARNING(fmt, arg...) \
117 LOGW("\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
120 #define SETTING_TRACE_ERROR(fmt, arg...) \
122 LOGE("\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
124 #define SETTING_TRACE_BEGIN do {\
126 LOGD("\n\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
127 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
131 #define SETTING_TRACE_END do {\
133 LOGD("\n\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
134 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
138 #define SETTING_TRACE(fmt, arg...) \
140 printf("\n[SETTING]\033[0;36m" fmt "\033[0m\t%s:%d\n", \
141 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
145 #define SETTING_TRACE_DEBUG(fmt, arg...) \
147 printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
148 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
151 #define SETTING_TRACE_WARNING(fmt, arg...) \
154 printf("[SETTING]\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
157 #define SETTING_TRACE_ERROR(fmt, arg...) \
159 {fprintf(stderr, "[SETTING]\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
162 #define SETTING_TRACE_BEGIN do {\
164 printf("\n[SETTING]\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
165 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
169 #define SETTING_TRACE_END do {\
171 printf("\n[SETTING]\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
172 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
177 #define SETTING_TRACE(fmt, arg...)
178 #define SETTING_TRACE_DEBUG(fmt, arg...)
179 #define SETTING_TRACE_WARNING(fmt, arg...)
180 #define SETTING_TRACE_ERROR(fmt, arg...)
181 #define SETTING_TRACE_BEGIN
182 #define SETTING_TRACE_END
185 #define setting_retvm_if(expr, val, fmt, arg...) do { \
187 SETTING_TRACE_ERROR(fmt, ##arg); \
192 #define setting_retm_if(expr, fmt, arg...) do { \
194 SETTING_TRACE_ERROR(fmt, ##arg); \
200 #define retm_if setting_retm_if
203 #define retvm_if setting_retvm_if
207 #define retv_if(expr, val) do { \
214 #define ret_if(expr) do { \
221 #define __FREE(del, arg) do { \
223 del((void *)(arg)); /*cast any argument to (void*) to avoid build warring*/\
227 #define FREE(arg) __FREE(free, arg)
228 #define G_FREE(arg) __FREE(g_free, arg)
232 //a trick:To manager back pointer. eg,
233 //For using genlist, whenever Setting side and Genlist side both keep pointers
234 //to a same block memory(here is genlis item data via calloc), must use __BACK_POINTER_SET to
235 //bind the Setting side point into the Genlist side pointer
236 #define __BACK_POINTER_SET(pData) do { \
239 pData->pBack = (void **)(&(pData));\
243 #define __BACK_POINTER_UNSET(pData) do { \
244 if (pData && pData->pBack)/*release Setting side poniter handlers*/\
246 *(pData->pBack) = NULL;\
251 #endif /* _SETTING_DEBUG_H_ */