3 * Copyright 2012 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license/
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
22 #include "_util_log.h"
23 #include "_util_efl.h"
31 static Eina_Bool rotate_cb(void *data, int type, void *event)
33 struct appdata *ad = data;
34 Ecore_X_Event_Client_Message *ev = event;
36 retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
38 return ECORE_CALLBACK_RENEW;
41 if (ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE){
44 return ECORE_CALLBACK_RENEW;
47 static int app_create(void *data)
49 struct appdata *ad = data;
51 retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
53 if(_app_create(ad)!=0){
54 _E("_app_create() if failed\n");
58 /* add rotation event callback */
59 ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
60 rotate_cb, (void *)data);
65 static int app_terminate(void *data)
67 struct appdata *ad = data;
70 evas_object_del(ad->win);
75 static int app_pause(void *data)
81 static int app_resume(void *data)
86 static int app_reset(bundle *b, void *data)
89 struct appdata *ad = data;
90 retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
92 if(_app_reset(b, data) == -1){
93 _D("_app_reset() if failed\n");
97 elm_win_activate(ad->win);
102 int main(int argc, char *argv[])
105 struct appcore_ops ops = {
106 .create = app_create,
107 .terminate = app_terminate,
109 .resume = app_resume,
113 /* appcore measure time example */
114 printf("from AUL to %s(): %d msec\n", __func__,
115 appcore_measure_time_from("APP_START_TIME"));
117 memset(&ad, 0x0, sizeof(struct appdata));
120 return appcore_efl_main(PACKAGE, &argc, &argv, &ops);