summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJi-Youn Park <jy0703.park@samsung.com>2015-06-08 14:53:01 -0400
committerChris Michael <cp.michael@samsung.com>2015-06-08 14:53:01 -0400
commit105cf65c8078c45bf9a7d3f368b2d124b1f90a48 (patch)
treee03a6fab21c7227837983bdfde33fdeb3027a7e0
parent172a0ccf0cd609dac4a3c0b48965c96afd3e1b01 (diff)
ecore_x_xi2: remove useless define check XI_TouchXXX.
Summary: we can use XI_TouchXXX defines after xi2_2. So we don't need check XI_TouchXXX defines. I think it is simple only using the ECORE_XI2_2 define instead of using XI_TouchXXX defines. Reviewers: raster, cedric, devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2637
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_xi2.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/lib/ecore_x/xlib/ecore_x_xi2.c b/src/lib/ecore_x/xlib/ecore_x_xi2.c
index d18bbabe78..2c37776ad2 100644
--- a/src/lib/ecore_x/xlib/ecore_x_xi2.c
+++ b/src/lib/ecore_x/xlib/ecore_x_xi2.c
@@ -374,6 +374,8 @@ _ecore_x_input_mouse_handler(XEvent *xevent)
374#endif /* ifdef ECORE_XI2 */ 374#endif /* ifdef ECORE_XI2 */
375} 375}
376 376
377//XI_TouchUpdate, XI_TouchBegin, XI_TouchEnd only available in XI2_2
378//So it is better using ECORE_XI2_2 define than XI_TouchXXX defines.
377void 379void
378_ecore_x_input_multi_handler(XEvent *xevent) 380_ecore_x_input_multi_handler(XEvent *xevent)
379{ 381{
@@ -384,13 +386,11 @@ _ecore_x_input_multi_handler(XEvent *xevent)
384 386
385 switch (xevent->xcookie.evtype) 387 switch (xevent->xcookie.evtype)
386 { 388 {
387#ifdef XI_TouchUpdate 389#ifdef ECORE_XI2_2
388 case XI_TouchUpdate: 390 case XI_TouchUpdate:
389 { 391 {
390#ifdef ECORE_XI2_2
391 int i = _ecore_x_input_touch_index_get(devid, evd->detail, XI_TouchUpdate); 392 int i = _ecore_x_input_touch_index_get(devid, evd->detail, XI_TouchUpdate);
392 if ((i == 0) && (evd->flags & XITouchEmulatingPointer)) return; 393 if ((i == 0) && (evd->flags & XITouchEmulatingPointer)) return;
393#endif /* #ifdef ECORE_XI2_2 */
394 INF("Handling XI_TouchUpdate"); 394 INF("Handling XI_TouchUpdate");
395 _ecore_mouse_move(evd->time, 395 _ecore_mouse_move(evd->time,
396 0, // state 396 0, // state
@@ -400,26 +400,18 @@ _ecore_x_input_multi_handler(XEvent *xevent)
400 (evd->child ? evd->child : evd->event), 400 (evd->child ? evd->child : evd->event),
401 evd->root, 401 evd->root,
402 1, // same_screen 402 1, // same_screen
403#ifdef ECORE_XI2_2
404 i, 1, 1, 403 i, 1, 1,
405#else
406 devid, 1, 1,
407#endif /* #ifdef ECORE_XI2_2 */
408 1.0, // pressure 404 1.0, // pressure
409 0.0, // angle 405 0.0, // angle
410 evd->event_x, evd->event_y, 406 evd->event_x, evd->event_y,
411 evd->root_x, evd->root_y); 407 evd->root_x, evd->root_y);
412#endif
413 } 408 }
414 break; 409 break;
415 410
416#ifdef XI_TouchBegin
417 case XI_TouchBegin: 411 case XI_TouchBegin:
418 { 412 {
419#ifdef ECORE_XI2_2
420 int i = _ecore_x_input_touch_index_get(devid, evd->detail, XI_TouchBegin); 413 int i = _ecore_x_input_touch_index_get(devid, evd->detail, XI_TouchBegin);
421 if ((i == 0) && (evd->flags & XITouchEmulatingPointer)) return; 414 if ((i == 0) && (evd->flags & XITouchEmulatingPointer)) return;
422#endif /* #ifdef ECORE_XI2_2 */
423 INF("Handling XI_TouchBegin"); 415 INF("Handling XI_TouchBegin");
424 _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN, 416 _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN,
425 evd->time, 417 evd->time,
@@ -431,30 +423,22 @@ _ecore_x_input_multi_handler(XEvent *xevent)
431 (evd->child ? evd->child : evd->event), 423 (evd->child ? evd->child : evd->event),
432 evd->root, 424 evd->root,
433 1, // same_screen 425 1, // same_screen
434#ifdef ECORE_XI2_2
435 i, 1, 1, 426 i, 1, 1,
436#else
437 devid, 1, 1,
438#endif /* #ifdef ECORE_XI2_2 */
439 1.0, // pressure 427 1.0, // pressure
440 0.0, // angle 428 0.0, // angle
441 evd->event_x, evd->event_y, 429 evd->event_x, evd->event_y,
442 evd->root_x, evd->root_y); 430 evd->root_x, evd->root_y);
443#endif
444 } 431 }
445 break; 432 break;
446 433
447#ifdef XI_TouchEnd
448 case XI_TouchEnd: 434 case XI_TouchEnd:
449 { 435 {
450#ifdef ECORE_XI2_2
451 int i = _ecore_x_input_touch_index_get(devid, evd->detail, XI_TouchEnd); 436 int i = _ecore_x_input_touch_index_get(devid, evd->detail, XI_TouchEnd);
452 if ((i == 0) && (evd->flags & XITouchEmulatingPointer)) 437 if ((i == 0) && (evd->flags & XITouchEmulatingPointer))
453 { 438 {
454 _ecore_x_input_touch_index_clear(devid, i); 439 _ecore_x_input_touch_index_clear(devid, i);
455 return; 440 return;
456 } 441 }
457#endif /* #ifdef ECORE_XI2_2 */
458 INF("Handling XI_TouchEnd"); 442 INF("Handling XI_TouchEnd");
459 _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_UP, 443 _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_UP,
460 evd->time, 444 evd->time,
@@ -466,21 +450,15 @@ _ecore_x_input_multi_handler(XEvent *xevent)
466 (evd->child ? evd->child : evd->event), 450 (evd->child ? evd->child : evd->event),
467 evd->root, 451 evd->root,
468 1, // same_screen 452 1, // same_screen
469#ifdef ECORE_XI2_2
470 i, 1, 1, 453 i, 1, 1,
471#else
472 devid, 1, 1,
473#endif /* #ifdef ECORE_XI2_2 */
474 1.0, // pressure 454 1.0, // pressure
475 0.0, // angle 455 0.0, // angle
476 evd->event_x, evd->event_y, 456 evd->event_x, evd->event_y,
477 evd->root_x, evd->root_y); 457 evd->root_x, evd->root_y);
478#ifdef ECORE_XI2_2
479 _ecore_x_input_touch_index_clear(devid, i); 458 _ecore_x_input_touch_index_clear(devid, i);
480#endif /* #ifdef ECORE_XI2_2 */
481#endif
482 } 459 }
483 break; 460 break;
461#endif /* ifdef ECORE_XI2_2 */
484 default: 462 default:
485 break; 463 break;
486 } 464 }