summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-01-08 23:23:44 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-01-08 23:23:44 +0900
commit61e16eb163a1ceefbb68bc1499ee87b28bf6a988 (patch)
treed1a93507c59743107b1a3872cdb20bb98a2d8c9c
parent0e7d521151ba93f3b5955caaf9b906e160ab6057 (diff)
genlist: remove internal callback usage.
there were multiple ports for item procedures. one port is enough.
-rw-r--r--src/lib/elm_genlist.c60
1 files changed, 27 insertions, 33 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 0deacb15d..198ea6ed4 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -141,6 +141,8 @@ static const char SIGNAL_GROUP_FIRST[] = "elm,state,group,first";
141static const char SIGNAL_GROUP_LAST[] = "elm,state,group,last"; 141static const char SIGNAL_GROUP_LAST[] = "elm,state,group,last";
142static const char SIGNAL_GROUP_MIDDLE[] = "elm,state,group,middle"; 142static const char SIGNAL_GROUP_MIDDLE[] = "elm,state,group,middle";
143 143
144static void _item_unrealize(Elm_Gen_Item *it);
145static void _item_select(Elm_Gen_Item *it);
144static Eina_Bool _key_action_move(Evas_Object *obj, const char *params); 146static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
145static Eina_Bool _key_action_select(Evas_Object *obj, const char *params); 147static Eina_Bool _key_action_select(Evas_Object *obj, const char *params);
146static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params); 148static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
@@ -596,7 +598,7 @@ _elm_genlist_item_unrealize(Elm_Gen_Item *it,
596 598
597 eo_do(EO_OBJ(it), elm_wdg_item_track_cancel()); 599 eo_do(EO_OBJ(it), elm_wdg_item_track_cancel());
598 600
599 it->unrealize_cb(it); 601 _item_unrealize(it);
600 602
601 it->realized = EINA_FALSE; 603 it->realized = EINA_FALSE;
602 it->want_unrealize = EINA_FALSE; 604 it->want_unrealize = EINA_FALSE;
@@ -3633,7 +3635,7 @@ _item_unselect(Elm_Gen_Item *it)
3633{ 3635{
3634 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 3636 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
3635 3637
3636 it->unhighlight_cb(it); /* unhighlight the item first */ 3638 _item_unhighlight(it); /* unhighlight the item first */
3637 if (!it->selected) return; /* then check whether the item is selected */ 3639 if (!it->selected) return; /* then check whether the item is selected */
3638 3640
3639 if (GL_IT(it)->wsd->focus_on_selection_enabled) 3641 if (GL_IT(it)->wsd->focus_on_selection_enabled)
@@ -3680,7 +3682,7 @@ _item_mouse_move_cb(void *data,
3680 { 3682 {
3681 sd->on_hold = EINA_TRUE; 3683 sd->on_hold = EINA_TRUE;
3682 if ((!sd->wasselected) && (!it->flipped)) 3684 if ((!sd->wasselected) && (!it->flipped))
3683 it->unsel_cb(it); 3685 _item_unselect(it);
3684 } 3686 }
3685 } 3687 }
3686 if (sd->multi_touched) 3688 if (sd->multi_touched)
@@ -3778,7 +3780,7 @@ _item_mouse_move_cb(void *data,
3778 it->dragging = EINA_TRUE; 3780 it->dragging = EINA_TRUE;
3779 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 3781 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
3780 if (!sd->wasselected) 3782 if (!sd->wasselected)
3781 it->unsel_cb(it); 3783 _item_unselect(it);
3782 if (dy < 0) 3784 if (dy < 0)
3783 { 3785 {
3784 if (ady > adx) 3786 if (ady > adx)
@@ -3845,7 +3847,7 @@ _long_press_cb(void *data)
3845 EINA_LIST_FREE(list, eo_it_tmp) 3847 EINA_LIST_FREE(list, eo_it_tmp)
3846 { 3848 {
3847 ELM_GENLIST_ITEM_DATA_GET(eo_it_tmp, it_tmp); 3849 ELM_GENLIST_ITEM_DATA_GET(eo_it_tmp, it_tmp);
3848 if (it != it_tmp) it->unsel_cb(it_tmp); 3850 if (it != it_tmp) _item_unselect(it_tmp);
3849 } 3851 }
3850 3852
3851 if (elm_genlist_item_expanded_get(EO_OBJ(it))) 3853 if (elm_genlist_item_expanded_get(EO_OBJ(it)))
@@ -3988,8 +3990,7 @@ _item_multi_down_cb(void *data,
3988 sd->multi_touched = EINA_TRUE; 3990 sd->multi_touched = EINA_TRUE;
3989 sd->prev_mx = ev->canvas.x; 3991 sd->prev_mx = ev->canvas.x;
3990 sd->prev_my = ev->canvas.y; 3992 sd->prev_my = ev->canvas.y;
3991 if (!sd->wasselected) 3993 if (!sd->wasselected) _item_unselect(it);
3992 it->unsel_cb(it);
3993 sd->wasselected = EINA_FALSE; 3994 sd->wasselected = EINA_FALSE;
3994 sd->longpressed = EINA_FALSE; 3995 sd->longpressed = EINA_FALSE;
3995 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 3996 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
@@ -4102,7 +4103,7 @@ _item_mouse_down_cb(void *data,
4102 // and finally call the user callbacks. 4103 // and finally call the user callbacks.
4103 // NOTE: keep this code at the bottom, as the user can change the 4104 // NOTE: keep this code at the bottom, as the user can change the
4104 // list at this point (clear, delete, etc...) 4105 // list at this point (clear, delete, etc...)
4105 it->highlight_cb(it); 4106 _item_highlight(it);
4106 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 4107 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
4107 { 4108 {
4108 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, eo_it); 4109 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, eo_it);
@@ -4601,11 +4602,11 @@ _access_activate_cb(void *data EINA_UNUSED,
4601 { 4602 {
4602 if (!it->selected) 4603 if (!it->selected)
4603 { 4604 {
4604 it->highlight_cb(it); 4605 _item_highlight(it);
4605 it->sel_cb(it); 4606 _item_select(it);
4606 } 4607 }
4607 else 4608 else
4608 it->unsel_cb(it); 4609 _item_unselect(it);
4609 } 4610 }
4610 else 4611 else
4611 { 4612 {
@@ -4615,7 +4616,7 @@ _access_activate_cb(void *data EINA_UNUSED,
4615 { 4616 {
4616 Elm_Object_Item *eo_sel = sd->selected->data; 4617 Elm_Object_Item *eo_sel = sd->selected->data;
4617 Elm_Gen_Item *sel = eo_data_scope_get(eo_sel, ELM_GENLIST_ITEM_CLASS); 4618 Elm_Gen_Item *sel = eo_data_scope_get(eo_sel, ELM_GENLIST_ITEM_CLASS);
4618 it->unsel_cb(sel); 4619 _item_unselect(sel);
4619 } 4620 }
4620 } 4621 }
4621 else 4622 else
@@ -4627,11 +4628,11 @@ _access_activate_cb(void *data EINA_UNUSED,
4627 { 4628 {
4628 ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2); 4629 ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2);
4629 if (it2 != it) 4630 if (it2 != it)
4630 it->unsel_cb(it2); 4631 _item_unselect(it2);
4631 } 4632 }
4632 } 4633 }
4633 it->highlight_cb(it); 4634 _item_highlight(it);
4634 it->sel_cb(it); 4635 _item_select(it);
4635 } 4636 }
4636} 4637}
4637 4638
@@ -4696,7 +4697,7 @@ _item_mouse_up_cb(void *data,
4696 if (sd->multi_touched) 4697 if (sd->multi_touched)
4697 { 4698 {
4698 if ((!sd->multi) && (!it->selected) && (it->highlighted)) 4699 if ((!sd->multi) && (!it->selected) && (it->highlighted))
4699 it->unhighlight_cb(it); 4700 _item_unhighlight(it);
4700 if (sd->multi_down) return; 4701 if (sd->multi_down) return;
4701 _multi_touch_gesture_eval(it); 4702 _multi_touch_gesture_eval(it);
4702 return; 4703 return;
@@ -4753,7 +4754,7 @@ _item_mouse_up_cb(void *data,
4753 { 4754 {
4754 sd->longpressed = EINA_FALSE; 4755 sd->longpressed = EINA_FALSE;
4755 if ((!sd->wasselected) && (!it->flipped)) 4756 if ((!sd->wasselected) && (!it->flipped))
4756 it->unsel_cb(it); 4757 _item_unselect(it);
4757 sd->wasselected = EINA_FALSE; 4758 sd->wasselected = EINA_FALSE;
4758 return; 4759 return;
4759 } 4760 }
@@ -4779,11 +4780,11 @@ _item_mouse_up_cb(void *data,
4779 { 4780 {
4780 if (!it->selected) 4781 if (!it->selected)
4781 { 4782 {
4782 it->highlight_cb(it); 4783 _item_highlight(it);
4783 it->sel_cb(it); 4784 _item_select(it);
4784 } 4785 }
4785 else 4786 else
4786 it->unsel_cb(it); 4787 _item_unselect(it);
4787 } 4788 }
4788 else 4789 else
4789 { 4790 {
@@ -4793,7 +4794,7 @@ _item_mouse_up_cb(void *data,
4793 { 4794 {
4794 Elm_Object_Item *eo_sel = sd->selected->data; 4795 Elm_Object_Item *eo_sel = sd->selected->data;
4795 Elm_Gen_Item *sel = eo_data_scope_get(eo_sel, ELM_GENLIST_ITEM_CLASS); 4796 Elm_Gen_Item *sel = eo_data_scope_get(eo_sel, ELM_GENLIST_ITEM_CLASS);
4796 it->unsel_cb(sel); 4797 _item_unselect(sel);
4797 } 4798 }
4798 } 4799 }
4799 else 4800 else
@@ -4805,11 +4806,11 @@ _item_mouse_up_cb(void *data,
4805 { 4806 {
4806 ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2); 4807 ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2);
4807 if (it2 != it) 4808 if (it2 != it)
4808 it->unsel_cb(it2); 4809 _item_unselect(it2);
4809 } 4810 }
4810 } 4811 }
4811 it->highlight_cb(it); 4812 _item_highlight(it);
4812 it->sel_cb(it); 4813 _item_select(it);
4813 } 4814 }
4814 4815
4815 if (sd->focused_item != EO_OBJ(it)) 4816 if (sd->focused_item != EO_OBJ(it))
@@ -4923,7 +4924,7 @@ _decorate_item_finished_signal_cb(void *data,
4923} 4924}
4924 4925
4925static void 4926static void
4926_item_unrealize_cb(Elm_Gen_Item *it) 4927_item_unrealize(Elm_Gen_Item *it)
4927{ 4928{
4928 Evas_Object *content; 4929 Evas_Object *content;
4929 EINA_LIST_FREE(it->item->flip_contents, content) 4930 EINA_LIST_FREE(it->item->flip_contents, content)
@@ -5893,13 +5894,6 @@ _elm_genlist_item_new(Elm_Genlist_Data *sd,
5893 it->func.func = func; 5894 it->func.func = func;
5894 it->func.data = func_data; 5895 it->func.data = func_data;
5895 5896
5896 it->del_cb = (Ecore_Cb)_item_del;
5897 it->highlight_cb = (Ecore_Cb)_item_highlight;
5898 it->unhighlight_cb = (Ecore_Cb)_item_unhighlight;
5899 it->sel_cb = (Ecore_Cb)_item_select;
5900 it->unsel_cb = (Ecore_Cb)_item_unselect;
5901 it->unrealize_cb = (Ecore_Cb)_item_unrealize_cb;
5902
5903 GL_IT(it) = ELM_NEW(Elm_Gen_Item_Type); 5897 GL_IT(it) = ELM_NEW(Elm_Gen_Item_Type);
5904 GL_IT(it)->wsd = sd; 5898 GL_IT(it)->wsd = sd;
5905 GL_IT(it)->type = type; 5899 GL_IT(it)->type = type;
@@ -7505,7 +7499,7 @@ _flip_job(void *data)
7505 Elm_Gen_Item *it = (Elm_Gen_Item *)data; 7499 Elm_Gen_Item *it = (Elm_Gen_Item *)data;
7506 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); 7500 ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
7507 7501
7508 it->unsel_cb(it); 7502 _item_unselect(it);
7509 _elm_genlist_item_unrealize(it, EINA_FALSE); 7503 _elm_genlist_item_unrealize(it, EINA_FALSE);
7510 7504
7511 it->flipped = EINA_TRUE; 7505 it->flipped = EINA_TRUE;