2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CLK_FWK_DEFINE_H__
18 #define __CLK_FWK_DEFINE_H__
20 #include "clock_fwk_dlog.h"
32 #define LOG_TAG "CLK_COM"
37 #define _(s) dgettext(PACKAGE, s)
38 #define S_(x) dgettext("sys_string", x)
40 #define IS_EQUAL(a, b) ((a) == (b))
41 #define NULL_CHECK(p) IS_EQUAL(p, NULL)
42 #define NOT_NULL(p) !NULL_CHECK(p)
43 #define IS_STR_EQUAL(a, b) (!strcmp(a, b))
44 #define IS_STR_NOT_EQUAL(a, b) (strcmp(a, b))
45 #define ASSERT(p) assert(p)
47 #define CALLOC(num, type) (type *)calloc(num, sizeof(type))
48 //******************define:free *************************************
49 #define FREEIF(p) if (p) {free(p); p = NULL; }
50 #define FREERIF_FN(p, fn) if (p) {fn(p); p = NULL; }
51 #define EVAS_OBJECT_DELIF(p) if (p) {evas_object_del(p); p = NULL; }
52 #define ELM_GENLIST_ITEM_DELIF(p) if (p) {elm_object_item_del(p); p = NULL; }
53 #define EVAS_OBJECT_SHOWIF(p) if (p) {evas_object_show(p); }
54 #define ECORE_TIMER_DELIF(p) if (p) {ecore_timer_del(p); p = NULL; }
55 #define ECORE_FILE_MONITOR_DELIF(p) if (p) {ecore_file_monitor_del(p); p = NULL; }
56 #define ECORE_EVENT_HANDLER_DELIF(p) if (p) {ecore_event_handler_del(p); p = NULL; }
57 #define ELM_SLIDER_VALUE_GET(p) (elm_slider_value_get(p)+0.5)
60 #define _EDJ(obj) elm_layout_edje_get(obj)
62 //******************set time *************************************
63 #define SET_TIME_DATA_T(pTime_data, YEAR, MONTH, DAY, HOUR, MIN, SEC) \
65 (pTime_data)->year = (YEAR);\
66 (pTime_data)->month = (MONTH);\
67 (pTime_data)->day = (DAY);\
68 (pTime_data)->hour = (HOUR);\
69 (pTime_data)->min = (MIN);\
70 (pTime_data)->sec = (SEC);\
73 #define BUF_SIZE_32 (32)
74 #define BUF_SIZE_64 (64)
75 #define BUF_SIZE_128 (128)
76 #define BUF_SIZE_256 (256)
85 struct _tc { /* text class */
86 char *name; /* text class name */
87 int size; /* font size */
90 struct _ts { /* text set */
91 char *name; /* part name */
92 char *msgid; /* message ID */
100 typedef struct _Edje_Color_Class {
107 #endif //__CLK_FWK_DEFINE_H__