Remove trivial unnecessary build dependency
[apps/core/preloaded/lockscreen.git] / src / lockscreen.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 <stdio.h>
18 #include <stdlib.h>
19
20 #include <Evas.h>
21 #include <Elementary.h>
22 #include <Eina.h>
23
24 #include <app.h>
25
26 #include "lockscreen.h"
27 #include "log.h"
28 #include "main_ctrl.h"
29
30 static Eina_Bool _lock_idler_cb(void *data)
31 {
32         lockscreen_main_ctrl_init();
33
34         return ECORE_CALLBACK_CANCEL;
35 }
36
37 bool _create_app(void *data)
38 {
39         DBG("Lockscreen launch request.");
40         elm_config_accel_preference_set("opengl");
41         DBG("base scale : %f", elm_app_base_scale_get());
42         DBG("edje scale : %f", edje_scale_get());
43
44         /* Quickfix: run real creation in idler since running device/display API here
45          * causes SIGSEGV */
46         ecore_idler_add(_lock_idler_cb, NULL);
47
48         return true;
49 }
50
51 void _terminate_app(void *data)
52 {
53         DBG("Lockscreen terminated request.");
54 }
55
56 int main(int argc, char *argv[])
57 {
58         int ret = 0;
59
60         ui_app_lifecycle_callback_s lifecycle_callback = {0,};
61
62         lifecycle_callback.create = _create_app;
63         lifecycle_callback.terminate = _terminate_app;
64
65         ret = ui_app_main(argc, argv, &lifecycle_callback, NULL);
66         if (ret != APP_ERROR_NONE) {
67                 ERR("ui_app_main failed: %s", get_error_message(ret));
68         }
69
70         return ret;
71 }