gengrid already emits "longpressed" signals, but it is not currently
documented nor demonstrated in the examples.  See the attached patch,
please.
Index: elementary/src/lib/elm_gengrid.c
===================================================================
--- elementary/src/lib/elm_gengrid.c	(revision 63305)
+++ elementary/src/lib/elm_gengrid.c	(working copy)
@@ -128,6 +128,7 @@
 
 static const char SIG_ACTIVATED[] = "activated";
 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
+static const char SIG_LONGPRESSED[] = "longpressed";
 static const char SIG_SELECTED[] = "selected";
 static const char SIG_UNSELECTED[] = "unselected";
 static const char SIG_REALIZED[] = "realized";
@@ -149,6 +150,7 @@
 static const Evas_Smart_Cb_Description _signals[] = {
    {SIG_ACTIVATED, ""},
    {SIG_CLICKED_DOUBLE, ""},
+   {SIG_LONGPRESSED, ""},
    {SIG_SELECTED, ""},
    {SIG_UNSELECTED, ""},
    {SIG_REALIZED, ""},
@@ -755,7 +757,7 @@
    item->long_timer = NULL;
    if ((item->disabled) || (item->dragging)) return ECORE_CALLBACK_CANCEL;
    item->wd->longpressed = EINA_TRUE;
-   evas_object_smart_callback_call(item->wd->self, "longpressed", item);
+   evas_object_smart_callback_call(item->wd->self, SIG_LONGPRESSED, item);
    if (item->wd->reorder_mode)
      {
         item->wd->reorder_item = item;
Index: elementary/src/lib/Elementary.h.in
===================================================================
--- elementary/src/lib/Elementary.h.in	(revision 63305)
+++ elementary/src/lib/Elementary.h.in	(working copy)
@@ -7817,6 +7817,8 @@
     *   is the gengrid item that was activated.
     * - @c "clicked,double" - The user has double-clicked an item.
     *   The @c event_info parameter is the gengrid item that was double-clicked.
+    * - @c "longpressed" - This is called when the item is pressed for a certain
+    *   amount of time. By default it's 1 second.
     * - @c "selected" - The user has made an item selected. The
     *   @c event_info parameter is the gengrid item that was selected.
     * - @c "unselected" - The user has made an item unselected. The
Index: elementary/src/examples/gengrid_example.c
===================================================================
--- elementary/src/examples/gengrid_example.c	(revision 63305)
+++ elementary/src/examples/gengrid_example.c	(working copy)
@@ -288,6 +288,16 @@
    fprintf(stdout, "Double click on item with handle %p\n", event_info);
 }
 
+/* item long press callback */
+static void
+_long_pressed(void        *data __UNUSED__,
+              Evas_Object *obj __UNUSED__,
+              void        *event_info)
+{
+   fprintf(stdout, "Long press on item with handle %p\n", event_info);
+}
+
+
 /* label fetching callback */
 static char *
 _grid_label_get(void        *data,
@@ -428,6 +438,7 @@
    evas_object_size_hint_min_set(grid, 600, 500);
    elm_box_pack_end(bx, grid);
    evas_object_smart_callback_add(grid, "clicked,double", _double_click, NULL);
+   evas_object_smart_callback_add(grid, "longpressed", _long_pressed, NULL);
    evas_object_show(grid);
 
    hbx_1 = elm_box_add(win);
------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to