From: WooHyun Jung Date: Tue, 7 Dec 2010 05:04:45 +0000 (+0000) Subject: From: WooHyun Jung X-Git-Tag: upstream/1.20.0~7116^2~14^2~10493 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34a3ad17b9ed759d5bd6e1e762b9e4cb08634135;p=platform%2Fupstream%2Fefl.git From: WooHyun Jung Subject: [E-devel] [PATCH] Some modifications for adapting elm_longpress_timeout_get(). I made a patch for adapting elm_longpress_timeout_get() function to all winsets, using long press event. And I checked one warning in elm_entry.c , so I modified it. SVN revision: 55339 --- diff --git a/legacy/elementary/src/lib/elm_colorselector.c b/legacy/elementary/src/lib/elm_colorselector.c index 6ae1630..be9f6c0 100644 --- a/legacy/elementary/src/lib/elm_colorselector.c +++ b/legacy/elementary/src/lib/elm_colorselector.c @@ -532,7 +532,7 @@ _left_button_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__ evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL); cp->button_state = L_BUTTON_PRESSED; if (wd->lp_timer) ecore_timer_del(wd->lp_timer); - wd->lp_timer = ecore_timer_add(1.0, _long_press_timer, cp); + wd->lp_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press_timer, cp); } static void @@ -570,7 +570,7 @@ _right_button_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED_ _draw_rects(data, x); evas_object_smart_callback_call(cp->parent, SIG_CHANGED, NULL); cp->button_state = R_BUTTON_PRESSED; - wd->lp_timer = ecore_timer_add(1.0, _long_press_timer, cp); + wd->lp_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press_timer, cp); } static void diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c index 71cd38c..ced00a8 100644 --- a/legacy/elementary/src/lib/elm_entry.c +++ b/legacy/elementary/src/lib/elm_entry.c @@ -834,7 +834,7 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void if (ev->button != 1) return; // if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer); - wd->longpress_timer = ecore_timer_add(1.0, _long_press, data); + wd->longpress_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data); wd->downx = ev->canvas.x; wd->downy = ev->canvas.y; } @@ -1517,7 +1517,7 @@ _get_item(void *data, Evas_Object *edje __UNUSED__, const char *part __UNUSED__, } if (!strncmp(item, "file://", 7)) { - char *fname = item + 7; + const char *fname = item + 7; o = evas_object_image_filled_add(evas_object_evas_get(data)); evas_object_image_file_set(o, fname, NULL); diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c index 46e4df3..f19c25f 100644 --- a/legacy/elementary/src/lib/elm_gengrid.c +++ b/legacy/elementary/src/lib/elm_gengrid.c @@ -783,7 +783,7 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_inf evas_object_smart_callback_call(item->wd->self, "clicked", item); if (item->long_timer) ecore_timer_del(item->long_timer); if (item->realized) - item->long_timer = ecore_timer_add(1.0, _long_press, item); + item->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, item); else item->long_timer = NULL; } diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 14388c7..6f6bfe2 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -2227,7 +2227,7 @@ elm_genlist_add(Evas_Object *parent) wd->mode = ELM_LIST_SCROLL; wd->max_items_per_block = MAX_ITEMS_PER_BLOCK; wd->item_cache_max = wd->max_items_per_block * 2; - wd->longpress_timeout = LONGPRESS_TIMEOUT; + wd->longpress_timeout = _elm_config->longpress_timeout; evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj); evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj); diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index 664f2ae..a146dfb 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -842,7 +842,7 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void _item_hilight(it); wd->longpressed = EINA_FALSE; if (it->long_timer) ecore_timer_del(it->long_timer); - it->long_timer = ecore_timer_add(1.0, _long_press, it); + it->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, it); if (it->swipe_timer) ecore_timer_del(it->swipe_timer); it->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it); /* Always call the callbacks last - the user may delete our context! */ diff --git a/legacy/elementary/src/lib/elm_map.c b/legacy/elementary/src/lib/elm_map.c index d069e94..b5d7df3 100644 --- a/legacy/elementary/src/lib/elm_map.c +++ b/legacy/elementary/src/lib/elm_map.c @@ -1038,7 +1038,7 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void evas_object_smart_callback_call(data, SIG_PRESS, NULL); wd->longpressed = EINA_FALSE; if (wd->long_timer) ecore_timer_del(wd->long_timer); - wd->long_timer = ecore_timer_add(1.0, _long_press, data); + wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data); } static void diff --git a/legacy/elementary/src/lib/elm_photocam.c b/legacy/elementary/src/lib/elm_photocam.c index c8df8e4..83972b3 100644 --- a/legacy/elementary/src/lib/elm_photocam.c +++ b/legacy/elementary/src/lib/elm_photocam.c @@ -654,7 +654,7 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void evas_object_smart_callback_call(data, "press", NULL); wd->longpressed = EINA_FALSE; if (wd->long_timer) ecore_timer_del(wd->long_timer); - wd->long_timer = ecore_timer_add(1.0, _long_press, data); + wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data); } static void