summaryrefslogtreecommitdiff
path: root/src/lib/ecore_input_evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-05-11 13:55:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-05-31 19:03:04 +0900
commit21bc2f89f5e932405a63a65f332a0f6d9319c0c3 (patch)
tree50acb980aa74ef2733753b588c851f71dfa1b3d4 /src/lib/ecore_input_evas
parent5aa00004a5f8e54fbf8637bf62338ed005a4239a (diff)
ecore_input: Pass all events through direct cb first
Since the direct input event callback returns true if the event has been processed, we can easily support legacy and progressively implement full support for eo input events.
Diffstat (limited to 'src/lib/ecore_input_evas')
-rw-r--r--src/lib/ecore_input_evas/ecore_input_evas.c165
1 files changed, 110 insertions, 55 deletions
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c
index daed66a0d7..df7a851d4d 100644
--- a/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -412,23 +412,36 @@ _ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press)
412 if (!lookup) return ECORE_CALLBACK_PASS_ON; 412 if (!lookup) return ECORE_CALLBACK_PASS_ON;
413 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers); 413 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
414 if (press == ECORE_DOWN) 414 if (press == ECORE_DOWN)
415 evas_event_feed_key_down_with_keycode(lookup->evas, 415 {
416 e->keyname, 416 if (!lookup->direct ||
417 e->key, 417 !lookup->direct(lookup->window, ECORE_EVENT_KEY_DOWN, e))
418 e->string, 418 {
419 e->compose, 419 evas_event_feed_key_down_with_keycode(lookup->evas,
420 e->timestamp, 420 e->keyname,
421 e->data, 421 e->key,
422 e->keycode); 422 e->string,
423 e->compose,
424 e->timestamp,
425 e->data,
426 e->keycode);
427 }
428 }
423 else 429 else
424 evas_event_feed_key_up_with_keycode(lookup->evas, 430 {
425 e->keyname, 431 if (!lookup->direct ||
426 e->key, 432 !lookup->direct(lookup->window, ECORE_EVENT_KEY_DOWN, e))
427 e->string, 433 {
428 e->compose, 434 evas_event_feed_key_up_with_keycode(lookup->evas,
429 e->timestamp, 435 e->keyname,
430 e->data, 436 e->key,
431 e->keycode); 437 e->string,
438 e->compose,
439 e->timestamp,
440 e->data,
441 e->keycode);
442 }
443 }
444
432 return ECORE_CALLBACK_PASS_ON; 445 return ECORE_CALLBACK_PASS_ON;
433} 446}
434 447
@@ -443,7 +456,11 @@ _ecore_event_evas_mouse_button_cancel(Ecore_Event_Mouse_Button *e)
443 if (!lookup) return ECORE_CALLBACK_PASS_ON; 456 if (!lookup) return ECORE_CALLBACK_PASS_ON;
444 457
445 INF("ButtonEvent cancel, device(%d), button(%d)", e->multi.device, e->buttons); 458 INF("ButtonEvent cancel, device(%d), button(%d)", e->multi.device, e->buttons);
446 evas_event_feed_mouse_cancel(lookup->evas, e->timestamp, NULL); 459 if (!lookup->direct ||
460 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_CANCEL, e))
461 {
462 evas_event_feed_mouse_cancel(lookup->evas, e->timestamp, NULL);
463 }
447 464
448 //the number of last event is small, simple check is ok. 465 //the number of last event is small, simple check is ok.
449 EINA_LIST_FOREACH(_last_events, l, eel) 466 EINA_LIST_FOREACH(_last_events, l, eel)
@@ -507,47 +524,67 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
507 { 524 {
508 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers); 525 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
509 if (press == ECORE_DOWN) 526 if (press == ECORE_DOWN)
510 evas_event_feed_mouse_down(lookup->evas, e->buttons, flags, 527 {
511 e->timestamp, NULL); 528 if (!lookup->direct ||
529 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_DOWN, e))
530 {
531 evas_event_feed_mouse_down(lookup->evas, e->buttons, flags,
532 e->timestamp, NULL);
533 }
534 }
512 else 535 else
513 evas_event_feed_mouse_up(lookup->evas, e->buttons, flags, 536 {
514 e->timestamp, NULL); 537 if (!lookup->direct ||
538 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_UP, e))
539 {
540 evas_event_feed_mouse_up(lookup->evas, e->buttons, flags,
541 e->timestamp, NULL);
542 }
543 }
515 } 544 }
516 else 545 else
517 { 546 {
518 if (press == ECORE_DOWN) 547 if (press == ECORE_DOWN)
519 { 548 {
520 if (lookup->down_multi) 549 if (!lookup->direct ||
521 lookup->down_multi(lookup->window, e->multi.device, 550 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_DOWN, e))
522 e->x, e->y, e->multi.radius, 551 {
523 e->multi.radius_x, e->multi.radius_y, 552 if (lookup->down_multi)
524 e->multi.pressure, e->multi.angle, 553 lookup->down_multi(lookup->window, e->multi.device,
525 e->multi.x, e->multi.y, flags, 554 e->x, e->y, e->multi.radius,
526 e->timestamp); 555 e->multi.radius_x, e->multi.radius_y,
527 else 556 e->multi.pressure, e->multi.angle,
528 evas_event_input_multi_down(lookup->evas, e->multi.device, 557 e->multi.x, e->multi.y, flags,
529 e->x, e->y, e->multi.radius, 558 e->timestamp);
530 e->multi.radius_x, e->multi.radius_y, 559 else
531 e->multi.pressure, e->multi.angle, 560 evas_event_input_multi_down(lookup->evas, e->multi.device,
532 e->multi.x, e->multi.y, flags, 561 e->x, e->y, e->multi.radius,
533 e->timestamp, NULL); 562 e->multi.radius_x, e->multi.radius_y,
563 e->multi.pressure, e->multi.angle,
564 e->multi.x, e->multi.y, flags,
565 e->timestamp, NULL);
566 }
534 } 567 }
535 else 568 else
536 { 569 {
537 if (lookup->up_multi) 570 if (!lookup->direct ||
538 lookup->up_multi(lookup->window, e->multi.device, 571 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_UP, e))
539 e->x, e->y, e->multi.radius, 572 {
540 e->multi.radius_x, e->multi.radius_y, 573 if (lookup->up_multi)
541 e->multi.pressure, e->multi.angle, 574 lookup->up_multi(lookup->window, e->multi.device,
542 e->multi.x, e->multi.y, flags, 575 e->x, e->y, e->multi.radius,
543 e->timestamp); 576 e->multi.radius_x, e->multi.radius_y,
544 else 577 e->multi.pressure, e->multi.angle,
545 evas_event_input_multi_up(lookup->evas, e->multi.device, 578 e->multi.x, e->multi.y, flags,
546 e->x, e->y, e->multi.radius, 579 e->timestamp);
547 e->multi.radius_x, e->multi.radius_y, 580 else
548 e->multi.pressure, e->multi.angle, 581 evas_event_input_multi_up(lookup->evas, e->multi.device,
549 e->multi.x, e->multi.y, flags, 582 e->x, e->y, e->multi.radius,
550 e->timestamp, NULL); 583 e->multi.radius_x, e->multi.radius_y,
584 e->multi.pressure, e->multi.angle,
585 e->multi.x, e->multi.y, flags,
586 e->timestamp, NULL);
587 }
551 } 588 }
552 } 589 }
553 return ECORE_CALLBACK_PASS_ON; 590 return ECORE_CALLBACK_PASS_ON;
@@ -622,10 +659,18 @@ _ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io)
622 switch (io) 659 switch (io)
623 { 660 {
624 case ECORE_IN: 661 case ECORE_IN:
625 evas_event_feed_mouse_in(lookup->evas, e->timestamp, NULL); 662 if (!lookup->direct ||
663 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_IN, e))
664 {
665 evas_event_feed_mouse_in(lookup->evas, e->timestamp, NULL);
666 }
626 break; 667 break;
627 case ECORE_OUT: 668 case ECORE_OUT:
628 evas_event_feed_mouse_out(lookup->evas, e->timestamp, NULL); 669 if (!lookup->direct ||
670 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_OUT, e))
671 {
672 evas_event_feed_mouse_out(lookup->evas, e->timestamp, NULL);
673 }
629 break; 674 break;
630 default: 675 default:
631 break; 676 break;
@@ -657,7 +702,12 @@ ecore_event_evas_mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void
657 lookup = _ecore_event_window_match(e->event_window); 702 lookup = _ecore_event_window_match(e->event_window);
658 if (!lookup) return ECORE_CALLBACK_PASS_ON; 703 if (!lookup) return ECORE_CALLBACK_PASS_ON;
659 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers); 704 ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
660 evas_event_feed_mouse_wheel(lookup->evas, e->direction, e->z, e->timestamp, NULL); 705 if (!lookup->direct ||
706 !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_WHEEL, e))
707 {
708 evas_event_feed_mouse_wheel(lookup->evas, e->direction, e->z, e->timestamp, NULL);
709 }
710
661 return ECORE_CALLBACK_PASS_ON; 711 return ECORE_CALLBACK_PASS_ON;
662} 712}
663 713
@@ -682,9 +732,14 @@ ecore_event_evas_axis_update(void *data EINA_UNUSED, int type EINA_UNUSED, void
682 e = event; 732 e = event;
683 lookup = _ecore_event_window_match(e->event_window); 733 lookup = _ecore_event_window_match(e->event_window);
684 if (!lookup) return ECORE_CALLBACK_PASS_ON; 734 if (!lookup) return ECORE_CALLBACK_PASS_ON;
685 evas_event_feed_axis_update(lookup->evas, e->timestamp, e->device, 735 if (!lookup->direct ||
686 e->toolid, e->naxis, 736 !lookup->direct(lookup->window, ECORE_EVENT_AXIS_UPDATE, e))
687 (Evas_Axis *)e->axis, NULL); 737 {
738 evas_event_feed_axis_update(lookup->evas, e->timestamp, e->device,
739 e->toolid, e->naxis,
740 (Evas_Axis *)e->axis, NULL);
741 }
742
688 return ECORE_CALLBACK_PASS_ON; 743 return ECORE_CALLBACK_PASS_ON;
689} 744}
690 745