From: Jaehwan Kim Date: Thu, 28 Feb 2013 06:18:51 +0000 (+0900) Subject: Add the option about sending signals in content_pos_set. X-Git-Tag: submit/efl/20131021.015827~884 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fce0bd9712c613746df56b4878901df1c4f585a9;p=platform%2Fupstream%2Felementary.git Add the option about sending signals in content_pos_set. When the scroller is resized, the signals("elm,action,scroll", "elm,edge,top" so on) shouldn't be sent, because it's not a scroll-action. So in this case, the content_pos_set should be called without the signals. --- diff --git a/ChangeLog b/ChangeLog index bb4ee42..76c15af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1057,3 +1057,9 @@ * Fix scroller acceleration bug. It was accelerated even it's scrolled after finishing the previous scroll. This happens with page scroll enabled. + +2013-02-28 Jaehwan Kim + + * Add the option about sending signals in content_pos_set. + When the scroller is resized, the signals("elm,action,scroll", "elm,edge,top" so on) shouldn't be sent, + because it's not a scroll-action. So in this case, the content_pos_set should be called without the signals. diff --git a/NEWS b/NEWS index eaec4c7..6c9c6d5 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,7 @@ Additions: * Added new APIs elm_transit_tween_mode_facator_set()/get() * Support widget orientation mode in order to widgets have multiple styles for each window degree. * Add elm_drop_target_add() elm_drop_target_del() and elm_drag_start() + * Add the option about sending signals in content_pos_set. Improvements: diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 8f360b0..5369b77 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -1902,7 +1902,7 @@ _elm_gengrid_smart_event(Eo *obj, void *_pd, va_list *list) else return; ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (ret) *ret = EINA_TRUE; } diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index bfcb67b..db975b7 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -537,7 +537,7 @@ _calc_job(void *data) it_y = sd->anchor_y; eo_do(sd->obj, elm_scrollable_interface_content_pos_set (sd->pan_x, it->item->block->y - + it->y + it_y)); + + it->y + it_y, EINA_TRUE)); sd->anchor_item = it; sd->anchor_y = it_y; } @@ -2446,7 +2446,7 @@ _elm_genlist_smart_event(Eo *obj, void *_pd, va_list *list) if (y < 0) y = 0; if (y > pan_max_y) y = pan_max_y; - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (ret) *ret = EINA_TRUE; } diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c index 61011ea..5047db9 100644 --- a/src/lib/elm_interface_scrollable.c +++ b/src/lib/elm_interface_scrollable.c @@ -1268,7 +1268,7 @@ _elm_scroll_bounce_x_animator(void *data) } x = sid->down.b2x + (int)((double)(dx - odx) * r); if (!sid->down.cancelled) - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (dt >= 1.0) { if (sid->down.momentum_animator) @@ -1325,7 +1325,7 @@ _elm_scroll_bounce_y_animator(void *data) } y = sid->down.b2y + (int)((double)(dy - ody) * r); if (!sid->down.cancelled) - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (dt >= 1.0) { if (sid->down.momentum_animator) @@ -1448,6 +1448,7 @@ _elm_scroll_content_pos_set(Eo *obj, void *_pd, va_list *list) { Evas_Coord x = va_arg(*list, Evas_Coord); Evas_Coord y = va_arg(*list, Evas_Coord); + Eina_Bool sig = va_arg(*list, int); Evas_Coord mx = 0, my = 0, px = 0, py = 0, minx = 0, miny = 0; double vx, vy; @@ -1499,7 +1500,7 @@ _elm_scroll_content_pos_set(Eo *obj, void *_pd, va_list *list) } eo_do(sid->pan_obj, elm_obj_pan_pos_set(x, y)); - if ((px != x) || (py != y)) + if (sig && ((px != x) || (py != y))) edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm"); if (!sid->down.bounce_x_animator) { @@ -1529,37 +1530,40 @@ _elm_scroll_content_pos_set(Eo *obj, void *_pd, va_list *list) if (sid->cb_func.scroll) sid->cb_func.scroll(obj, NULL); } - if (x != px) + if (sig) { - if (x == minx) - { - if (sid->cb_func.edge_left) - sid->cb_func.edge_left(obj, NULL); - edje_object_signal_emit(sid->edje_obj, "elm,edge,left", "elm"); - } - if (x == (mx + minx)) + if (x != px) { - if (sid->cb_func.edge_right) - sid->cb_func.edge_right(obj, NULL); - edje_object_signal_emit(sid->edje_obj, "elm,edge,right", "elm"); - } - } - if (y != py) - { - if (y == miny) - { - if (sid->cb_func.edge_top) - sid->cb_func.edge_top(obj, NULL); - edje_object_signal_emit(sid->edje_obj, "elm,edge,top", "elm"); + if (x == minx) + { + if (sid->cb_func.edge_left) + sid->cb_func.edge_left(obj, NULL); + edje_object_signal_emit(sid->edje_obj, "elm,edge,left", "elm"); + } + if (x == (mx + minx)) + { + if (sid->cb_func.edge_right) + sid->cb_func.edge_right(obj, NULL); + edje_object_signal_emit(sid->edje_obj, "elm,edge,right", "elm"); + } } - if (y == my + miny) + if (y != py) { - if (sid->cb_func.edge_bottom) - sid->cb_func.edge_bottom(obj, NULL); - edje_object_signal_emit(sid->edje_obj, "elm,edge,bottom", "elm"); + if (y == miny) + { + if (sid->cb_func.edge_top) + sid->cb_func.edge_top(obj, NULL); + edje_object_signal_emit(sid->edje_obj, "elm,edge,top", "elm"); + } + if (y == my + miny) + { + if (sid->cb_func.edge_bottom) + sid->cb_func.edge_bottom(obj, NULL); + edje_object_signal_emit(sid->edje_obj, "elm,edge,bottom", "elm"); + } } } - + _elm_direction_arrows_eval(sid); } @@ -1586,7 +1590,7 @@ _elm_scroll_mirrored_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list) else wx = sid->wx; - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(wx, sid->wy)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(wx, sid->wy, EINA_FALSE)); } /* returns TRUE when we need to move the scroller, FALSE otherwise. @@ -1700,7 +1704,7 @@ _elm_scroll_content_region_set(Eo *obj, void *_pd, va_list *list) if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h)) { - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_FALSE)); sid->down.sx = x; sid->down.sy = y; sid->down.x = sid->down.history[0].x; @@ -1725,7 +1729,7 @@ _elm_scroll_content_region_show(Eo *obj, void *_pd, va_list *list) sid->wh = h; if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h)) { - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); sid->down.sx = x; sid->down.sy = y; sid->down.x = sid->down.history[0].x; @@ -1843,7 +1847,7 @@ _elm_scroll_wheel_event_cb(void *data, if ((!sid->hold) && (!sid->freeze)) { _elm_scroll_wanted_coordinates_update(sid, x, y); - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); } } @@ -1911,7 +1915,7 @@ _elm_scroll_momentum_animator(void *data) sid->down.by = sid->down.by0 - dy + sid->down.b0y; y = py; } - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); _elm_scroll_wanted_coordinates_update(sid, x, y); eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&maxx, &maxy)); eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny)); @@ -2026,7 +2030,7 @@ _elm_scroll_scroll_to_x_animator(void *data) if (t >= sid->scrollto.x.t_end) { px = sid->scrollto.x.end; - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py, EINA_TRUE)); sid->down.sx = px; sid->down.x = sid->down.history[0].x; sid->down.pdx = 0; @@ -2036,7 +2040,7 @@ _elm_scroll_scroll_to_x_animator(void *data) _elm_scroll_anim_stop(sid); return ECORE_CALLBACK_CANCEL; } - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py, EINA_TRUE)); _elm_scroll_wanted_coordinates_update(sid, px, py); return ECORE_CALLBACK_RENEW; } @@ -2061,7 +2065,7 @@ _elm_scroll_scroll_to_y_animator(void *data) if (t >= sid->scrollto.y.t_end) { py = sid->scrollto.y.end; - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py, EINA_TRUE)); sid->down.sy = py; sid->down.y = sid->down.history[0].y; sid->down.pdy = 0; @@ -2071,7 +2075,7 @@ _elm_scroll_scroll_to_y_animator(void *data) _elm_scroll_anim_stop(sid); return ECORE_CALLBACK_CANCEL; } - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py, EINA_TRUE)); _elm_scroll_wanted_coordinates_update(sid, px, py); return ECORE_CALLBACK_RENEW; @@ -2407,7 +2411,7 @@ _elm_scroll_mouse_up_event_cb(void *data, sid->down.dragged = EINA_FALSE; sid->down.now = EINA_FALSE; eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y)); - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); _elm_scroll_wanted_coordinates_update(sid, x, y); if (sid->content_info.resized) @@ -2779,7 +2783,7 @@ _elm_scroll_hold_animator(void *data) _elm_scroll_smooth_debug_movetime_add(ox, oy); #endif - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(ox, oy)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(ox, oy, EINA_TRUE)); return ECORE_CALLBACK_RENEW; } @@ -2827,7 +2831,7 @@ _elm_scroll_on_hold_animator(void *data) } } - eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); } sid->down.onhold_tlast = t; @@ -4015,7 +4019,7 @@ _elm_scroll_page_show(Eo *obj, void *_pd, va_list *list) if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h)) - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); } static void diff --git a/src/lib/elm_interface_scrollable.h b/src/lib/elm_interface_scrollable.h index 9279577..de5db26 100644 --- a/src/lib/elm_interface_scrollable.h +++ b/src/lib/elm_interface_scrollable.h @@ -427,9 +427,10 @@ enum * * @param[in] x * @param[in] y + * @param[in] sig * */ -#define elm_scrollable_interface_content_pos_set(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y) +#define elm_scrollable_interface_content_pos_set(x, y, sig) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Eina_Bool, sig) /** * @def elm_scrollable_interface_content_pos_get diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index ffec117..9f1e231 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -354,7 +354,7 @@ _elm_list_smart_event(Eo *obj, void *_pd, va_list *list) else return; ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (ret) *ret = EINA_TRUE; } diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index 28bcc7a..21b3342 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -3924,7 +3924,7 @@ _elm_map_smart_event(Eo *obj, void *_pd, va_list *list) else return; ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (ret) *ret = EINA_TRUE; } diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c index a0e1480..7d6abab 100644 --- a/src/lib/elm_photocam.c +++ b/src/lib/elm_photocam.c @@ -1019,7 +1019,7 @@ _elm_photocam_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list) else return; ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (ret) *ret = EINA_TRUE; } diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 2257095..ffbe3d6 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -249,7 +249,7 @@ _elm_scroller_smart_event(Eo *obj, void *_pd, va_list *list) else return; ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (ret) *ret = EINA_TRUE; } @@ -305,7 +305,7 @@ _elm_scroller_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list) x += page_x; } - eo_do(obj, elm_scrollable_interface_content_pos_set(x, y)); + eo_do(obj, elm_scrollable_interface_content_pos_set(x, y, EINA_TRUE)); if (ret) *ret = EINA_TRUE; }