summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-23 09:49:55 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-26 11:37:04 +0100
commit97ece33134612bce2828248ec8f5ac4a2b6caf9a (patch)
treeaa4344aa5ede13b7d4150873782d14039cc351d3 /src
parentfccc5fc438f798d0bd71c45d18691ce3fd5b754d (diff)
efl_ui_focus_object: introduce a new event for focus geometry changes
before the move and resize events have been used. However, this turned out to not work well, because not all registered items are real efl.gfx.entity objects, there is also a custom property for getting the focus geometry, so now this property is completed with a event that is emitted when the focus geometry changes. With this event we can reintroduce relation caching. Since all events are marked correctly dirty now. Differential Revision: https://phab.enlightenment.org/D7347
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_calendar.c1
-rw-r--r--src/lib/elementary/efl_ui_focus_composition.c3
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_calc.c5
-rw-r--r--src/lib/elementary/efl_ui_focus_object.eo1
-rw-r--r--src/lib/elementary/efl_ui_widget.c1
-rw-r--r--src/lib/elementary/elm_calendar.c2
-rw-r--r--src/lib/elementary/elm_colorselector.c2
-rw-r--r--src/lib/elementary/elm_main.c13
-rw-r--r--src/lib/elementary/elm_priv.h2
-rw-r--r--src/lib/elementary/elm_segment_control.c1
-rw-r--r--src/lib/elementary/elm_toolbar.c1
11 files changed, 28 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_calendar.c b/src/lib/elementary/efl_ui_calendar.c
index ae0e0ab69c..3e5d34dd7a 100644
--- a/src/lib/elementary/efl_ui_calendar.c
+++ b/src/lib/elementary/efl_ui_calendar.c
@@ -1276,6 +1276,7 @@ _efl_ui_calendar_item_day_number_set(Eo *obj, Efl_Ui_Calendar_Item_Data *pd, int
1276 pd->part = po; 1276 pd->part = po;
1277 else 1277 else
1278 pd->part = evas_object_data_get(po, "_part_access_obj"); 1278 pd->part = evas_object_data_get(po, "_part_access_obj");
1279 _efl_ui_focus_event_redirector(pd->part, obj);
1279 1280
1280 EINA_SAFETY_ON_NULL_RETURN(pd->part); 1281 EINA_SAFETY_ON_NULL_RETURN(pd->part);
1281} 1282}
diff --git a/src/lib/elementary/efl_ui_focus_composition.c b/src/lib/elementary/efl_ui_focus_composition.c
index ebcb051451..8a4b3dfe4c 100644
--- a/src/lib/elementary/efl_ui_focus_composition.c
+++ b/src/lib/elementary/efl_ui_focus_composition.c
@@ -243,10 +243,9 @@ _canvas_object_deleted(void *data, const Efl_Event *ev EINA_UNUSED)
243static void 243static void
244_new_geom(void *data, const Efl_Event *event) 244_new_geom(void *data, const Efl_Event *event)
245{ 245{
246 efl_event_callback_call(data, event->desc, event->info); 246 efl_event_callback_call(data, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED, event->info);
247} 247}
248 248
249
250EFL_CALLBACKS_ARRAY_DEFINE(canvas_obj, 249EFL_CALLBACKS_ARRAY_DEFINE(canvas_obj,
251 {EFL_GFX_ENTITY_EVENT_RESIZE, _new_geom}, 250 {EFL_GFX_ENTITY_EVENT_RESIZE, _new_geom},
252 {EFL_GFX_ENTITY_EVENT_MOVE, _new_geom}, 251 {EFL_GFX_ENTITY_EVENT_MOVE, _new_geom},
diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 9dd444dde6..18643f92bb 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -402,6 +402,8 @@ dirty_flush_node(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Cal
402static void 402static void
403dirty_flush(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *node) 403dirty_flush(Efl_Ui_Focus_Manager *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *node)
404{ 404{
405 if (!pd->dirty) return;
406
405 efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL); 407 efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, NULL);
406 408
407 dirty_flush_node(obj, pd, node); 409 dirty_flush_node(obj, pd, node);
@@ -465,8 +467,7 @@ _object_del_cb(void *data, const Efl_Event *event)
465} 467}
466 468
467EFL_CALLBACKS_ARRAY_DEFINE(regular_node, 469EFL_CALLBACKS_ARRAY_DEFINE(regular_node,
468 {EFL_GFX_ENTITY_EVENT_RESIZE, _node_new_geometry_cb}, 470 {EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED, _node_new_geometry_cb},
469 {EFL_GFX_ENTITY_EVENT_MOVE, _node_new_geometry_cb},
470 {EFL_EVENT_INVALIDATE, _object_del_cb}, 471 {EFL_EVENT_INVALIDATE, _object_del_cb},
471); 472);
472 473
diff --git a/src/lib/elementary/efl_ui_focus_object.eo b/src/lib/elementary/efl_ui_focus_object.eo
index b82b259a0c..0058be0d11 100644
--- a/src/lib/elementary/efl_ui_focus_object.eo
+++ b/src/lib/elementary/efl_ui_focus_object.eo
@@ -88,5 +88,6 @@ mixin Efl.Ui.Focus.Object
88 logical,changed: Efl.Ui.Focus.Object; [[Emitted when a new logical 88 logical,changed: Efl.Ui.Focus.Object; [[Emitted when a new logical
89 parent should be used.]] 89 parent should be used.]]
90 child_focus,changed: bool; [[Emitted if child_focus has changed]] 90 child_focus,changed: bool; [[Emitted if child_focus has changed]]
91 focus_geometry,changed: void; [[Emitted if focus geometry of this object has changed]]
91 } 92 }
92} 93}
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 498296ee47..d4a253191d 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -5323,6 +5323,7 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN
5323 Eo *parent = NULL; 5323 Eo *parent = NULL;
5324 5324
5325 sd->on_create = EINA_TRUE; 5325 sd->on_create = EINA_TRUE;
5326 _efl_ui_focus_event_redirector(obj, obj);
5326 efl_canvas_group_clipped_set(obj, EINA_FALSE); 5327 efl_canvas_group_clipped_set(obj, EINA_FALSE);
5327 obj = efl_constructor(efl_super(obj, MY_CLASS)); 5328 obj = efl_constructor(efl_super(obj, MY_CLASS));
5328 efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); 5329 efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
diff --git a/src/lib/elementary/elm_calendar.c b/src/lib/elementary/elm_calendar.c
index 75fde218aa..e150e54cd6 100644
--- a/src/lib/elementary/elm_calendar.c
+++ b/src/lib/elementary/elm_calendar.c
@@ -1955,6 +1955,8 @@ _elm_calendar_item_day_number_set(Eo *obj, Elm_Calendar_Item_Data *pd, int i)
1955 else 1955 else
1956 pd->part = evas_object_data_get(po, "_part_access_obj"); 1956 pd->part = evas_object_data_get(po, "_part_access_obj");
1957 1957
1958 _efl_ui_focus_event_redirector(pd->part, obj);
1959
1958 EINA_SAFETY_ON_NULL_RETURN(pd->part); 1960 EINA_SAFETY_ON_NULL_RETURN(pd->part);
1959} 1961}
1960 1962
diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c
index ef785786a9..80ffdf8129 100644
--- a/src/lib/elementary/elm_colorselector.c
+++ b/src/lib/elementary/elm_colorselector.c
@@ -1781,6 +1781,8 @@ _elm_color_item_efl_object_constructor(Eo *eo_item, Elm_Color_Item_Data *item)
1781 evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL); 1781 evas_object_size_hint_align_set(VIEW(item), EVAS_HINT_FILL, EVAS_HINT_FILL);
1782 evas_object_event_callback_add 1782 evas_object_event_callback_add
1783 (VIEW(item), EVAS_CALLBACK_RESIZE, _item_resize, NULL); 1783 (VIEW(item), EVAS_CALLBACK_RESIZE, _item_resize, NULL);
1784 _efl_ui_focus_event_redirector(VIEW(item), obj);
1785
1784 1786
1785 item->color_obj = edje_object_add(evas_object_evas_get(obj)); 1787 item->color_obj = edje_object_add(evas_object_evas_get(obj));
1786 elm_widget_theme_object_set 1788 elm_widget_theme_object_set
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index 00f8c22ed0..ce17b986f0 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -41,6 +41,19 @@ Eina_Bool _use_build_config;
41static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV }; 41static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
42EAPI Elm_Version *elm_version = &_version; 42EAPI Elm_Version *elm_version = &_version;
43 43
44static void
45_focus_ev_redirect_cb(void *data, const Efl_Event *ev)
46{
47 efl_event_callback_call(data, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_GEOMETRY_CHANGED, NULL);
48}
49
50void
51_efl_ui_focus_event_redirector(Efl_Ui_Focus_Object *obj, Efl_Ui_Focus_Object *goal)
52{
53 efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_MOVE, _focus_ev_redirect_cb, goal);
54 efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_RESIZE, _focus_ev_redirect_cb, goal);
55}
56
44void 57void
45_efl_ui_focus_manager_redirect_events_del(Efl_Ui_Focus_Manager *manager, Eo *obj) 58_efl_ui_focus_manager_redirect_events_del(Efl_Ui_Focus_Manager *manager, Eo *obj)
46{ 59{
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 57aa2fa6df..665bee0e03 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -909,4 +909,6 @@ void legacy_child_focus_handle(Efl_Ui_Focus_Object *object);
909 */ 909 */
910void legacy_object_focus_handle(Efl_Ui_Focus_Object *object); 910void legacy_object_focus_handle(Efl_Ui_Focus_Object *object);
911 911
912void _efl_ui_focus_event_redirector(Efl_Ui_Focus_Object *obj, Efl_Ui_Focus_Object *goal);
913
912#endif 914#endif
diff --git a/src/lib/elementary/elm_segment_control.c b/src/lib/elementary/elm_segment_control.c
index 13d7a66602..e46e3802d9 100644
--- a/src/lib/elementary/elm_segment_control.c
+++ b/src/lib/elementary/elm_segment_control.c
@@ -596,6 +596,7 @@ _elm_segment_control_item_efl_object_constructor(Eo *obj, Elm_Segment_Control_It
596 parent = efl_parent_get(obj); 596 parent = efl_parent_get(obj);
597 597
598 VIEW_SET(it, edje_object_add(evas_object_evas_get(parent))); 598 VIEW_SET(it, edje_object_add(evas_object_evas_get(parent)));
599 _efl_ui_focus_event_redirector(VIEW(it), obj);
599 edje_object_scale_set(VIEW(it),efl_gfx_entity_scale_get(WIDGET(it)) * 600 edje_object_scale_set(VIEW(it),efl_gfx_entity_scale_get(WIDGET(it)) *
600 elm_config_scale_get()); 601 elm_config_scale_get());
601 evas_object_smart_member_add(VIEW(it), parent); 602 evas_object_smart_member_add(VIEW(it), parent);
diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c
index b01a043a79..a8f541ff7d 100644
--- a/src/lib/elementary/elm_toolbar.c
+++ b/src/lib/elementary/elm_toolbar.c
@@ -2413,6 +2413,7 @@ _item_new(Evas_Object *obj,
2413 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data); 2413 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data);
2414 2414
2415 VIEW_SET(it, elm_layout_add(obj)); 2415 VIEW_SET(it, elm_layout_add(obj));
2416 _efl_ui_focus_event_redirector(VIEW(it), eo_it);
2416 elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE); 2417 elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE);
2417 evas_object_data_set(VIEW(it), "item", it); 2418 evas_object_data_set(VIEW(it), "item", it);
2418 efl_access_object_access_type_set(VIEW(it), EFL_ACCESS_TYPE_DISABLED); 2419 efl_access_object_access_type_set(VIEW(it), EFL_ACCESS_TYPE_DISABLED);