zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7142acd19c88b782122d089c95a81895123b59a8
commit 7142acd19c88b782122d089c95a81895123b59a8 Author: Mike Blumenkrantz <zm...@samsung.com> Date: Fri Aug 30 14:48:04 2019 -0400 efl_ui/pan: add position info to pan,content_position,changed event Summary: changed events should always send the related data when possible ref T7708 Depends on D9789 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl_widgets Maniphest Tasks: T7708 Differential Revision: https://phab.enlightenment.org/D9790 --- src/lib/elementary/efl_ui_collection.c | 8 ++++---- src/lib/elementary/efl_ui_image_zoomable.c | 2 +- src/lib/elementary/efl_ui_list_view.c | 2 +- src/lib/elementary/efl_ui_pan.c | 2 +- src/lib/elementary/efl_ui_pan.eo | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c index 4f233f0abb..160bbcd35f 100644 --- a/src/lib/elementary/efl_ui_collection.c +++ b/src/lib/elementary/efl_ui_collection.c @@ -198,17 +198,17 @@ _pan_viewport_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) } static void -_pan_position_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) +_pan_position_changed_cb(void *data, const Efl_Event *ev) { MY_DATA_GET(data, pd); - Eina_Position2D pos = efl_ui_pan_position_get(pd->pan); + Eina_Position2D *pos = ev->info; Eina_Position2D max = efl_ui_pan_position_max_get(pd->pan); Eina_Vector2 rpos = {0.0, 0.0}; if (max.x > 0.0) - rpos.x = (double)pos.x/(double)max.x; + rpos.x = (double)pos->x/(double)max.x; if (max.y > 0.0) - rpos.y = (double)pos.y/(double)max.y; + rpos.y = (double)pos->y/(double)max.y; efl_ui_position_manager_entity_scroll_position_set(pd->pos_man, rpos.x, rpos.y); } diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 8655558b47..014b0dec51 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -402,7 +402,7 @@ _efl_ui_image_zoomable_pan_efl_ui_pan_pan_position_set(Eo *obj, Efl_Ui_Image_Zoo psd->wsd->pan_y = pos.y; evas_object_smart_changed(obj); - efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_CONTENT_POSITION_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_CONTENT_POSITION_CHANGED, &pos); } EOLIAN static Eina_Position2D diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c index d6b9f29663..0f95bfb880 100644 --- a/src/lib/elementary/efl_ui_list_view.c +++ b/src/lib/elementary/efl_ui_list_view.c @@ -59,7 +59,7 @@ _efl_ui_list_view_pan_efl_ui_pan_pan_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Li psd->gmt.x = pos.x; psd->gmt.y = pos.y; - efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_CONTENT_POSITION_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_CONTENT_POSITION_CHANGED, &pos); evas_object_smart_changed(psd->wobj); } diff --git a/src/lib/elementary/efl_ui_pan.c b/src/lib/elementary/efl_ui_pan.c index 22211071f6..93a234bceb 100644 --- a/src/lib/elementary/efl_ui_pan.c +++ b/src/lib/elementary/efl_ui_pan.c @@ -69,7 +69,7 @@ _efl_ui_pan_pan_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd, Eina_Pos psd->py = pos.y; evas_object_smart_changed(obj); - efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_CONTENT_POSITION_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_PAN_EVENT_PAN_CONTENT_POSITION_CHANGED, &pos); } EOLIAN static Eina_Position2D diff --git a/src/lib/elementary/efl_ui_pan.eo b/src/lib/elementary/efl_ui_pan.eo index e9edd8f273..7e8e4358b2 100644 --- a/src/lib/elementary/efl_ui_pan.eo +++ b/src/lib/elementary/efl_ui_pan.eo @@ -65,7 +65,7 @@ class @beta Efl.Ui.Pan extends Efl.Canvas.Group implements Efl.Content } events { pan,viewport,changed: void; [[This widget's position or size has changed.]] - pan,content_position,changed: void; [[The content's position has changed.]] + pan,content_position,changed: Eina.Position2D; [[The content's position has changed, its position in the event is the new position.]] pan,content_size,changed: Eina.Size2D; [[The content's size has changed, its size in the event is the new size]] } } --