summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-10 16:57:57 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-11 13:30:27 +0200
commitd512ff68ae41b71956c60d335216e93b33df2afb (patch)
tree11ca9e60398a44a100d8ac71d19bce8ce0a27f4e
parentd30fc5f5d3a150ce847470caf5140719eef638cc (diff)
efl_ui_item: remove internal pointer to select_mode
there was this internal pointer to select_mode for getting the selection mode of the container. However, we now have API for checking this, so there is exactly 0 reason for doing this like this. Additionally, with the old way of doing, bildings like C# or lua are just lost, they cannot use this class at all in there implementations, as they cannot access the privat data. ref T905 Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D9263
-rw-r--r--src/lib/elementary/efl_ui_grid.c7
-rw-r--r--src/lib/elementary/efl_ui_item.c17
-rw-r--r--src/lib/elementary/efl_ui_item_private.h1
-rw-r--r--src/lib/elementary/efl_ui_list.c7
4 files changed, 12 insertions, 20 deletions
diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c
index 36d069b5c7..20ef53d2f1 100644
--- a/src/lib/elementary/efl_ui_grid.c
+++ b/src/lib/elementary/efl_ui_grid.c
@@ -746,10 +746,6 @@ _grid_item_process(Eo *obj, Efl_Ui_Grid_Data *pd, EINA_UNUSED Efl_Ui_Grid_Item *
746 if (!efl_ui_widget_sub_object_add(obj, it)) 746 if (!efl_ui_widget_sub_object_add(obj, it))
747 return EINA_FALSE; 747 return EINA_FALSE;
748 748
749 //FIXME: This is tricky workaround for set select mode and parent value.
750 EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(it, gd, EINA_FALSE);
751 EFL_UI_ITEM_DATA_GET_OR_RETURN(it, id, EINA_FALSE);
752 id->select_mode = &(pd->select_mode);
753 efl_ui_item_container_set(it, obj); 749 efl_ui_item_container_set(it, obj);
754 efl_canvas_group_member_add(pd->pan, it); 750 efl_canvas_group_member_add(pd->pan, it);
755 efl_ui_mirrored_set(it, efl_ui_mirrored_get(obj)); 751 efl_ui_mirrored_set(it, efl_ui_mirrored_get(obj));
@@ -768,9 +764,6 @@ static void
768_grid_item_unpack_internal(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Ui_Grid_Item *it) 764_grid_item_unpack_internal(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Ui_Grid_Item *it)
769{ 765{
770 EFL_UI_GRID_ITEM_CHECK_OR_RETURN(it); 766 EFL_UI_GRID_ITEM_CHECK_OR_RETURN(it);
771 EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(it, gd);
772 EFL_UI_ITEM_DATA_GET_OR_RETURN(it, id);
773 id->select_mode = NULL;
774 efl_ui_item_container_set(it, NULL); 767 efl_ui_item_container_set(it, NULL);
775 768
776 pd->items = eina_list_remove(pd->items, it); 769 pd->items = eina_list_remove(pd->items, it);
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
index 47d7b632a5..8b16afd5f2 100644
--- a/src/lib/elementary/efl_ui_item.c
+++ b/src/lib/elementary/efl_ui_item.c
@@ -143,10 +143,12 @@ _efl_ui_item_part_content_efl_content_content_unset(Eo *obj, void *pd EINA_UNUSE
143static void 143static void
144_item_select(Eo *obj, Efl_Ui_Item_Data *pd) 144_item_select(Eo *obj, Efl_Ui_Item_Data *pd)
145{ 145{
146 if (pd->selected && 146 Efl_Ui_Select_Mode m;
147 (*(pd->select_mode) != EFL_UI_SELECT_MODE_SINGLE_ALWAYS)) 147 if (!pd->parent)
148 return;
149 m = efl_ui_select_mode_get(pd->parent);
150 if (m == EFL_UI_SELECT_MODE_NONE || (pd->selected && m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS))
148 return; 151 return;
149 if (*(pd->select_mode) == EFL_UI_SELECT_MODE_NONE) return;
150 152
151 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 153 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
152 154
@@ -206,6 +208,10 @@ _item_mouse_up(void *data,
206{ 208{
207 Evas_Event_Mouse_Up *ev = event_info; 209 Evas_Event_Mouse_Up *ev = event_info;
208 Eo *item = data; 210 Eo *item = data;
211 Efl_Ui_Select_Mode m;
212
213 if (!efl_ui_item_container_get(item))
214 return;
209 EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd); 215 EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd);
210 ELM_WIDGET_DATA_GET_OR_RETURN(item, wd); 216 ELM_WIDGET_DATA_GET_OR_RETURN(item, wd);
211 if (wd->disabled) return; 217 if (wd->disabled) return;
@@ -226,9 +232,10 @@ _item_mouse_up(void *data,
226 edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl"); 232 edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl");
227 efl_event_callback_call(item, EFL_UI_EVENT_UNPRESSED, NULL); 233 efl_event_callback_call(item, EFL_UI_EVENT_UNPRESSED, NULL);
228 234
229 if ((*(pd->select_mode) != EFL_UI_SELECT_MODE_SINGLE_ALWAYS) && (pd->selected)) 235 m = efl_ui_select_mode_get(efl_ui_item_container_get(item));
236 if ((m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS) && (pd->selected))
230 _item_unselect(item, pd); 237 _item_unselect(item, pd);
231 else if (*(pd->select_mode) != EFL_UI_SELECT_MODE_NONE) 238 else if (m != EFL_UI_SELECT_MODE_NONE)
232 _item_select(item, pd); 239 _item_select(item, pd);
233} 240}
234 241
diff --git a/src/lib/elementary/efl_ui_item_private.h b/src/lib/elementary/efl_ui_item_private.h
index b8849a2316..ea8ac073c9 100644
--- a/src/lib/elementary/efl_ui_item_private.h
+++ b/src/lib/elementary/efl_ui_item_private.h
@@ -9,7 +9,6 @@ typedef struct _Efl_Ui_Item_Data
9 Eo *obj; /* Self-Object */ 9 Eo *obj; /* Self-Object */
10 Eo *parent; /* Parent Widget */ 10 Eo *parent; /* Parent Widget */
11 11
12 Efl_Ui_Select_Mode *select_mode; /* Select Mdoe of parent widget */
13 Ecore_Timer *longpress_timer; /* Timer for longpress handle */ 12 Ecore_Timer *longpress_timer; /* Timer for longpress handle */
14 13
15 // Boolean Data 14 // Boolean Data
diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c
index 971754ca88..bc7ee583a6 100644
--- a/src/lib/elementary/efl_ui_list.c
+++ b/src/lib/elementary/efl_ui_list.c
@@ -671,10 +671,6 @@ _list_item_process(Eo *obj, Efl_Ui_List_Data *pd, EINA_UNUSED Efl_Ui_List_Item *
671{ 671{
672 EFL_UI_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE); 672 EFL_UI_LIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
673 673
674 //FIXME: This is tricky workaround for set select mode and parent value.
675 EFL_UI_LIST_ITEM_DATA_GET_OR_RETURN(it, ld, EINA_FALSE);
676 EFL_UI_ITEM_DATA_GET_OR_RETURN(it, id, EINA_FALSE);
677 id->select_mode = &(pd->select_mode);
678 efl_ui_item_container_set(it, obj); 674 efl_ui_item_container_set(it, obj);
679 efl_ui_mirrored_set(it, efl_ui_mirrored_get(obj)); 675 efl_ui_mirrored_set(it, efl_ui_mirrored_get(obj));
680 676
@@ -691,9 +687,6 @@ static void
691_list_item_clear(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED, EINA_UNUSED Efl_Ui_List_Item *it) 687_list_item_clear(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED, EINA_UNUSED Efl_Ui_List_Item *it)
692{ 688{
693 EFL_UI_LIST_ITEM_CHECK_OR_RETURN(it); 689 EFL_UI_LIST_ITEM_CHECK_OR_RETURN(it);
694 EFL_UI_LIST_ITEM_DATA_GET_OR_RETURN(it, ld);
695 EFL_UI_ITEM_DATA_GET_OR_RETURN(it, id);
696 id->select_mode = NULL;
697 efl_ui_item_container_set(it, NULL); 690 efl_ui_item_container_set(it, NULL);
698 691
699 efl_event_callback_del(it, EFL_UI_EVENT_PRESSED, _list_item_pressed, obj); 692 efl_event_callback_del(it, EFL_UI_EVENT_PRESSED, _list_item_pressed, obj);