From 148e6d13e87a494ece4241cf373340289bb7128c Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 9 Mar 2016 17:16:19 +0000 Subject: [PATCH] Fix examples according to the recent eo event changes. --- unsorted/eldbus/dbusmodel.c | 22 +++++------ unsorted/emotion/emotion_basic_example.c | 3 +- unsorted/emotion/emotion_border_example.c | 28 ++++++------- unsorted/emotion/emotion_generic_example.c | 30 ++++++-------- .../emotion_generic_subtitle_example.c | 3 +- unsorted/emotion/emotion_signals_example.c | 39 ++++++++----------- 6 files changed, 50 insertions(+), 75 deletions(-) diff --git a/unsorted/eldbus/dbusmodel.c b/unsorted/eldbus/dbusmodel.c index 3e4063ea..ec37309e 100644 --- a/unsorted/eldbus/dbusmodel.c +++ b/unsorted/eldbus/dbusmodel.c @@ -14,11 +14,9 @@ static unsigned int children_count = 0; static Eina_Bool -_event_interface_load_status_cb(void *data EINA_UNUSED, Eo *model, - const Eo_Event_Description *desc EINA_UNUSED, - void *event_info) +_event_interface_load_status_cb(void *data EINA_UNUSED, const Eo_Event *event) { - Efl_Model_Load *actual_load = (Efl_Model_Load*)event_info; + Efl_Model_Load *actual_load = (Efl_Model_Load*)event->event_info; Eina_Array *properties_list; Eina_Array_Iterator iterator; Eina_Value const* property_value; @@ -29,8 +27,8 @@ _event_interface_load_status_cb(void *data EINA_UNUSED, Eo *model, if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status) return EINA_TRUE; - name = eldbus_model_proxy_name_get(model); - efl_model_properties_get(model, &properties_list); + name = eldbus_model_proxy_name_get(event->obj); + efl_model_properties_get(event->obj, &properties_list); printf(" -> %s\n", name); if (eina_array_count(properties_list)) @@ -38,7 +36,7 @@ _event_interface_load_status_cb(void *data EINA_UNUSED, Eo *model, EINA_ARRAY_ITER_NEXT(properties_list, i, property, iterator) { - efl_model_property_get(model, property, &property_value); + efl_model_property_get(event->obj, property, &property_value); if (property_value) { prop_str = eina_value_to_string(property_value); @@ -57,11 +55,9 @@ _event_interface_load_status_cb(void *data EINA_UNUSED, Eo *model, } static Eina_Bool -_event_load_status_cb(void *data EINA_UNUSED, Eo *model, - const Eo_Event_Description *desc EINA_UNUSED, - void *event_info) +_event_load_status_cb(void *data EINA_UNUSED, const Eo_Event *event) { - Efl_Model_Load *actual_load = (Efl_Model_Load*)event_info; + Efl_Model_Load *actual_load = (Efl_Model_Load*)event->event_info; Eina_Accessor *accessor; Eo *child = NULL; unsigned int i; @@ -69,7 +65,7 @@ _event_load_status_cb(void *data EINA_UNUSED, Eo *model, if (EFL_MODEL_LOAD_STATUS_LOADED != actual_load->status) return EINA_TRUE; - efl_model_children_count_get(model, &children_count); + efl_model_children_count_get(event->obj, &children_count); if (children_count == 0) { printf("Don't find Interfaces\n"); @@ -77,7 +73,7 @@ _event_load_status_cb(void *data EINA_UNUSED, Eo *model, return EINA_FALSE; } - efl_model_children_slice_get(model, 0, 0, &accessor); + efl_model_children_slice_get(event->obj, 0, 0, &accessor); printf("\nInterfaces:\n"); EINA_ACCESSOR_FOREACH(accessor, i, child) { diff --git a/unsorted/emotion/emotion_basic_example.c b/unsorted/emotion/emotion_basic_example.c index 9675f6b4..9ad35750 100644 --- a/unsorted/emotion/emotion_basic_example.c +++ b/unsorted/emotion/emotion_basic_example.c @@ -15,8 +15,7 @@ #define HEIGHT (240) static Eina_Bool -_playback_started_cb(void *data EINA_UNUSED, - Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_playback_started_cb(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED) { printf("Emotion object started playback.\n"); diff --git a/unsorted/emotion/emotion_border_example.c b/unsorted/emotion/emotion_border_example.c index ea3c07d6..f422fbe1 100644 --- a/unsorted/emotion/emotion_border_example.c +++ b/unsorted/emotion/emotion_border_example.c @@ -18,8 +18,7 @@ static Eina_List *filenames = NULL; static Eina_List *curfile = NULL; static Eina_Bool -_playback_started_cb(void *data EINA_UNUSED, - Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_playback_started_cb(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED) { printf("Emotion object started playback.\n"); @@ -109,8 +108,7 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void * } static Eina_Bool -_frame_decode_cb(void *data EINA_UNUSED, - Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_frame_decode_cb(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED) { // fprintf(stderr, "smartcb: frame_decode\n"); @@ -118,40 +116,36 @@ _frame_decode_cb(void *data EINA_UNUSED, } static Eina_Bool -_length_change_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_length_change_cb(void *data EINA_UNUSED, const Eo_Event *event) { - fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(o)); + fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(event->obj)); return EINA_TRUE; } static Eina_Bool -_position_update_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_position_update_cb(void *data EINA_UNUSED, const Eo_Event *event) { - fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(o)); + fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(event->obj)); return EINA_TRUE; } static Eina_Bool -_progress_change_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_progress_change_cb(void *data EINA_UNUSED, const Eo_Event *event) { fprintf(stderr, "smartcb: progress_change: %0.3f, %s\n", - emotion_object_progress_status_get(o), - emotion_object_progress_info_get(o)); + emotion_object_progress_status_get(event->obj), + emotion_object_progress_info_get(event->obj)); return EINA_TRUE; } static Eina_Bool -_frame_resize_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_frame_resize_cb(void *data EINA_UNUSED, const Eo_Event *event) { int w, h; - emotion_object_size_get(o, &w, &h); + emotion_object_size_get(event->obj, &w, &h); fprintf(stderr, "smartcb: frame_resize: %dx%d\n", w, h); return EINA_TRUE; diff --git a/unsorted/emotion/emotion_generic_example.c b/unsorted/emotion/emotion_generic_example.c index cdbfe6e1..15059fc0 100644 --- a/unsorted/emotion/emotion_generic_example.c +++ b/unsorted/emotion/emotion_generic_example.c @@ -19,8 +19,7 @@ static Eina_List *filenames = NULL; static Eina_List *curfile = NULL; static Eina_Bool -_playback_started_cb(void *data EINA_UNUSED, - Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_playback_started_cb(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED) { printf("Emotion object started playback.\n"); @@ -28,12 +27,11 @@ _playback_started_cb(void *data EINA_UNUSED, } static Eina_Bool -_playback_stopped_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_playback_stopped_cb(void *data EINA_UNUSED, const Eo_Event *event) { printf("Emotion playback stopped.\n"); - emotion_object_play_set(o, EINA_FALSE); - emotion_object_position_set(o, 0); + emotion_object_play_set(event->obj, EINA_FALSE); + emotion_object_position_set(event->obj, 0); return EINA_TRUE; } @@ -133,8 +131,7 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void * } static Eina_Bool -_frame_decode_cb(void *data EINA_UNUSED, - Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_frame_decode_cb(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED) { // fprintf(stderr, "smartcb: frame_decode\n"); @@ -142,30 +139,27 @@ _frame_decode_cb(void *data EINA_UNUSED, } static Eina_Bool -_length_change_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_length_change_cb(void *data EINA_UNUSED, const Eo_Event *event) { - fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(o)); + fprintf(stderr, "smartcb: length_change: %0.3f\n", emotion_object_play_length_get(event->obj)); return EINA_TRUE; } static Eina_Bool -_position_update_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_position_update_cb(void *data EINA_UNUSED, const Eo_Event *event) { - fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(o)); + fprintf(stderr, "smartcb: position_update: %0.3f\n", emotion_object_position_get(event->obj)); return EINA_TRUE; } static Eina_Bool -_progress_change_cb(void *data EINA_UNUSED, - Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_progress_change_cb(void *data EINA_UNUSED, const Eo_Event *event) { fprintf(stderr, "smartcb: progress_change: %0.3f, %s\n", - emotion_object_progress_status_get(obj), - emotion_object_progress_info_get(obj)); + emotion_object_progress_status_get(event->obj), + emotion_object_progress_info_get(event->obj)); return EINA_TRUE; } diff --git a/unsorted/emotion/emotion_generic_subtitle_example.c b/unsorted/emotion/emotion_generic_subtitle_example.c index 1d32f777..1ecdf8b3 100644 --- a/unsorted/emotion/emotion_generic_subtitle_example.c +++ b/unsorted/emotion/emotion_generic_subtitle_example.c @@ -14,8 +14,7 @@ #define HEIGHT (240) static Eina_Bool -_playback_started_cb(void *data EINA_UNUSED, - Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_playback_started_cb(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED) { printf("Emotion object started playback.\n"); diff --git a/unsorted/emotion/emotion_signals_example.c b/unsorted/emotion/emotion_signals_example.c index b84c47d8..8cf620dd 100644 --- a/unsorted/emotion/emotion_signals_example.c +++ b/unsorted/emotion/emotion_signals_example.c @@ -34,73 +34,66 @@ _display_info(Evas_Object *o) } static Eina_Bool -_playback_started_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_playback_started_cb(void *data EINA_UNUSED, const Eo_Event *event) { printf(">>> Emotion object started playback.\n"); - _display_info(o); + _display_info(event->obj); return EINA_TRUE; } static Eina_Bool -_playback_finished_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_playback_finished_cb(void *data EINA_UNUSED, const Eo_Event *event) { printf(">>> Emotion object finished playback.\n"); - _display_info(o); + _display_info(event->obj); return EINA_TRUE; } static Eina_Bool -_open_done_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_open_done_cb(void *data EINA_UNUSED, const Eo_Event *event) { printf(">>> Emotion object open done.\n"); - _display_info(o); + _display_info(event->obj); return EINA_TRUE; } static Eina_Bool -_position_update_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_position_update_cb(void *data EINA_UNUSED, const Eo_Event *event) { printf(">>> Emotion object first position update.\n"); - eo_event_callback_del(o, EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb, NULL); - _display_info(o); + eo_event_callback_del(event->obj, EMOTION_OBJECT_EVENT_POSITION_UPDATE, _position_update_cb, NULL); + _display_info(event->obj); return EINA_TRUE; } static Eina_Bool -_frame_decode_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_frame_decode_cb(void *data EINA_UNUSED, const Eo_Event *event) { printf(">>> Emotion object first frame decode.\n"); - eo_event_callback_del(o, EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, NULL); - _display_info(o); + eo_event_callback_del(event->obj, EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, NULL); + _display_info(event->obj); return EINA_TRUE; } static Eina_Bool -_decode_stop_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_decode_stop_cb(void *data EINA_UNUSED, const Eo_Event *event) { printf(">>> Emotion object decode stop.\n"); - _display_info(o); + _display_info(event->obj); return EINA_TRUE; } static Eina_Bool -_frame_resize_cb(void *data EINA_UNUSED, - Eo *o, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) +_frame_resize_cb(void *data EINA_UNUSED, const Eo_Event *event) { printf(">>> Emotion object frame resize.\n"); - _display_info(o); + _display_info(event->obj); return EINA_TRUE; }