0283242ae06d8ca47720e61122efa93b0c216dae
[apps/home/draglock.git] / include / draglock.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 #ifndef __DRAGLOCK_H__
18 #define __DRAGLOCK_H__
19
20 #include <Elementary.h>
21 #include <power.h>
22
23 #ifdef  LOG_TAG
24 #undef  LOG_TAG
25 #endif
26 #define LOG_TAG "DRAGLOCK"
27
28 #include <dlog.h>
29
30 #define DRAGLOCK_ERR(fmt, arg...)  LOGE("["LOG_TAG"%s:%d:E] : %s "fmt, __FILE__, __LINE__, __func__, ##arg)
31 #define DRAGLOCK_DBG(fmt, arg...)  LOGD("["LOG_TAG"%s:%d:D] : %s "fmt, __FILE__, __LINE__, __func__, ##arg)
32 #define DRAGLOCK_WARN(fmt, arg...) LOGW("["LOG_TAG"%s:%d:D] : %s "fmt, __FILE__, __LINE__, __func__, ##arg)
33
34 #if !defined(PACKAGE)
35 #define PACKAGE "draglock"
36 #endif
37
38 #if !defined(PKGNAME)
39 #define PKGNAME "org.tizen."PACKAGE
40 #endif
41
42 #if !defined(EDJEDIR)
43 #define EDJEDIR "/opt/apps/"PKGNAME"/res/edje"
44 #endif
45
46 #define EDJEFILE EDJEDIR"/"PACKAGE".edj"
47
48 #define _EDJ(x) elm_layout_edje_get(x)
49
50 #define DEFAULT_WIN_WIDTH 720
51 #define DEFAULT_SLIDE_HEIGHT 114
52 #define DEFAULT_SLIDE_Y 1116
53 #define SLIDE_RATIO_H 0.089
54 #define SLIDE_RATIO_Y 0.872
55
56 struct appdata {
57         Evas_Object *win;
58
59         int win_w;
60         int win_h;
61
62         double scale;
63
64         Evas_Object *ui_layout;
65         Evas_Object *time_layout;
66         Evas_Object *slide_layout;
67
68         Ecore_Timer *clock_timer;
69
70         int slide_status; // 0 : invalid 1 : valid
71         int slide_step;
72
73         Evas_Coord_Rectangle slide_rel1;
74         Evas_Coord_Rectangle slide_rel2;
75
76         power_state_e power_state;
77 };
78
79 #endif /* __DRAGLOCK_H__ */