2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://www.tizenopensource.org/license
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.
22 #include "draglock-ui.h"
23 #include "draglock-util.h"
25 static void device_orientation(app_device_orientation_e orientation,
27 struct appdata *ad = (struct appdata *) user_data;
29 if (ad == NULL || ad->win == NULL)
33 static bool app_create(void *user_data) {
34 struct appdata *ad = (struct appdata *) user_data;
39 DRAGLOCK_DBG("launching draglock");
45 ecore_x_window_size_get(ecore_x_window_root_first_get(), &ad->win_w,
47 DRAGLOCK_DBG("window size(%d,%d)", ad->win_w, ad->win_h);
52 win = draglock_util_add_window(name);
57 evas_object_show(win);
59 ad->scale = elm_scale_get();
61 bg = draglock_util_add_bg(win);
63 draglock_ui_create(ad);
70 static void app_terminate(void *user_data) {
71 struct appdata *ad = (struct appdata *) user_data;
77 draglock_ui_destroy(ad);
80 evas_object_del(ad->win);
83 static void app_pause(void *user_data) {
84 struct appdata *ad = (struct appdata *) user_data;
88 static void app_resume(void *user_data) {
89 struct appdata *ad = (struct appdata *) user_data;
93 static void app_service(service_h service, void *user_data) {
94 struct appdata *ad = (struct appdata *) user_data;
101 elm_win_activate(ad->win);
104 int main(int argc, char *argv[]) {
107 app_event_callback_s event_callback;
109 event_callback.create = app_create;
110 event_callback.terminate = app_terminate;
111 event_callback.pause = app_pause;
112 event_callback.resume = app_resume;
113 event_callback.service = app_service;
114 event_callback.low_memory = NULL;
115 event_callback.low_battery = NULL;
116 event_callback.device_orientation = device_orientation;
117 event_callback.language_changed = NULL;
118 event_callback.region_format_changed = NULL;
120 memset(&ad, 0x0, sizeof(struct appdata));
122 return app_efl_main(&argc, &argv, &event_callback, &ad);