Commit 962a5d8b authored by Javier Jardón's avatar Javier Jardón

Require XInput2.h in X11 backend

Also remove support for XInput.h
parent c9229671
......@@ -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 */
......
......@@ -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)
......
......@@ -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 \
......
......@@ -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 \
......
This diff is collapsed.
......@@ -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 */
......@@ -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"));
......
This diff is collapsed.
......@@ -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)
......
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_DEVICE_PRIVATE_XI_H__
#define __GDK_DEVICE_PRIVATE_XI_H__
#include "gdkx11device-xi.h"
#include "gdkdeviceprivate.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XInput.h>
G_BEGIN_DECLS
struct _GdkX11DeviceXI
{
GdkDevice parent_instance;
XDevice *xdevice;
gint *axis_data;
guint32 device_id;
gint button_press_type;
gint button_release_type;
gint key_press_type;
gint key_release_type;
gint motion_notify_type;
gint proximity_in_type;
gint proximity_out_type;
gint state_notify_type;
gint min_keycode; /* minimum key code for device */
guint in_proximity : 1;
};
struct _GdkX11DeviceXIClass
{
GdkDeviceClass parent_class;
};
G_END_DECLS
#endif /* __GDK_DEVICE_PRIVATE_XI_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,
......
......@@ -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>
......
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_X11_DEVICE_XI_H__
#define __GDK_X11_DEVICE_XI_H__
#include <gdk/gdk.h>
G_BEGIN_DECLS
#define GDK_TYPE_X11_DEVICE_XI (gdk_x11_device_xi_get_type ())
#define GDK_X11_DEVICE_XI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_X11_DEVICE_XI, GdkX11DeviceXI))
#define GDK_X11_DEVICE_XI_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_X11_DEVICE_XI, GdkX11DeviceXIClass))
#define GDK_IS_X11_DEVICE_XI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_X11_DEVICE_XI))
#define GDK_IS_X11_DEVICE_XI_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_X11_DEVICE_XI))
#define GDK_X11_DEVICE_XI_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_X11_DEVICE_XI, GdkX11DeviceXIClass))
typedef struct _GdkX11DeviceXI GdkX11DeviceXI;
typedef struct _GdkX11DeviceXIClass GdkX11DeviceXIClass;
GType gdk_x11_device_xi_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GDK_X11_DEVICE_XI_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment