diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/examples/ecore_evas_callbacks.c | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/libraries/ecore/src/examples/ecore_evas_callbacks.c b/libraries/ecore/src/examples/ecore_evas_callbacks.c new file mode 100644 index 0000000..31b724d --- /dev/null +++ b/libraries/ecore/src/examples/ecore_evas_callbacks.c | |||
@@ -0,0 +1,127 @@ | |||
1 | /** | ||
2 | * Ecore example illustrating ecore evas callbacks. | ||
3 | * | ||
4 | * You'll need at least one Evas engine built for it (excluding the | ||
5 | * buffer one). See stdout/stderr for output. | ||
6 | * | ||
7 | * @verbatim | ||
8 | * gcc -o ecore_evas_callbacks ecore_evas_callbacks.c `pkg-config --libs --cflags ecore-evas` | ||
9 | * @endverbatim | ||
10 | */ | ||
11 | |||
12 | #include <Ecore.h> | ||
13 | #include <Ecore_Evas.h> | ||
14 | |||
15 | static void | ||
16 | _destroy(Ecore_Evas *ee) | ||
17 | { | ||
18 | printf("destroy\n"); | ||
19 | ecore_main_loop_quit(); | ||
20 | } | ||
21 | |||
22 | static void | ||
23 | _delete(Ecore_Evas *ee) | ||
24 | { | ||
25 | printf("delete\n"); | ||
26 | ecore_main_loop_quit(); | ||
27 | } | ||
28 | |||
29 | static void | ||
30 | _focus_in(Ecore_Evas *ee) | ||
31 | { | ||
32 | printf("focus_in\n"); | ||
33 | } | ||
34 | |||
35 | static void | ||
36 | _focus_out(Ecore_Evas *ee) | ||
37 | { | ||
38 | printf("focus_out\n"); | ||
39 | } | ||
40 | |||
41 | static void | ||
42 | _hide(Ecore_Evas *ee) | ||
43 | { | ||
44 | printf("hide\n"); | ||
45 | } | ||
46 | |||
47 | static void | ||
48 | _mouse_in(Ecore_Evas *ee) | ||
49 | { | ||
50 | printf("mouse_in\n"); | ||
51 | } | ||
52 | |||
53 | static void | ||
54 | _show(Ecore_Evas *ee) | ||
55 | { | ||
56 | printf("show\n"); | ||
57 | } | ||
58 | |||
59 | static void | ||
60 | _mouse_out(Ecore_Evas *ee) | ||
61 | { | ||
62 | printf("mouse_out\n"); | ||
63 | } | ||
64 | |||
65 | static void | ||
66 | _move(Ecore_Evas *ee) | ||
67 | { | ||
68 | printf("move\n"); | ||
69 | } | ||
70 | |||
71 | static void | ||
72 | _post_render(Ecore_Evas *ee) | ||
73 | { | ||
74 | printf("post_render\n"); | ||
75 | } | ||
76 | |||
77 | static void | ||
78 | _pre_free(Ecore_Evas *ee) | ||
79 | { | ||
80 | printf("pre_free\n"); | ||
81 | } | ||
82 | |||
83 | static void | ||
84 | _pre_render(Ecore_Evas *ee) | ||
85 | { | ||
86 | printf("pre_render\n"); | ||
87 | } | ||
88 | |||
89 | static void | ||
90 | _resize(Ecore_Evas *ee) | ||
91 | { | ||
92 | printf("resize\n"); | ||
93 | } | ||
94 | |||
95 | int | ||
96 | main(void) | ||
97 | { | ||
98 | Ecore_Evas *ee; | ||
99 | |||
100 | ecore_evas_init(); | ||
101 | |||
102 | ee = ecore_evas_new(NULL, 0, 0, 200, 100, NULL); | ||
103 | ecore_evas_title_set(ee, "Ecore Evas Callbacks Example"); | ||
104 | ecore_evas_show(ee); | ||
105 | |||
106 | //callbacks | ||
107 | ecore_evas_callback_delete_request_set(ee, _delete); | ||
108 | ecore_evas_callback_destroy_set(ee, _destroy); | ||
109 | ecore_evas_callback_focus_in_set(ee, _focus_in); | ||
110 | ecore_evas_callback_focus_out_set(ee, _focus_out); | ||
111 | ecore_evas_callback_hide_set(ee, _hide); | ||
112 | ecore_evas_callback_mouse_in_set(ee, _mouse_in); | ||
113 | ecore_evas_callback_mouse_out_set(ee, _mouse_out); | ||
114 | ecore_evas_callback_move_set(ee, _move); | ||
115 | ecore_evas_callback_post_render_set(ee, _post_render); | ||
116 | ecore_evas_callback_pre_free_set(ee, _pre_free); | ||
117 | ecore_evas_callback_pre_render_set(ee, _pre_render); | ||
118 | ecore_evas_callback_resize_set(ee, _resize); | ||
119 | ecore_evas_callback_show_set (ee, _show); | ||
120 | |||
121 | ecore_main_loop_begin(); | ||
122 | |||
123 | ecore_evas_free(ee); | ||
124 | ecore_evas_shutdown(); | ||
125 | |||
126 | return 0; | ||
127 | } | ||