summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-07-18 12:40:17 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-08-10 20:56:04 +0200
commitdf3d0e3d7b03b91e0f3fb03f5012c329422712d1 (patch)
treee7485ecf90f4419a6dfba4ad9b3550111c904aba /src/lib
parentd4cd85aa55c15fdc088c27aaf46c745c9000b514 (diff)
efl_ui_focus_manager: make focus a property
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.eo16
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c14
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.eo3
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_root_focus.c8
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_root_focus.eo3
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_sub.c2
-rw-r--r--src/lib/elementary/efl_ui_win.c4
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c4
-rw-r--r--src/lib/elementary/elm_interface_scrollable.eo2
-rw-r--r--src/lib/elementary/elm_inwin.c6
-rw-r--r--src/lib/elementary/elm_scroller.c2
-rw-r--r--src/lib/elementary/elm_widget.c2
12 files changed, 28 insertions, 38 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager.eo b/src/lib/elementary/efl_ui_focus_manager.eo
index 3491f20..2bb0862 100644
--- a/src/lib/elementary/efl_ui_focus_manager.eo
+++ b/src/lib/elementary/efl_ui_focus_manager.eo
@@ -59,21 +59,13 @@ interface Efl.Ui.Focus.Manager {
59 } 59 }
60 return : Efl.Ui.Focus.Object; [[Next object to focus]] 60 return : Efl.Ui.Focus.Object; [[Next object to focus]]
61 } 61 }
62 focus { 62 @property focus {
63 [[Make the given object the currently focused object in this manager. 63 [[The element which is currently focused by this manager]]
64 64
65 The object has to be part of this manager object. 65 values {
66 If you want to focus something in the redirect manager, just call 66 focus : Efl.Ui.Focus.Object @nonull;
67 the function on the redirect manager.
68 ]]
69 params {
70 focus : Efl.Ui.Focus.Object @nonull; [[The object to be focused. Pass the root to get the first available none logical registered child focused]]
71 } 67 }
72 } 68 }
73 focused {
74 [[Return the currently focused element of this manager.]]
75 return : Efl.Ui.Focus.Object; [[The object that has focus.]]
76 }
77 @property redirect { 69 @property redirect {
78 [[Add a another manager to serve the move requests. 70 [[Add a another manager to serve the move requests.
79 71
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index b8c2294..6ed83c8 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -1184,7 +1184,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_request_move(Eo *obj EINA_UNUSED
1184} 1184}
1185 1185
1186EOLIAN static void 1186EOLIAN static void
1187_efl_ui_focus_manager_calc_efl_ui_focus_manager_focus(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *focus) 1187_efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *focus)
1188{ 1188{
1189 Node *node; 1189 Node *node;
1190 Node *old_focus; 1190 Node *old_focus;
@@ -1250,7 +1250,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_focus(Eo *obj, Efl_Ui_Focus_Mana
1250 Efl_Ui_Focus_Object *root; 1250 Efl_Ui_Focus_Object *root;
1251 1251
1252 root = efl_ui_focus_manager_root_get(node->redirect_manager); 1252 root = efl_ui_focus_manager_root_get(node->redirect_manager);
1253 efl_ui_focus_manager_focus(node->redirect_manager, root); 1253 efl_ui_focus_manager_focus_set(node->redirect_manager, root);
1254 } 1254 }
1255 1255
1256 //now check if this is also a listener object 1256 //now check if this is also a listener object
@@ -1271,7 +1271,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui
1271 { 1271 {
1272 Efl_Ui_Focus_Object *old_candidate = NULL; 1272 Efl_Ui_Focus_Object *old_candidate = NULL;
1273 candidate = efl_ui_focus_manager_move(pd->redirect, direction); 1273 candidate = efl_ui_focus_manager_move(pd->redirect, direction);
1274 old_candidate = efl_ui_focus_manager_focused(pd->redirect); 1274 old_candidate = efl_ui_focus_manager_focus_get(pd->redirect);
1275 1275
1276 if (!candidate) 1276 if (!candidate)
1277 { 1277 {
@@ -1289,7 +1289,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui
1289 { 1289 {
1290 n = T(n).parent; 1290 n = T(n).parent;
1291 new_candidate = _request_move(obj, pd, direction, n); 1291 new_candidate = _request_move(obj, pd, direction, n);
1292 efl_ui_focus_manager_focus(obj, new_candidate); 1292 efl_ui_focus_manager_focus_set(obj, new_candidate);
1293 candidate = new_candidate; 1293 candidate = new_candidate;
1294 } 1294 }
1295 } 1295 }
@@ -1302,7 +1302,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui
1302 if (new_candidate) 1302 if (new_candidate)
1303 { 1303 {
1304 //redirect does not have smth. but we do have. 1304 //redirect does not have smth. but we do have.
1305 efl_ui_focus_manager_focus(obj, new_candidate); 1305 efl_ui_focus_manager_focus_set(obj, new_candidate);
1306 } 1306 }
1307 candidate = new_candidate; 1307 candidate = new_candidate;
1308 } 1308 }
@@ -1314,7 +1314,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui
1314 candidate = efl_ui_focus_manager_request_move(obj, direction); 1314 candidate = efl_ui_focus_manager_request_move(obj, direction);
1315 1315
1316 if (candidate) 1316 if (candidate)
1317 efl_ui_focus_manager_focus(obj, candidate); 1317 efl_ui_focus_manager_focus_set(obj, candidate);
1318 } 1318 }
1319 1319
1320 F_DBG("Manager: %p moved to %p %s in direction %d", obj, candidate, efl_class_name_get(candidate), direction); 1320 F_DBG("Manager: %p moved to %p %s in direction %d", obj, candidate, efl_class_name_get(candidate), direction);
@@ -1378,7 +1378,7 @@ _convert(Eina_List *node_list)
1378} 1378}
1379 1379
1380EOLIAN static Efl_Ui_Focus_Object* 1380EOLIAN static Efl_Ui_Focus_Object*
1381_efl_ui_focus_manager_calc_efl_ui_focus_manager_focused(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd) 1381_efl_ui_focus_manager_calc_efl_ui_focus_manager_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Calc_Data *pd)
1382{ 1382{
1383 Node *upper = NULL; 1383 Node *upper = NULL;
1384 1384
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.eo b/src/lib/elementary/efl_ui_focus_manager_calc.eo
index 5817506..fec5875 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.eo
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.eo
@@ -92,8 +92,7 @@ class Efl.Ui.Focus.Manager.Calc (Efl.Object, Efl.Ui.Focus.Manager) {
92 class.destructor; 92 class.destructor;
93 Efl.Ui.Focus.Manager.move; 93 Efl.Ui.Focus.Manager.move;
94 Efl.Ui.Focus.Manager.request_move; 94 Efl.Ui.Focus.Manager.request_move;
95 Efl.Ui.Focus.Manager.focus; 95 Efl.Ui.Focus.Manager.focus {get; set;}
96 Efl.Ui.Focus.Manager.focused;
97 Efl.Ui.Focus.Manager.redirect {set; get;} 96 Efl.Ui.Focus.Manager.redirect {set; get;}
98 Efl.Ui.Focus.Manager.border_elements {get;} 97 Efl.Ui.Focus.Manager.border_elements {get;}
99 Efl.Ui.Focus.Manager.root {set; get;} 98 Efl.Ui.Focus.Manager.root {set; get;}
diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.c b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
index 056e7e0..cdb78fb 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.c
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.c
@@ -65,16 +65,16 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_unregister(Eo *obj, E
65 65
66 66
67EOLIAN static void 67EOLIAN static void
68_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_focus(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *focus) 68_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_focus_set(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *focus)
69{ 69{
70 efl_ui_focus_manager_focus(efl_super(obj, MY_CLASS), _trap(pd, focus)); 70 efl_ui_focus_manager_focus_set(efl_super(obj, MY_CLASS), _trap(pd, focus));
71} 71}
72 72
73 73
74EOLIAN static Efl_Ui_Focus_Object* 74EOLIAN static Efl_Ui_Focus_Object*
75_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_focused(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd) 75_efl_ui_focus_manager_root_focus_efl_ui_focus_manager_focus_get(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd)
76{ 76{
77 return _trap(pd, efl_ui_focus_manager_focused(efl_super(obj, MY_CLASS))); 77 return _trap(pd, efl_ui_focus_manager_focus_get(efl_super(obj, MY_CLASS)));
78} 78}
79 79
80 80
diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.eo b/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
index 0865b42..90404d5 100644
--- a/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
+++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.eo
@@ -3,8 +3,7 @@ class Efl.Ui.Focus.Manager.Root_Focus(Efl.Ui.Focus.Manager.Calc) {
3 implements { 3 implements {
4 Efl.Ui.Focus.Manager.Calc.register; 4 Efl.Ui.Focus.Manager.Calc.register;
5 Efl.Ui.Focus.Manager.Calc.unregister; 5 Efl.Ui.Focus.Manager.Calc.unregister;
6 Efl.Ui.Focus.Manager.focus; 6 Efl.Ui.Focus.Manager.focus {set; get;}
7 Efl.Ui.Focus.Manager.focused;
8 Efl.Ui.Focus.Manager.fetch; 7 Efl.Ui.Focus.Manager.fetch;
9 Efl.Ui.Focus.Manager.logical_end; 8 Efl.Ui.Focus.Manager.logical_end;
10 Efl.Ui.Focus.Manager.border_elements {get;} 9 Efl.Ui.Focus.Manager.border_elements {get;}
diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c b/src/lib/elementary/efl_ui_focus_manager_sub.c
index 7826b22..265781d 100644
--- a/src/lib/elementary/efl_ui_focus_manager_sub.c
+++ b/src/lib/elementary/efl_ui_focus_manager_sub.c
@@ -45,7 +45,7 @@ _focus_changed(void *data, const Efl_Event *event)
45 //if there is already the redirect, ignore this focus request 45 //if there is already the redirect, ignore this focus request
46 if (efl_ui_focus_manager_redirect_get(manager)) return; 46 if (efl_ui_focus_manager_redirect_get(manager)) return;
47 47
48 efl_ui_focus_manager_focus(m, event->object); 48 efl_ui_focus_manager_focus_set(m, event->object);
49} 49}
50 50
51static void 51static void
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 9947f46..f7f394b 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -1729,7 +1729,7 @@ _key_action_move(Evas_Object *obj, const char *params)
1729 Efl_Ui_Focus_Object *root; 1729 Efl_Ui_Focus_Object *root;
1730 1730
1731 root = efl_ui_focus_manager_root_get(obj); 1731 root = efl_ui_focus_manager_root_get(obj);
1732 efl_ui_focus_manager_focus(obj, root); 1732 efl_ui_focus_manager_focus_set(obj, root);
1733 } 1733 }
1734 1734
1735 if (!o && focus_dir == EFL_UI_FOCUS_DIRECTION_PREV) 1735 if (!o && focus_dir == EFL_UI_FOCUS_DIRECTION_PREV)
@@ -1737,7 +1737,7 @@ _key_action_move(Evas_Object *obj, const char *params)
1737 Efl_Ui_Focus_Object *last; 1737 Efl_Ui_Focus_Object *last;
1738 1738
1739 last = efl_ui_focus_manager_logical_end(obj); 1739 last = efl_ui_focus_manager_logical_end(obj);
1740 efl_ui_focus_manager_focus(obj, last); 1740 efl_ui_focus_manager_focus_set(obj, last);
1741 } 1741 }
1742 1742
1743 return EINA_TRUE; 1743 return EINA_TRUE;
diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c
index 4753a7b..cc4cd47 100644
--- a/src/lib/elementary/elm_interface_scrollable.c
+++ b/src/lib/elementary/elm_interface_scrollable.c
@@ -4700,12 +4700,12 @@ _elm_interface_scrollable_efl_ui_focus_manager_border_elements_get(Eo *obj, Elm_
4700} 4700}
4701 4701
4702EOLIAN static void 4702EOLIAN static void
4703_elm_interface_scrollable_efl_ui_focus_manager_focus(Eo *obj, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *focus) 4703_elm_interface_scrollable_efl_ui_focus_manager_focus_set(Eo *obj, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *focus)
4704{ 4704{
4705 Eina_Rectangle geom; 4705 Eina_Rectangle geom;
4706 Eina_Rectangle obj_geom; 4706 Eina_Rectangle obj_geom;
4707 4707
4708 efl_ui_focus_manager_focus(efl_super(obj, MY_SCROLLABLE_INTERFACE), focus); 4708 efl_ui_focus_manager_focus_set(efl_super(obj, MY_SCROLLABLE_INTERFACE), focus);
4709 4709
4710 if (!focus) return; 4710 if (!focus) return;
4711 4711
diff --git a/src/lib/elementary/elm_interface_scrollable.eo b/src/lib/elementary/elm_interface_scrollable.eo
index fd05fcc..40462fc 100644
--- a/src/lib/elementary/elm_interface_scrollable.eo
+++ b/src/lib/elementary/elm_interface_scrollable.eo
@@ -681,7 +681,7 @@ mixin Elm.Interface_Scrollable(Efl.Ui.Scrollable, Efl.Canvas.Group, Efl.Ui.Focus
681 class.constructor; 681 class.constructor;
682 Efl.Object.constructor; 682 Efl.Object.constructor;
683 Efl.Ui.Focus.Manager.border_elements { get; } 683 Efl.Ui.Focus.Manager.border_elements { get; }
684 Efl.Ui.Focus.Manager.focus; 684 Efl.Ui.Focus.Manager.focus {set; }
685 Elm.Widget.focus_manager_factory; 685 Elm.Widget.focus_manager_factory;
686 } 686 }
687 events { 687 events {
diff --git a/src/lib/elementary/elm_inwin.c b/src/lib/elementary/elm_inwin.c
index 26f019c..33f3176 100644
--- a/src/lib/elementary/elm_inwin.c
+++ b/src/lib/elementary/elm_inwin.c
@@ -164,7 +164,7 @@ _elm_inwin_efl_gfx_visible_set(Eo *obj, Elm_Inwin_Data *pd, Eina_Bool v)
164 pd->registered_manager = efl_ui_focus_user_manager_get(obj); 164 pd->registered_manager = efl_ui_focus_user_manager_get(obj);
165 165
166 efl_ui_focus_manager_redirect_set(pd->registered_manager, obj); 166 efl_ui_focus_manager_redirect_set(pd->registered_manager, obj);
167 efl_ui_focus_manager_focus(pd->manager, obj); 167 efl_ui_focus_manager_focus_set(pd->manager, obj);
168 pd->registered = EINA_TRUE; 168 pd->registered = EINA_TRUE;
169 } 169 }
170 else if (!v && pd->registered) 170 else if (!v && pd->registered)
@@ -183,9 +183,9 @@ _elm_inwin_efl_ui_focus_manager_move(Eo *obj, Elm_Inwin_Data *pd, Efl_Ui_Focus_D
183 return ret; 183 return ret;
184 184
185 if ((direction == EFL_UI_FOCUS_DIRECTION_PREV) || (direction == EFL_UI_FOCUS_DIRECTION_NEXT)) 185 if ((direction == EFL_UI_FOCUS_DIRECTION_PREV) || (direction == EFL_UI_FOCUS_DIRECTION_NEXT))
186 efl_ui_focus_manager_focus(pd->manager, obj); 186 efl_ui_focus_manager_focus_set(pd->manager, obj);
187 187
188 return efl_ui_focus_manager_focused(obj); 188 return efl_ui_focus_manager_focus_get(obj);
189} 189}
190 190
191 191
diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c
index ac85d6c..d0593b5 100644
--- a/src/lib/elementary/elm_scroller.c
+++ b/src/lib/elementary/elm_scroller.c
@@ -134,7 +134,7 @@ _key_action_move(Evas_Object *obj, const char *params)
134 Efl_Ui_Focus_Object *focused; 134 Efl_Ui_Focus_Object *focused;
135 Eina_Rectangle focused_geom, viewport; 135 Eina_Rectangle focused_geom, viewport;
136 136
137 focused = efl_ui_focus_manager_focused(obj); 137 focused = efl_ui_focus_manager_focus_get(obj);
138 138
139 if (focused && 139 if (focused &&
140 (!strcmp(dir, "next") || 140 (!strcmp(dir, "next") ||
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index cb14afc..0eead3f 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -4349,7 +4349,7 @@ _elm_widget_focus_mouse_up_handle(Eo *obj, Elm_Widget_Smart_Data *pd)
4349 } 4349 }
4350 4350
4351 4351
4352 efl_ui_focus_manager_focus(pd->focus.manager, obj); 4352 efl_ui_focus_manager_focus_set(pd->focus.manager, obj);
4353 } 4353 }
4354} 4354}
4355 4355