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>
40 #include <Elementary.h>
44 #include <efl_extension.h>
45 #include <system_info.h>
47 #if !defined(HEREMAPS_UC_PKG)
48 #define HEREMAPS_UC_PKG "org.tizen.heremaps-uc"
51 #define DOMAIN_NAME HEREMAPS_UC_PKG
53 #define TAG_HEREMAPS_UC "HEREMAPS_UC"
54 #define HEREMAPS_UC_DLOG_DEBUG
56 #ifdef HEREMAPS_UC_DLOG_DEBUG /**< if debug mode, show filename & line number */
60 #define LOG_TAG TAG_HEREMAPS_UC
63 #define LS_LOGD(fmt,args...) LOGD(fmt, ##args)
64 #define LS_LOGW(fmt,args...) LOGW(fmt, ##args)
65 #define LS_LOGI(fmt,args...) LOGI(fmt, ##args)
66 #define LS_LOGE(fmt,args...) LOGE(fmt, ##args)
68 #elif HEREMAPS_UC_DLOG_RELEASE /* if release mode */
72 #define LOG_TAG TAG_HEREMAPS_UC
75 #define LS_LOGD(fmt,args...) LOGD(fmt, ##args)
76 #define LS_LOGW(fmt,args...) LOGW(fmt, ##args)
77 #define LS_LOGI(fmt,args...) LOGI(fmt, ##args)
78 #define LS_LOGE(fmt,args...) LOGE(fmt, ##args)
79 #else /* if do not use dlog */
80 #define LS_LOGD(...) g_debug(__VA_ARGS__)
81 #define LS_LOGW(...) g_warning(__VA_ARGS__)
82 #define LS_LOGI(...) g_message(__VA_ARGS__)
83 #define LS_LOGE(...) g_error(__VA_ARGS__)
86 #define P_(s) dgettext(HEREMAPS_UC_PKG, s)
87 #define S_(s) dgettext("sys_string", s)
88 #define dgettext_noop(s) (s)
89 #define N_(s) dgettext_noop(s)
92 #define KEY_DISABLED 0
94 #define LS_FUNC_ENTER LS_LOGD("(%s) ENTER", __FUNCTION__);
95 #define LS_FUNC_EXIT LS_LOGD("(%s) EXIT", __FUNCTION__);
97 #define SAFE_STRDUP(src) (src) ? strdup(src) : NULL
99 #define LS_MEM_FREE(ptr) \
108 #define LS_MEM_NEW(ptr, num_elements, type) \
110 if ((int)(num_elements) <= 0) { \
113 ptr = (type *) calloc(num_elements, sizeof(type)); \
118 #define LS_RETURN_IF_FAILED(point) do { \
119 if (point == NULL) { \
120 LS_LOGE("critical error : LS_RETURN_IF_FAILED"); \
125 #define LS_RETURN_VAL_IF_FAILED(point, val) do { \
126 if (point == NULL) { \
127 LS_LOGE("critical error : NAVI_RETURN_VAL_IS_FAILED"); \
132 typedef struct appdata
134 app_control_h app_control;
136 Evas_Object *win_main;
137 Evas_Object *conformant;
138 Evas_Object *layout_main;
141 } heremaps_uc_app_data;
145 #endif /*__cplusplus */
147 #endif /* HEREMAPS_UC_COMMON_H_ */