summaryrefslogtreecommitdiff
path: root/src/tests/emotion
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-06-11 15:20:13 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-06-28 09:41:13 +0300
commitd833722e6ee2fb2848ab28e940aac6dd2a4b2969 (patch)
treeb6be33a7b27626f3fbac76a47d7ca7947f23d885 /src/tests/emotion
parent76ff4430a2746ed879b197daf93d8faa0b36674d (diff)
emotion: revert changes to emotion test as discussed on ML and chat
We want a separate test for Eo callbacks, as we still want to verify legacy callbacks.
Diffstat (limited to 'src/tests/emotion')
-rw-r--r--src/tests/emotion/emotion_test_main.c110
1 files changed, 36 insertions, 74 deletions
diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c
index 3d7d4a935e..24ab7dbffe 100644
--- a/src/tests/emotion/emotion_test_main.c
+++ b/src/tests/emotion/emotion_test_main.c
@@ -1,11 +1,7 @@
1#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
2#include "config.h" 2# include "config.h"
3#else
4#define EFL_EO_API_SUPPORT
5#define EFL_BETA_API_SUPPORT
6#endif 3#endif
7 4
8#include <Eo.h>
9#include <stdlib.h> 5#include <stdlib.h>
10#include <stdio.h> 6#include <stdio.h>
11#include <string.h> 7#include <string.h>
@@ -329,9 +325,8 @@ video_obj_time_changed(Evas_Object *obj, Evas_Object *edje)
329 edje_object_part_text_set(edje, "video_progress_txt", buf); 325 edje_object_part_text_set(edje, "video_progress_txt", buf);
330} 326}
331 327
332static Eina_Bool 328static void
333video_obj_frame_decode_cb(void *data, 329video_obj_frame_decode_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
334 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
335{ 330{
336 video_obj_time_changed(obj, data); 331 video_obj_time_changed(obj, data);
337 332
@@ -343,12 +338,10 @@ video_obj_frame_decode_cb(void *data,
343 printf("FPS: %3.3f\n", 1.0 / (t - pt)); 338 printf("FPS: %3.3f\n", 1.0 / (t - pt));
344 pt = t; 339 pt = t;
345 } 340 }
346 return EINA_TRUE;
347} 341}
348 342
349static Eina_Bool 343static void
350video_obj_frame_resize_cb(void *data, 344video_obj_frame_resize_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
351 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
352{ 345{
353 Evas_Object *oe; 346 Evas_Object *oe;
354 int iw, ih; 347 int iw, ih;
@@ -366,33 +359,24 @@ video_obj_frame_resize_cb(void *data,
366 evas_object_resize(oe, w, h); 359 evas_object_resize(oe, w, h);
367 evas_object_size_hint_min_set(obj, 0, 0); 360 evas_object_size_hint_min_set(obj, 0, 0);
368 edje_object_part_swallow(oe, "video_swallow", obj); 361 edje_object_part_swallow(oe, "video_swallow", obj);
369
370 return EINA_TRUE;
371} 362}
372 363
373static Eina_Bool 364static void
374video_obj_length_change_cb(void *data, 365video_obj_length_change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
375 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
376{ 366{
377 printf("len change!\n"); 367 printf("len change!\n");
378 video_obj_time_changed(obj, data); 368 video_obj_time_changed(obj, data);
379
380 return EINA_TRUE;
381} 369}
382 370
383static Eina_Bool 371static void
384video_obj_position_update_cb(void *data, 372video_obj_position_update_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
385 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
386{ 373{
387 printf("pos up!\n"); 374 printf("pos up!\n");
388 video_obj_time_changed(obj, data); 375 video_obj_time_changed(obj, data);
389
390 return EINA_TRUE;
391} 376}
392 377
393static Eina_Bool 378static void
394video_obj_stopped_cb(void *data EINA_UNUSED, 379video_obj_stopped_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
395 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
396{ 380{
397 printf("video stopped!!!\n"); 381 printf("video stopped!!!\n");
398 if (loop) 382 if (loop)
@@ -400,73 +384,54 @@ video_obj_stopped_cb(void *data EINA_UNUSED,
400 emotion_object_position_set(obj, 0.0); 384 emotion_object_position_set(obj, 0.0);
401 emotion_object_play_set(obj, 1); 385 emotion_object_play_set(obj, 1);
402 } 386 }
403
404 return EINA_TRUE;
405} 387}
406 388
407static Eina_Bool 389static void
408video_obj_channels_cb(void *data EINA_UNUSED, 390video_obj_channels_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
409 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
410{ 391{
411 printf("channels changed: [AUD %i][VID %i][SPU %i]\n", 392 printf("channels changed: [AUD %i][VID %i][SPU %i]\n",
412 emotion_object_audio_channel_count(obj), 393 emotion_object_audio_channel_count(obj),
413 emotion_object_video_channel_count(obj), 394 emotion_object_video_channel_count(obj),
414 emotion_object_spu_channel_count(obj)); 395 emotion_object_spu_channel_count(obj));
415
416 return EINA_TRUE;
417} 396}
418 397
419static Eina_Bool 398static void
420 video_obj_title_cb(void *data EINA_UNUSED, 399video_obj_title_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
421 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
422{ 400{
423 printf("video title to: \"%s\"\n", emotion_object_title_get(obj)); 401 printf("video title to: \"%s\"\n", emotion_object_title_get(obj));
424
425 return EINA_TRUE;
426} 402}
427 403
428static Eina_Bool 404static void
429video_obj_progress_cb(void *data EINA_UNUSED, 405video_obj_progress_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
430 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
431{ 406{
432 printf("progress: \"%s\" %3.3f\n", 407 printf("progress: \"%s\" %3.3f\n",
433 emotion_object_progress_info_get(obj), 408 emotion_object_progress_info_get(obj),
434 emotion_object_progress_status_get(obj)); 409 emotion_object_progress_status_get(obj));
435
436 return EINA_TRUE;
437} 410}
438 411
439static Eina_Bool 412static void
440video_obj_ref_cb(void *data EINA_UNUSED, 413video_obj_ref_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
441 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
442{ 414{
443 printf("video ref to: \"%s\" %i\n", 415 printf("video ref to: \"%s\" %i\n",
444 emotion_object_ref_file_get(obj), 416 emotion_object_ref_file_get(obj),
445 emotion_object_ref_num_get(obj)); 417 emotion_object_ref_num_get(obj));
446
447 return EINA_TRUE;
448} 418}
449 419
450static Eina_Bool 420static void
451video_obj_button_num_cb(void *data EINA_UNUSED, 421video_obj_button_num_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
452 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
453{ 422{
454 printf("video spu buttons to: %i\n", 423 printf("video spu buttons to: %i\n",
455 emotion_object_spu_button_count_get(obj)); 424 emotion_object_spu_button_count_get(obj));
456
457 return EINA_TRUE;
458} 425}
459 426
460static Eina_Bool 427static void
461video_obj_button_cb(void *data EINA_UNUSED, 428video_obj_button_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
462 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
463{ 429{
464 printf("video selected spu button: %i\n", 430 printf("video selected spu button: %i\n",
465 emotion_object_spu_button_get(obj)); 431 emotion_object_spu_button_get(obj));
466
467 return EINA_TRUE;
468} 432}
469 433
434
470static void 435static void
471video_obj_signal_play_cb(void *data, Evas_Object *o, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) 436video_obj_signal_play_cb(void *data, Evas_Object *o, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
472{ 437{
@@ -611,20 +576,6 @@ video_obj_signal_frame_move_cb(void *data EINA_UNUSED, Evas_Object *o, const cha
611 } 576 }
612} 577}
613 578
614static const Eo_Callback_Array_Item emotion_object_test_callbacks[] = {
615 { EMOTION_OBJECT_EVENT_FRAME_DECODE, video_obj_frame_decode_cb },
616 { EMOTION_OBJECT_EVENT_FRAME_RESIZE, video_obj_frame_resize_cb },
617 { EMOTION_OBJECT_EVENT_LENGTH_CHANGE, video_obj_length_change_cb },
618 { EMOTION_OBJECT_EVENT_POSITION_UPDATE, video_obj_position_update_cb },
619 { EMOTION_OBJECT_EVENT_DECODE_STOP, video_obj_stopped_cb },
620 { EMOTION_OBJECT_EVENT_CHANNELS_CHANGE, video_obj_channels_cb },
621 { EMOTION_OBJECT_EVENT_TITLE_CHANGE, video_obj_title_cb },
622 { EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, video_obj_progress_cb },
623 { EMOTION_OBJECT_EVENT_REF_CHANGE, video_obj_ref_cb },
624 { EMOTION_OBJECT_EVENT_BUTTON_NUM_CHANGE, video_obj_button_num_cb },
625 { EMOTION_OBJECT_EVENT_BUTTON_CHANGE, video_obj_button_cb },
626 { NULL, NULL }
627};
628 579
629static void 580static void
630init_video_object(const char *module_filename, const char *filename) 581init_video_object(const char *module_filename, const char *filename)
@@ -670,7 +621,18 @@ init_video_object(const char *module_filename, const char *filename)
670 edje_object_size_min_calc(oe, &w, &h); 621 edje_object_size_min_calc(oe, &w, &h);
671 evas_object_resize(oe, w, h); 622 evas_object_resize(oe, w, h);
672 623
673 eo_do(o, eo_event_callback_array_add(emotion_object_test_callbacks, oe)); 624 evas_object_smart_callback_add(o, "frame_decode", video_obj_frame_decode_cb, oe);
625 evas_object_smart_callback_add(o, "frame_resize", video_obj_frame_resize_cb, oe);
626 evas_object_smart_callback_add(o, "length_change", video_obj_length_change_cb, oe);
627 evas_object_smart_callback_add(o, "position_update", video_obj_position_update_cb, oe);
628
629 evas_object_smart_callback_add(o, "decode_stop", video_obj_stopped_cb, oe);
630 evas_object_smart_callback_add(o, "channels_change", video_obj_channels_cb, oe);
631 evas_object_smart_callback_add(o, "title_change", video_obj_title_cb, oe);
632 evas_object_smart_callback_add(o, "progress_change", video_obj_progress_cb, oe);
633 evas_object_smart_callback_add(o, "ref_change", video_obj_ref_cb, oe);
634 evas_object_smart_callback_add(o, "button_num_change", video_obj_button_num_cb, oe);
635 evas_object_smart_callback_add(o, "button_change", video_obj_button_cb, oe);
674 636
675 edje_object_signal_callback_add(oe, "video_control", "play", video_obj_signal_play_cb, o); 637 edje_object_signal_callback_add(oe, "video_control", "play", video_obj_signal_play_cb, o);
676 edje_object_signal_callback_add(oe, "video_control", "pause", video_obj_signal_pause_cb, o); 638 edje_object_signal_callback_add(oe, "video_control", "pause", video_obj_signal_pause_cb, o);