devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=105cf65c8078c45bf9a7d3f368b2d124b1f90a48

commit 105cf65c8078c45bf9a7d3f368b2d124b1f90a48
Author: Ji-Youn Park <jy0703.p...@samsung.com>
Date:   Mon Jun 8 14:53:01 2015 -0400

    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
---
 src/lib/ecore_x/xlib/ecore_x_xi2.c | 30 ++++--------------------------
 1 file 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 d18bbab..2c37776 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)
 #endif /* ifdef ECORE_XI2 */
 }
 
+//XI_TouchUpdate, XI_TouchBegin, XI_TouchEnd only available in XI2_2
+//So it is better using ECORE_XI2_2 define than XI_TouchXXX defines.
 void
 _ecore_x_input_multi_handler(XEvent *xevent)
 {
@@ -384,13 +386,11 @@ _ecore_x_input_multi_handler(XEvent *xevent)
 
    switch (xevent->xcookie.evtype)
      {
-#ifdef XI_TouchUpdate
+#ifdef ECORE_XI2_2
       case XI_TouchUpdate:
           {
-#ifdef ECORE_XI2_2
              int i = _ecore_x_input_touch_index_get(devid, evd->detail, 
XI_TouchUpdate);
              if ((i == 0) && (evd->flags & XITouchEmulatingPointer)) return;
-#endif /* #ifdef ECORE_XI2_2 */
              INF("Handling XI_TouchUpdate");
              _ecore_mouse_move(evd->time,
                                0,   // state
@@ -400,26 +400,18 @@ _ecore_x_input_multi_handler(XEvent *xevent)
                                (evd->child ? evd->child : evd->event),
                                evd->root,
                                1,   // same_screen
-#ifdef ECORE_XI2_2
                                i, 1, 1,
-#else
-                               devid, 1, 1,
-#endif /* #ifdef ECORE_XI2_2 */
                                1.0,   // pressure
                                0.0,   // angle
                                evd->event_x, evd->event_y,
                                evd->root_x, evd->root_y);
-#endif
           }
         break;
 
-#ifdef XI_TouchBegin
       case XI_TouchBegin:
           {
-#ifdef ECORE_XI2_2
              int i = _ecore_x_input_touch_index_get(devid, evd->detail, 
XI_TouchBegin);
              if ((i == 0) && (evd->flags & XITouchEmulatingPointer)) return;
-#endif /* #ifdef ECORE_XI2_2 */
              INF("Handling XI_TouchBegin");
              _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN,
                                  evd->time,
@@ -431,30 +423,22 @@ _ecore_x_input_multi_handler(XEvent *xevent)
                                  (evd->child ? evd->child : evd->event),
                                  evd->root,
                                  1,   // same_screen
-#ifdef ECORE_XI2_2
                                  i, 1, 1,
-#else
-                                 devid, 1, 1,
-#endif /* #ifdef ECORE_XI2_2 */
                                  1.0,   // pressure
                                  0.0,   // angle
                                  evd->event_x, evd->event_y,
                                  evd->root_x, evd->root_y);
-#endif
           }
         break;
 
-#ifdef XI_TouchEnd
       case XI_TouchEnd:
           {
-#ifdef ECORE_XI2_2
              int i = _ecore_x_input_touch_index_get(devid, evd->detail, 
XI_TouchEnd);
              if ((i == 0) && (evd->flags & XITouchEmulatingPointer))
                {
                   _ecore_x_input_touch_index_clear(devid,  i);
                   return;
                }
-#endif /* #ifdef ECORE_XI2_2 */
              INF("Handling XI_TouchEnd");
              _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_UP,
                                  evd->time,
@@ -466,21 +450,15 @@ _ecore_x_input_multi_handler(XEvent *xevent)
                                  (evd->child ? evd->child : evd->event),
                                  evd->root,
                                  1,   // same_screen
-#ifdef ECORE_XI2_2
                                  i, 1, 1,
-#else
-                                 devid, 1, 1,
-#endif /* #ifdef ECORE_XI2_2 */
                                  1.0,   // pressure
                                  0.0,   // angle
                                  evd->event_x, evd->event_y,
                                  evd->root_x, evd->root_y);
-#ifdef ECORE_XI2_2
              _ecore_x_input_touch_index_clear(devid,  i);
-#endif /* #ifdef ECORE_XI2_2 */
-#endif
           }
         break;
+#endif /* ifdef ECORE_XI2_2 */
       default:
         break;
       }

-- 


Reply via email to