summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2012-10-26 12:44:52 +0000
committerChunEon Park <hermet@hermet.pe.kr>2012-10-26 12:44:52 +0000
commit54624fe95f7f98ee846687c27517309e5f68805c (patch)
tree239336a3c0a51fc1f8187e232ea5643b447ed67f /legacy/evas/src/lib
parentc05e3d7d88f96b15b1f422a8b9e94c1ee3bf06fe (diff)
evas/event - fill the insufficient source events calls funcs.
pain in my ass! Still source_mouse_in, source_mouse_out needs to be implemented. SVN revision: 78531
Diffstat (limited to 'legacy/evas/src/lib')
-rw-r--r--legacy/evas/src/lib/canvas/evas_events.c544
1 files changed, 496 insertions, 48 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_events.c b/legacy/evas/src/lib/canvas/evas_events.c
index 805adc0..3ed93ae 100644
--- a/legacy/evas/src/lib/canvas/evas_events.c
+++ b/legacy/evas/src/lib/canvas/evas_events.c
@@ -6,6 +6,10 @@ _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
6 const Eina_Inlist *list, Evas_Object *stop, 6 const Eina_Inlist *list, Evas_Object *stop,
7 int x, int y, int *no_rep, Eina_Bool source); 7 int x, int y, int *no_rep, Eina_Bool source);
8 8
9static Eina_List *
10evas_event_list_copy(Eina_List *list);
11
12
9static void 13static void
10_evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed) 14_evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed)
11{ 15{
@@ -214,84 +218,342 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
214 if (src->proxy.src_event_in) 218 if (src->proxy.src_event_in)
215 src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in); 219 src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
216 220
217 //FIXME: Needs to care the src mouse grab. 221 int no_rep = 0;
222 Eina_List *l;
223 Evas_Object *eo_child;
224 Evas_Object_Protected_Data *child;
225
218 if (src->is_smart) 226 if (src->is_smart)
219 { 227 {
220 int no_rep = 0;
221 src->proxy.src_event_in = _evas_event_object_list_raw_in_get(eo_e, src->proxy.src_event_in, evas_object_smart_members_get_direct(eo_src), NULL, ev->canvas.x, ev->canvas.y, &no_rep, EINA_TRUE); 228 src->proxy.src_event_in = _evas_event_object_list_raw_in_get(eo_e, src->proxy.src_event_in, evas_object_smart_members_get_direct(eo_src), NULL, ev->canvas.x, ev->canvas.y, &no_rep, EINA_TRUE);
222 } 229 }
223 else 230 else
224 src->proxy.src_event_in = eina_list_append(src->proxy.src_event_in, src); 231 src->proxy.src_event_in = eina_list_append(src->proxy.src_event_in, src);
225 _evas_event_source_events_call(src, EVAS_CALLBACK_MOUSE_DOWN, ev, event_id); 232
233 int addgrab = 0;
234 if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1;
235
236 EINA_LIST_FOREACH(src->proxy.src_event_in, l, eo_child)
237 {
238 Evas_Object_Protected_Data *child = eo_data_get(eo_child,
239 EVAS_OBJ_CLASS);
240 if ((child->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) ||
241 (child->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN))
242 {
243 child->mouse_grabbed += (addgrab + 1);
244 e->pointer.mouse_grabbed += (addgrab + 1);
245 if (child->pointer_mode ==
246 EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
247 {
248 e->pointer.nogrep++;
249 break;
250 }
251 }
252 }
253
254 Evas_Coord point_x = ev->canvas.x;
255 Evas_Coord point_y = ev->canvas.y;
256
257 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
258 EINA_LIST_FOREACH(copy, l, eo_child)
259 {
260 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
261 ev->canvas.x = point_x;
262 ev->canvas.y = point_y;
263 _evas_event_framespace_adjust(eo_child, &ev->canvas.x,
264 &ev->canvas.y);
265 _evas_event_havemap_adjust(eo_child, child, &ev->canvas.x,
266 &ev->canvas.y,
267 child->mouse_grabbed);
268 evas_object_event_callback_call(eo_child, child,
269 EVAS_CALLBACK_MOUSE_DOWN, ev, event_id);
270 if (e->delete_me) break;
271 if (obj->pointer_mode ==
272 EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
273 break;
274 }
275 eina_list_free(copy);
226 ev->canvas = canvas; 276 ev->canvas = canvas;
227 ev->output = output; 277 ev->output = output;
228} 278}
229 279
230static void 280static void
231_evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas_Event_Mouse_Move *ev, int event_id) 281_evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Move *ev, int event_id)
232{ 282{
233 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 283 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
234 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 284 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
235 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 285 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
286 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
236 Evas_Position cur_pos = ev->cur; 287 Evas_Position cur_pos = ev->cur;
237 288
238 if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return; 289 if (obj->delete_me || src->delete_me || e->is_frozen) return;
239 290
240 _transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y); 291 _transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y);
241 292
242 ev->cur.output.x = ev->cur.canvas.x; 293 ev->cur.output.x = ev->cur.canvas.x;
243 ev->cur.output.y = ev->cur.canvas.y; 294 ev->cur.output.y = ev->cur.canvas.y;
244 295
245 //FIXME: transform previous coords also. 296 //FIXME: transform previous coords also.
246 //FIXME: Needs to care the src mouse grab. 297 Eina_List *l;
247 _evas_event_source_events_call(src, EVAS_CALLBACK_MOUSE_MOVE, ev, event_id); 298 Evas_Object *eo_child;
299 Evas_Object_Protected_Data *child;
300 Evas_Coord point_x = ev->cur.canvas.x;
301 Evas_Coord point_y = ev->cur.canvas.y;
302
303 if (e->pointer.mouse_grabbed)
304 {
305 Eina_List *outs = NULL;
306 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
307 EINA_LIST_FOREACH(copy, l, eo_child)
308 {
309 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
248 310
249 //FIXME: Update the mouse out objects. 311 if ((evas_object_clippers_is_visible(eo_child, child) ||
250 //FIXME: If any object isn't grabbed then get the event list again. 312 child->mouse_grabbed) &&
313 (!evas_event_passes_through(eo_child, child)) &&
314 (!evas_event_freezes_through(eo_child, child)) &&
315 (!child->clip.clipees))
316 {
317 ev->cur.canvas.x = point_x;
318 ev->cur.canvas.y = point_y;
319 _evas_event_framespace_adjust(eo_child, &ev->cur.canvas.x,
320 &ev->cur.canvas.y);
321 _evas_event_havemap_adjust(eo_child, child, &ev->cur.canvas.x,
322 &ev->cur.canvas.y,
323 child->mouse_grabbed);
324 if ((e->pointer.x != ev->cur.canvas.x) ||
325 (e->pointer.y != ev->cur.canvas.y))
326 evas_object_event_callback_call(eo_child, child,
327 EVAS_CALLBACK_MOUSE_MOVE,
328 ev, event_id);
329 }
330 else
331 outs = eina_list_append(outs, eo_child);
332 if (e->delete_me || e->is_frozen) break;
333 //FIXME: take care nograb object
334 }
335 eina_list_free(copy);
336
337 while (outs)
338 {
339 eo_child = outs->data;
340 outs = eina_list_remove(outs, eo_child);
341 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
342 if ((child->mouse_grabbed == 0) && (!e->delete_me))
343 {
344 if (child->mouse_in) continue;
345 child->mouse_in = 0;
346 if (child->delete_me || e->is_frozen) continue;
347 ev->cur.canvas.x = cur_pos.canvas.x;
348 ev->cur.canvas.y = cur_pos.canvas.y;
349 _evas_event_framespace_adjust(eo_child, &ev->cur.canvas.x,
350 &ev->cur.canvas.y);
351 _evas_event_havemap_adjust(eo_child, child, &ev->cur.canvas.x,
352 &ev->cur.canvas.y,
353 child->mouse_grabbed);
354 src->proxy.src_event_in =
355 eina_list_remove(src->proxy.src_event_in, eo_child);
356 evas_object_event_callback_call(eo_child, child,
357 EVAS_CALLBACK_MOUSE_OUT,
358 ev, event_id);
359 }
360 }
361 }
362 else
363 {
364 Eina_List *ins = NULL;
365 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
366 if (src->is_smart)
367 {
368 int no_rep = 0;
369 ins = _evas_event_object_list_raw_in_get(eo_e, ins, evas_object_smart_members_get_direct(eo_src), NULL, ev->cur.canvas.x, ev->cur.canvas.y, &no_rep, EINA_TRUE);
370 }
371 else
372 ins = eina_list_append(ins, eo_src);
373
374 EINA_LIST_FOREACH(copy, l, eo_child)
375 {
376 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
377
378 ev->cur.canvas.x = point_x;
379 ev->cur.canvas.y = point_y;
380
381 if (evas_object_is_in_output_rect(eo_child, child,
382 ev->cur.canvas.x,
383 ev->cur.canvas.y, 1, 1) &&
384 (evas_object_clippers_is_visible(eo_child, child) ||
385 child->mouse_grabbed) &&
386 eina_list_data_find(ins, eo_child) &&
387 (!evas_event_passes_through(eo_child, child)) &&
388 (!evas_event_freezes_through(eo_child, child)) &&
389 (!child->clip.clipees) &&
390 ((!child->precise_is_inside) ||
391 evas_object_is_inside(eo_child, child, ev->cur.canvas.x,
392 ev->cur.canvas.y)))
393 {
394 _evas_event_havemap_adjust(eo_child, child, &ev->cur.canvas.x,
395 &ev->cur.canvas.y,
396 child->mouse_grabbed);
397 if ((e->pointer.x != ev->cur.canvas.x) ||
398 (e->pointer.y != ev->cur.canvas.y))
399 evas_object_event_callback_call(eo_child, child,
400 EVAS_CALLBACK_MOUSE_MOVE,
401 ev, event_id);
402 }
403 else if (child->mouse_in)
404 {
405 child->mouse_in = 0;
406 if (e->is_frozen) continue;
407 ev->cur.canvas.x = point_x;
408 ev->cur.canvas.y = point_y;
409 _evas_event_framespace_adjust(eo_child,
410 &ev->cur.canvas.x,
411 &ev->cur.canvas.y);
412 _evas_event_havemap_adjust(eo_child, child,
413 &ev->cur.canvas.x,
414 &ev->cur.canvas.y,
415 child->mouse_grabbed);
416 evas_object_event_callback_call(eo_child, child,
417 EVAS_CALLBACK_MOUSE_OUT,
418 ev, event_id);
419 if (e->delete_me) break;
420
421 }
422 if (e->delete_me || e->is_frozen) break;
423 }
424 eina_list_free(copy);
425 _evas_object_event_new();
426 int event_id2 = _evas_event_counter;
427 EINA_LIST_FOREACH(ins, l, eo_child)
428 {
429 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
430 if (!eina_list_data_find(src->proxy.src_event_in, eo_child))
431 {
432 if (!child->mouse_in)
433 {
434 child->mouse_in = 1;
435 if (e->is_frozen) continue;
436 ev->cur.canvas.x = point_x;
437 ev->cur.canvas.y = point_y;
438 _evas_event_framespace_adjust(eo_child,
439 &ev->cur.canvas.x,
440 &ev->cur.canvas.y);
441 _evas_event_havemap_adjust(eo_child, child,
442 &ev->cur.canvas.x,
443 &ev->cur.canvas.y,
444 child->mouse_grabbed);
445 evas_object_event_callback_call(eo_child, child,
446 EVAS_CALLBACK_MOUSE_IN,
447 ev, event_id2);
448 if (e->delete_me) break;
449 }
450 }
451 }
452 if (e->pointer.mouse_grabbed == 0)
453 {
454 if (src->proxy.src_event_in)
455 eina_list_free(src->proxy.src_event_in);
456 src->proxy.src_event_in = ins;
457 }
458 else
459 {
460 if (ins) eina_list_free(ins);
461 }
462 }
251 463
252 ev->cur = cur_pos; 464 ev->cur = cur_pos;
253} 465}
254 466
255static void 467static void
256_evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas_Event_Mouse_Up *ev, int event_id) 468_evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Up *ev, int event_id)
257{ 469{
258 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 470 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
259 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 471 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
260 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 472 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
473 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
261 Evas_Point output = ev->output; 474 Evas_Point output = ev->output;
262 Evas_Coord_Point canvas = ev->canvas; 475 Evas_Coord_Point canvas = ev->canvas;
263 476
264 if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return; 477 if (obj->delete_me || src->delete_me || e->is_frozen) return;
265 478
266 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y); 479 _transform_to_src_space(obj, src, &ev->canvas.x, &ev->canvas.y);
267 480
268 ev->output.x = ev->canvas.x; 481 ev->output.x = ev->canvas.x;
269 ev->output.y = ev->canvas.y; 482 ev->output.y = ev->canvas.y;
270 483
271 //FIXME: Needs to care the src mouse grab. 484 Eina_List *l;
272 _evas_event_source_events_call(src, EVAS_CALLBACK_MOUSE_UP, ev, event_id); 485 Evas_Object *eo_child;
273 src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in); 486 Evas_Object_Protected_Data *child;
487 Evas_Coord point_x = ev->canvas.x;
488 Evas_Coord point_y = ev->canvas.y;
489
490 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
491 EINA_LIST_FOREACH(copy, l, eo_child)
492 {
493 if (src->delete_me) return;
494 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
495 if ((child->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) &&
496 (child->mouse_grabbed > 0))
497 {
498 child->mouse_grabbed--;
499 e->pointer.mouse_grabbed--;
500 }
501
502 ev->canvas.x = point_x;
503 ev->canvas.y = point_y;
504 _evas_event_framespace_adjust(eo_child,
505 &ev->canvas.x,
506 &ev->canvas.y);
507 _evas_event_havemap_adjust(eo_child, child,
508 &ev->canvas.x,
509 &ev->canvas.y,
510 child->mouse_grabbed);
511 evas_object_event_callback_call(eo_child, child,
512 EVAS_CALLBACK_MOUSE_UP, ev, event_id);
513 if (e->delete_me) break;
514 if (obj->pointer_mode ==
515 EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN)
516 {
517 if (e->pointer.nogrep > 0) e->pointer.nogrep--;
518 break;
519 }
520 }
521 eina_list_free(copy);
274 522
275 ev->canvas = canvas; 523 ev->canvas = canvas;
276 ev->output = output; 524 ev->output = output;
277} 525}
278 526
279static void 527static void
280_evas_event_source_hold_events(Evas_Object *eo_obj, void *ev, int event_id) 528_evas_event_source_hold_events(Evas_Object *eo_obj, Evas *eo_e, void *ev, int event_id)
281{ 529{
282 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 530 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
283 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 531 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
284 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 532 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
533 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
534
285 if (obj->layer->evas->is_frozen) return; 535 if (obj->layer->evas->is_frozen) return;
286 _evas_event_source_events_call(src, EVAS_CALLBACK_HOLD, ev, event_id); 536
537 Eina_List *l;
538 Evas_Object *child_eo;
539 Evas_Object_Protected_Data *child;
540 EINA_LIST_FOREACH(src->proxy.src_event_in, l, child_eo)
541 {
542 if (src->delete_me) return;
543 child = eo_data_get(child_eo, EVAS_OBJ_CLASS);
544 evas_object_event_callback_call(child_eo, child, EVAS_CALLBACK_HOLD, ev,
545 event_id);
546 if (src->layer->evas->delete_me) break;
547 }
287} 548}
288 549
289static void 550static void
290_evas_event_source_wheel_events(Evas_Object *eo_obj, Evas_Event_Mouse_Wheel *ev, int event_id) 551_evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_Wheel *ev, int event_id)
291{ 552{
292 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 553 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
293 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 554 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
294 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 555 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
556 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
295 Evas_Point output = ev->output; 557 Evas_Point output = ev->output;
296 Evas_Coord_Point canvas = ev->canvas; 558 Evas_Coord_Point canvas = ev->canvas;
297 559
@@ -302,18 +564,42 @@ _evas_event_source_wheel_events(Evas_Object *eo_obj, Evas_Event_Mouse_Wheel *ev,
302 ev->output.x = ev->canvas.x; 564 ev->output.x = ev->canvas.x;
303 ev->output.y = ev->canvas.y; 565 ev->output.y = ev->canvas.y;
304 566
305 _evas_event_source_events_call(src, EVAS_CALLBACK_MOUSE_WHEEL, ev, event_id); 567 Eina_List *l;
568 Evas_Object *eo_child;
569 Evas_Object_Protected_Data *child;
570 Evas_Coord point_x = ev->canvas.x;
571 Evas_Coord point_y = ev->canvas.y;
306 572
573 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
574 EINA_LIST_FOREACH(copy, l, eo_child)
575 {
576 if (src->delete_me) return;
577 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
578 ev->canvas.x = point_x;
579 ev->canvas.y = point_y;
580 _evas_event_framespace_adjust(eo_child,
581 &ev->canvas.x,
582 &ev->canvas.y);
583 _evas_event_havemap_adjust(eo_child, child,
584 &ev->canvas.x,
585 &ev->canvas.y,
586 child->mouse_grabbed);
587 evas_object_event_callback_call(eo_child, child,
588 EVAS_CALLBACK_MOUSE_WHEEL, ev, event_id);
589 if (e->delete_me) break;
590 }
591 eina_list_free(copy);
307 ev->canvas = canvas; 592 ev->canvas = canvas;
308 ev->output = output; 593 ev->output = output;
309} 594}
310 595
311static void 596static void
312_evas_event_source_multi_down_events(Evas_Object *eo_obj, Evas_Event_Multi_Down *ev, int event_id) 597_evas_event_source_multi_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Multi_Down *ev, int event_id)
313{ 598{
314 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 599 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
315 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 600 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
316 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 601 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
602 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
317 Evas_Point output = ev->output; 603 Evas_Point output = ev->output;
318 Evas_Coord_Precision_Point canvas = ev->canvas; 604 Evas_Coord_Precision_Point canvas = ev->canvas;
319 605
@@ -325,19 +611,56 @@ _evas_event_source_multi_down_events(Evas_Object *eo_obj, Evas_Event_Multi_Down
325 ev->output.x = ev->canvas.x; 611 ev->output.x = ev->canvas.x;
326 ev->output.y = ev->canvas.y; 612 ev->output.y = ev->canvas.y;
327 613
328 //FIXME: Needs to care the src mouse grab. 614 Eina_List *l;
329 _evas_event_source_events_call(src, EVAS_CALLBACK_MULTI_DOWN, ev, event_id); 615 Evas_Object *eo_child;
616 Evas_Object_Protected_Data *child;
617
618 int addgrab = 0;
619 if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1;
620
621 EINA_LIST_FOREACH(src->proxy.src_event_in, l, eo_child)
622 {
623 Evas_Object_Protected_Data *child = eo_data_get(eo_child,
624 EVAS_OBJ_CLASS);
625 if (child->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
626 {
627 child->mouse_grabbed += (addgrab + 1);
628 e->pointer.mouse_grabbed += (addgrab + 1);
629 }
630 }
631
632 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
633 EINA_LIST_FOREACH(copy, l, eo_child)
634 {
635 Evas_Coord point_x = ev->canvas.x;
636 Evas_Coord point_y = ev->canvas.y;
637 ev->canvas.x = point_x;
638 ev->canvas.y = point_y;
639 _evas_event_framespace_adjust(eo_child,
640 &ev->canvas.x,
641 &ev->canvas.y);
642 _evas_event_havemap_adjust(eo_child, child,
643 &ev->canvas.x,
644 &ev->canvas.y,
645 child->mouse_grabbed);
646 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
647 evas_object_event_callback_call(eo_child, child,
648 EVAS_CALLBACK_MULTI_DOWN, ev, event_id);
649 if (e->delete_me) break;
650 }
651 eina_list_free(copy);
330 652
331 ev->canvas = canvas; 653 ev->canvas = canvas;
332 ev->output = output; 654 ev->output = output;
333} 655}
334 656
335static void 657static void
336_evas_event_source_multi_up_events(Evas_Object *eo_obj, Evas_Event_Multi_Up *ev, int event_id) 658_evas_event_source_multi_up_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Multi_Up *ev, int event_id)
337{ 659{
338 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 660 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
339 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 661 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
340 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 662 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
663 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
341 Evas_Point output = ev->output; 664 Evas_Point output = ev->output;
342 Evas_Coord_Precision_Point canvas = ev->canvas; 665 Evas_Coord_Precision_Point canvas = ev->canvas;
343 666
@@ -349,37 +672,158 @@ _evas_event_source_multi_up_events(Evas_Object *eo_obj, Evas_Event_Multi_Up *ev,
349 ev->output.x = ev->canvas.x; 672 ev->output.x = ev->canvas.x;
350 ev->output.y = ev->canvas.y; 673 ev->output.y = ev->canvas.y;
351 674
352 //FIXME: Needs to care the src mouse grab. 675 Evas_Coord point_x = ev->canvas.x;
353 _evas_event_source_events_call(src, EVAS_CALLBACK_MULTI_UP, ev, event_id); 676 Evas_Coord point_y = ev->canvas.y;
677
678 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
679
680 Eina_List *l;
681 Evas_Object *eo_child;
682 Evas_Object_Protected_Data *child;
683 EINA_LIST_FOREACH(copy, l, eo_child)
684 {
685 ev->canvas.x = point_x;
686 ev->canvas.y = point_y;
687 if ((child->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
688 (child->mouse_grabbed > 0))
689 {
690 child->mouse_grabbed--;
691 e->pointer.mouse_grabbed--;
692 }
693 _evas_event_framespace_adjust(eo_child,
694 &ev->canvas.x,
695 &ev->canvas.y);
696 _evas_event_havemap_adjust(eo_child, child,
697 &ev->canvas.x,
698 &ev->canvas.y,
699 child->mouse_grabbed);
700 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
701 evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MULTI_UP,
702 ev, event_id);
703 if (e->delete_me || e->is_frozen) break;
704 }
705 eina_list_free(copy);
354 706
355 ev->canvas = canvas; 707 ev->canvas = canvas;
356 ev->output = output; 708 ev->output = output;
357} 709}
358 710
359static void 711static void
360_evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas_Event_Multi_Move *ev, int event_id) 712_evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Multi_Move *ev, int event_id)
361{ 713{
362 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 714 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
363 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 715 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
364 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS); 716 Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
717 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
365 Evas_Precision_Position cur_pos = ev->cur; 718 Evas_Precision_Position cur_pos = ev->cur;
366 719
367 if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return; 720 if (obj->delete_me || src->delete_me || e->is_frozen) return;
368 721
369 _transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y); 722 _transform_to_src_space(obj, src, &ev->cur.canvas.x, &ev->cur.canvas.y);
370 723
371 ev->cur.output.x = ev->cur.canvas.x; 724 ev->cur.output.x = ev->cur.canvas.x;
372 ev->cur.output.y = ev->cur.canvas.y; 725 ev->cur.output.y = ev->cur.canvas.y;
726 //FIXME: transform precision
727
728 Evas_Coord point_x = ev->cur.canvas.x;
729 Evas_Coord point_y = ev->cur.canvas.y;
373 730
374 //FIXME: Needs to care the src mouse grab. 731 _evas_object_event_new();
375 _evas_event_source_events_call(src, EVAS_CALLBACK_MULTI_MOVE, ev, event_id); 732 event_id = _evas_event_counter;
733 Eina_List *l;
734 Evas_Object *eo_child;
735 Evas_Object_Protected_Data *child;
736
737 if (e->pointer.mouse_grabbed > 0)
738 {
739 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
740 EINA_LIST_FOREACH(copy, l, eo_child)
741 {
742 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
743 if ((evas_object_clippers_is_visible(eo_child, child) ||
744 (child->mouse_grabbed) &&
745 (!evas_event_passes_through(eo_child, child)) &&
746 (!evas_event_freezes_through(eo_child, child)) &&
747 (!child->clip.clipees)))
748 {
749 ev->cur.canvas.x = point_x;
750 ev->cur.canvas.y = point_y;
751 _evas_event_framespace_adjust(eo_child,
752 &ev->cur.canvas.x,
753 &ev->cur.canvas.y);
754 _evas_event_havemap_adjust(eo_child, child,
755 &ev->cur.canvas.x,
756 &ev->cur.canvas.y,
757 child->mouse_grabbed);
758 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
759 evas_object_event_callback_call(eo_child, child,
760 EVAS_CALLBACK_MULTI_MOVE, ev,
761 event_id);
762 if (e->delete_me || e->is_frozen) break;
763 }
764 }
765 eina_list_free(copy);
766 }
767 else
768 {
769 Eina_List *ins = NULL;
770
771 if (src->is_smart)
772 {
773 int no_rep = 0;
774 ins = _evas_event_object_list_raw_in_get(eo_e, ins, evas_object_smart_members_get_direct(eo_src), NULL, ev->cur.canvas.x, ev->cur.canvas.y, &no_rep, EINA_TRUE);
775 }
776 else
777 ins = eina_list_append(ins, src);
778 Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
779 EINA_LIST_FOREACH(copy, l, eo_child)
780 {
781 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
782 ev->cur.canvas.x = point_x;
783 ev->cur.canvas.y = point_y;
784
785 if (evas_object_is_in_output_rect(eo_child, child,
786 ev->cur.canvas.x,
787 ev->cur.canvas.y, 1, 1) &&
788 (evas_object_clippers_is_visible(eo_child, child) ||
789 child->mouse_grabbed) &&
790 eina_list_data_find(ins, eo_child) &&
791 (!evas_event_passes_through(eo_child, child)) &&
792 (!evas_event_freezes_through(eo_child, child)) &&
793 (!child->clip.clipees) &&
794 ((!child->precise_is_inside) ||
795 evas_object_is_inside(eo_child, child, ev->cur.canvas.x,
796 ev->cur.canvas.y)))
797 {
798 _evas_event_framespace_adjust(eo_child,
799 &ev->cur.canvas.x,
800 &ev->cur.canvas.y);
801 _evas_event_havemap_adjust(eo_child, child,
802 &ev->cur.canvas.x,
803 &ev->cur.canvas.y,
804 child->mouse_grabbed);
805 child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
806 evas_object_event_callback_call(eo_child, child,
807 EVAS_CALLBACK_MULTI_MOVE, ev,
808 event_id);
809 if (e->delete_me || e->is_frozen) break;
810 }
811 }
812 eina_list_free(copy);
813 if (e->pointer.mouse_grabbed == 0)
814 {
815 eina_list_free(src->proxy.src_event_in);
816 src->proxy.src_event_in = ins;
817 }
818 else
819 eina_list_free(ins);
820 }
376 821
377 //FIXME: If any object isn't grabbed then get the event list again.
378 ev->cur = cur_pos; 822 ev->cur = cur_pos;
379} 823}
380 824
381static void 825static void
382_evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas_Event_Mouse_In *ev, int event_id) 826_evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mouse_In *ev, int event_id)
383{ 827{
384 //FIXME: Should implement again. 828 //FIXME: Should implement again.
385 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 829 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
@@ -796,8 +1240,7 @@ _post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data)
796 &ev_in, event_id); 1240 &ev_in, event_id);
797 if ((obj_itr->proxy.is_proxy) && 1241 if ((obj_itr->proxy.is_proxy) &&
798 (obj_itr->proxy.src_events)) 1242 (obj_itr->proxy.src_events))
799 _evas_event_source_mouse_in_events(eo_obj_itr, 1243 _evas_event_source_mouse_in_events(eo_obj_itr, eo_e, &ev_in,
800 &ev_in,
801 event_id); 1244 event_id);
802 if (e->delete_me) break; 1245 if (e->delete_me) break;
803 } 1246 }
@@ -909,7 +1352,7 @@ _canvas_event_feed_mouse_up(Eo *eo_e, void *_pd, va_list *list)
909 EVAS_CALLBACK_MOUSE_UP, 1352 EVAS_CALLBACK_MOUSE_UP,
910 &ev, event_id); 1353 &ev, event_id);
911 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 1354 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
912 _evas_event_source_mouse_up_events(eo_obj, &ev, 1355 _evas_event_source_mouse_up_events(eo_obj, eo_e, &ev,
913 event_id); 1356 event_id);
914 if (e->delete_me) break; 1357 if (e->delete_me) break;
915 } 1358 }
@@ -1034,7 +1477,7 @@ _canvas_event_feed_mouse_wheel(Eo *eo_e, void *_pd, va_list *list)
1034 EVAS_CALLBACK_MOUSE_WHEEL, &ev, 1477 EVAS_CALLBACK_MOUSE_WHEEL, &ev,
1035 event_id); 1478 event_id);
1036 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 1479 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
1037 _evas_event_source_wheel_events(eo_obj, &ev, event_id); 1480 _evas_event_source_wheel_events(eo_obj, eo_e, &ev, event_id);
1038 if (e->delete_me || e->is_frozen) break; 1481 if (e->delete_me || e->is_frozen) break;
1039 } 1482 }
1040 } 1483 }
@@ -1144,7 +1587,8 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
1144 EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); 1587 EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
1145 if ((obj->proxy.is_proxy) && 1588 if ((obj->proxy.is_proxy) &&
1146 (obj->proxy.src_events)) 1589 (obj->proxy.src_events))
1147 _evas_event_source_mouse_move_events(eo_obj, &ev, 1590 _evas_event_source_mouse_move_events(eo_obj, eo_e,
1591 &ev,
1148 event_id); 1592 event_id);
1149 } 1593 }
1150 } 1594 }
@@ -1298,7 +1742,7 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
1298 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); 1742 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
1299 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); 1743 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
1300 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 1744 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
1301 _evas_event_source_mouse_move_events(eo_obj,&ev, 1745 _evas_event_source_mouse_move_events(eo_obj, eo_e, &ev,
1302 event_id); 1746 event_id);
1303 } 1747 }
1304 } 1748 }
@@ -1355,7 +1799,7 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
1355 &ev3, event_id2); 1799 &ev3, event_id2);
1356 if ((obj->proxy.is_proxy) && 1800 if ((obj->proxy.is_proxy) &&
1357 (obj->proxy.src_events)) 1801 (obj->proxy.src_events))
1358 _evas_event_source_mouse_in_events(eo_obj, &ev3, 1802 _evas_event_source_mouse_in_events(eo_obj, eo_e, &ev3,
1359 event_id2); 1803 event_id2);
1360 if (e->delete_me) break; 1804 if (e->delete_me) break;
1361 } 1805 }
@@ -1493,7 +1937,7 @@ nogrep:
1493 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed); 1937 _evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
1494 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id); 1938 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
1495 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 1939 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
1496 _evas_event_source_mouse_move_events(eo_obj, &ev, 1940 _evas_event_source_mouse_move_events(eo_obj, eo_e, &ev,
1497 event_id); 1941 event_id);
1498 } 1942 }
1499 } 1943 }
@@ -1543,7 +1987,8 @@ nogrep:
1543 EVAS_CALLBACK_MOUSE_IN, &ev3, 1987 EVAS_CALLBACK_MOUSE_IN, &ev3,
1544 event_id2); 1988 event_id2);
1545 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 1989 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
1546 _evas_event_source_mouse_in_events(eo_obj, &ev3, event_id2); 1990 _evas_event_source_mouse_in_events(eo_obj, eo_e, &ev3,
1991 event_id2);
1547 if (e->delete_me) break; 1992 if (e->delete_me) break;
1548 } 1993 }
1549 } 1994 }
@@ -1623,7 +2068,7 @@ _canvas_event_feed_mouse_in(Eo *eo_e, void *_pd, va_list *list)
1623 EVAS_CALLBACK_MOUSE_IN, &ev, 2068 EVAS_CALLBACK_MOUSE_IN, &ev,
1624 event_id); 2069 event_id);
1625 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 2070 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
1626 _evas_event_source_mouse_in_events(eo_obj, &ev, event_id); 2071 _evas_event_source_mouse_in_events(eo_obj, eo_e, &ev, event_id);
1627 if (e->delete_me || e->is_frozen) break; 2072 if (e->delete_me || e->is_frozen) break;
1628 } 2073 }
1629 } 2074 }
@@ -1820,7 +2265,7 @@ _canvas_event_feed_multi_down(Eo *eo_e, void *_pd, va_list *list)
1820 EVAS_CALLBACK_MULTI_DOWN, &ev, 2265 EVAS_CALLBACK_MULTI_DOWN, &ev,
1821 event_id); 2266 event_id);
1822 if ((obj->proxy.is_proxy) || (obj->proxy.src_events)) 2267 if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
1823 _evas_event_source_multi_down_events(eo_obj, &ev, event_id); 2268 _evas_event_source_multi_down_events(eo_obj, eo_e, &ev, event_id);
1824 if (e->delete_me || e->is_frozen) break; 2269 if (e->delete_me || e->is_frozen) break;
1825 } 2270 }
1826 if (copy) eina_list_free(copy); 2271 if (copy) eina_list_free(copy);
@@ -1925,7 +2370,7 @@ _canvas_event_feed_multi_up(Eo *eo_e, void *_pd, va_list *list)
1925 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_UP, 2370 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_UP,
1926 &ev, event_id); 2371 &ev, event_id);
1927 if ((obj->proxy.is_proxy) || (obj->proxy.src_events)) 2372 if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
1928 _evas_event_source_multi_up_events(eo_obj, &ev, event_id); 2373 _evas_event_source_multi_up_events(eo_obj, eo_e, &ev, event_id);
1929 if (e->delete_me || e->is_frozen) break; 2374 if (e->delete_me || e->is_frozen) break;
1930 } 2375 }
1931 if (copy) copy = eina_list_free(copy); 2376 if (copy) copy = eina_list_free(copy);
@@ -2033,9 +2478,11 @@ _canvas_event_feed_multi_move(Eo *eo_e, void *_pd, va_list *list)
2033 ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision 2478 ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
2034 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id); 2479 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id);
2035 if ((obj->proxy.is_proxy) || (obj->proxy.src_events)) 2480 if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
2036 _evas_event_source_multi_move_events(eo_obj, &ev, event_id); 2481 _evas_event_source_multi_move_events(eo_obj, eo_e, &ev,
2482 event_id);
2483
2484 if (e->delete_me || e->is_frozen) break;
2037 } 2485 }
2038 if (e->delete_me || e->is_frozen) break;
2039 } 2486 }
2040 eina_list_free(copy); 2487 eina_list_free(copy);
2041 _evas_post_event_callback_call(eo_e, e); 2488 _evas_post_event_callback_call(eo_e, e);
@@ -2106,7 +2553,8 @@ _canvas_event_feed_multi_move(Eo *eo_e, void *_pd, va_list *list)
2106 ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision 2553 ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
2107 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id); 2554 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id);
2108 if ((obj->proxy.is_proxy) || (obj->proxy.src_events)) 2555 if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
2109 _evas_event_source_multi_move_events(eo_obj, &ev, event_id); 2556 _evas_event_source_multi_move_events(eo_obj, eo_e, &ev,
2557 event_id);
2110 } 2558 }
2111 if (e->delete_me || e->is_frozen) break; 2559 if (e->delete_me || e->is_frozen) break;
2112 } 2560 }
@@ -2395,7 +2843,7 @@ _canvas_event_feed_hold(Eo *eo_e, void *_pd, va_list *list)
2395 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD, 2843 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD,
2396 &ev, event_id); 2844 &ev, event_id);
2397 if ((obj->proxy.is_proxy) && (obj->proxy.src_events)) 2845 if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
2398 _evas_event_source_hold_events(eo_obj, &ev, event_id); 2846 _evas_event_source_hold_events(eo_obj, eo_e, &ev, event_id);
2399 } 2847 }
2400 if (e->delete_me || e->is_frozen) break; 2848 if (e->delete_me || e->is_frozen) break;
2401 } 2849 }