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_
30 /*#define MTRACE_ENABLED*/
32 #define DISABLED_CODE 0
36 #define SETTING_USING_PLATFORM_DBG
37 #ifdef SETTING_USING_PLATFORM_DBG
44 #define LOG_TAG "SETTING"
48 #if !defined(LOCALEDIR)
49 #define LOCALEDIR "/usr/apps/org.tizen.setting/res/locale"
53 #define EDJDIR "/usr/apps/org.tizen.setting/res/edje"
56 #define SUPPORT_BOTTOM_BTNS 1
57 #define REMOVE_BACK_BUTTON_MAIN 0
58 #define SUPPORT_GL_ENGINE 1
61 /*macros to control program flow*/
62 #define SUPPORT_MORE_ITEM_FUNCTION 1
64 // #define SUPPORT_MDM
67 #define SUPPORT_AllShare_Memory 0
68 #define SUPPORT_FMradio 1
69 #define SUPPORT_FONT 1
70 #define SUPPORT_MENUSCREEN 1
71 #define SUPPORT_WALLPAPER 1
72 #define SUPPOR_SEPARATE_BRIGHTNESS 1
74 #define SUPPORT_RCS_FOR_DEMO 0
75 #define SUPPORT_ACCESSIBILITY 1
76 #define SUPPORT_CERTIFICATES 0
77 #define SUPPORT_MOTIONS 1
78 #define SUPPORT_POWERSAVING 1
79 #define SUPPORT_RUN_SYSTEM_COMMAND 0
80 #define SUPPORT_STORAGE 1
81 #define SUPPORT_WIFI_DIRECT 1
82 #define SUPPORT_DATA_USAGE 0
83 #define SUPPORT_SECURITY 0
84 #define SUPPORT_WEB_APPLICATION 0
88 #define SUPPORT_APP_ROATION 1
89 #define SUPPORT_LCD_TIMEOUT_KEEPING 0
90 #define USE_DEVICE_SET_DISPLAY_BRT 1
92 #define LOW_BATTERY_DO_NOTHING 1 /**< 1 : turn the low batter handlding off */
94 #define APPLIED_BACK_KEY_UG 0
96 #define APPLIED_DATATIME_FIRSTDAY_WEEK 0
97 #define SUPPORT_DATEFIELD_DATE_FORMAT_AUTOSET 0
100 #define SUPPORT_PARENTAL_MODE 0
102 #define SETTING_ENABLE_TRACE
104 #ifdef SETTING_ENABLE_TRACE
105 #ifdef SETTING_USING_PLATFORM_DBG
106 #define SETTING_TRACE_DEBUG(fmt, arg...) \
108 LOGD("\n\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
109 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
112 #define SETTING_TRACE(fmt, arg...) \
114 LOGI("\n\033[0;36m" fmt "\033[0m\t%s:%d\n", \
115 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
118 #define SETTING_TRACE_WARNING(fmt, arg...) \
120 LOGW("\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
123 #define SETTING_TRACE_ERROR(fmt, arg...) \
125 LOGE("\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
127 #define SETTING_TRACE_BEGIN do {\
129 LOGD("\n\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
130 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
134 #define SETTING_TRACE_END do {\
136 LOGD("\n\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
137 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
141 #define SETTING_TRACE(fmt, arg...) \
143 printf("\n[SETTING]\033[0;36m" fmt "\033[0m\t%s:%d\n", \
144 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
148 #define SETTING_TRACE_DEBUG(fmt, arg...) \
150 printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
151 ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
154 #define SETTING_TRACE_WARNING(fmt, arg...) \
157 printf("[SETTING]\033[0;33mWARRING: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
160 #define SETTING_TRACE_ERROR(fmt, arg...) \
162 {fprintf(stderr, "[SETTING]\033[0;31mERROR: " fmt "\033[0m\t%s:%d\n", ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);}\
165 #define SETTING_TRACE_BEGIN do {\
167 printf("\n[SETTING]\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
168 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
172 #define SETTING_TRACE_END do {\
174 printf("\n[SETTING]\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
175 __FUNCTION__, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
180 #define SETTING_TRACE(fmt, arg...)
181 #define SETTING_TRACE_DEBUG(fmt, arg...)
182 #define SETTING_TRACE_WARNING(fmt, arg...)
183 #define SETTING_TRACE_ERROR(fmt, arg...)
184 #define SETTING_TRACE_BEGIN
185 #define SETTING_TRACE_END
188 #define setting_retvm_if(expr, val, fmt, arg...) do { \
190 SETTING_TRACE_ERROR(fmt, ##arg); \
195 #define setting_retm_if(expr, fmt, arg...) do { \
197 SETTING_TRACE_ERROR(fmt, ##arg); \
203 #define retm_if setting_retm_if
206 #define retvm_if setting_retvm_if
210 #define retv_if(expr, val) do { \
217 #define ret_if(expr) do { \
224 #define __FREE(del, arg) do { \
226 del((void *)(arg)); /*cast any argument to (void*) to avoid build warring*/\
230 #define FREE(arg) __FREE(free, arg)
231 #define G_FREE(arg) __FREE(g_free, arg)
235 //a trick:To manager back pointer. eg,
236 //For using genlist, whenever Setting side and Genlist side both keep pointers
237 //to a same block memory(here is genlis item data via calloc), must use __BACK_POINTER_SET to
238 //bind the Setting side point into the Genlist side pointer
239 #define __BACK_POINTER_SET(pData) do { \
242 pData->pBack = (void **)(&(pData));\
246 #define __BACK_POINTER_UNSET(pData) do { \
247 if (pData && pData->pBack)/*release Setting side poniter handlers*/\
249 *(pData->pBack) = NULL;\
254 #endif /* _SETTING_DEBUG_H_ */