tizen 2.4 release
[apps/home/attach-panel.git] / sample / sample.h
1 /*
2  * Samsung API
3  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/license/
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an AS IS BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18
19 #ifndef __ATTACK_PANEL_SAMPLE_H__
20 #define __ATTACK_PANEL_SAMPLE_H__
21
22 #include <dlog.h>
23
24
25 #define BASE_WIDTH 1280
26 #define BASE_HEIGHT 720
27
28
29 //log
30 #if !defined(_D)
31 #define _D(fmt, arg...) LOGD(fmt"\n", ##arg)
32 #endif
33
34 #if !defined(_W)
35 #define _W(fmt, arg...) LOGW(fmt"\n", ##arg)
36 #endif
37
38 #if !defined(_E)
39 #define _E(fmt, arg...) LOGE(fmt"\n", ##arg)
40 #endif
41
42 #define retv_if(expr, val) do { \
43         if(expr) { \
44                 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
45                 return (val); \
46         } \
47 } while (0)
48
49 #define ret_if(expr) do { \
50         if(expr) { \
51                 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
52                 return; \
53         } \
54 } while (0)
55
56 #define goto_if(expr, val) do { \
57         if(expr) { \
58                 _E("(%s) -> goto", #expr); \
59                 goto val; \
60         } \
61 } while (0)
62
63
64 #endif