[gtk+] Require XInput2.h in X11 backend



commit 962a5d8b8a457a7829555596d872f9180ceaf829
Author: Javier JardÃn <jjardon gnome org>
Date:   Fri Mar 2 12:52:12 2012 +0000

    Require XInput2.h in X11 backend
    
    Also remove support for XInput.h

 config.h.win32.in              |    6 -
 configure.ac                   |   25 +--
 gdk/Makefile.am                |    2 -
 gdk/x11/Makefile.am            |    5 -
 gdk/x11/gdkdevice-xi.c         |  660 --------------------------------------
 gdk/x11/gdkdevice-xi2.c        |   18 -
 gdk/x11/gdkdevicemanager-x11.c |   18 +-
 gdk/x11/gdkdevicemanager-xi.c  |  685 ----------------------------------------
 gdk/x11/gdkdevicemanager-xi2.c |   25 --
 gdk/x11/gdkdeviceprivate-xi.h  |   59 ----
 gdk/x11/gdkprivate-x11.h       |   18 -
 gdk/x11/gdkx.h                 |    2 -
 gdk/x11/gdkx11device-xi.h      |   40 ---
 13 files changed, 6 insertions(+), 1557 deletions(-)
---
diff --git a/config.h.win32.in b/config.h.win32.in
index 8c27bea..f48100f 100644
--- a/config.h.win32.in
+++ b/config.h.win32.in
@@ -279,12 +279,6 @@
 /* Define to 1 if XInput 2.0 is available */
 /* #undef XINPUT_2 */
 
-/* Define to 1 if no XInput should be used */
-/* #undef XINPUT_NONE */
-
-/* Define to 1 if XFree XInput should be used */
-/* #undef XINPUT_XFREE */
-
 /* Define to 1 if the X Window System is missing or not being used. */
 /* #undef X_DISPLAY_MISSING */
 
diff --git a/configure.ac b/configure.ac
index 25a8428..2056223 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,10 +265,6 @@ AC_ARG_ENABLE(xinerama,
               [AS_HELP_STRING([--enable-xinerama],
 	                      [support Xinerama extension [default=maybe]])],,
               [enable_xinerama="maybe"])
-AC_ARG_ENABLE(xinput,
-              [AS_HELP_STRING([--enable-xinput],
-                              [support XInput extension [default=yes]])],,
-              [enable_xinput="maybe"])
 AC_ARG_ENABLE(xrandr,
               [AS_HELP_STRING([--enable-xrandr],
                               [support XRandR extension [default=maybe]])],,
@@ -1111,11 +1107,7 @@ if test "x$enable_x11_backend" = xyes; then
                 AC_DEFINE(HAVE_XGENERICEVENTS, 1, [Have XGenericEvent]))
 
   # set up things for XInput
-  if test "x$enable_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then
-    have_xinput=yes
-
-    AC_DEFINE(XINPUT_XFREE, 1,
-              [Define to 1 if XFree XInput should be used])
+  if $PKG_CONFIG --exists "xi" ; then
 
     X_PACKAGES="$X_PACKAGES xi"
     GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xi"
@@ -1123,26 +1115,18 @@ if test "x$enable_x11_backend" = xyes; then
     AC_CHECK_HEADER(X11/extensions/XInput2.h,
                     have_xinput2=yes
                     X_EXTENSIONS="$X_EXTENSIONS XI2"
-                    AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]),
-                    X_EXTENSIONS="$X_EXTENSIONS XInput")
+                    AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
 
     gtk_save_LIBS="$LIBS"
     LIBS="$LIBS -lXi"
     AC_CHECK_FUNC(XIAllowTouchEvents, AC_DEFINE(XINPUT_2_2, 1, [Define to 1 if XInput 2.2 is available]))
     LIBS="$gtk_save_LIBS"
-  else
-    AC_DEFINE(XINPUT_NONE, 1,
-              [Define to 1 if no XInput should be used])
   fi
 
-  AM_CONDITIONAL(XINPUT_XFREE, test "x$have_xinput" = "xyes")
   AM_CONDITIONAL(XINPUT_2,     test "x$have_xinput2" = "xyes")
 
-  if test "x$enable_xinput" = "xyes" ; then
-    if test "x$have_xinput" != "xyes" -a "x$have_xinput2" != "xyes" ; then
-      AC_MSG_ERROR([*** XInput extension not found. Check 'config.log' for more details.])
-    fi
-  fi
+  AS_IF([test "x$have_xinput2" != "xyes"],
+        [AC_MSG_ERROR([*** XInput2 extension not found. Check 'config.log' for more details.])])
 
   # Check for the RANDR extension
   if test x"$enable_xrandr" != xno; then
