2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include <Elementary.h>
19 #include <app_debug.h>
32 static Evas_Object *_add_win(const char *name)
36 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
40 elm_win_title_set(win, name);
41 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
42 evas_object_show(win);
47 static bool _create(void *user_data)
52 _ERR("Invalid argument");
58 elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
60 ad->win = _add_win(ad->name);
62 _ERR("failed to create window");
66 if (!viewmgr_create(ad->win)) {
67 _ERR("failed to create viewmgr");
68 evas_object_del(ad->win);
73 viewmgr_add_view(view_main_get_vclass(), NULL);
78 static void _terminate(void *user_data)
89 evas_object_del(ad->win);
93 static void _pause(void *user_data)
98 static void _resume(void *user_data)
103 static void _control(app_control_h app_control, void *user_data)
108 _ERR("Invalid argument");
115 elm_win_activate(ad->win);
116 viewmgr_push_view(VIEW_MAIN);
120 int main(int argc, char **argv)
124 ui_app_lifecycle_callback_s event_callback = {0,};
126 event_callback.create = _create;
127 event_callback.terminate = _terminate;
128 event_callback.pause = _pause;
129 event_callback.resume = _resume;
130 event_callback.app_control = _control;
132 memset(&ad, 0x00, sizeof(ad));
135 return ui_app_main(argc, argv, &event_callback, &ad);