From: WooHyun Jung <wh0705.jung@samsung.com>
authorWooHyun Jung <wh0705.jung@samsung.com>
Tue, 7 Dec 2010 05:04:45 +0000 (05:04 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Tue, 7 Dec 2010 05:04:45 +0000 (05:04 +0000)
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

legacy/elementary/src/lib/elm_colorselector.c
legacy/elementary/src/lib/elm_entry.c
legacy/elementary/src/lib/elm_gengrid.c
legacy/elementary/src/lib/elm_genlist.c
legacy/elementary/src/lib/elm_list.c
legacy/elementary/src/lib/elm_map.c
legacy/elementary/src/lib/elm_photocam.c

index 6ae1630..be9f6c0 100644 (file)
@@ -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
index 71cd38c..ced00a8 100644 (file)
@@ -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);
index 46e4df3..f19c25f 100644 (file)
@@ -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;
 }
index 14388c7..6f6bfe2 100644 (file)
@@ -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);
index 664f2ae..a146dfb 100644 (file)
@@ -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! */
index d069e94..b5d7df3 100644 (file)
@@ -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
index c8df8e4..83972b3 100644 (file)
@@ -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