@@ -1223,7 +1207,6 @@ if test "x$enable_x11_backend" = xyes; then
 else
   XPACKAGES=
 
-  AM_CONDITIONAL(XINPUT_XFREE, false)
   AM_CONDITIONAL(XINPUT_2, false)
   AM_CONDITIONAL(USE_X11, false)
   AM_CONDITIONAL(HAVE_X11R6, false)
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 191d0b6..6b647e5 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -211,10 +211,8 @@ x11_introspection_files = 		\
 	x11/gdkdevice-core-x11.c	\
 	x11/gdkdevicemanager-core-x11.c	\
 	x11/gdkdevicemanager-x11.c	\
-	x11/gdkdevicemanager-xi.c	\
 	x11/gdkdevicemanager-xi2.c	\
 	x11/gdkdevice-xi2.c		\
-	x11/gdkdevice-xi.c		\
 	x11/gdkdisplay-x11.c		\
 	x11/gdkdnd-x11.c		\
 	x11/gdkeventsource.c		\
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index d8abfd5..0b3f81e 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -26,12 +26,9 @@ libgdk_x11_la_SOURCES = 	\
 	gdkasync.h		\
 	gdkcursor-x11.c		\
 	gdkdevice-core-x11.c	\
-	gdkdevice-xi.c		\
 	gdkdevice-xi2.c		\
-	gdkdeviceprivate-xi.h	\
 	gdkdevicemanager-core-x11.c \
 	gdkdevicemanager-x11.c	\
-	gdkdevicemanager-xi.c	\
 	gdkdevicemanager-xi2.c	\
 	gdkdevicemanagerprivate-core.h \
 	gdkdisplaymanager-x11.c	\
@@ -70,11 +67,9 @@ libgdkx11include_HEADERS = 	\
 	gdkx11cursor.h		\
 	gdkx11device.h		\
 	gdkx11device-core.h	\
-	gdkx11device-xi.h	\
 	gdkx11device-xi2.h	\
 	gdkx11devicemanager.h   \
 	gdkx11devicemanager-core.h \
-	gdkx11devicemanager-xi.h \
 	gdkx11devicemanager-xi2.h \
 	gdkx11display.h		\
 	gdkx11displaymanager.h	\
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index d1139da..4426a0e 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -24,14 +24,11 @@
 #include "gdkasync.h"
 #include "gdkprivate-x11.h"
 
-#ifdef XINPUT_2
-
 #include <stdlib.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/extensions/XInput2.h>
 
-#endif
 
 typedef struct _ScrollValuator ScrollValuator;
 
@@ -58,7 +55,6 @@ struct _GdkX11DeviceXI2Class
 
 G_DEFINE_TYPE (GdkX11DeviceXI2, gdk_x11_device_xi2, GDK_TYPE_DEVICE)
 
-#ifdef XINPUT_2
 
 static void gdk_x11_device_xi2_finalize     (GObject      *object);
 static void gdk_x11_device_xi2_get_property (GObject      *object,
@@ -885,17 +881,3 @@ _gdk_x11_device_xi2_get_id (GdkX11DeviceXI2 *device)
 
   return device->device_id;
 }
-
-#else /* XINPUT_2 */
-
-static void
-gdk_x11_device_xi2_class_init (GdkX11DeviceXI2Class *klass)
-{
-}
-
-static void
-gdk_x11_device_xi2_init (GdkX11DeviceXI2 *device)
-{
-}
-
-#endif /* XINPUT_2 */
diff --git a/gdk/x11/gdkdevicemanager-x11.c b/gdk/x11/gdkdevicemanager-x11.c
index 7547063..a34ff66 100644
--- a/gdk/x11/gdkdevicemanager-x11.c
+++ b/gdk/x11/gdkdevicemanager-x11.c
@@ -19,12 +19,9 @@
 
 #include "gdkx11devicemanager-core.h"
 #include "gdkdevicemanagerprivate-core.h"
-#ifdef XINPUT_XFREE
-#include "gdkx11devicemanager-xi.h"
 #ifdef XINPUT_2
 #include "gdkx11devicemanager-xi2.h"
 #endif
-#endif
 #include "gdkinternals.h"
 #include "gdkprivate-x11.h"
 
