summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-03 11:46:48 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-17 09:12:22 +0100
commitdfc9cd8a6735b5fa77ca953ad7d7e4ec50ee495a (patch)
tree2dd78ad051dc4ce6bb0a0a8d990f356b689e5673 /src/lib/elementary
parent2d4f25fb3298756a024f96367fc2aeea26b1e9fe (diff)
elm_focus: implement elm_object_focus_next_item_set / get
you can use this now to let the focus move to the widget container of the passed item. I know this patch contains a whitespace change, but i have to get out this whitespace each & every time i am editing the file - which is annoying. So remove it once, which makes further work easier. fixes T6183. Reviewed-by: YeongJong Lee <yj34.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D7408
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_focus_legacy.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/lib/elementary/elm_focus_legacy.c b/src/lib/elementary/elm_focus_legacy.c
index 15da74aadc..8075ab2233 100644
--- a/src/lib/elementary/elm_focus_legacy.c
+++ b/src/lib/elementary/elm_focus_legacy.c
@@ -194,10 +194,18 @@ elm_object_focus_next(Evas_Object *obj,
194 Efl_Ui_Focus_Object *legacy_target = NULL; 194 Efl_Ui_Focus_Object *legacy_target = NULL;
195 ELM_WIDGET_DATA_GET_OR_RETURN(logical, pd_logical); 195 ELM_WIDGET_DATA_GET_OR_RETURN(logical, pd_logical);
196 196
197 #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd_logical->legacy_focus.field) legacy_target = pd_logical->legacy_focus.field; 197
198 #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd_logical->legacy_focus.item_ ##field) legacy_target = elm_object_item_widget_get(pd_logical->legacy_focus.item_ ##field);
198 MAPPING() 199 MAPPING()
199 #undef MAP 200 #undef MAP
200 201
202 if (!legacy_target)
203 {
204 #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd_logical->legacy_focus.field) legacy_target = pd_logical->legacy_focus.field;
205 MAPPING()
206 #undef MAP
207 }
208
201 if (legacy_target) 209 if (legacy_target)
202 { 210 {
203 efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, legacy_target); 211 efl_ui_focus_util_focus(EFL_UI_FOCUS_UTIL_CLASS, legacy_target);
@@ -242,7 +250,11 @@ elm_object_focus_next_item_get(const Evas_Object *obj,
242 Elm_Focus_Direction dir EINA_UNUSED) 250 Elm_Focus_Direction dir EINA_UNUSED)
243{ 251{
244 API_ENTRY_VAL(NULL) 252 API_ENTRY_VAL(NULL)
245 /* FOCUS-FIXME */ 253
254 #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.item_ ##field) return pd->legacy_focus.item_ ##field;
255 MAPPING()
256 #undef MAP
257
246 return NULL; 258 return NULL;
247} 259}
248 260
@@ -252,7 +264,10 @@ elm_object_focus_next_item_set(Evas_Object *obj,
252 Elm_Focus_Direction dir EINA_UNUSED) 264 Elm_Focus_Direction dir EINA_UNUSED)
253{ 265{
254 API_ENTRY() 266 API_ENTRY()
255 /* FOCUS-FIXME */ 267
268 #define MAP(direction, field) if (dir == EFL_UI_FOCUS_DIRECTION_ ##direction) pd->legacy_focus.item_ ##field = next_item;
269 MAPPING()
270 #undef MAP
256} 271}
257 272
258EAPI Evas_Object * 273EAPI Evas_Object *