4 #define PACKAGE_EXAMPLES_DIR "."
9 #include <Ecore_Evas.h>
17 _on_delete(Ecore_Evas *ee)
19 ecore_main_loop_quit();
23 main(int argc __UNUSED__, char **argv)
25 char edje_file_path[PATH_MAX];
26 const char *edje_file = "animations2.edj";
30 Evas_Object *edje_obj;
33 if (!ecore_evas_init()) return EXIT_FAILURE;
35 if (!edje_init()) goto shutdown_ecore_evas;
37 pfx = eina_prefix_new(argv[0], main, "EDJE_EXAMPLES", "edje/examples",
38 edje_file, PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
39 PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
41 if (!pfx) goto shutdown_edje;
43 ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
45 if (!ee) goto eina_prefix_free;
47 ecore_evas_callback_delete_request_set(ee, _on_delete);
48 ecore_evas_title_set(ee, "Animations");
50 evas = ecore_evas_get(ee);
52 bg = evas_object_rectangle_add(evas);
53 evas_object_color_set(bg, 255, 255, 255, 255);
54 evas_object_move(bg, 0, 0);
55 evas_object_resize(bg, WIDTH, HEIGHT);
58 ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
59 evas_object_focus_set(bg, EINA_TRUE);
61 edje_obj = edje_object_add(evas);
63 snprintf(edje_file_path, sizeof(edje_file_path), "%s/examples/%s",
64 eina_prefix_data_get(pfx), edje_file);
66 if (!edje_object_file_set(edje_obj, edje_file_path, "animation_group"))
68 int err = edje_object_load_error_get(edje_obj);
69 const char *errmsg = edje_load_error_str(err);
70 fprintf(stderr, "Could not load the edje file - reason:%s\n", errmsg);
71 goto eina_prefix_free;
74 evas_object_resize(edje_obj, 700, 700);
75 evas_object_move(edje_obj, 50, 50);
76 evas_object_show(edje_obj);
80 ecore_main_loop_begin();
82 eina_prefix_free(pfx);
85 ecore_evas_shutdown();
89 eina_prefix_free: eina_prefix_free(pfx);
91 shutdown_edje: edje_shutdown();
93 shutdown_ecore_evas: ecore_evas_shutdown();