summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/evas/canvas/efl_canvas_object_event_grabber.c85
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c4
-rw-r--r--src/lib/evas/canvas/evas_events.c4
-rw-r--r--src/lib/evas/canvas/evas_focus.c18
-rw-r--r--src/lib/evas/canvas/evas_object_main.c84
-rw-r--r--src/lib/evas/include/evas_private.h32
6 files changed, 80 insertions, 147 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_object_event_grabber.c b/src/lib/evas/canvas/efl_canvas_object_event_grabber.c
index 30d3f88..12d882d 100644
--- a/src/lib/evas/canvas/efl_canvas_object_event_grabber.c
+++ b/src/lib/evas/canvas/efl_canvas_object_event_grabber.c
@@ -31,7 +31,7 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_iterator_next(Efl_Object
31 31
32 if (!eina_clist_next(it->head, it->current)) return EINA_FALSE; 32 if (!eina_clist_next(it->head, it->current)) return EINA_FALSE;
33 33
34 obj = EINA_CLIST_ENTRY(eina_clist_head(it->current), Evas_Object_Protected_Data, events->event.member); 34 obj = EINA_CLIST_ENTRY(eina_clist_head(it->current), Evas_Object_Protected_Data, event.member);
35 if (data) *data = obj->object; 35 if (data) *data = obj->object;
36 36
37 it->current = eina_clist_next(it->head, it->current); 37 it->current = eina_clist_next(it->head, it->current);
@@ -100,14 +100,6 @@ _stacking_verify(Efl_Object_Event_Grabber_Data *pd, Evas_Object_Protected_Data *
100} 100}
101 101
102static void 102static void
103_child_add_after(Evas_Object_Protected_Data *a, Evas_Object_Events_Data *events)
104{
105 EINA_COW_WRITE_BEGIN(evas_object_events_cow, a->events, Evas_Object_Events_Data, evs)
106 eina_clist_add_after(&evs->event.member, &events->event.member);
107 EINA_COW_WRITE_END(evas_object_events_cow, a->events, evs);
108}
109
110static void
111_child_insert(Efl_Object_Event_Grabber_Data *pd, Evas_Object_Protected_Data *obj) 103_child_insert(Efl_Object_Event_Grabber_Data *pd, Evas_Object_Protected_Data *obj)
112{ 104{
113 Evas_Object_Protected_Data *a, *i; 105 Evas_Object_Protected_Data *a, *i;
@@ -115,44 +107,38 @@ _child_insert(Efl_Object_Event_Grabber_Data *pd, Evas_Object_Protected_Data *obj
115 if (eina_clist_empty(&pd->contained)) 107 if (eina_clist_empty(&pd->contained))
116 { 108 {
117 /* pd->rect case */ 109 /* pd->rect case */
118 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 110 eina_clist_add_head(&pd->contained, &obj->event.member);
119 eina_clist_add_head(&pd->contained, &events->event.member);
120 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
121 return; 111 return;
122 } 112 }
123 113
124 if (pd->vis) _stacking_verify(pd, obj); 114 if (pd->vis) _stacking_verify(pd, obj);
125 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 115 EINA_CLIST_FOR_EACH_ENTRY_REV(a, &pd->contained, Evas_Object_Protected_Data, event.member)
126 { 116 {
127 EINA_CLIST_FOR_EACH_ENTRY_REV(a, &pd->contained, Evas_Object_Protected_Data, events->event.member) 117 if (a->object == pd->rect)
118 {
119 eina_clist_add_after(&a->event.member, &obj->event.member);
120 return;
121 }
122 if (a->layer->layer > obj->layer->layer) continue;
123 if (a->layer->layer < obj->layer->layer)
124 {
125 eina_clist_add_after(&a->event.member, &obj->event.member);
126 return;
127 }
128 EINA_INLIST_FOREACH(EINA_INLIST_GET(a->layer->objects), i)
128 { 129 {
129 if (a->object == pd->rect) 130 if (a == i)
130 { 131 {
131 _child_add_after(a, events); 132 eina_clist_add_after(&a->event.member, &obj->event.member);
132 return; 133 return;
133 } 134 }
134 if (a->layer->layer > obj->layer->layer) continue; 135 if (obj == i)
135 if (a->layer->layer < obj->layer->layer)
136 { 136 {
137 _child_add_after(a, events); 137 eina_clist_add_before(&a->event.member, &obj->event.member);
138 return; 138 return;
139 } 139 }
140 EINA_INLIST_FOREACH(EINA_INLIST_GET(a->layer->objects), i)
141 {
142 if (a == i)
143 {
144 _child_add_after(a, events);
145 return;
146 }
147 if (obj == i)
148 {
149 _child_add_after(a, events);
150 return;
151 }
152 }
153 } 140 }
154 } 141 }
155 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
156} 142}
157 143
158static void 144static void
@@ -161,10 +147,7 @@ _efl_canvas_object_event_grabber_child_restack(void *data, const Efl_Event *even
161 Efl_Object_Event_Grabber_Data *pd = data; 147 Efl_Object_Event_Grabber_Data *pd = data;
162 Evas_Object_Protected_Data *obj = efl_data_scope_get(event->object, EFL_CANVAS_OBJECT_CLASS); 148 Evas_Object_Protected_Data *obj = efl_data_scope_get(event->object, EFL_CANVAS_OBJECT_CLASS);
163 149
164 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 150 eina_clist_remove(&obj->event.member);
165 eina_clist_remove(&events->event.member);
166 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
167
168 _child_insert(pd, obj); 151 _child_insert(pd, obj);
169} 152}
170 153
@@ -214,12 +197,10 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_member_add(Eo *eo_obj, E
214 return; 197 return;
215 } 198 }
216 } 199 }
217 if (obj->events->event.parent == eo_obj) return; 200 if (obj->event.parent == eo_obj) return;
218 201
219 if (obj->smart.parent || obj->events->event.parent) evas_object_smart_member_del(member); 202 if (obj->smart.parent || obj->event.parent) evas_object_smart_member_del(member);
220 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 203 obj->event.parent = eo_obj;
221 events->event.parent = eo_obj;
222 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
223 _child_insert(pd, obj); 204 _child_insert(pd, obj);
224 efl_event_callback_add(member, EFL_EVENT_DEL, _efl_canvas_object_event_grabber_child_del, pd); 205 efl_event_callback_add(member, EFL_EVENT_DEL, _efl_canvas_object_event_grabber_child_del, pd);
225 if (member != pd->rect) 206 if (member != pd->rect)
@@ -233,12 +214,8 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_member_del(Eo *eo_obj EI
233 214
234 efl_event_callback_del(member, EFL_EVENT_DEL, _efl_canvas_object_event_grabber_child_del, pd); 215 efl_event_callback_del(member, EFL_EVENT_DEL, _efl_canvas_object_event_grabber_child_del, pd);
235 efl_event_callback_del(member, EFL_GFX_EVENT_RESTACK, _efl_canvas_object_event_grabber_child_restack, pd); 216 efl_event_callback_del(member, EFL_GFX_EVENT_RESTACK, _efl_canvas_object_event_grabber_child_restack, pd);
236 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 217 eina_clist_remove(&obj->event.member);
237 { 218 obj->event.parent = NULL;
238 eina_clist_remove(&events->event.member);
239 events->event.parent = NULL;
240 }
241 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
242} 219}
243 220
244EOLIAN static void 221EOLIAN static void
@@ -286,7 +263,7 @@ _efl_canvas_object_event_grabber_efl_gfx_visible_set(Eo *eo_obj EINA_UNUSED, Efl
286 { 263 {
287 Evas_Object_Protected_Data *obj; 264 Evas_Object_Protected_Data *obj;
288 265
289 EINA_CLIST_FOR_EACH_ENTRY(obj, &pd->contained, Evas_Object_Protected_Data, events->event.member) 266 EINA_CLIST_FOR_EACH_ENTRY(obj, &pd->contained, Evas_Object_Protected_Data, event.member)
290 if (obj->object != pd->rect) _stacking_verify(pd, obj); 267 if (obj->object != pd->rect) _stacking_verify(pd, obj);
291 } 268 }
292 pd->vis = !!set; 269 pd->vis = !!set;
@@ -310,13 +287,11 @@ _efl_canvas_object_event_grabber_restack(void *data, const Efl_Event *event)
310 evas_object_layer_set(pd->rect, evas_object_layer_get(event->object)); 287 evas_object_layer_set(pd->rect, evas_object_layer_get(event->object));
311 evas_object_stack_below(pd->rect, event->object); 288 evas_object_stack_below(pd->rect, event->object);
312 289
313 EINA_CLIST_FOR_EACH_ENTRY_SAFE(obj, nobj, &pd->contained, Evas_Object_Protected_Data, events->event.member) 290 EINA_CLIST_FOR_EACH_ENTRY_SAFE(obj, nobj, &pd->contained, Evas_Object_Protected_Data, event.member)
314 { 291 {
315 if (obj->object == pd->rect) continue; 292 if (obj->object == pd->rect) continue;
316 list = eina_list_append(list, obj); 293 list = eina_list_append(list, obj);
317 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 294 eina_clist_remove(&obj->event.member);
318 eina_clist_remove(&events->event.member);
319 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
320 } 295 }
321 EINA_LIST_FREE(list, obj) 296 EINA_LIST_FREE(list, obj)
322 _child_insert(pd, obj); 297 _child_insert(pd, obj);
@@ -326,7 +301,7 @@ EOLIAN static Eo *
326_efl_canvas_object_event_grabber_efl_object_constructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd) 301_efl_canvas_object_event_grabber_efl_object_constructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd)
327{ 302{
328 Evas_Object_Protected_Data *obj; 303 Evas_Object_Protected_Data *obj;
329 304
330 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); 305 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
331 efl_canvas_object_type_set(eo_obj, MY_CLASS_NAME_LEGACY); 306 efl_canvas_object_type_set(eo_obj, MY_CLASS_NAME_LEGACY);
332 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 307 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
@@ -346,7 +321,7 @@ EOLIAN static void
346_efl_canvas_object_event_grabber_efl_object_destructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd) 321_efl_canvas_object_event_grabber_efl_object_destructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd)
347{ 322{
348 Evas_Object_Protected_Data *obj, *nobj; 323 Evas_Object_Protected_Data *obj, *nobj;
349 EINA_CLIST_FOR_EACH_ENTRY_SAFE(obj, nobj, &pd->contained, Evas_Object_Protected_Data, events->event.member) 324 EINA_CLIST_FOR_EACH_ENTRY_SAFE(obj, nobj, &pd->contained, Evas_Object_Protected_Data, event.member)
350 efl_canvas_group_member_del(eo_obj, obj->object); 325 efl_canvas_group_member_del(eo_obj, obj->object);
351 efl_canvas_group_del(eo_obj); 326 efl_canvas_group_del(eo_obj);
352 efl_destructor(efl_super(eo_obj, MY_CLASS)); 327 efl_destructor(efl_super(eo_obj, MY_CLASS));
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index 35cc834..822baa2 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -436,13 +436,13 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
436nothing_here: 436nothing_here:
437 if (!obj->no_propagate) 437 if (!obj->no_propagate)
438 { 438 {
439 if ((obj->smart.parent || obj->events->event.parent) && (type != EVAS_CALLBACK_FREE) && 439 if ((obj->smart.parent || obj->event.parent) && (type != EVAS_CALLBACK_FREE) &&
440 (type <= EVAS_CALLBACK_KEY_UP)) 440 (type <= EVAS_CALLBACK_KEY_UP))
441 { 441 {
442 Evas_Object_Protected_Data *parent_obj; 442 Evas_Object_Protected_Data *parent_obj;
443 Eo *parent; 443 Eo *parent;
444 444
445 parent = obj->events->event.parent ?: obj->smart.parent; 445 parent = obj->event.parent ?: obj->smart.parent;
446 parent_obj = efl_data_scope_get(parent, EFL_CANVAS_OBJECT_CLASS); 446 parent_obj = efl_data_scope_get(parent, EFL_CANVAS_OBJECT_CLASS);
447 evas_object_event_callback_call(parent, parent_obj, type, event_info, event_id, efl_event_desc); 447 evas_object_event_callback_call(parent, parent_obj, type, event_info, event_id, efl_event_desc);
448 } 448 }
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 222169b..a97129d 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -387,7 +387,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
387 obj; 387 obj;
388 obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev)) 388 obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev))
389 { 389 {
390 if (obj->events->event.parent) continue; 390 if (obj->event.parent) continue;
391 in = _evas_event_object_list_raw_in_get_single(eo_e, obj, in, stop, x, y, no_rep, source 391 in = _evas_event_object_list_raw_in_get_single(eo_e, obj, in, stop, x, y, no_rep, source
392#ifdef DDD_DO 392#ifdef DDD_DO
393 ,&spaces 393 ,&spaces
@@ -398,7 +398,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
398 } 398 }
399 else 399 else
400 { 400 {
401 EINA_CLIST_FOR_EACH_ENTRY_SAFE_REV(obj, nobj, clist, Evas_Object_Protected_Data, events->event.member) 401 EINA_CLIST_FOR_EACH_ENTRY_SAFE_REV(obj, nobj, clist, Evas_Object_Protected_Data, event.member)
402 { 402 {
403 in = _evas_event_object_list_raw_in_get_single(eo_e, obj, in, stop, x, y, no_rep, source 403 in = _evas_event_object_list_raw_in_get_single(eo_e, obj, in, stop, x, y, no_rep, source
404#ifdef DDD_DO 404#ifdef DDD_DO
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c
index 6ea934a..0b79bf9 100644
--- a/src/lib/evas/canvas/evas_focus.c
+++ b/src/lib/evas/canvas/evas_focus.c
@@ -106,10 +106,7 @@ _evas_object_unfocus(Evas_Object_Protected_Data *obj, Efl_Input_Device *seat)
106{ 106{
107 int event_id = _evas_event_counter; 107 int event_id = _evas_event_counter;
108 108
109 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 109 obj->focused_by_seats = eina_list_remove(obj->focused_by_seats, seat);
110 events->focused_by_seats = eina_list_remove(events->focused_by_seats, seat);
111 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
112
113 _evas_focus_set(obj->object, seat, EINA_FALSE); 110 _evas_focus_set(obj->object, seat, EINA_FALSE);
114 _evas_focus_dispatch_event(obj, seat, EINA_FALSE); 111 _evas_focus_dispatch_event(obj, seat, EINA_FALSE);
115 _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); 112 _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
@@ -141,7 +138,7 @@ _efl_canvas_object_seat_focus_del(Eo *eo_obj,
141 obj->layer->evas->pending_default_focus_obj = NULL; 138 obj->layer->evas->pending_default_focus_obj = NULL;
142 } 139 }
143 140
144 EINA_LIST_FOREACH(obj->events->focused_by_seats, l, dev) 141 EINA_LIST_FOREACH(obj->focused_by_seats, l, dev)
145 { 142 {
146 if (dev != seat) 143 if (dev != seat)
147 continue; 144 continue;
@@ -187,7 +184,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
187 if (!efl_input_seat_event_filter_get(eo_obj, seat)) 184 if (!efl_input_seat_event_filter_get(eo_obj, seat))
188 return EINA_FALSE; 185 return EINA_FALSE;
189 186
190 if (_already_focused(obj->events->focused_by_seats, seat)) 187 if (_already_focused(obj->focused_by_seats, seat))
191 goto end; 188 goto end;
192 189
193 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET, 190 if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET,
@@ -205,10 +202,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
205 202
206 efl_event_callback_add(seat, EFL_EVENT_DEL, _evas_focus_device_del_cb, obj); 203 efl_event_callback_add(seat, EFL_EVENT_DEL, _evas_focus_device_del_cb, obj);
207 204
208 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 205 obj->focused_by_seats = eina_list_append(obj->focused_by_seats, seat);
209 events->focused_by_seats = eina_list_append(events->focused_by_seats, seat);
210 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
211
212 _evas_focus_set(eo_obj, seat, EINA_TRUE); 206 _evas_focus_set(eo_obj, seat, EINA_TRUE);
213 207
214 _evas_focus_dispatch_event(obj, seat, EINA_TRUE); 208 _evas_focus_dispatch_event(obj, seat, EINA_TRUE);
@@ -231,7 +225,7 @@ _efl_canvas_object_seat_focus_check(Eo *eo_obj,
231 225
232 if (!seat) seat = _default_seat_get(eo_obj); 226 if (!seat) seat = _default_seat_get(eo_obj);
233 227
234 EINA_LIST_FOREACH(obj->events->focused_by_seats, l, s) 228 EINA_LIST_FOREACH(obj->focused_by_seats, l, s)
235 { 229 {
236 if (s == seat) 230 if (s == seat)
237 return EINA_TRUE; 231 return EINA_TRUE;
@@ -259,7 +253,7 @@ _efl_canvas_object_seat_focus_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
259 return EINA_FALSE; 253 return EINA_FALSE;
260 MAGIC_CHECK_END(); 254 MAGIC_CHECK_END();
261 255
262 return eina_list_count(obj->events->focused_by_seats) ? EINA_TRUE : EINA_FALSE; 256 return eina_list_count(obj->focused_by_seats) ? EINA_TRUE : EINA_FALSE;
263} 257}
264 258
265EOLIAN Eina_Bool 259EOLIAN Eina_Bool
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index b1547b6..9a5ccdd 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -35,16 +35,12 @@ static const Evas_Object_Protected_State default_state = {
35static const Evas_Object_Mask_Data default_mask = { 35static const Evas_Object_Mask_Data default_mask = {
36 NULL, 0, 0, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE 36 NULL, 0, 0, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE
37}; 37};
38static const Evas_Object_Events_Data default_events = {
39 NULL, NULL, NULL, { NULL, { 0 } }
40};
41 38
42Eina_Cow *evas_object_proxy_cow = NULL; 39Eina_Cow *evas_object_proxy_cow = NULL;
43Eina_Cow *evas_object_map_cow = NULL; 40Eina_Cow *evas_object_map_cow = NULL;
44Eina_Cow *evas_object_state_cow = NULL; 41Eina_Cow *evas_object_state_cow = NULL;
45Eina_Cow *evas_object_3d_cow = NULL; 42Eina_Cow *evas_object_3d_cow = NULL;
46Eina_Cow *evas_object_mask_cow = NULL; 43Eina_Cow *evas_object_mask_cow = NULL;
47Eina_Cow *evas_object_events_cow = NULL;
48 44
49static Eina_Bool 45static Eina_Bool
50_init_cow(void) 46_init_cow(void)
@@ -56,24 +52,21 @@ _init_cow(void)
56 evas_object_state_cow = eina_cow_add("Evas Object State", sizeof (Evas_Object_Protected_State), 64, &default_state, EINA_FALSE); 52 evas_object_state_cow = eina_cow_add("Evas Object State", sizeof (Evas_Object_Protected_State), 64, &default_state, EINA_FALSE);
57 evas_object_3d_cow = eina_cow_add("Evas Object 3D", sizeof (Evas_Object_3D_Data), 8, &default_proxy, EINA_TRUE); 53 evas_object_3d_cow = eina_cow_add("Evas Object 3D", sizeof (Evas_Object_3D_Data), 8, &default_proxy, EINA_TRUE);
58 evas_object_mask_cow = eina_cow_add("Evas Mask Data", sizeof (Evas_Object_Mask_Data), 8, &default_mask, EINA_TRUE); 54 evas_object_mask_cow = eina_cow_add("Evas Mask Data", sizeof (Evas_Object_Mask_Data), 8, &default_mask, EINA_TRUE);
59 evas_object_events_cow = eina_cow_add("Evas Events Data", sizeof (Evas_Object_Events_Data), 8, &default_events, EINA_TRUE);
60 55
61 if (!(evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && 56 if (!(evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow &&
62 evas_object_3d_cow && evas_object_mask_cow && evas_object_events_cow)) 57 evas_object_3d_cow && evas_object_mask_cow))
63 { 58 {
64 eina_cow_del(evas_object_proxy_cow); 59 eina_cow_del(evas_object_proxy_cow);
65 eina_cow_del(evas_object_map_cow); 60 eina_cow_del(evas_object_map_cow);
66 eina_cow_del(evas_object_state_cow); 61 eina_cow_del(evas_object_state_cow);
67 eina_cow_del(evas_object_3d_cow); 62 eina_cow_del(evas_object_3d_cow);
68 eina_cow_del(evas_object_mask_cow); 63 eina_cow_del(evas_object_mask_cow);
69 eina_cow_del(evas_object_events_cow);
70 64
71 evas_object_proxy_cow = NULL; 65 evas_object_proxy_cow = NULL;
72 evas_object_map_cow = NULL; 66 evas_object_map_cow = NULL;
73 evas_object_state_cow = NULL; 67 evas_object_state_cow = NULL;
74 evas_object_3d_cow = NULL; 68 evas_object_3d_cow = NULL;
75 evas_object_mask_cow = NULL; 69 evas_object_mask_cow = NULL;
76 evas_object_events_cow = NULL;
77 70
78 return EINA_FALSE; 71 return EINA_FALSE;
79 } 72 }
@@ -87,7 +80,7 @@ _evas_object_pointer_data_find(Evas_Object_Protected_Data *obj,
87{ 80{
88 Evas_Object_Pointer_Data *pdata; 81 Evas_Object_Pointer_Data *pdata;
89 82
90 EINA_INLIST_FOREACH(obj->events->pointer_grabs, pdata) 83 EINA_INLIST_FOREACH(obj->pointer_grabs, pdata)
91 { 84 {
92 if (pdata->evas_pdata->pointer == pointer) 85 if (pdata->evas_pdata->pointer == pointer)
93 return pdata; 86 return pdata;
@@ -120,10 +113,8 @@ _evas_object_pointer_grab_del(Evas_Object_Protected_Data *obj,
120 pdata->evas_pdata->seat->object.in = eina_list_remove(pdata->evas_pdata->seat->object.in, obj->object); 113 pdata->evas_pdata->seat->object.in = eina_list_remove(pdata->evas_pdata->seat->object.in, obj->object);
121 efl_event_callback_del(pdata->evas_pdata->pointer, EFL_EVENT_DEL, 114 efl_event_callback_del(pdata->evas_pdata->pointer, EFL_EVENT_DEL,
122 _evas_device_del_cb, obj); 115 _evas_device_del_cb, obj);
123 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 116 obj->pointer_grabs = eina_inlist_remove(obj->pointer_grabs,
124 events->pointer_grabs = eina_inlist_remove(events->pointer_grabs, EINA_INLIST_GET(pdata)); 117 EINA_INLIST_GET(pdata));
125 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
126
127 free(pdata); 118 free(pdata);
128} 119}
129 120
@@ -137,11 +128,8 @@ _evas_object_pointer_data_add(Evas_Pointer_Data *evas_pdata,
137 EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL); 128 EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
138 pdata->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB; 129 pdata->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
139 pdata->evas_pdata = evas_pdata; 130 pdata->evas_pdata = evas_pdata;
140 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 131 obj->pointer_grabs = eina_inlist_append(obj->pointer_grabs,
141 events->pointer_grabs = eina_inlist_append(events->pointer_grabs, 132 EINA_INLIST_GET(pdata));
142 EINA_INLIST_GET(pdata));
143 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
144
145 efl_event_callback_priority_add(evas_pdata->pointer, EFL_EVENT_DEL, 133 efl_event_callback_priority_add(evas_pdata->pointer, EFL_EVENT_DEL,
146 EFL_CALLBACK_PRIORITY_BEFORE, 134 EFL_CALLBACK_PRIORITY_BEFORE,
147 _evas_device_del_cb, obj); 135 _evas_device_del_cb, obj);
@@ -189,7 +177,6 @@ _efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data
189 obj->prev = eina_cow_alloc(evas_object_state_cow); 177 obj->prev = eina_cow_alloc(evas_object_state_cow);
190 obj->data_3d = eina_cow_alloc(evas_object_3d_cow); 178 obj->data_3d = eina_cow_alloc(evas_object_3d_cow);
191 obj->mask = eina_cow_alloc(evas_object_mask_cow); 179 obj->mask = eina_cow_alloc(evas_object_mask_cow);
192 obj->events = eina_cow_alloc(evas_object_events_cow);
193 180
194 evas_object_inject(eo_obj, obj, evas); 181 evas_object_inject(eo_obj, obj, evas);
195 evas_object_callback_init(eo_obj, obj); 182 evas_object_callback_init(eo_obj, obj);
@@ -904,7 +891,7 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_get(Eo *eo_obj EINA_UNU
904 //It means this object accept events from any seat. 891 //It means this object accept events from any seat.
905 if (!obj->events_filter_enabled) 892 if (!obj->events_filter_enabled)
906 return EINA_TRUE; 893 return EINA_TRUE;
907 return eina_list_data_find(obj->events->events_whitelist, seat) ? 894 return eina_list_data_find(obj->events_whitelist, seat) ?
908 EINA_TRUE : EINA_FALSE; 895 EINA_TRUE : EINA_FALSE;
909} 896}
910 897
@@ -912,11 +899,8 @@ static void
912_whitelist_events_device_remove_cb(void *data, const Efl_Event *event) 899_whitelist_events_device_remove_cb(void *data, const Efl_Event *event)
913{ 900{
914 Evas_Object_Protected_Data *obj = data; 901 Evas_Object_Protected_Data *obj = data;
915 902 obj->events_whitelist = eina_list_remove(obj->events_whitelist,
916 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 903 event->object);
917 events->events_whitelist = eina_list_remove(events->events_whitelist,
918 event->object);
919 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
920} 904}
921 905
922EOLIAN static void 906EOLIAN static void
@@ -932,10 +916,10 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj,
932 obj->events_filter_enabled = EINA_TRUE; 916 obj->events_filter_enabled = EINA_TRUE;
933 if (add) 917 if (add)
934 { 918 {
935 if (eina_list_data_find(obj->events->events_whitelist, seat)) return; 919 if (eina_list_data_find(obj->events_whitelist, seat)) return;
936 /* remove all previously focused seats, if any - it may happen 920 /* remove all previously focused seats, if any - it may happen
937 since there wasn't a whitelist in place (no restrictions) */ 921 since there wasn't a whitelist in place (no restrictions) */
938 if ((!obj->events->events_whitelist) && (obj->layer) && (obj->layer->evas)) 922 if ((!obj->events_whitelist) && (obj->layer) && (obj->layer->evas))
939 { 923 {
940 const Eina_List *devices, *l; 924 const Eina_List *devices, *l;
941 Efl_Input_Device *dev; 925 Efl_Input_Device *dev;
@@ -948,20 +932,14 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj,
948 efl_canvas_object_seat_focus_del(eo_obj, dev); 932 efl_canvas_object_seat_focus_del(eo_obj, dev);
949 } 933 }
950 } 934 }
951 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 935 obj->events_whitelist = eina_list_append(obj->events_whitelist, seat);
952 events->events_whitelist = eina_list_append(events->events_whitelist, seat);
953 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
954
955 efl_event_callback_add(seat, EFL_EVENT_DEL, 936 efl_event_callback_add(seat, EFL_EVENT_DEL,
956 _whitelist_events_device_remove_cb, obj); 937 _whitelist_events_device_remove_cb, obj);
957 } 938 }
958 else 939 else
959 { 940 {
960 efl_canvas_object_seat_focus_del(eo_obj, seat); 941 efl_canvas_object_seat_focus_del(eo_obj, seat);
961 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 942 obj->events_whitelist = eina_list_remove(obj->events_whitelist, seat);
962 events->events_whitelist = eina_list_remove(events->events_whitelist, seat);
963 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
964
965 efl_event_callback_del(seat, EFL_EVENT_DEL, 943 efl_event_callback_del(seat, EFL_EVENT_DEL,
966 _whitelist_events_device_remove_cb, obj); 944 _whitelist_events_device_remove_cb, obj);
967 } 945 }
@@ -1032,30 +1010,24 @@ _efl_canvas_object_efl_object_destructor(Eo *eo_obj, Evas_Object_Protected_Data
1032 1010
1033 edata = efl_data_scope_get(evas_object_evas_get(eo_obj), EVAS_CANVAS_CLASS); 1011 edata = efl_data_scope_get(evas_object_evas_get(eo_obj), EVAS_CANVAS_CLASS);
1034 evas_object_hide(eo_obj); 1012 evas_object_hide(eo_obj);
1035 1013 EINA_LIST_FREE (obj->focused_by_seats, dev)
1036 EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) 1014 {
1037 { 1015 event_id = _evas_event_counter;
1038 EINA_LIST_FREE (events->focused_by_seats, dev) 1016 efl_event_callback_del(dev, EFL_EVENT_DEL,
1039 { 1017 _evas_focus_device_del_cb, obj);
1040 event_id = _evas_event_counter; 1018 eina_hash_del_by_key(edata->focused_objects, &dev);
1041 efl_event_callback_del(dev, EFL_EVENT_DEL, 1019 _evas_focus_dispatch_event(obj, dev, EINA_FALSE);
1042 _evas_focus_device_del_cb, obj); 1020 if ((obj->layer) && (obj->layer->evas))
1043 eina_hash_del_by_key(edata->focused_objects, &dev); 1021 _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
1044 _evas_focus_dispatch_event(obj, dev, EINA_FALSE); 1022 }
1045 if ((obj->layer) && (obj->layer->evas)) 1023 EINA_INLIST_FREE(obj->pointer_grabs, pdata)
1046 _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); 1024 _evas_object_pointer_grab_del(obj, pdata);
1047 }
1048 EINA_INLIST_FREE(events->pointer_grabs, pdata)
1049 _evas_object_pointer_grab_del(obj, pdata);
1050 EINA_LIST_FREE(events->events_whitelist, dev)
1051 efl_event_callback_del(dev, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj);
1052 }
1053 EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events);
1054
1055 event_id = _evas_object_event_new(); 1025 event_id = _evas_object_event_new();
1056 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, event_id, NULL); 1026 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, event_id, NULL);
1057 if ((obj->layer) && (obj->layer->evas)) 1027 if ((obj->layer) && (obj->layer->evas))
1058 _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); 1028 _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
1029 EINA_LIST_FREE(obj->events_whitelist, dev)
1030 efl_event_callback_del(dev, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj);
1059 if (obj->name) evas_object_name_set(eo_obj, NULL); 1031 if (obj->name) evas_object_name_set(eo_obj, NULL);
1060 if (obj->layer) 1032 if (obj->layer)
1061 { 1033 {
@@ -1765,7 +1737,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
1765 { 1737 {
1766 Evas_Object_Pointer_Data *obj_pdata; 1738 Evas_Object_Pointer_Data *obj_pdata;
1767 1739
1768 EINA_INLIST_FOREACH(obj->events->pointer_grabs, obj_pdata) 1740 EINA_INLIST_FOREACH(obj->pointer_grabs, obj_pdata)
1769 { 1741 {
1770 if (!obj_pdata->mouse_grabbed && 1742 if (!obj_pdata->mouse_grabbed &&
1771 evas_object_is_in_output_rect(eo_obj, obj, obj_pdata->evas_pdata->seat->x, 1743 evas_object_is_in_output_rect(eo_obj, obj, obj_pdata->evas_pdata->seat->x,
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 50333f0..fea6c3a 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -86,7 +86,6 @@ typedef struct _Evas_Post_Callback Evas_Post_Callback;
86typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point; 86typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point;
87typedef struct _Evas_Object_Proxy_Data Evas_Object_Proxy_Data; 87typedef struct _Evas_Object_Proxy_Data Evas_Object_Proxy_Data;
88typedef struct _Evas_Object_Map_Data Evas_Object_Map_Data; 88typedef struct _Evas_Object_Map_Data Evas_Object_Map_Data;
89typedef struct _Evas_Object_Events_Data Evas_Object_Events_Data;
90typedef struct _Evas_Proxy_Render_Data Evas_Proxy_Render_Data; 89typedef struct _Evas_Proxy_Render_Data Evas_Proxy_Render_Data;
91typedef struct _Evas_Object_3D_Data Evas_Object_3D_Data; 90typedef struct _Evas_Object_3D_Data Evas_Object_3D_Data;
92typedef struct _Evas_Object_Mask_Data Evas_Object_Mask_Data; 91typedef struct _Evas_Object_Mask_Data Evas_Object_Mask_Data;
@@ -1094,23 +1093,6 @@ struct _Evas_Object_Mask_Data
1094 Eina_Bool is_scaled : 1; 1093 Eina_Bool is_scaled : 1;
1095}; 1094};
1096 1095
1097struct _Evas_Object_Events_Data
1098{
1099 /*
1100 The list below contain the seats (Efl.Input.Devices) which this
1101 object allows events to be reported (Mouse, Keybord and focus events).
1102 */
1103 Eina_List *events_whitelist;
1104
1105 Eina_List *focused_by_seats;
1106 Eina_Inlist *pointer_grabs;
1107
1108 struct {
1109 Evas_Object *parent;
1110 Eina_Clist member;
1111 } event;
1112};
1113
1114struct _Evas_Object_Protected_State 1096struct _Evas_Object_Protected_State
1115{ 1097{
1116 Evas_Object_Protected_Data *clipper; 1098 Evas_Object_Protected_Data *clipper;
@@ -1166,6 +1148,11 @@ struct _Evas_Object_Protected_Data
1166 Eina_List *grabs; 1148 Eina_List *grabs;
1167 1149
1168 Eina_Inlist *callbacks; 1150 Eina_Inlist *callbacks;
1151 /*
1152 The list below contain the seats (Efl.Input.Devices) which this
1153 object allows events to be reported (Mouse, Keybord and focus events).
1154 */
1155 Eina_List *events_whitelist;
1169 1156
1170 struct { 1157 struct {
1171 Eina_List *clipees; 1158 Eina_List *clipees;
@@ -1184,12 +1171,18 @@ struct _Evas_Object_Protected_Data
1184 Evas_Object_Protected_Data *parent_object_data; 1171 Evas_Object_Protected_Data *parent_object_data;
1185 } smart; 1172 } smart;
1186 1173
1174 struct {
1175 Evas_Object *parent;
1176 Eina_Clist member;
1177 } event;
1178
1187 // Eina_Cow pointer be careful when writing to it 1179 // Eina_Cow pointer be careful when writing to it
1188 const Evas_Object_Proxy_Data *proxy; 1180 const Evas_Object_Proxy_Data *proxy;
1189 const Evas_Object_Map_Data *map; 1181 const Evas_Object_Map_Data *map;
1190 const Evas_Object_3D_Data *data_3d; 1182 const Evas_Object_3D_Data *data_3d;
1191 const Evas_Object_Mask_Data *mask; 1183 const Evas_Object_Mask_Data *mask;
1192 const Evas_Object_Events_Data *events; 1184 Eina_List *focused_by_seats;
1185 Eina_Inlist *pointer_grabs;
1193 1186
1194 // Pointer to the Evas_Object itself 1187 // Pointer to the Evas_Object itself
1195 Evas_Object *object; 1188 Evas_Object *object;
@@ -2085,7 +2078,6 @@ extern Eina_Cow *evas_object_image_pixels_cow;
2085extern Eina_Cow *evas_object_image_load_opts_cow; 2078extern Eina_Cow *evas_object_image_load_opts_cow;
2086extern Eina_Cow *evas_object_image_state_cow; 2079extern Eina_Cow *evas_object_image_state_cow;
2087extern Eina_Cow *evas_object_mask_cow; 2080extern Eina_Cow *evas_object_mask_cow;
2088extern Eina_Cow *evas_object_events_cow;
2089 2081
2090# define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \ 2082# define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \
2091 EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \ 2083 EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \