apply FSL(Flora Software License)
[apps/core/preloaded/image-viewer.git] / include / image-viewer.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
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
7  *
8  *        http://www.tizenopensource.org/license
9  *
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.
15  */
16
17
18 #include <Elementary.h>
19
20 #define IV_LOG_OUTPUT_DLOG
21
22 #ifdef IV_LOG_OUTPUT_DLOG
23
24 #include <dlog.h>
25
26 #undef LOG_TAG
27 #define LOG_TAG "IMAGE-VIEWER"
28
29 #define iv_debug_msg(type, fmt, arg...) LOGD("[%s : %05d]" fmt "\n", __func__, __LINE__, ##arg)
30
31 #else /*IV_LOG_OUTPUT_DLOG*/
32
33 #define iv_debug_msg(type, fmt,arg...)  fprintf(stdout, "[%s: %d] [%s]" fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg)
34
35 #endif
36
37
38 #  define iv_ret_if(expr) do { \
39                 if(expr) { \
40                         fprintf(stderr, "(%s) -> %s:%d() return\n", #expr, __func__, __LINE__); \
41                         return; \
42                 } \
43         } while (0)
44
45 #  define iv_retv_if(expr, val) do { \
46                 if(expr) { \
47                         fprintf(stderr, "(%s) -> %s():%d return\n", #expr, __func__, __LINE__); \
48                         return (val); \
49                 } \
50         } while (0)
51
52 typedef struct appdata_iv
53 {
54         int win_w;
55         int win_h;
56
57         Evas *evas;
58         Evas_Object* win_main;
59         Evas_Object* ly_main;
60
61         struct ui_gadget *iv_ug;
62
63         Evas_Object* iv_bg;
64         const char* iv_param_path;
65         const char* sort_type;
66         const char* view_mode;
67         const char* media_type;
68         const char* view_by;
69
70 } appdata_iv;
71