From: Flavio Ceolin Date: Wed, 20 Mar 2013 16:39:51 +0000 (-0300) Subject: Upstream cherry-pick: X-Git-Tag: accepted/tizen/20130927.071315^2~447 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fdff0e8417b791fc5b04c313116366a33defedb2;p=profile%2Fmobile%2Felementary.git Upstream cherry-pick: Genlist, gengrid: two new smart callbacks Adding ones for mouse pressed and mouse released on items. The event info for both callbacks are the items being pressed/released. Conflicts: src/lib/elm_gengrid.c src/lib/elm_genlist.c Change-Id: I803f4129d1b07d439cd788599d4f612f41692b95 --- diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 62e9989..aef55ab 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -53,6 +53,8 @@ static const char SIG_INDEX_UPDATE[] = "index,update"; static const char SIG_HIGHLIGHTED[] = "highlighted"; static const char SIG_UNHIGHLIGHTED[] = "unhighlighted"; static const char SIG_LANG_CHANGED[] = "language,changed"; +static const char SIG_PRESSED[] = "pressed"; +static const char SIG_RELEASED[] = "released"; static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_ACTIVATED, ""}, @@ -82,6 +84,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_HIGHLIGHTED, ""}, {SIG_UNHIGHLIGHTED, ""}, {SIG_LANG_CHANGED, ""}, + {SIG_PRESSED, ""}, + {SIG_RELEASED, ""}, {NULL, NULL} }; @@ -525,6 +529,8 @@ _item_mouse_down_cb(void *data, evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it); evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it); } + + evas_object_smart_callback_call(WIDGET(it), SIG_PRESSED, it); if (it->long_timer) ecore_timer_del(it->long_timer); if (it->realized) it->long_timer = ecore_timer_add @@ -596,6 +602,7 @@ _item_mouse_up_cb(void *data, sd->on_hold = EINA_TRUE; else sd->on_hold = EINA_FALSE; + evas_object_smart_callback_call(WIDGET(it), SIG_RELEASED, it); if (it->long_timer) { ecore_timer_del(it->long_timer); diff --git a/src/lib/elm_gengrid.h b/src/lib/elm_gengrid.h index bc5719e..ed0bd2b 100644 --- a/src/lib/elm_gengrid.h +++ b/src/lib/elm_gengrid.h @@ -166,6 +166,10 @@ * - @c "activated" - The user has double-clicked or pressed * (enter|return|spacebar) on an item. The @c event_info parameter * is the gengrid item that was activated. + * - @c "pressed" - The user pressed the an item. The @c event_info + * parameter is the item that was pressed. + * - @c "released" - The user released the an item. The @c event_info + * parameter is the item that was released. * - @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 diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index a8d1add..7306458 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -75,6 +75,9 @@ static const char SIG_INDEX_UPDATE[] = "index,update"; static const char SIG_TREE_EFFECT_FINISHED [] = "tree,effect,finished"; static const char SIG_HIGHLIGHTED[] = "highlighted"; static const char SIG_UNHIGHLIGHTED[] = "unhighlighted"; +static const char SIG_LANG_CHANGED[] = "language,changed"; +static const char SIG_PRESSED[] = "pressed"; +static const char SIG_RELEASED[] = "released"; static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_CLICKED_DOUBLE, ""}, @@ -121,6 +124,9 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_TREE_EFFECT_FINISHED, ""}, {SIG_HIGHLIGHTED, ""}, {SIG_UNHIGHLIGHTED, ""}, + {SIG_LANG_CHANGED, ""}, + {SIG_PRESSED, ""}, + {SIG_RELEASED, ""}, {NULL, NULL} }; @@ -3539,6 +3545,7 @@ _item_mouse_down_cb(void *data, evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it); evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it); } + evas_object_smart_callback_call(WIDGET(it), SIG_PRESSED, it); if (it->item->swipe_timer) ecore_timer_del(it->item->swipe_timer); it->item->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it); if (it->long_timer) ecore_timer_del(it->long_timer); @@ -4029,6 +4036,7 @@ _item_mouse_up_cb(void *data, sd = GL_IT(it)->wsd; sd->mouse_down = EINA_FALSE; + evas_object_smart_callback_call(WIDGET(it), SIG_RELEASED, it); if (sd->multi_touched) { if ((!sd->multi) && (!it->selected) && (it->highlighted)) diff --git a/src/lib/elm_genlist.h b/src/lib/elm_genlist.h index c3be90d..1efcd07 100644 --- a/src/lib/elm_genlist.h +++ b/src/lib/elm_genlist.h @@ -264,6 +264,10 @@ * - @c "activated" - The user has double-clicked or pressed * (enter|return|spacebar) on an item. The @c event_info parameter is the * item that was activated. + * - @c "pressed" - The user pressed the an item. The @c event_info + * parameter is the item that was pressed. + * - @c "released" - The user released the an item. The @c event_info + * parameter is the item that was released. * - @c "clicked,double" - The user has double-clicked an item. The @c * event_info parameter is the item that was double-clicked. * - @c "selected" - This is called when a user has made an item selected.