3696307a35c655eaa271216e2f3ed27f71f0145e
[framework/uifw/elementary.git] / src / examples / transit_example_01.c
1 //Compile with:
2 //gcc -g -DPACKAGE_DATA_DIR="\"<directory>\"" `pkg-config --cflags --libs elementary` transit_example_01.c -o transit_example_01
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;
23    Elm_Transit *trans;
24
25    win = elm_win_add(NULL, "transit-basic", ELM_WIN_BASIC);
26    elm_win_title_set(win, "Transit - Basic");
27    evas_object_smart_callback_add(win, "delete,request", on_done, NULL);
28    elm_win_autodel_set(win, EINA_TRUE);
29    evas_object_resize(win, 400, 400);
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, "Resizing Effect");
38    evas_object_show(bt);
39    evas_object_move(bt, 50, 100);
40    evas_object_resize(bt, 100, 50);
41
42    evas_object_show(win);
43
44    trans = elm_transit_add();
45    elm_transit_object_add(trans, bt);
46
47    elm_transit_effect_resizing_add(trans, 100, 50, 300, 150);
48
49    elm_transit_duration_set(trans, 5.0);
50    elm_transit_go(trans);
51
52    elm_run();
53
54    return 0;
55 }
56
57 ELM_MAIN()