diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index c62baa9d41..059e2aad79 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -899,3 +899,6 @@ * Don't link anymore with E_DBus at build time. +2013-01-13 Daniel Juyung Seo (SeoZ) + + * Added "highlighted" and "unhighlighted" signals to list, genlist, and gengrid. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 73c778b959..daf20284b9 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -29,6 +29,7 @@ Additions: * Add elm_label_slide_mode_set(), elm_label_slide_mode_get() * Add elm_label_slide_go() * Add a label signal callback "slide,end" + * Add "highlighted" and "unhighlighted" callbacks to list, genlist, and gengrid. Improvements: diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c index 8d1457cb2c..42f6000e0b 100644 --- a/legacy/elementary/src/lib/elm_gengrid.c +++ b/legacy/elementary/src/lib/elm_gengrid.c @@ -57,6 +57,8 @@ static const char SIG_EDGE_LEFT[] = "edge,left"; static const char SIG_EDGE_RIGHT[] = "edge,right"; static const char SIG_MOVED[] = "moved"; static const char SIG_INDEX_UPDATE[] = "index,update"; +static const char SIG_HIGHLIGHTED[] = "highlighted"; +static const char SIG_UNHIGHLIGHTED[] = "unhighlighted"; static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_ACTIVATED, ""}, {SIG_CLICKED_DOUBLE, ""}, @@ -82,6 +84,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_EDGE_LEFT, ""}, {SIG_EDGE_RIGHT, ""}, {SIG_MOVED, ""}, + {SIG_HIGHLIGHTED, ""}, + {SIG_UNHIGHLIGHTED, ""}, {NULL, NULL} }; @@ -260,6 +264,7 @@ _item_unselect(Elm_Gen_Item *it) return; edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm"); + evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, it); it->highlighted = EINA_FALSE; if (it->selected) { @@ -445,6 +450,7 @@ _item_highlight(Elm_Gen_Item *it) return; edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); + evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, it); it->highlighted = EINA_TRUE; } diff --git a/legacy/elementary/src/lib/elm_gengrid.h b/legacy/elementary/src/lib/elm_gengrid.h index 15e9494b43..c126c57e33 100644 --- a/legacy/elementary/src/lib/elm_gengrid.h +++ b/legacy/elementary/src/lib/elm_gengrid.h @@ -217,6 +217,10 @@ * until the left edge. * - @c "edge,right" - This is called when the gengrid is scrolled * until the right edge. + * - @c "highlighted" - an item in the list is pressed and highlighted. + * The %c event_info parameter is the item that was highlighted. + * - @c "unhighlighted" - an item in the list is unpressed and unhighlighted. + * The %c event_info parameter is the item that was unhighlighted. * * Supported elm_object common APIs * @li elm_object_signal_emit() diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index f89bf518bd..aefd44e23a 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -66,6 +66,8 @@ static const char SIG_MOVED_AFTER[] = "moved,after"; static const char SIG_MOVED_BEFORE[] = "moved,before"; 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 Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_CLICKED_DOUBLE, ""}, @@ -104,6 +106,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_MOVED_AFTER, ""}, {SIG_MOVED_BEFORE, ""}, {SIG_TREE_EFFECT_FINISHED, ""}, + {SIG_HIGHLIGHTED, ""}, + {SIG_UNHIGHLIGHTED, ""}, {NULL, NULL} }; @@ -2568,6 +2572,7 @@ _item_highlight(Elm_Gen_Item *it) edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); if (it->deco_all_view) edje_object_signal_emit(it->deco_all_view, "elm,state,selected", "elm"); + evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, it); selectraise = edje_object_data_get(VIEW(it), "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) @@ -2587,6 +2592,7 @@ _item_unhighlight(Elm_Gen_Item *it) return; edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm"); + evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, it); if (it->deco_all_view) edje_object_signal_emit (it->deco_all_view, "elm,state,unselected", "elm"); diff --git a/legacy/elementary/src/lib/elm_genlist.h b/legacy/elementary/src/lib/elm_genlist.h index 505a035825..2db17ae0a4 100644 --- a/legacy/elementary/src/lib/elm_genlist.h +++ b/legacy/elementary/src/lib/elm_genlist.h @@ -350,6 +350,10 @@ * - @c "language,changed" - This is called when the program's language is * changed. * - @c "tree,effect,finished" - This is called when a genlist tree effect is finished. + * - @c "highlighted" - an item in the list is pressed and highlighted. + * The %c event_info parameter is the item that was highlighted. + * - @c "unhighlighted" - an item in the list is unpressed and unhighlighted. + * The %c event_info parameter is the item that was unhighlighted. * * * Supported elm_object_item common APIs diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index 637ace08c0..977edaaa6c 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -20,6 +20,8 @@ static const char SIG_EDGE_LEFT[] = "edge,left"; static const char SIG_EDGE_RIGHT[] = "edge,right"; static const char SIG_LANG_CHANGED[] = "language,changed"; static const char SIG_SWIPE[] = "swipe"; +static const char SIG_HIGHLIGHTED[] = "highlighted"; +static const char SIG_UNHIGHLIGHTED[] = "unhighlighted"; static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_ACTIVATED, ""}, {SIG_CLICKED_DOUBLE, ""}, @@ -32,6 +34,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_EDGE_RIGHT, ""}, {SIG_LANG_CHANGED, ""}, {SIG_SWIPE, ""}, + {SIG_HIGHLIGHTED, ""}, + {SIG_UNHIGHLIGHTED, ""}, {NULL, NULL} }; @@ -873,6 +877,7 @@ _item_highlight(Elm_List_Item *it) _elm_list_walk(sd); edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); + evas_object_smart_callback_call(obj, SIG_HIGHLIGHTED, it); select_raise = edje_object_data_get(VIEW(it), "selectraise"); if ((select_raise) && (!strcmp(select_raise, "on"))) evas_object_raise(VIEW(it)); @@ -927,6 +932,7 @@ _item_unselect(Elm_List_Item *it) _elm_list_walk(sd); edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm"); + evas_object_smart_callback_call(obj, SIG_UNHIGHLIGHTED, it); stacking = edje_object_data_get(VIEW(it), "stacking"); select_raise = edje_object_data_get(VIEW(it), "selectraise"); if ((select_raise) && (!strcmp(select_raise, "on"))) diff --git a/legacy/elementary/src/lib/elm_list.h b/legacy/elementary/src/lib/elm_list.h index 70a40073cc..e33807b105 100644 --- a/legacy/elementary/src/lib/elm_list.h +++ b/legacy/elementary/src/lib/elm_list.h @@ -37,6 +37,10 @@ * - @c "edge,left" - the list is scrolled until the left edge * - @c "edge,right" - the list is scrolled until the right edge * - @c "language,changed" - the program's language changed + * - @c "highlighted" - an item in the list is pressed and highlighted. + * The %c event_info parameter is the item that was highlighted. + * - @c "unhighlighted" - an item in the list is unpressed and unhighlighted. + * The %c event_info parameter is the item that was unhighlighted. * * Available styles for it are: * - @c "default"