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