From: tasn Date: Sun, 10 Jul 2011 14:10:57 +0000 (+0000) Subject: Elm glayer: Moved functions around. X-Git-Tag: REL_F_I9500_20120323_1~17^2~2345 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=429010cefd08caacd4cd172b756b485180f97fc4;p=framework%2Fuifw%2Felementary.git Elm glayer: Moved functions around. This patch, and the 2 before are from Aharon Hillel. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@61209 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/elm_gesture_layer.c b/src/lib/elm_gesture_layer.c index 0789273..0c24809 100644 --- a/src/lib/elm_gesture_layer.c +++ b/src/lib/elm_gesture_layer.c @@ -256,28 +256,6 @@ static void _multi_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE static void _multi_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info); static void _multi_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info); -static void -_dbl_click_test_reset(Gesture_Info *gesture) -{ - if (!gesture) - return; - - Widget_Data *wd = elm_widget_data_get(gesture->obj); - if (wd->dbl_timeout) ecore_timer_del(wd->dbl_timeout); - wd->dbl_timeout = NULL; - Eina_List *data; - Pointer_Event *pe; - - if (!gesture->data) - return; - - EINA_LIST_FREE(((Taps_Type *) gesture->data)->l, data) - EINA_LIST_FREE(data, pe) - free(pe); - - memset(gesture->data, 0, sizeof(Taps_Type)); -} - /* START - Functions to manage touched-device list */ /** * @internal @@ -585,35 +563,32 @@ _inside(Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2) return EINA_TRUE; } -/** - * @internal - * - * when this timer expires we ABORT double click gesture. - * - * @param data The gesture-layer object. - * @return cancles callback for this timer. - * - * @ingroup Elm_Gesture_Layer - */ -static Eina_Bool -_dbl_click_timeout(void *data) +/* All *test_reset() funcs are called to clear + * gesture intermediate data. + * This happens when we need to reset our tests. + * for example when gesture is detected or all ABORTed. */ +static void +_dbl_click_test_reset(Gesture_Info *gesture) { - Gesture_Info *gesture = data; - Widget_Data *wd = elm_widget_data_get(gesture->obj); + if (!gesture) + return; + Widget_Data *wd = elm_widget_data_get(gesture->obj); + if (wd->dbl_timeout) ecore_timer_del(wd->dbl_timeout); wd->dbl_timeout = NULL; - _set_state(gesture, ELM_GESTURE_STATE_ABORT, - gesture->info, EINA_FALSE); + Eina_List *data; + Pointer_Event *pe; - _dbl_click_test_reset(gesture); - _clear_if_finished(gesture->obj); - return ECORE_CALLBACK_CANCEL; + if (!gesture->data) + return; + + EINA_LIST_FREE(((Taps_Type *) gesture->data)->l, data) + EINA_LIST_FREE(data, pe) + free(pe); + + memset(gesture->data, 0, sizeof(Taps_Type)); } -/* All *test_reset() funcs are called to clear - * gesture intermediate data. - * This happens when we need to reset our tests. - * for example when gesture is detected or all ABORTed. */ static void _momentum_test_reset(Gesture_Info *gesture) { @@ -1141,6 +1116,31 @@ _record_pointer_event(Taps_Type *st, Eina_List *pe_list, Pointer_Event *pe, /** * @internal * + * when this timer expires we ABORT double click gesture. + * + * @param data The gesture-layer object. + * @return cancles callback for this timer. + * + * @ingroup Elm_Gesture_Layer + */ +static Eina_Bool +_dbl_click_timeout(void *data) +{ + Gesture_Info *gesture = data; + Widget_Data *wd = elm_widget_data_get(gesture->obj); + + wd->dbl_timeout = NULL; + _set_state(gesture, ELM_GESTURE_STATE_ABORT, + gesture->info, EINA_FALSE); + + _dbl_click_test_reset(gesture); + _clear_if_finished(gesture->obj); + return ECORE_CALLBACK_CANCEL; +} + +/** + * @internal + * * This function checks all click/tap and double/triple taps * * @param obj The gesture-layer object.