summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2013-01-14 10:12:50 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-01-14 10:12:50 +0000
commit2e27b0409195c675e8c155af9d6a78c0f86ff512 (patch)
tree86748846b13f595c4741dba9d5cb39c2ae2a8dbb
parent7e06d3529966a8ea27543507acdbe10e021fbcb3 (diff)
elm list, genlist, gengrid: Added highlighted and unhighlighted signal callbacks.
SVN revision: 82750
-rw-r--r--ChangeLog3
-rw-r--r--NEWS1
-rw-r--r--src/lib/elm_gengrid.c6
-rw-r--r--src/lib/elm_gengrid.h4
-rw-r--r--src/lib/elm_genlist.c6
-rw-r--r--src/lib/elm_genlist.h4
-rw-r--r--src/lib/elm_list.c6
-rw-r--r--src/lib/elm_list.h4
8 files changed, 34 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c62baa9d4..059e2aad7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -899,3 +899,6 @@
899 899
900 * Don't link anymore with E_DBus at build time. 900 * Don't link anymore with E_DBus at build time.
901 901
9022013-01-13 Daniel Juyung Seo (SeoZ)
903
904 * Added "highlighted" and "unhighlighted" signals to list, genlist, and gengrid.
diff --git a/NEWS b/NEWS
index 73c778b95..daf20284b 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ Additions:
29 * Add elm_label_slide_mode_set(), elm_label_slide_mode_get() 29 * Add elm_label_slide_mode_set(), elm_label_slide_mode_get()
30 * Add elm_label_slide_go() 30 * Add elm_label_slide_go()
31 * Add a label signal callback "slide,end" 31 * Add a label signal callback "slide,end"
32 * Add "highlighted" and "unhighlighted" callbacks to list, genlist, and gengrid.
32 33
33Improvements: 34Improvements:
34 35
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 8d1457cb2..42f6000e0 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -57,6 +57,8 @@ static const char SIG_EDGE_LEFT[] = "edge,left";
57static const char SIG_EDGE_RIGHT[] = "edge,right"; 57static const char SIG_EDGE_RIGHT[] = "edge,right";
58static const char SIG_MOVED[] = "moved"; 58static const char SIG_MOVED[] = "moved";
59static const char SIG_INDEX_UPDATE[] = "index,update"; 59static const char SIG_INDEX_UPDATE[] = "index,update";
60static const char SIG_HIGHLIGHTED[] = "highlighted";
61static const char SIG_UNHIGHLIGHTED[] = "unhighlighted";
60static const Evas_Smart_Cb_Description _smart_callbacks[] = { 62static const Evas_Smart_Cb_Description _smart_callbacks[] = {
61 {SIG_ACTIVATED, ""}, 63 {SIG_ACTIVATED, ""},
62 {SIG_CLICKED_DOUBLE, ""}, 64 {SIG_CLICKED_DOUBLE, ""},
@@ -82,6 +84,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
82 {SIG_EDGE_LEFT, ""}, 84 {SIG_EDGE_LEFT, ""},
83 {SIG_EDGE_RIGHT, ""}, 85 {SIG_EDGE_RIGHT, ""},
84 {SIG_MOVED, ""}, 86 {SIG_MOVED, ""},
87 {SIG_HIGHLIGHTED, ""},
88 {SIG_UNHIGHLIGHTED, ""},
85 {NULL, NULL} 89 {NULL, NULL}
86}; 90};
87 91
@@ -260,6 +264,7 @@ _item_unselect(Elm_Gen_Item *it)
260 return; 264 return;
261 265
262 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm"); 266 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
267 evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, it);
263 it->highlighted = EINA_FALSE; 268 it->highlighted = EINA_FALSE;
264 if (it->selected) 269 if (it->selected)
265 { 270 {
@@ -445,6 +450,7 @@ _item_highlight(Elm_Gen_Item *it)
445 return; 450 return;
446 451
447 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); 452 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
453 evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, it);
448 it->highlighted = EINA_TRUE; 454 it->highlighted = EINA_TRUE;
449} 455}
450 456
diff --git a/src/lib/elm_gengrid.h b/src/lib/elm_gengrid.h
index 15e9494b4..c126c57e3 100644
--- a/src/lib/elm_gengrid.h
+++ b/src/lib/elm_gengrid.h
@@ -217,6 +217,10 @@
217 * until the left edge. 217 * until the left edge.
218 * - @c "edge,right" - This is called when the gengrid is scrolled 218 * - @c "edge,right" - This is called when the gengrid is scrolled
219 * until the right edge. 219 * until the right edge.
220 * - @c "highlighted" - an item in the list is pressed and highlighted.
221 * The %c event_info parameter is the item that was highlighted.
222 * - @c "unhighlighted" - an item in the list is unpressed and unhighlighted.
223 * The %c event_info parameter is the item that was unhighlighted.
220 * 224 *
221 * Supported elm_object common APIs 225 * Supported elm_object common APIs
222 * @li elm_object_signal_emit() 226 * @li elm_object_signal_emit()
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index f89bf518b..aefd44e23 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -66,6 +66,8 @@ static const char SIG_MOVED_AFTER[] = "moved,after";
66static const char SIG_MOVED_BEFORE[] = "moved,before"; 66static const char SIG_MOVED_BEFORE[] = "moved,before";
67static const char SIG_INDEX_UPDATE[] = "index,update"; 67static const char SIG_INDEX_UPDATE[] = "index,update";
68static const char SIG_TREE_EFFECT_FINISHED [] = "tree,effect,finished"; 68static const char SIG_TREE_EFFECT_FINISHED [] = "tree,effect,finished";
69static const char SIG_HIGHLIGHTED[] = "highlighted";
70static const char SIG_UNHIGHLIGHTED[] = "unhighlighted";
69 71
70static const Evas_Smart_Cb_Description _smart_callbacks[] = { 72static const Evas_Smart_Cb_Description _smart_callbacks[] = {
71 {SIG_CLICKED_DOUBLE, ""}, 73 {SIG_CLICKED_DOUBLE, ""},
@@ -104,6 +106,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
104 {SIG_MOVED_AFTER, ""}, 106 {SIG_MOVED_AFTER, ""},
105 {SIG_MOVED_BEFORE, ""}, 107 {SIG_MOVED_BEFORE, ""},
106 {SIG_TREE_EFFECT_FINISHED, ""}, 108 {SIG_TREE_EFFECT_FINISHED, ""},
109 {SIG_HIGHLIGHTED, ""},
110 {SIG_UNHIGHLIGHTED, ""},
107 {NULL, NULL} 111 {NULL, NULL}
108}; 112};
109 113
@@ -2568,6 +2572,7 @@ _item_highlight(Elm_Gen_Item *it)
2568 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); 2572 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
2569 if (it->deco_all_view) 2573 if (it->deco_all_view)
2570 edje_object_signal_emit(it->deco_all_view, "elm,state,selected", "elm"); 2574 edje_object_signal_emit(it->deco_all_view, "elm,state,selected", "elm");
2575 evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, it);
2571 2576
2572 selectraise = edje_object_data_get(VIEW(it), "selectraise"); 2577 selectraise = edje_object_data_get(VIEW(it), "selectraise");
2573 if ((selectraise) && (!strcmp(selectraise, "on"))) 2578 if ((selectraise) && (!strcmp(selectraise, "on")))
@@ -2587,6 +2592,7 @@ _item_unhighlight(Elm_Gen_Item *it)
2587 return; 2592 return;
2588 2593
2589 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm"); 2594 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
2595 evas_object_smart_callback_call(WIDGET(it), SIG_UNHIGHLIGHTED, it);
2590 if (it->deco_all_view) 2596 if (it->deco_all_view)
2591 edje_object_signal_emit 2597 edje_object_signal_emit
2592 (it->deco_all_view, "elm,state,unselected", "elm"); 2598 (it->deco_all_view, "elm,state,unselected", "elm");
diff --git a/src/lib/elm_genlist.h b/src/lib/elm_genlist.h
index 505a03582..2db17ae0a 100644
--- a/src/lib/elm_genlist.h
+++ b/src/lib/elm_genlist.h
@@ -350,6 +350,10 @@
350 * - @c "language,changed" - This is called when the program's language is 350 * - @c "language,changed" - This is called when the program's language is
351 * changed. 351 * changed.
352 * - @c "tree,effect,finished" - This is called when a genlist tree effect is finished. 352 * - @c "tree,effect,finished" - This is called when a genlist tree effect is finished.
353 * - @c "highlighted" - an item in the list is pressed and highlighted.
354 * The %c event_info parameter is the item that was highlighted.
355 * - @c "unhighlighted" - an item in the list is unpressed and unhighlighted.
356 * The %c event_info parameter is the item that was unhighlighted.
353 * 357 *
354 * 358 *
355 * Supported elm_object_item common APIs 359 * Supported elm_object_item common APIs
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 637ace08c..977edaaa6 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -20,6 +20,8 @@ static const char SIG_EDGE_LEFT[] = "edge,left";
20static const char SIG_EDGE_RIGHT[] = "edge,right"; 20static const char SIG_EDGE_RIGHT[] = "edge,right";
21static const char SIG_LANG_CHANGED[] = "language,changed"; 21static const char SIG_LANG_CHANGED[] = "language,changed";
22static const char SIG_SWIPE[] = "swipe"; 22static const char SIG_SWIPE[] = "swipe";
23static const char SIG_HIGHLIGHTED[] = "highlighted";
24static const char SIG_UNHIGHLIGHTED[] = "unhighlighted";
23static const Evas_Smart_Cb_Description _smart_callbacks[] = { 25static const Evas_Smart_Cb_Description _smart_callbacks[] = {
24 {SIG_ACTIVATED, ""}, 26 {SIG_ACTIVATED, ""},
25 {SIG_CLICKED_DOUBLE, ""}, 27 {SIG_CLICKED_DOUBLE, ""},
@@ -32,6 +34,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
32 {SIG_EDGE_RIGHT, ""}, 34 {SIG_EDGE_RIGHT, ""},
33 {SIG_LANG_CHANGED, ""}, 35 {SIG_LANG_CHANGED, ""},
34 {SIG_SWIPE, ""}, 36 {SIG_SWIPE, ""},
37 {SIG_HIGHLIGHTED, ""},
38 {SIG_UNHIGHLIGHTED, ""},
35 {NULL, NULL} 39 {NULL, NULL}
36}; 40};
37 41
@@ -873,6 +877,7 @@ _item_highlight(Elm_List_Item *it)
873 _elm_list_walk(sd); 877 _elm_list_walk(sd);
874 878
875 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm"); 879 edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
880 evas_object_smart_callback_call(obj, SIG_HIGHLIGHTED, it);
876 select_raise = edje_object_data_get(VIEW(it), "selectraise"); 881 select_raise = edje_object_data_get(VIEW(it), "selectraise");
877 if ((select_raise) && (!strcmp(select_raise, "on"))) 882 if ((select_raise) && (!strcmp(select_raise, "on")))
878 evas_object_raise(VIEW(it)); 883 evas_object_raise(VIEW(it));
@@ -927,6 +932,7 @@ _item_unselect(Elm_List_Item *it)
927 _elm_list_walk(sd); 932 _elm_list_walk(sd);
928 933
929 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm"); 934 edje_object_signal_emit(VIEW(it), "elm,state,unselected", "elm");
935 evas_object_smart_callback_call(obj, SIG_UNHIGHLIGHTED, it);
930 stacking = edje_object_data_get(VIEW(it), "stacking"); 936 stacking = edje_object_data_get(VIEW(it), "stacking");
931 select_raise = edje_object_data_get(VIEW(it), "selectraise"); 937 select_raise = edje_object_data_get(VIEW(it), "selectraise");
932 if ((select_raise) && (!strcmp(select_raise, "on"))) 938 if ((select_raise) && (!strcmp(select_raise, "on")))
diff --git a/src/lib/elm_list.h b/src/lib/elm_list.h
index 70a40073c..e33807b10 100644
--- a/src/lib/elm_list.h
+++ b/src/lib/elm_list.h
@@ -37,6 +37,10 @@
37 * - @c "edge,left" - the list is scrolled until the left edge 37 * - @c "edge,left" - the list is scrolled until the left edge
38 * - @c "edge,right" - the list is scrolled until the right edge 38 * - @c "edge,right" - the list is scrolled until the right edge
39 * - @c "language,changed" - the program's language changed 39 * - @c "language,changed" - the program's language changed
40 * - @c "highlighted" - an item in the list is pressed and highlighted.
41 * The %c event_info parameter is the item that was highlighted.
42 * - @c "unhighlighted" - an item in the list is unpressed and unhighlighted.
43 * The %c event_info parameter is the item that was unhighlighted.
40 * 44 *
41 * Available styles for it are: 45 * Available styles for it are:
42 * - @c "default" 46 * - @c "default"