summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-22 15:41:31 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-26 11:37:04 +0100
commite36dce177e41179913ab90dd13dd4260d67a3515 (patch)
tree421fc308ce2f0456409fe0ed7fbdf2c83e36b6b0 /src/lib/elementary
parent97ece33134612bce2828248ec8f5ac4a2b6caf9a (diff)
efl_ui_focus_manager: introduce a new API
the new api can be used to freeze the cache. This means, when the widgets of the focus manager are all equally moved, the cache can stay, cause the relative positions did not change, this enables a whole new set of available optimizations. Differential Revision: https://phab.enlightenment.org/D7348
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.eo13
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c23
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.eo2
-rw-r--r--src/lib/elementary/elm_main.c2
4 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager.eo b/src/lib/elementary/efl_ui_focus_manager.eo
index f2bddfba3a..767c0b6b8d 100644
--- a/src/lib/elementary/efl_ui_focus_manager.eo
+++ b/src/lib/elementary/efl_ui_focus_manager.eo
@@ -158,6 +158,18 @@ interface Efl.Ui.Focus.Manager {
158 entry : Efl.Ui.Focus.Object; [[The object that caused this manager to be redirect]] 158 entry : Efl.Ui.Focus.Object; [[The object that caused this manager to be redirect]]
159 } 159 }
160 } 160 }
161 dirty_logic_freeze {
162 [[This disables the cache invalidation when a object is moved.
163
164 Even the object is moved, the focus manager will not recalculate its relations, this can be used when you know that the set of widgets in the focus manager is equally moved. so the relations between the widets in the set do not change.
165 ]]
166 }
167 dirty_logic_unfreeze {
168 [[This enables the cache invalidation when a object is moved.
169
170 This is the counter part to @.dirty_logic_freeze
171 ]]
172 }
161 } 173 }
162 events { 174 events {
163 redirect,changed : Efl.Ui.Focus.Manager; [[Emitted when the redirect 175 redirect,changed : Efl.Ui.Focus.Manager; [[Emitted when the redirect
@@ -167,5 +179,6 @@ interface Efl.Ui.Focus.Manager {
167 potential changes in border_elements you want to know about]] 179 potential changes in border_elements you want to know about]]
168 focus,changed : Efl.Ui.Focus.Object; [[Emitted if the manager has focused an 180 focus,changed : Efl.Ui.Focus.Object; [[Emitted if the manager has focused an
169 object, the passed focus object is the last focused object]] 181 object, the passed focus object is the last focused object]]
182 dirty_logic_freeze,changed : bool; [[Called when this focus manager is frozen or unfrozen, even_info beeing $true indicates that it is now frozen, $false indicates that it is unfrozen.]]
170 } 183 }
171} 184}
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 18643f92bb..1906ddd931 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -79,6 +79,7 @@ typedef struct {
79 Efl_Ui_Focus_Object *redirect_entry; 79 Efl_Ui_Focus_Object *redirect_entry;
80 Eina_List *dirty; 80 Eina_List *dirty;
81 Efl_Ui_Focus_Graph_Context graph_ctx; 81 Efl_Ui_Focus_Graph_Context graph_ctx;
82 int freeze;
82 83
83 Node *root; 84 Node *root;
84} Efl_Ui_Focus_Manager_Calc_Data; 85} Efl_Ui_Focus_Manager_Calc_Data;
@@ -447,6 +448,10 @@ _node_new_geometry_cb(void *data, const Efl_Event *event)
447 Node *node; 448 Node *node;
448 FOCUS_DATA(data) 449 FOCUS_DATA(data)
449 450
451 if (pd->freeze > 0) {
452 return;
453 }
454
450 node = node_get(data, pd, event->object); 455 node = node_get(data, pd, event->object);
451 if (!node) 456 if (!node)
452 return; 457 return;
@@ -1838,6 +1843,24 @@ _efl_ui_focus_manager_calc_efl_object_dbg_info_get(Eo *obj, Efl_Ui_Focus_Manager
1838 eina_iterator_free(iter); 1843 eina_iterator_free(iter);
1839} 1844}
1840 1845
1846EOLIAN static void
1847_efl_ui_focus_manager_calc_efl_ui_focus_manager_dirty_logic_freeze(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
1848{
1849 pd->freeze ++;
1850 if (pd->freeze == 1)
1851 efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, (void*)EINA_TRUE);
1852}
1853
1854
1855EOLIAN static void
1856_efl_ui_focus_manager_calc_efl_ui_focus_manager_dirty_logic_unfreeze(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd)
1857{
1858 pd->freeze --;
1859 if (!pd->freeze)
1860 efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, (void*)EINA_FALSE);
1861}
1862
1863
1841#define EFL_UI_FOCUS_MANAGER_CALC_EXTRA_OPS \ 1864#define EFL_UI_FOCUS_MANAGER_CALC_EXTRA_OPS \
1842 EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_focus_manager_calc_efl_object_dbg_info_get) 1865 EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_ui_focus_manager_calc_efl_object_dbg_info_get)
1843 1866
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.eo b/src/lib/elementary/efl_ui_focus_manager_calc.eo
index cfaffd826c..ba4addf3d3 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.eo
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.eo
@@ -102,6 +102,8 @@ class Efl.Ui.Focus.Manager_Calc (Efl.Object, Efl.Ui.Focus.Manager) {
102 Efl.Ui.Focus.Manager.reset_history; 102 Efl.Ui.Focus.Manager.reset_history;
103 Efl.Ui.Focus.Manager.pop_history_stack; 103 Efl.Ui.Focus.Manager.pop_history_stack;
104 Efl.Ui.Focus.Manager.setup_on_first_touch; 104 Efl.Ui.Focus.Manager.setup_on_first_touch;
105 Efl.Ui.Focus.Manager.dirty_logic_freeze;
106 Efl.Ui.Focus.Manager.dirty_logic_unfreeze;
105 Efl.Object.constructor; 107 Efl.Object.constructor;
106 Efl.Object.finalize; 108 Efl.Object.finalize;
107 Efl.Object.provider_find; 109 Efl.Object.provider_find;
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index ce17b986f0..75f5641f6f 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -61,6 +61,7 @@ _efl_ui_focus_manager_redirect_events_del(Efl_Ui_Focus_Manager *manager, Eo *obj
61 efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, obj); 61 efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, obj);
62 efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED , obj); 62 efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED , obj);
63 efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, obj); 63 efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, obj);
64 efl_event_callback_forwarder_del(manager, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, obj);
64} 65}
65 66
66void 67void
@@ -70,6 +71,7 @@ _efl_ui_focus_manager_redirect_events_add(Efl_Ui_Focus_Manager *manager, Eo *obj
70 efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, obj); 71 efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, obj);
71 efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED , obj); 72 efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_FOCUS_CHANGED , obj);
72 efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, obj); 73 efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, obj);
74 efl_event_callback_forwarder_add(manager, EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, obj);
73} 75}
74 76
75Eina_Bool 77Eina_Bool