@@ -39,7 +36,7 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
 {
   if (!g_getenv ("GDK_CORE_DEVICE_EVENTS"))
     {
-#if defined (XINPUT_2) || defined (XINPUT_XFREE)
+#ifdef XINPUT_2
       int opcode, firstevent, firsterror;
       Display *xdisplay;
 
@@ -48,7 +45,6 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
       if (XQueryExtension (xdisplay, "XInputExtension",
                            &opcode, &firstevent, &firsterror))
         {
-#ifdef XINPUT_2
           int major, minor;
 
           major = 2;
@@ -74,18 +70,8 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
 
               return GDK_DEVICE_MANAGER (device_manager_xi2);
             }
-          else
-#endif /* XINPUT_2 */
-            {
-              GDK_NOTE (INPUT, g_print ("Creating XI device manager\n"));
-
-              return g_object_new (GDK_TYPE_X11_DEVICE_MANAGER_XI,
-                                   "display", display,
-                                   "event-base", firstevent,
-                                   NULL);
-            }
         }
-#endif /* XINPUT_2 || XINPUT_XFREE */
+#endif /* XINPUT_2 */
     }
 
   GDK_NOTE (INPUT, g_print ("Creating core device manager\n"));
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 1f7c845..8479464 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -29,16 +29,12 @@
 #include "gdkkeysyms.h"
 #include "gdkinternals.h"
 
-#ifdef XINPUT_2
-
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/extensions/XInput2.h>
 
 #include <string.h>
 
-#endif /* XINPUT_2 */
-
 struct _GdkX11DeviceManagerXI2
 {
   GdkX11DeviceManagerCore parent_object;
@@ -64,8 +60,6 @@ G_DEFINE_TYPE_WITH_CODE (GdkX11DeviceManagerXI2, gdk_x11_device_manager_xi2, GDK
                                                 gdk_x11_device_manager_xi2_event_translator_init))
 
 
-#ifdef XINPUT_2
-
 #define HAS_FOCUS(toplevel) ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
 
 
@@ -1646,25 +1640,6 @@ gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator,
   return get_event_window (translator, ev);
 }
 
-#else /* XINPUT_2 */
-
-static void
-gdk_x11_device_manager_xi2_class_init (GdkX11DeviceManagerXI2Class *klass)
-{
-}
-
-static void
-gdk_x11_device_manager_xi2_init (GdkX11DeviceManagerXI2 *device_manager)
-{
-}
-
-static void
-gdk_x11_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface)
-{
-}
-
-#endif /* XINPUT_2 */
-
 GdkDevice *
 _gdk_x11_device_manager_xi2_lookup (GdkX11DeviceManagerXI2 *device_manager_xi2,
                                     gint                    device_id)
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 5eea9a4..14ab2fd 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -39,9 +39,6 @@
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
-#ifdef XINPUT_XFREE
-#include <X11/extensions/XInput.h>
-#endif
 #ifdef XINPUT_2
 #include <X11/extensions/XInput2.h>
 #endif
@@ -229,21 +226,6 @@ void _gdk_x11_device_check_extension_events   (GdkDevice  *device);
 
 GdkDeviceManager *_gdk_x11_device_manager_new (GdkDisplay *display);
 
-#ifdef XINPUT_XFREE
-void _gdk_x11_device_xi_update_window_info (GdkWindow *window);
-
-void _gdk_x11_device_xi_update_axes        (GdkDevice *device,
-                                            gint       axes_count,
-                                            gint       first_axis,
-                                            gint      *axis_data);
-void _gdk_x11_device_xi_translate_axes     (GdkDevice *device,
-                                            GdkWindow *window,
-                                            gint      *axis_data,
-                                            gdouble   *axes,
-                                            gdouble   *x,
-                                            gdouble   *y);
-#endif
-
 #ifdef XINPUT_2
 guchar * _gdk_x11_device_xi2_translate_event_mask (GdkX11DeviceManagerXI2 *device_manager_xi2,
                                                    GdkEventMask            event_mask,
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 28bb362..b28580d 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -36,11 +36,9 @@
 #include <gdk/x11/gdkx11cursor.h>
 #include <gdk/x11/gdkx11device.h>
 #include <gdk/x11/gdkx11device-core.h>
-#include <gdk/x11/gdkx11device-xi.h>
 #include <gdk/x11/gdkx11device-xi2.h>
 #include <gdk/x11/gdkx11devicemanager.h>
 #include <gdk/x11/gdkx11devicemanager-core.h>
-#include <gdk/x11/gdkx11devicemanager-xi.h>
 #include <gdk/x11/gdkx11devicemanager-xi2.h>
 #include <gdk/x11/gdkx11display.h>
 #include <gdk/x11/gdkx11displaymanager.h>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]