4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jongmun Woo <jongmun.woo@samsung.com>, Young-Ae Kang <youngae.kang@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.
24 #ifndef HEREMAPS_UC_COMMON_H_
25 #define HEREMAPS_UC_COMMON_H_
35 #include <vconf-internal-location-keys.h>
39 #include <Elementary.h>
43 #include <efl_extension.h>
44 #include <system_info.h>
46 #if !defined(HEREMAPS_UC_PKG)
47 #define HEREMAPS_UC_PKG "org.tizen.heremaps-uc"
50 #define DOMAIN_NAME HEREMAPS_UC_PKG
52 #define TAG_HEREMAPS_UC "HEREMAPS_UC"
53 #define HEREMAPS_UC_DLOG_DEBUG
55 #ifdef HEREMAPS_UC_DLOG_DEBUG /**< if debug mode, show filename & line number */
59 #define LOG_TAG TAG_HEREMAPS_UC
62 #define LS_LOGD(fmt,args...) LOGD(fmt, ##args)
63 #define LS_LOGW(fmt,args...) LOGW(fmt, ##args)
64 #define LS_LOGI(fmt,args...) LOGI(fmt, ##args)
65 #define LS_LOGE(fmt,args...) LOGE(fmt, ##args)
67 #elif HEREMAPS_UC_DLOG_RELEASE /* if release mode */
71 #define LOG_TAG TAG_HEREMAPS_UC
74 #define LS_LOGD(fmt,args...) LOGD(fmt, ##args)
75 #define LS_LOGW(fmt,args...) LOGW(fmt, ##args)
76 #define LS_LOGI(fmt,args...) LOGI(fmt, ##args)
77 #define LS_LOGE(fmt,args...) LOGE(fmt, ##args)
78 #else /* if do not use dlog */
79 #define LS_LOGD(...) g_debug(__VA_ARGS__)
80 #define LS_LOGW(...) g_warning(__VA_ARGS__)
81 #define LS_LOGI(...) g_message(__VA_ARGS__)
82 #define LS_LOGE(...) g_error(__VA_ARGS__)
85 #define P_(s) dgettext(HEREMAPS_UC_PKG, s)
86 #define S_(s) dgettext("sys_string", s)
87 #define dgettext_noop(s) (s)
88 #define N_(s) dgettext_noop(s)
91 #define KEY_DISABLED 0
93 #define LS_FUNC_ENTER LS_LOGD("(%s) ENTER", __FUNCTION__);
94 #define LS_FUNC_EXIT LS_LOGD("(%s) EXIT", __FUNCTION__);
96 #define SAFE_STRDUP(src) (src) ? strdup(src) : NULL
98 #define LS_MEM_FREE(ptr) \
107 #define LS_MEM_NEW(ptr, num_elements, type) \
109 if ((int)(num_elements) <= 0) { \
112 ptr = (type *) calloc(num_elements, sizeof(type)); \
117 #define LS_RETURN_IF_FAILED(point) do { \
118 if (point == NULL) { \
119 LS_LOGE("critical error : LS_RETURN_IF_FAILED"); \
124 #define LS_RETURN_VAL_IF_FAILED(point, val) do { \
125 if (point == NULL) { \
126 LS_LOGE("critical error : NAVI_RETURN_VAL_IS_FAILED"); \
131 typedef struct appdata
133 app_control_h app_control;
135 Evas_Object *win_main;
136 Evas_Object *conformant;
137 Evas_Object *layout_main;
140 } heremaps_uc_app_data;
144 #endif /*__cplusplus */
146 #endif /* HEREMAPS_UC_COMMON_H_ */