summaryrefslogtreecommitdiff
path: root/src/tests/emotion/emotion_test_main-eo.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-06-13 21:21:31 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-06-14 16:27:42 +0900
commitedc7675db6c928372163a877fc18ae9ef8a54c12 (patch)
treea04106a7dca4df61e73e0728194873634de7967c /src/tests/emotion/emotion_test_main-eo.c
parent77bd2819b92cb4cbd77a3d6676fea642b61f5fe6 (diff)
tests: Remove eo evas object events
This is the last usage, apart from evas_callbacks.c itself.
Diffstat (limited to '')
-rw-r--r--src/tests/emotion/emotion_test_main-eo.c67
1 files changed, 35 insertions, 32 deletions
diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c
index 01ca23925e..1b521dd210 100644
--- a/src/tests/emotion/emotion_test_main-eo.c
+++ b/src/tests/emotion/emotion_test_main-eo.c
@@ -118,7 +118,7 @@ bg_setup(void)
118 efl_gfx_stack_layer_set(o_bg, -999); 118 efl_gfx_stack_layer_set(o_bg, -999);
119 efl_gfx_visible_set(o_bg, EINA_TRUE); 119 efl_gfx_visible_set(o_bg, EINA_TRUE);
120 evas_obj_focus_set(o_bg, EINA_TRUE); 120 evas_obj_focus_set(o_bg, EINA_TRUE);
121 eo_event_callback_add(o_bg, EVAS_OBJECT_EVENT_KEY_DOWN, bg_key_down, NULL); 121 eo_event_callback_add(o_bg, EFL_EVENT_KEY_DOWN, bg_key_down, NULL);
122} 122}
123 123
124static void 124static void
@@ -134,51 +134,54 @@ broadcast_event(Emotion_Event ev)
134static Eina_Bool 134static Eina_Bool
135bg_key_down(void *data EINA_UNUSED, const Eo_Event *event) 135bg_key_down(void *data EINA_UNUSED, const Eo_Event *event)
136{ 136{
137 Evas_Event_Key_Down *ev = event->info; 137 Efl_Event_Key *ev = event->info;
138 Eina_List *l; 138 Eina_List *l;
139 Evas_Object *o; 139 Evas_Object *o;
140 const char *keyname = efl_event_key_name_get(ev);
140 141
141 if (!strcmp(ev->keyname, "Escape")) 142 if (!keyname) return EO_CALLBACK_CONTINUE;
143
144 if (!strcmp(keyname, "Escape"))
142 ecore_main_loop_quit(); 145 ecore_main_loop_quit();
143 else if (!strcmp(ev->keyname, "Up")) 146 else if (!strcmp(keyname, "Up"))
144 broadcast_event(EMOTION_EVENT_UP); 147 broadcast_event(EMOTION_EVENT_UP);
145 else if (!strcmp(ev->keyname, "Down")) 148 else if (!strcmp(keyname, "Down"))
146 broadcast_event(EMOTION_EVENT_DOWN); 149 broadcast_event(EMOTION_EVENT_DOWN);
147 else if (!strcmp(ev->keyname, "Left")) 150 else if (!strcmp(keyname, "Left"))
148 broadcast_event(EMOTION_EVENT_LEFT); 151 broadcast_event(EMOTION_EVENT_LEFT);
149 else if (!strcmp(ev->keyname, "Right")) 152 else if (!strcmp(keyname, "Right"))
150 broadcast_event(EMOTION_EVENT_RIGHT); 153 broadcast_event(EMOTION_EVENT_RIGHT);
151 else if (!strcmp(ev->keyname, "Return")) 154 else if (!strcmp(keyname, "Return"))
152 broadcast_event(EMOTION_EVENT_SELECT); 155 broadcast_event(EMOTION_EVENT_SELECT);
153 else if (!strcmp(ev->keyname, "m")) 156 else if (!strcmp(keyname, "m"))
154 broadcast_event(EMOTION_EVENT_MENU1); 157 broadcast_event(EMOTION_EVENT_MENU1);
155 else if (!strcmp(ev->keyname, "Prior")) 158 else if (!strcmp(keyname, "Prior"))
156 broadcast_event(EMOTION_EVENT_PREV); 159 broadcast_event(EMOTION_EVENT_PREV);
157 else if (!strcmp(ev->keyname, "Next")) 160 else if (!strcmp(keyname, "Next"))
158 broadcast_event(EMOTION_EVENT_NEXT); 161 broadcast_event(EMOTION_EVENT_NEXT);
159 else if (!strcmp(ev->keyname, "0")) 162 else if (!strcmp(keyname, "0"))
160 broadcast_event(EMOTION_EVENT_0); 163 broadcast_event(EMOTION_EVENT_0);
161 else if (!strcmp(ev->keyname, "1")) 164 else if (!strcmp(keyname, "1"))
162 broadcast_event(EMOTION_EVENT_1); 165 broadcast_event(EMOTION_EVENT_1);
163 else if (!strcmp(ev->keyname, "2")) 166 else if (!strcmp(keyname, "2"))
164 broadcast_event(EMOTION_EVENT_2); 167 broadcast_event(EMOTION_EVENT_2);
165 else if (!strcmp(ev->keyname, "3")) 168 else if (!strcmp(keyname, "3"))
166 broadcast_event(EMOTION_EVENT_3); 169 broadcast_event(EMOTION_EVENT_3);
167 else if (!strcmp(ev->keyname, "4")) 170 else if (!strcmp(keyname, "4"))
168 broadcast_event(EMOTION_EVENT_4); 171 broadcast_event(EMOTION_EVENT_4);
169 else if (!strcmp(ev->keyname, "5")) 172 else if (!strcmp(keyname, "5"))
170 broadcast_event(EMOTION_EVENT_5); 173 broadcast_event(EMOTION_EVENT_5);
171 else if (!strcmp(ev->keyname, "6")) 174 else if (!strcmp(keyname, "6"))
172 broadcast_event(EMOTION_EVENT_6); 175 broadcast_event(EMOTION_EVENT_6);
173 else if (!strcmp(ev->keyname, "7")) 176 else if (!strcmp(keyname, "7"))
174 broadcast_event(EMOTION_EVENT_7); 177 broadcast_event(EMOTION_EVENT_7);
175 else if (!strcmp(ev->keyname, "8")) 178 else if (!strcmp(keyname, "8"))
176 broadcast_event(EMOTION_EVENT_8); 179 broadcast_event(EMOTION_EVENT_8);
177 else if (!strcmp(ev->keyname, "9")) 180 else if (!strcmp(keyname, "9"))
178 broadcast_event(EMOTION_EVENT_9); 181 broadcast_event(EMOTION_EVENT_9);
179 else if (!strcmp(ev->keyname, "-")) 182 else if (!strcmp(keyname, "-"))
180 broadcast_event(EMOTION_EVENT_10); 183 broadcast_event(EMOTION_EVENT_10);
181 else if (!strcmp(ev->keyname, "v")) 184 else if (!strcmp(keyname, "v"))
182 { 185 {
183 EINA_LIST_FOREACH(video_objs, l, o) 186 EINA_LIST_FOREACH(video_objs, l, o)
184 { 187 {
@@ -188,7 +191,7 @@ bg_key_down(void *data EINA_UNUSED, const Eo_Event *event)
188 emotion_object_video_mute_set(o, EINA_TRUE); 191 emotion_object_video_mute_set(o, EINA_TRUE);
189 } 192 }
190 } 193 }
191 else if (!strcmp(ev->keyname, "a")) 194 else if (!strcmp(keyname, "a"))
192 { 195 {
193 EINA_LIST_FOREACH(video_objs, l, o) 196 EINA_LIST_FOREACH(video_objs, l, o)
194 { 197 {
@@ -204,7 +207,7 @@ bg_key_down(void *data EINA_UNUSED, const Eo_Event *event)
204 } 207 }
205 } 208 }
206 } 209 }
207 else if (!strcmp(ev->keyname, "i")) 210 else if (!strcmp(keyname, "i"))
208 { 211 {
209 EINA_LIST_FOREACH(video_objs, l, o) 212 EINA_LIST_FOREACH(video_objs, l, o)
210 { 213 {
@@ -214,21 +217,21 @@ bg_key_down(void *data EINA_UNUSED, const Eo_Event *event)
214 printf("seekable: %i\n", emotion_object_seekable_get(o)); 217 printf("seekable: %i\n", emotion_object_seekable_get(o));
215 } 218 }
216 } 219 }
217 else if (!strcmp(ev->keyname, "f")) 220 else if (!strcmp(keyname, "f"))
218 { 221 {
219 if (!ecore_evas_fullscreen_get(ecore_evas)) 222 if (!ecore_evas_fullscreen_get(ecore_evas))
220 ecore_evas_fullscreen_set(ecore_evas, EINA_TRUE); 223 ecore_evas_fullscreen_set(ecore_evas, EINA_TRUE);
221 else 224 else
222 ecore_evas_fullscreen_set(ecore_evas, EINA_FALSE); 225 ecore_evas_fullscreen_set(ecore_evas, EINA_FALSE);
223 } 226 }
224 else if (!strcmp(ev->keyname, "d")) 227 else if (!strcmp(keyname, "d"))
225 { 228 {
226 if (!ecore_evas_avoid_damage_get(ecore_evas)) 229 if (!ecore_evas_avoid_damage_get(ecore_evas))
227 ecore_evas_avoid_damage_set(ecore_evas, EINA_TRUE); 230 ecore_evas_avoid_damage_set(ecore_evas, EINA_TRUE);
228 else 231 else
229 ecore_evas_avoid_damage_set(ecore_evas, EINA_FALSE); 232 ecore_evas_avoid_damage_set(ecore_evas, EINA_FALSE);
230 } 233 }
231 else if (!strcmp(ev->keyname, "s")) 234 else if (!strcmp(keyname, "s"))
232 { 235 {
233 if (!ecore_evas_shaped_get(ecore_evas)) 236 if (!ecore_evas_shaped_get(ecore_evas))
234 { 237 {
@@ -241,14 +244,14 @@ bg_key_down(void *data EINA_UNUSED, const Eo_Event *event)
241 evas_object_show(o_bg); 244 evas_object_show(o_bg);
242 } 245 }
243 } 246 }
244 else if (!strcmp(ev->keyname, "b")) 247 else if (!strcmp(keyname, "b"))
245 { 248 {
246 if (!ecore_evas_borderless_get(ecore_evas)) 249 if (!ecore_evas_borderless_get(ecore_evas))
247 ecore_evas_borderless_set(ecore_evas, EINA_TRUE); 250 ecore_evas_borderless_set(ecore_evas, EINA_TRUE);
248 else 251 else
249 ecore_evas_borderless_set(ecore_evas, EINA_FALSE); 252 ecore_evas_borderless_set(ecore_evas, EINA_FALSE);
250 } 253 }
251 else if (!strcmp(ev->keyname, "q")) 254 else if (!strcmp(keyname, "q"))
252 { 255 {
253 ecore_main_loop_quit(); 256 ecore_main_loop_quit();
254 while (video_objs) 257 while (video_objs)
@@ -259,7 +262,7 @@ bg_key_down(void *data EINA_UNUSED, const Eo_Event *event)
259 printf("done\n"); 262 printf("done\n");
260 } 263 }
261 } 264 }
262 else if (!strcmp(ev->keyname, "z")) 265 else if (!strcmp(keyname, "z"))
263 { 266 {
264 vis = (vis + 1) % EMOTION_VIS_LAST; 267 vis = (vis + 1) % EMOTION_VIS_LAST;
265 printf("new visualization: %d\n", vis); 268 printf("new visualization: %d\n", vis);
@@ -283,7 +286,7 @@ bg_key_down(void *data EINA_UNUSED, const Eo_Event *event)
283 } 286 }
284 else 287 else
285 { 288 {
286 printf("UNHANDLED: %s\n", ev->keyname); 289 printf("UNHANDLED: %s\n", keyname);
287 } 290 }
288 291
289 return EINA_TRUE; 292 return EINA_TRUE;