Update the project to the newest version.
[framework/appfw/shortcut.git] / test / application.c
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
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
7  *
8  * http://www.tizenopensource.org/license
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 <Elementary.h>
18 #include <shortcut.h>
19
20 static int result_cb(int ret, int pid, void *data)
21 {
22         printf("Client: Return %d (%d)\n", ret, pid);
23         //elm_exit();
24         return 0;
25 }
26
27 static Eina_Bool shortcut_add_cb(void *data)
28 {
29         int ret;
30
31         ret = add_to_home_shortcut("pkgname", "MyName", 0, "/usr/bin/true", "/opt/share/image/what.png", result_cb, NULL);
32         printf("Client: shortcut_add_to_home returns: %d\n", ret);
33
34         ret = add_to_home_livebox("pkgname", "MyName", 0, "/usr/bin/true", "/opt/share/image/what.png", 1.0f, result_cb, NULL);
35         printf("Client: shortcut_add_to_home_with_period returns: %d\n", ret);
36
37         return ECORE_CALLBACK_RENEW;
38 }
39
40 int elm_main(int argc, char *argv[])
41 {
42         Ecore_Timer *timer;
43
44         timer = ecore_timer_add(3.0f, shortcut_add_cb, NULL);
45         if (!timer) {
46                 printf("Failed to add a timer\n");
47         }
48
49         elm_run();
50         elm_shutdown();
51
52         return 0;
53 }
54
55 ELM_MAIN()
56 /* End of a file */