modified code to use efl_util_set_notification_window_level() for setting notificatio...
[apps/core/preloaded/lockscreen.git] / src / window.c
1 /*
2  * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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 #include <Evas.h>
18 #include <Ecore.h>
19 #include <Elementary.h>
20 #include <vconf.h>
21 #include <efl_util.h>
22
23 #include "lockscreen.h"
24 #include "log.h"
25 #include "window.h"
26
27 #define STR_ATOM_PANEL_SCROLLABLE_STATE "_E_MOVE_PANEL_SCROLLABLE_STATE"
28
29 static struct _s_info {
30         Evas_Object *win;
31         int win_w;
32         int win_h;
33 } s_info = {
34         .win = NULL,
35         .win_w = 0,
36         .win_h = 0,
37 };
38
39 Evas_Object *lock_window_win_get(void)
40 {
41         return s_info.win;
42 }
43
44 int lock_window_width_get(void)
45 {
46         return s_info.win_w;
47 }
48
49 int lock_window_height_get(void)
50 {
51         return s_info.win_h;
52 }
53
54 Evas_Object *lock_window_create(int type)
55 {
56         int x = 0, y = 0, w = 0, h = 0;
57
58         Evas_Object *win = elm_win_add(NULL, "LOCKSCREEN", ELM_WIN_NOTIFICATION);
59         retv_if(!win, NULL);
60
61         elm_win_alpha_set(win, EINA_TRUE);
62         elm_win_title_set(win, "LOCKSCREEN");
63         elm_win_borderless_set(win, EINA_TRUE);
64         elm_win_autodel_set(win, EINA_TRUE);
65         efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM);
66
67         elm_win_screen_size_get(win, &x, &y, &w, &h);
68
69         s_info.win = win;
70         s_info.win_w = w;
71         s_info.win_h = h;
72
73         return win;
74 }