summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_gengrid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_gengrid.c')
-rw-r--r--src/lib/elementary/elm_gengrid.c55
1 files changed, 30 insertions, 25 deletions
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index febe0b8..d1851b1 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -13,11 +13,12 @@
13#include "elm_priv.h" 13#include "elm_priv.h"
14#include "elm_widget_gengrid.h" 14#include "elm_widget_gengrid.h"
15#include "elm_interface_scrollable.h" 15#include "elm_interface_scrollable.h"
16#include "efl_ui_focus_parent_provider_gen.eo.h" 16#include "elm_pan_eo.h"
17#include "efl_ui_focus_parent_provider_gen_eo.h"
17#include "efl_ui_focus_composition_adapter.eo.h" 18#include "efl_ui_focus_composition_adapter.eo.h"
18#include "elm_gengrid_item.eo.h" 19#include "elm_gengrid_item_eo.h"
19#include "elm_gengrid_pan.eo.h" 20#include "elm_gengrid_pan_eo.h"
20#include "elm_gengrid.eo.h" 21#include "elm_gengrid_eo.h"
21 22
22#define MY_PAN_CLASS ELM_GENGRID_PAN_CLASS 23#define MY_PAN_CLASS ELM_GENGRID_PAN_CLASS
23 24
@@ -205,6 +206,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents)
205 Item_Cache *itc = NULL; 206 Item_Cache *itc = NULL;
206 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 207 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
207 Evas_Object *obj = sd->obj; 208 Evas_Object *obj = sd->obj;
209 Evas_Object *win = elm_widget_top_get(obj);
208 210
209 evas_event_freeze(evas_object_evas_get(obj)); 211 evas_event_freeze(evas_object_evas_get(obj));
210 if (sd->item_cache_max > 0) 212 if (sd->item_cache_max > 0)
@@ -230,7 +232,7 @@ _item_cache_add(Elm_Gen_Item *it, Eina_List *contents)
230 if (elm_wdg_item_disabled_get(EO_OBJ(it))) 232 if (elm_wdg_item_disabled_get(EO_OBJ(it)))
231 edje_object_signal_emit(itc->base_view, "elm,state,enabled", "elm"); 233 edje_object_signal_emit(itc->base_view, "elm,state,enabled", "elm");
232 if ((EO_OBJ(it) == sd->focused_item) && 234 if ((EO_OBJ(it) == sd->focused_item) &&
233 (elm_widget_focus_highlight_enabled_get(obj) || _elm_config->win_auto_focus_enable)) 235 (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable))
234 edje_object_signal_emit(itc->base_view, "elm,state,unfocused", "elm"); 236 edje_object_signal_emit(itc->base_view, "elm,state,unfocused", "elm");
235 237
236 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 238 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
@@ -722,7 +724,7 @@ _item_unselect(Elm_Gen_Item *it)
722 efl_event_callback_legacy_call 724 efl_event_callback_legacy_call
723 (WIDGET(it), EFL_UI_EVENT_UNSELECTED, eo_it); 725 (WIDGET(it), EFL_UI_EVENT_UNSELECTED, eo_it);
724 if (_elm_config->atspi_mode) 726 if (_elm_config->atspi_mode)
725 efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_FALSE); 727 efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_SELECTED, EINA_FALSE);
726 } 728 }
727} 729}
728 730
@@ -1106,6 +1108,7 @@ _item_content_realize(Elm_Gen_Item *it,
1106 _elm_widget_full_eval(content); 1108 _elm_widget_full_eval(content);
1107 } 1109 }
1108 1110
1111 elm_widget_sub_object_add(WIDGET(it), content);
1109 if (elm_wdg_item_disabled_get(EO_OBJ(it))) 1112 if (elm_wdg_item_disabled_get(EO_OBJ(it)))
1110 elm_widget_disabled_set(content, EINA_TRUE); 1113 elm_widget_disabled_set(content, EINA_TRUE);
1111 1114
@@ -1169,10 +1172,10 @@ _view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style)
1169 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 1172 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
1170 snprintf(buf, sizeof(buf), "item/%s", style ? style : "default"); 1173 snprintf(buf, sizeof(buf), "item/%s", style ? style : "default");
1171 1174
1172 Efl_Ui_Theme_Apply_Result th_ret = 1175 Eina_Error th_ret =
1173 elm_widget_theme_object_set(WIDGET(it), view, "gengrid", buf, 1176 elm_widget_theme_object_set(WIDGET(it), view, "gengrid", buf,
1174 elm_widget_style_get(WIDGET(it))); 1177 elm_widget_style_get(WIDGET(it)));
1175 if (th_ret == EFL_UI_THEME_APPLY_RESULT_FAIL) 1178 if (th_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC)
1176 { 1179 {
1177 ERR("%s is not a valid gengrid item style. " 1180 ERR("%s is not a valid gengrid item style. "
1178 "Automatically falls back into default style.", 1181 "Automatically falls back into default style.",
@@ -1229,7 +1232,7 @@ _elm_gengrid_item_all_contents_unset(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it,
1229 1232
1230 EINA_LIST_FREE (it->contents, content) 1233 EINA_LIST_FREE (it->contents, content)
1231 { 1234 {
1232 evas_object_smart_member_del(content); 1235 _elm_widget_sub_object_redirect_to_top(WIDGET(it), content);
1233 // edje can be reused by item caching, 1236 // edje can be reused by item caching,
1234 // content should be un-swallowed from edje 1237 // content should be un-swallowed from edje
1235 edje_object_part_unswallow(VIEW(it), content); 1238 edje_object_part_unswallow(VIEW(it), content);
@@ -1560,9 +1563,10 @@ _elm_gengrid_item_focus_update(Elm_Gen_Item *it)
1560{ 1563{
1561 const char *focus_raise; 1564 const char *focus_raise;
1562 Evas_Object *obj = WIDGET(it); 1565 Evas_Object *obj = WIDGET(it);
1566 Evas_Object *win = elm_widget_top_get(obj);
1563 ELM_GENGRID_DATA_GET(obj, sd); 1567 ELM_GENGRID_DATA_GET(obj, sd);
1564 1568
1565 if (elm_widget_focus_highlight_enabled_get(obj) || _elm_config->win_auto_focus_enable) 1569 if (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable)
1566 { 1570 {
1567 edje_object_signal_emit 1571 edje_object_signal_emit
1568 (VIEW(it), "elm,state,focused", "elm"); 1572 (VIEW(it), "elm,state,focused", "elm");
@@ -2305,7 +2309,7 @@ _elm_gengrid_pan_class_constructor(Efl_Class *klass)
2305 evas_smart_legacy_type_register(MY_PAN_CLASS_NAME_LEGACY, klass); 2309 evas_smart_legacy_type_register(MY_PAN_CLASS_NAME_LEGACY, klass);
2306} 2310}
2307 2311
2308#include "elm_gengrid_pan.eo.c" 2312#include "elm_gengrid_pan_eo.c"
2309 2313
2310static void 2314static void
2311_elm_gengrid_item_focused(Elm_Object_Item *eo_it) 2315_elm_gengrid_item_focused(Elm_Object_Item *eo_it)
@@ -2349,7 +2353,7 @@ _elm_gengrid_item_focused(Elm_Object_Item *eo_it)
2349 2353
2350 efl_event_callback_legacy_call(obj, ELM_GENGRID_EVENT_ITEM_FOCUSED, eo_it); 2354 efl_event_callback_legacy_call(obj, ELM_GENGRID_EVENT_ITEM_FOCUSED, eo_it);
2351 if (_elm_config->atspi_mode) 2355 if (_elm_config->atspi_mode)
2352 efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE); 2356 efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_TRUE);
2353} 2357}
2354 2358
2355static void 2359static void
@@ -2357,6 +2361,7 @@ _elm_gengrid_item_unfocused(Elm_Object_Item *eo_it)
2357{ 2361{
2358 ELM_GENGRID_ITEM_DATA_GET(eo_it, it); 2362 ELM_GENGRID_ITEM_DATA_GET(eo_it, it);
2359 Evas_Object *obj = WIDGET(it); 2363 Evas_Object *obj = WIDGET(it);
2364 Evas_Object *win = elm_widget_top_get(obj);
2360 ELM_GENGRID_DATA_GET(obj, sd); 2365 ELM_GENGRID_DATA_GET(obj, sd);
2361 2366
2362 if (it->generation < sd->generation) 2367 if (it->generation < sd->generation)
@@ -2369,7 +2374,7 @@ _elm_gengrid_item_unfocused(Elm_Object_Item *eo_it)
2369 (eo_it != sd->focused_item)) 2374 (eo_it != sd->focused_item))
2370 return; 2375 return;
2371 2376
2372 if (elm_widget_focus_highlight_enabled_get(obj) || _elm_config->win_auto_focus_enable) 2377 if (elm_win_focus_highlight_enabled_get(win) || _elm_config->win_auto_focus_enable)
2373 { 2378 {
2374 ELM_GENGRID_ITEM_DATA_GET(sd->focused_item, focus_it); 2379 ELM_GENGRID_ITEM_DATA_GET(sd->focused_item, focus_it);
2375 edje_object_signal_emit 2380 edje_object_signal_emit
@@ -2379,7 +2384,7 @@ _elm_gengrid_item_unfocused(Elm_Object_Item *eo_it)
2379 sd->focused_item = NULL; 2384 sd->focused_item = NULL;
2380 efl_event_callback_legacy_call(obj, ELM_GENGRID_EVENT_ITEM_UNFOCUSED, eo_it); 2385 efl_event_callback_legacy_call(obj, ELM_GENGRID_EVENT_ITEM_UNFOCUSED, eo_it);
2381 if (_elm_config->atspi_mode) 2386 if (_elm_config->atspi_mode)
2382 efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_FOCUSED, EINA_FALSE); 2387 efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_FOCUSED, EINA_FALSE);
2383} 2388}
2384 2389
2385static Eina_Bool 2390static Eina_Bool
@@ -3586,12 +3591,12 @@ _mirrored_set(Evas_Object *obj,
3586 } 3591 }
3587} 3592}
3588 3593
3589EOLIAN static Efl_Ui_Theme_Apply_Result 3594EOLIAN static Eina_Error
3590_elm_gengrid_efl_ui_widget_theme_apply(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED) 3595_elm_gengrid_efl_ui_widget_theme_apply(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED)
3591{ 3596{
3592 Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; 3597 Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
3593 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); 3598 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
3594 if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; 3599 if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;
3595 3600
3596 _mirrored_set(obj, efl_ui_mirrored_get(obj)); 3601 _mirrored_set(obj, efl_ui_mirrored_get(obj));
3597 3602
@@ -3955,7 +3960,7 @@ _item_select(Elm_Gen_Item *it)
3955 { 3960 {
3956 efl_event_callback_legacy_call(WIDGET(it), EFL_UI_EVENT_SELECTED, eo_it); 3961 efl_event_callback_legacy_call(WIDGET(it), EFL_UI_EVENT_SELECTED, eo_it);
3957 if (_elm_config->atspi_mode) 3962 if (_elm_config->atspi_mode)
3958 efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_SELECTED, EINA_TRUE); 3963 efl_access_state_changed_signal_emit(eo_it, EFL_ACCESS_STATE_TYPE_SELECTED, EINA_TRUE);
3959 } 3964 }
3960 3965
3961 efl_ref(eo_it); 3966 efl_ref(eo_it);
@@ -5478,10 +5483,10 @@ _elm_gengrid_item_efl_access_object_state_set_get(const Eo *eo_it, Elm_Gen_Item
5478 5483
5479 sel = elm_obj_gengrid_item_selected_get(eo_it); 5484 sel = elm_obj_gengrid_item_selected_get(eo_it);
5480 5485
5481 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTABLE); 5486 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTABLE);
5482 5487
5483 if (sel) 5488 if (sel)
5484 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_SELECTED); 5489 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_SELECTED);
5485 5490
5486 return ret; 5491 return ret;
5487} 5492}
@@ -5606,7 +5611,7 @@ _elm_gengrid_efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Gengr
5606} 5611}
5607 5612
5608EOLIAN static Elm_Object_Item * 5613EOLIAN static Elm_Object_Item *
5609_elm_gengrid_efl_ui_widget_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd) 5614_elm_gengrid_elm_widget_item_container_focused_item_get(const Eo *obj EINA_UNUSED, Elm_Gengrid_Data *sd)
5610{ 5615{
5611 return sd->focused_item; 5616 return sd->focused_item;
5612} 5617}
@@ -5689,10 +5694,10 @@ _elm_gengrid_efl_access_object_state_set_get(const Eo *obj, Elm_Gengrid_Data *sd
5689 5694
5690 ret = efl_access_object_state_set_get(efl_super(obj, ELM_GENGRID_CLASS)); 5695 ret = efl_access_object_state_set_get(efl_super(obj, ELM_GENGRID_CLASS));
5691 5696
5692 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MANAGES_DESCENDANTS); 5697 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_MANAGES_DESCENDANTS);
5693 5698
5694 if (elm_gengrid_multi_select_get(obj)) 5699 if (elm_gengrid_multi_select_get(obj))
5695 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_MULTISELECTABLE); 5700 STATE_TYPE_SET(ret, EFL_ACCESS_STATE_TYPE_MULTISELECTABLE);
5696 5701
5697 return ret; 5702 return ret;
5698} 5703}
@@ -5862,5 +5867,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_gengrid, Elm_Gengrid_Data)
5862 ELM_LAYOUT_SIZING_EVAL_OPS(elm_gengrid), \ 5867 ELM_LAYOUT_SIZING_EVAL_OPS(elm_gengrid), \
5863 EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_gengrid) 5868 EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_gengrid)
5864 5869
5865#include "elm_gengrid.eo.c" 5870#include "elm_gengrid_eo.c"
5866#include "elm_gengrid_item.eo.c" 5871#include "elm_gengrid_item_eo.c"