From 68e15dcb64ec61f2865f279b1337a0f788ba3d48 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Wed, 20 Nov 2019 15:32:09 +0900 Subject: [PATCH] efl_ui_scrollable: add new event for destination information. Scroll manager send a signal to widget when destination of scroll is finalized. Change-Id: Icfaebcdd5ad281f967cddb72efca75d149c9432a --- src/lib/efl/interfaces/efl_ui_scrollable.eo | 3 +++ src/lib/elementary/efl_ui_scroll_manager.c | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/lib/efl/interfaces/efl_ui_scrollable.eo b/src/lib/efl/interfaces/efl_ui_scrollable.eo index 872f883..3b7c48e 100644 --- a/src/lib/efl/interfaces/efl_ui_scrollable.eo +++ b/src/lib/efl/interfaces/efl_ui_scrollable.eo @@ -188,5 +188,8 @@ interface Efl.Ui.Scrollable scroll,anim,finished: void; [[Called when scroll animation finishes.]] scroll,drag,started: void; [[Called when scroll drag starts.]] scroll,drag,finished: void; [[Called when scroll drag finishes.]] + //TIZEN_ONLY(20191121): add new event for destination information. + scroll,destination,finalized @beta: Eina.Position2D; [[Called when scroll destination is finalized.]] + // } } diff --git a/src/lib/elementary/efl_ui_scroll_manager.c b/src/lib/elementary/efl_ui_scroll_manager.c index 3d332e9..0b61a38 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.c +++ b/src/lib/elementary/efl_ui_scroll_manager.c @@ -759,6 +759,11 @@ _scroll_wheel_post_event_go(Efl_Ui_Scroll_Manager_Data *sd, int x, int y) _scroll_manager_scrollto_animator_add(sd, cur.x, cur.y, x, y, _elm_config->bring_in_scroll_friction, _elm_config->bring_in_scroll_friction, INTERP_DECEL); + + //TIZEN_ONLY(20191121): add new event for destination information. + Eina_Position2D dst = EINA_POSITION2D(x, y); + efl_event_callback_call(sd->parent, EFL_UI_EVENT_SCROLL_DESTINATION_FINALIZED, &dst); + // } } @@ -1034,6 +1039,9 @@ _efl_ui_scroll_manager_mouse_up_event_momentum_eval(Efl_Ui_Scroll_Manager_Data * double t, at; Evas_Coord dx, dy, ax, ay, vel; signed char sdx, sdy; + //TIZEN_ONLY(20191121): add new event for destination information. + Eina_Position2D dst = efl_ui_pan_position_get(sd->pan_obj); + // t = ev->timestamp / 1000.0; @@ -1060,12 +1068,19 @@ _efl_ui_scroll_manager_mouse_up_event_momentum_eval(Efl_Ui_Scroll_Manager_Data * (vel > _elm_config->thumbscroll_momentum_threshold)) { _scroll_manager_momentum_animator_add(sd, -sdx*dx/at, -sdy*dy/at); + + //TIZEN_ONLY(20191121): add new event for destination information. + return; + // } else if (!sd->bouncemex && !sd->bouncemey) { _efl_ui_scroll_manager_scroll_stop(sd); } } + //TIZEN_ONLY(20191121): add new event for destination information. + efl_event_callback_call(sd->parent, EFL_UI_EVENT_SCROLL_DESTINATION_FINALIZED, &dst); + // } static void @@ -1307,6 +1322,9 @@ _scroll_manager_momentum_animator_add(Efl_Ui_Scroll_Manager_Data *sd, double vx, double dur = 0.0; signed char sdx = 0, sdy = 0; Evas_Coord dstx = 0, dsty = 0; + //TIZEN_ONLY(20191121): add new event for destination information. + Eina_Position2D dst = {0, 0}; + // /* if (_scroll_manager_scrollto_animator_del(sd)) @@ -1327,6 +1345,11 @@ _scroll_manager_momentum_animator_add(Efl_Ui_Scroll_Manager_Data *sd, double vx, _scroll_manager_scrollto_animator_add(sd, cur.x, cur.y, dstx, dsty, dur, dur, INTERP_DECEL); + + //TIZEN_ONLY(20191121): add new event for destination information. + dst = EINA_POSITION2D(dstx, dsty); + efl_event_callback_call(sd->parent, EFL_UI_EVENT_SCROLL_DESTINATION_FINALIZED, &dst); + // } static void -- 2.7.4