Merge "[stackicon] remove trailing whitespaces"
[framework/uifw/elementary.git] / src / examples / transit_example_02.c
1 //Compile with:
2 //gcc -g -DPACKAGE_DATA_DIR="\"<directory>\"" `pkg-config --cflags --libs elementary` transit_example_02.c -o transit_example_02
3 // where directory is the a path where images/plant_01.jpg can be found.
4
5 #include <Elementary.h>
6 #ifdef HAVE_CONFIG_H
7 # include "elementary_config.h"
8 #else
9 # define __UNUSED__
10 #endif
11
12 static void
13 on_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
14 {
15    /* quit the mainloop (elm_run) */
16    elm_exit();
17 }
18
19 int
20 elm_main(int argc __UNUSED__, char **argv __UNUSED__)
21 {
22    Evas_Object *win, *bg, *bt, *bt2, *bt3, *bt4;
23    Elm_Transit *trans, *trans2, *trans3, *trans4;
24
25    win = elm_win_add(NULL, "transit9", ELM_WIN_BASIC);
26    elm_win_title_set(win, "Transit 9");
27    elm_win_autodel_set(win, EINA_TRUE);
28    evas_object_resize(win, 400, 400);
29    evas_object_show(win);
30
31    bg = elm_bg_add(win);
32    elm_win_resize_object_add(win, bg);
33    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
34    evas_object_show(bg);
35
36    bt = elm_button_add(win);
37    elm_object_text_set(bt, "Chain 1");
38    evas_object_resize(bt, 100, 100);
39    evas_object_move(bt, 0, 0);
40    evas_object_show(bt);
41
42    bt2 = elm_button_add(win);
43    elm_object_text_set(bt2, "Chain 2");
44    evas_object_resize(bt2, 100, 100);
45    evas_object_move(bt2, 300, 0);
46    evas_object_show(bt2);
47
48    bt3 = elm_button_add(win);
49    elm_object_text_set(bt3, "Chain 3");
50    evas_object_resize(bt3, 100, 100);
51    evas_object_move(bt3, 300, 300);
52    evas_object_show(bt3);
53
54    bt4 = elm_button_add(win);
55    elm_object_text_set(bt4, "Chain 4");
56    evas_object_resize(bt4, 100, 100);
57    evas_object_move(bt4, 0, 300);
58    evas_object_show(bt4);
59
60    trans = elm_transit_add();
61    elm_transit_tween_mode_set(trans, ELM_TRANSIT_TWEEN_MODE_ACCELERATE);
62    elm_transit_effect_translation_add(trans, 0, 0, 300, 0);
63    elm_transit_object_add(trans, bt);
64    elm_transit_duration_set(trans, 1);
65    elm_transit_objects_final_state_keep_set(trans, EINA_TRUE);
66    elm_transit_go(trans);
67
68    trans2 = elm_transit_add();
69    elm_transit_tween_mode_set(trans2, ELM_TRANSIT_TWEEN_MODE_ACCELERATE);
70    elm_transit_effect_translation_add(trans2, 0, 0, 0, 300);
71    elm_transit_object_add(trans2, bt2);
72    elm_transit_duration_set(trans2, 1);
73    elm_transit_objects_final_state_keep_set(trans2, EINA_TRUE);
74    elm_transit_chain_transit_add(trans, trans2);
75
76    trans3 = elm_transit_add();
77    elm_transit_tween_mode_set(trans3, ELM_TRANSIT_TWEEN_MODE_ACCELERATE);
78    elm_transit_effect_translation_add(trans3, 0, 0, -300, 0);
79    elm_transit_object_add(trans3, bt3);
80    elm_transit_duration_set(trans3, 1);
81    elm_transit_objects_final_state_keep_set(trans3, EINA_TRUE);
82    elm_transit_chain_transit_add(trans2, trans3);
83
84    trans4 = elm_transit_add();
85    elm_transit_tween_mode_set(trans4, ELM_TRANSIT_TWEEN_MODE_ACCELERATE);
86    elm_transit_effect_translation_add(trans4, 0, 0, 0, -300);
87    elm_transit_object_add(trans4, bt4);
88    elm_transit_duration_set(trans4, 1);
89    elm_transit_objects_final_state_keep_set(trans4, EINA_TRUE);
90    elm_transit_chain_transit_add(trans3, trans4);
91
92    elm_run();
93
94    return 0;
95 }
96
97 ELM_MAIN()