aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/test
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-06 18:48:27 +0000
committermarha <marha@users.sourceforge.net>2009-09-06 18:48:27 +0000
commita915739887477b28d924ecc8417ee107d125bd6c (patch)
treec02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/test
parent6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff)
downloadvcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz
vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2
vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip
Switched to xorg-server-1.6.99.900.tar.gz
Diffstat (limited to 'xorg-server/test')
-rw-r--r--xorg-server/test/Makefile.am38
-rw-r--r--xorg-server/test/Makefile.in979
-rw-r--r--xorg-server/test/README36
-rw-r--r--xorg-server/test/input.c732
-rw-r--r--xorg-server/test/libxservertest.c0
-rw-r--r--xorg-server/test/xi2/Makefile.am47
-rw-r--r--xorg-server/test/xi2/Makefile.in1174
-rw-r--r--xorg-server/test/xi2/protocol-common.c169
-rw-r--r--xorg-server/test/xi2/protocol-common.h153
-rw-r--r--xorg-server/test/xi2/protocol-eventconvert.c904
-rw-r--r--xorg-server/test/xi2/protocol-xigetclientpointer.c167
-rw-r--r--xorg-server/test/xi2/protocol-xigetselectedevents.c241
-rw-r--r--xorg-server/test/xi2/protocol-xiquerydevice.c316
-rw-r--r--xorg-server/test/xi2/protocol-xiquerypointer.c220
-rw-r--r--xorg-server/test/xi2/protocol-xiqueryversion.c186
-rw-r--r--xorg-server/test/xi2/protocol-xiselectevents.c337
-rw-r--r--xorg-server/test/xi2/protocol-xisetclientpointer.c149
-rw-r--r--xorg-server/test/xi2/protocol-xiwarppointer.c216
-rw-r--r--xorg-server/test/xkb.c173
-rw-r--r--xorg-server/test/xtest.c116
20 files changed, 6353 insertions, 0 deletions
diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am
new file mode 100644
index 000000000..d8d89852b
--- /dev/null
+++ b/xorg-server/test/Makefile.am
@@ -0,0 +1,38 @@
+if UNITTESTS
+SUBDIRS= . xi2
+check_PROGRAMS = xkb input xtest
+check_LTLIBRARIES = libxservertest.la
+
+TESTS=$(check_PROGRAMS)
+
+AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
+INCLUDES = @XORG_INCS@
+TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
+
+xkb_LDADD=$(TEST_LDADD)
+input_LDADD=$(TEST_LDADD)
+xtest_LDADD=$(TEST_LDADD)
+
+libxservertest_la_LIBADD = \
+ $(XSERVER_LIBS) \
+ $(top_builddir)/hw/xfree86/loader/libloader.la \
+ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
+ $(top_builddir)/hw/xfree86/common/libcommon.la \
+ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \
+ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
+ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \
+ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \
+ $(top_builddir)/hw/xfree86/ddc/libddc.la \
+ $(top_builddir)/hw/xfree86/i2c/libi2c.la \
+ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
+ $(top_builddir)/hw/xfree86/libxorg.la \
+ $(top_builddir)/mi/libmi.la \
+ $(top_builddir)/os/libos.la \
+ @XORG_LIBS@
+
+CLEANFILES=libxservertest.c
+
+libxservertest.c:
+ touch $@
+
+endif
diff --git a/xorg-server/test/Makefile.in b/xorg-server/test/Makefile.in
new file mode 100644
index 000000000..02ec9b518
--- /dev/null
+++ b/xorg-server/test/Makefile.in
@@ -0,0 +1,979 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@UNITTESTS_TRUE@check_PROGRAMS = xkb$(EXEEXT) input$(EXEEXT) \
+@UNITTESTS_TRUE@ xtest$(EXEEXT)
+subdir = test
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
+ $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
+ $(top_builddir)/include/xorg-server.h \
+ $(top_builddir)/include/dix-config.h \
+ $(top_builddir)/include/xorg-config.h \
+ $(top_builddir)/include/xkb-config.h \
+ $(top_builddir)/include/xwin-config.h \
+ $(top_builddir)/include/kdrive-config.h \
+ $(top_builddir)/include/version-config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__DEPENDENCIES_1 =
+@UNITTESTS_TRUE@libxservertest_la_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_1) \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/loader/libloader.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/common/libcommon.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/ddc/libddc.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/i2c/libi2c.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/libxorg.la \
+@UNITTESTS_TRUE@ $(top_builddir)/mi/libmi.la \
+@UNITTESTS_TRUE@ $(top_builddir)/os/libos.la
+libxservertest_la_SOURCES = libxservertest.c
+libxservertest_la_OBJECTS = libxservertest.lo
+@UNITTESTS_TRUE@am_libxservertest_la_rpath =
+input_SOURCES = input.c
+input_OBJECTS = input.$(OBJEXT)
+@UNITTESTS_TRUE@am__DEPENDENCIES_2 = libxservertest.la \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_1)
+@UNITTESTS_TRUE@input_DEPENDENCIES = $(am__DEPENDENCIES_2)
+xkb_SOURCES = xkb.c
+xkb_OBJECTS = xkb.$(OBJEXT)
+@UNITTESTS_TRUE@xkb_DEPENDENCIES = $(am__DEPENDENCIES_2)
+xtest_SOURCES = xtest.c
+xtest_OBJECTS = xtest.$(OBJEXT)
+@UNITTESTS_TRUE@xtest_DEPENDENCIES = $(am__DEPENDENCIES_2)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = libxservertest.c input.c xkb.c xtest.c
+DIST_SOURCES = libxservertest.c input.c xkb.c xtest.c
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DIST_SUBDIRS = . xi2
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_MAKEFLAGS = @AM_MAKEFLAGS@
+APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@
+APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BUILD_DATE = @BUILD_DATE@
+BUILD_TIME = @BUILD_TIME@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+CXX = @CXX@
+CYGPATH_W = @CYGPATH_W@
+DARWIN_LIBS = @DARWIN_LIBS@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_CFLAGS = @DGA_CFLAGS@
+DGA_LIBS = @DGA_LIBS@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
+DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
+DMXMODULES_LIBS = @DMXMODULES_LIBS@
+DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
+DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DOLT_BASH = @DOLT_BASH@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_CFLAGS = @DRI_CFLAGS@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DRI_LIBS = @DRI_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FGREP = @FGREP@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
+GLX_DEFINES = @GLX_DEFINES@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+LIBDRM_LIBS = @LIBDRM_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTCOMPILE = @LTCOMPILE@
+LTCXXCOMPILE = @LTCXXCOMPILE@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAIN_LIB = @MAIN_LIB@
+MAKEFLAGS = @MAKEFLAGS@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCCLD = @OBJCCLD@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJCFLAGS = @OBJCFLAGS@
+OBJCLINK = @OBJCLINK@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+Q = @Q@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+SED = @SED@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+STRIP = @STRIP@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
+V = @V@
+VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
+VERSION = @VERSION@
+WINDRES = @WINDRES@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_LIBS = @XDMCP_LIBS@
+XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
+XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
+XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
+XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
+XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
+XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
+XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
+XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
+XLIB_CFLAGS = @XLIB_CFLAGS@
+XLIB_LIBS = @XLIB_LIBS@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
+XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
+XORG_OS = @XORG_OS@
+XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
+XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@
+XPBPROXY_LIBS = @XPBPROXY_LIBS@
+XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
+docdir = @docdir@
+driverdir = @driverdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+shavedir = @shavedir@
+srcdir = @srcdir@
+symbol_visibility = @symbol_visibility@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+@UNITTESTS_TRUE@SUBDIRS = . xi2
+@UNITTESTS_TRUE@check_LTLIBRARIES = libxservertest.la
+@UNITTESTS_TRUE@TESTS = $(check_PROGRAMS)
+@UNITTESTS_TRUE@AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
+@UNITTESTS_TRUE@INCLUDES = @XORG_INCS@
+@UNITTESTS_TRUE@TEST_LDADD = libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
+@UNITTESTS_TRUE@xkb_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@input_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@xtest_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@libxservertest_la_LIBADD = \
+@UNITTESTS_TRUE@ $(XSERVER_LIBS) \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/loader/libloader.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/common/libcommon.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/parser/libxf86config_internal.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/modes/libxf86modes.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/ddc/libddc.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/i2c/libi2c.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
+@UNITTESTS_TRUE@ $(top_builddir)/hw/xfree86/libxorg.la \
+@UNITTESTS_TRUE@ $(top_builddir)/mi/libmi.la \
+@UNITTESTS_TRUE@ $(top_builddir)/os/libos.la \
+@UNITTESTS_TRUE@ @XORG_LIBS@
+
+@UNITTESTS_TRUE@CLEANFILES = libxservertest.c
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkLTLIBRARIES:
+ -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES)
+ @list='$(check_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libxservertest.la: $(libxservertest_la_OBJECTS) $(libxservertest_la_DEPENDENCIES)
+ $(LINK) $(am_libxservertest_la_rpath) $(libxservertest_la_OBJECTS) $(libxservertest_la_LIBADD) $(LIBS)
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+input$(EXEEXT): $(input_OBJECTS) $(input_DEPENDENCIES)
+ @rm -f input$(EXEEXT)
+ $(LINK) $(input_OBJECTS) $(input_LDADD) $(LIBS)
+xkb$(EXEEXT): $(xkb_OBJECTS) $(xkb_DEPENDENCIES)
+ @rm -f xkb$(EXEEXT)
+ $(LINK) $(xkb_OBJECTS) $(xkb_LDADD) $(LIBS)
+xtest$(EXEEXT): $(xtest_OBJECTS) $(xtest_DEPENDENCIES)
+ @rm -f xtest$(EXEEXT)
+ $(LINK) $(xtest_OBJECTS) $(xtest_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxservertest.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtest.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes$$std"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \
+ clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
+ ctags-recursive install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-TESTS check-am clean \
+ clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \
+ clean-libtool ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+
+@UNITTESTS_TRUE@libxservertest.c:
+@UNITTESTS_TRUE@ touch $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/xorg-server/test/README b/xorg-server/test/README
new file mode 100644
index 000000000..5759a72fd
--- /dev/null
+++ b/xorg-server/test/README
@@ -0,0 +1,36 @@
+ X server test suite
+
+This suite contains a set of tests to verify the behaviour of functions used
+internally to the server. This test suite is based on glib's testing
+framework [1].
+
+= How it works =
+Through some automake abuse, we link the test programs with the same static
+libraries as the Xorg binary. The test suites can then call various functions
+and verify their behaviour - without the need to start the server or connect
+clients.
+
+This testing only works for functions that do not rely on a particular state
+of the X server. Unless the test suite replicates the expected state, which
+may be difficult.
+
+= How to run the tests =
+Run "make check" the test directory. This will compile the tests and execute
+them in the order specified in the TESTS variable in test/Makefile.am.
+
+Each set of tests related to a subsystem are available as a binary that can be
+executed directly. For example, run "xkb" to perform some xkb-related tests.
+
+== Adding a new test ==
+When adding a new test, ensure that you add a short description of what the
+test does and what the expected outcome is. If the test reproduces a
+particular bug, using g_test_bug().
+
+== Misc ==
+
+The programs "gtester" and "gtester-report" may be used to generate XML/HTML
+log files of tests succeeded and failed.
+
+---------
+
+[1] http://library.gnome.org/devel/glib/stable/glib-Testing.html
diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c
new file mode 100644
index 000000000..71e1504f1
--- /dev/null
+++ b/xorg-server/test/input.c
@@ -0,0 +1,732 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdint.h>
+#include <X11/X.h>
+#include "misc.h"
+#include "resource.h"
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include <X11/Xatom.h>
+#include "windowstr.h"
+#include "inputstr.h"
+#include "eventconvert.h"
+#include "exevents.h"
+#include "dixgrabs.h"
+#include "eventstr.h"
+#include <glib.h>
+
+/**
+ * Init a device with axes.
+ * Verify values set on the device.
+ *
+ * Result: All axes set to default values (usually 0).
+ */
+static void dix_init_valuators(void)
+{
+ DeviceIntRec dev;
+ ValuatorClassPtr val;
+ const int num_axes = 2;
+ int i;
+ Atom atoms[MAX_VALUATORS] = { 0 };
+
+
+ memset(&dev, 0, sizeof(DeviceIntRec));
+ dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */
+
+ g_assert(InitValuatorClassDeviceStruct(NULL, 0, atoms, 0, 0) == FALSE);
+ g_assert(InitValuatorClassDeviceStruct(&dev, num_axes, atoms, 0, Absolute));
+
+ val = dev.valuator;
+ g_assert(val);
+ g_assert(val->numAxes == num_axes);
+ g_assert(val->numMotionEvents == 0);
+ g_assert(val->mode == Absolute);
+ g_assert(val->axisVal);
+
+ for (i = 0; i < num_axes; i++)
+ {
+ g_assert(val->axisVal[i] == 0);
+ g_assert(val->axes->min_value == NO_AXIS_LIMITS);
+ g_assert(val->axes->max_value == NO_AXIS_LIMITS);
+ }
+
+ g_assert(dev.last.numValuators == num_axes);
+}
+
+/* just check the known success cases, and that error cases set the client's
+ * error value correctly. */
+static void dix_check_grab_values(void)
+{
+ ClientRec client;
+ GrabParameters param;
+ int rc;
+
+ memset(&client, 0, sizeof(client));
+
+ param.grabtype = GRABTYPE_CORE;
+ param.this_device_mode = GrabModeSync;
+ param.other_devices_mode = GrabModeSync;
+ param.modifiers = AnyModifier;
+ param.ownerEvents = FALSE;
+
+ rc = CheckGrabValues(&client, &param);
+ g_assert(rc == Success);
+
+ param.this_device_mode = GrabModeAsync;
+ rc = CheckGrabValues(&client, &param);
+ g_assert(rc == Success);
+
+ param.this_device_mode = GrabModeAsync + 1;
+ rc = CheckGrabValues(&client, &param);
+ g_assert(rc == BadValue);
+ g_assert(client.errorValue == param.this_device_mode);
+ g_assert(client.errorValue == GrabModeAsync + 1);
+
+ param.this_device_mode = GrabModeSync;
+ param.other_devices_mode = GrabModeAsync;
+ rc = CheckGrabValues(&client, &param);
+ g_assert(rc == Success);
+
+ param.other_devices_mode = GrabModeAsync + 1;
+ rc = CheckGrabValues(&client, &param);
+ g_assert(rc == BadValue);
+ g_assert(client.errorValue == param.other_devices_mode);
+ g_assert(client.errorValue == GrabModeAsync + 1);
+
+ param.other_devices_mode = GrabModeSync;
+
+ param.modifiers = 1 << 13;
+ rc = CheckGrabValues(&client, &param);
+ g_assert(rc == BadValue);
+ g_assert(client.errorValue == param.modifiers);
+ g_assert(client.errorValue == (1 << 13));
+
+
+ param.modifiers = AnyModifier;
+ param.ownerEvents = TRUE;
+ rc = CheckGrabValues(&client, &param);
+ g_assert(rc == Success);
+
+ param.ownerEvents = 3;
+ rc = CheckGrabValues(&client, &param);
+ g_assert(rc == BadValue);
+ g_assert(client.errorValue == param.ownerEvents);
+ g_assert(client.errorValue == 3);
+}
+
+
+/**
+ * Convert various internal events to the matching core event and verify the
+ * parameters.
+ */
+static void dix_event_to_core(int type)
+{
+ DeviceEvent ev;
+ xEvent core;
+ int time;
+ int x, y;
+ int rc;
+ int state;
+ int detail;
+
+ /* EventToCore memsets the event to 0 */
+#define test_event() \
+ g_assert(rc == Success); \
+ g_assert(core.u.u.type == type); \
+ g_assert(core.u.u.detail == detail); \
+ g_assert(core.u.keyButtonPointer.time == time); \
+ g_assert(core.u.keyButtonPointer.rootX == x); \
+ g_assert(core.u.keyButtonPointer.rootY == y); \
+ g_assert(core.u.keyButtonPointer.state == state); \
+ g_assert(core.u.keyButtonPointer.eventX == 0); \
+ g_assert(core.u.keyButtonPointer.eventY == 0); \
+ g_assert(core.u.keyButtonPointer.root == 0); \
+ g_assert(core.u.keyButtonPointer.event == 0); \
+ g_assert(core.u.keyButtonPointer.child == 0); \
+ g_assert(core.u.keyButtonPointer.sameScreen == FALSE);
+
+ x = 0;
+ y = 0;
+ time = 12345;
+ state = 0;
+ detail = 0;
+
+ ev.header = 0xFF;
+ ev.length = sizeof(DeviceEvent);
+ ev.time = time;
+ ev.root_y = x;
+ ev.root_x = y;
+ ev.corestate = state;
+ ev.detail.key = detail;
+
+ ev.type = type;
+ ev.detail.key = 0;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ test_event();
+
+ x = 1;
+ y = 2;
+ ev.root_x = x;
+ ev.root_y = y;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ test_event();
+
+ x = 0x7FFF;
+ y = 0x7FFF;
+ ev.root_x = x;
+ ev.root_y = y;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ test_event();
+
+ x = 0x8000; /* too high */
+ y = 0x8000; /* too high */
+ ev.root_x = x;
+ ev.root_y = y;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ g_assert(core.u.keyButtonPointer.rootX != x);
+ g_assert(core.u.keyButtonPointer.rootY != y);
+
+ x = 0x7FFF;
+ y = 0x7FFF;
+ ev.root_x = x;
+ ev.root_y = y;
+ time = 0;
+ ev.time = time;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ test_event();
+
+ detail = 1;
+ ev.detail.key = detail;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ test_event();
+
+ detail = 0xFF; /* highest value */
+ ev.detail.key = detail;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ test_event();
+
+ detail = 0xFFF; /* too big */
+ ev.detail.key = detail;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ g_assert(rc == BadMatch);
+
+ detail = 0xFF; /* too big */
+ ev.detail.key = detail;
+ state = 0xFFFF; /* highest value */
+ ev.corestate = state;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ test_event();
+
+ state = 0x10000; /* too big */
+ ev.corestate = state;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ g_assert(core.u.keyButtonPointer.state != state);
+ g_assert(core.u.keyButtonPointer.state == (state & 0xFFFF));
+
+#undef test_event
+}
+
+static void dix_event_to_core_conversion(void)
+{
+ DeviceEvent ev;
+ xEvent core;
+ int rc;
+
+ ev.header = 0xFF;
+ ev.length = sizeof(DeviceEvent);
+
+ ev.type = 0;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ g_assert(rc == BadImplementation);
+
+ ev.type = 1;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ g_assert(rc == BadImplementation);
+
+ ev.type = ET_ProximityOut + 1;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ g_assert(rc == BadImplementation);
+
+ ev.type = ET_ProximityIn;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ g_assert(rc == BadMatch);
+
+ ev.type = ET_ProximityOut;
+ rc = EventToCore((InternalEvent*)&ev, &core);
+ g_assert(rc == BadMatch);
+
+ dix_event_to_core(ET_KeyPress);
+ dix_event_to_core(ET_KeyRelease);
+ dix_event_to_core(ET_ButtonPress);
+ dix_event_to_core(ET_ButtonRelease);
+ dix_event_to_core(ET_Motion);
+}
+
+static void xi2_struct_sizes(void)
+{
+#define compare(req) \
+ g_assert(sizeof(req) == sz_##req);
+
+ compare(xXIQueryVersionReq);
+ compare(xXIWarpPointerReq);
+ compare(xXIChangeCursorReq);
+ compare(xXIChangeHierarchyReq);
+ compare(xXISetClientPointerReq);
+ compare(xXIGetClientPointerReq);
+ compare(xXISelectEventsReq);
+ compare(xXIQueryVersionReq);
+ compare(xXIQueryDeviceReq);
+ compare(xXISetFocusReq);
+ compare(xXIGetFocusReq);
+ compare(xXIGrabDeviceReq);
+ compare(xXIUngrabDeviceReq);
+ compare(xXIAllowEventsReq);
+ compare(xXIPassiveGrabDeviceReq);
+ compare(xXIPassiveUngrabDeviceReq);
+ compare(xXIListPropertiesReq);
+ compare(xXIChangePropertyReq);
+ compare(xXIDeletePropertyReq);
+ compare(xXIGetPropertyReq);
+ compare(xXIGetSelectedEventsReq);
+#undef compare
+}
+
+
+static void dix_grab_matching(void)
+{
+ DeviceIntRec xi_all_devices, xi_all_master_devices, dev1, dev2;
+ GrabRec a, b;
+ BOOL rc;
+
+ memset(&a, 0, sizeof(a));
+ memset(&b, 0, sizeof(b));
+
+ /* different grabtypes must fail */
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_XI2;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI2;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_CORE;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ /* XI2 grabs for different devices must fail, regardless of ignoreDevice
+ * XI2 grabs for master devices must fail against a slave */
+ memset(&xi_all_devices, 0, sizeof(DeviceIntRec));
+ memset(&xi_all_master_devices, 0, sizeof(DeviceIntRec));
+ memset(&dev1, 0, sizeof(DeviceIntRec));
+ memset(&dev2, 0, sizeof(DeviceIntRec));
+
+ xi_all_devices.id = XIAllDevices;
+ xi_all_master_devices.id = XIAllMasterDevices;
+ dev1.id = 10;
+ dev1.type = SLAVE;
+ dev2.id = 11;
+ dev2.type = SLAVE;
+
+ inputInfo.all_devices = &xi_all_devices;
+ inputInfo.all_master_devices = &xi_all_master_devices;
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.device = &dev1;
+ b.device = &dev2;
+
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+
+ a.device = &dev2;
+ b.device = &dev1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&a, &b, TRUE);
+ g_assert(rc == FALSE);
+
+ a.device = inputInfo.all_master_devices;
+ b.device = &dev1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&a, &b, TRUE);
+ g_assert(rc == FALSE);
+
+ a.device = &dev1;
+ b.device = inputInfo.all_master_devices;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&a, &b, TRUE);
+ g_assert(rc == FALSE);
+
+ /* ignoreDevice FALSE must fail for different devices for CORE and XI */
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ a.device = &dev1;
+ b.device = &dev2;
+ a.modifierDevice = &dev1;
+ b.modifierDevice = &dev1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ a.device = &dev1;
+ b.device = &dev2;
+ a.modifierDevice = &dev1;
+ b.modifierDevice = &dev1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+
+ /* ignoreDevice FALSE must fail for different modifier devices for CORE
+ * and XI */
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ a.device = &dev1;
+ b.device = &dev1;
+ a.modifierDevice = &dev1;
+ b.modifierDevice = &dev2;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ a.device = &dev1;
+ b.device = &dev1;
+ a.modifierDevice = &dev1;
+ b.modifierDevice = &dev2;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+
+ /* different event type must fail */
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.device = &dev1;
+ b.device = &dev1;
+ a.modifierDevice = &dev1;
+ b.modifierDevice = &dev1;
+ a.type = XI_KeyPress;
+ b.type = XI_KeyRelease;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&a, &b, TRUE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ a.device = &dev1;
+ b.device = &dev1;
+ a.modifierDevice = &dev1;
+ b.modifierDevice = &dev1;
+ a.type = XI_KeyPress;
+ b.type = XI_KeyRelease;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&a, &b, TRUE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ a.device = &dev1;
+ b.device = &dev1;
+ a.modifierDevice = &dev1;
+ b.modifierDevice = &dev1;
+ a.type = XI_KeyPress;
+ b.type = XI_KeyRelease;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&a, &b, TRUE);
+ g_assert(rc == FALSE);
+
+ /* different modifiers must fail */
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.device = &dev1;
+ b.device = &dev1;
+ a.modifierDevice = &dev1;
+ b.modifierDevice = &dev1;
+ a.type = XI_KeyPress;
+ b.type = XI_KeyPress;
+ a.modifiersDetail.exact = 1;
+ b.modifiersDetail.exact = 2;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ /* AnyModifier must fail for XI2 */
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.modifiersDetail.exact = AnyModifier;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ /* XIAnyModifier must fail for CORE and XI */
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ a.modifiersDetail.exact = XIAnyModifier;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ a.modifiersDetail.exact = XIAnyModifier;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ /* different detail must fail */
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.detail.exact = 1;
+ b.detail.exact = 2;
+ a.modifiersDetail.exact = 1;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ /* detail of AnyModifier must fail */
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.detail.exact = AnyModifier;
+ b.detail.exact = 1;
+ a.modifiersDetail.exact = 1;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ /* detail of XIAnyModifier must fail */
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.detail.exact = XIAnyModifier;
+ b.detail.exact = 1;
+ a.modifiersDetail.exact = 1;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == FALSE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == FALSE);
+
+ /* XIAnyModifier or AnyModifer must succeed */
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.detail.exact = 1;
+ b.detail.exact = 1;
+ a.modifiersDetail.exact = XIAnyModifier;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == TRUE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == TRUE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ a.detail.exact = 1;
+ b.detail.exact = 1;
+ a.modifiersDetail.exact = AnyModifier;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == TRUE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == TRUE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ a.detail.exact = 1;
+ b.detail.exact = 1;
+ a.modifiersDetail.exact = AnyModifier;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == TRUE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == TRUE);
+
+ /* AnyKey or XIAnyKeycode must succeed */
+ a.grabtype = GRABTYPE_XI2;
+ b.grabtype = GRABTYPE_XI2;
+ a.detail.exact = XIAnyKeycode;
+ b.detail.exact = 1;
+ a.modifiersDetail.exact = 1;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == TRUE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == TRUE);
+
+ a.grabtype = GRABTYPE_CORE;
+ b.grabtype = GRABTYPE_CORE;
+ a.detail.exact = AnyKey;
+ b.detail.exact = 1;
+ a.modifiersDetail.exact = 1;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == TRUE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == TRUE);
+
+ a.grabtype = GRABTYPE_XI;
+ b.grabtype = GRABTYPE_XI;
+ a.detail.exact = AnyKey;
+ b.detail.exact = 1;
+ a.modifiersDetail.exact = 1;
+ b.modifiersDetail.exact = 1;
+ rc = GrabMatchesSecond(&a, &b, FALSE);
+ g_assert(rc == TRUE);
+ rc = GrabMatchesSecond(&b, &a, FALSE);
+ g_assert(rc == TRUE);
+}
+
+static void include_byte_padding_macros(void)
+{
+ int i;
+ g_test_message("Testing bits_to_bytes()");
+
+ /* the macros don't provide overflow protection */
+ for (i = 0; i < INT_MAX - 7; i++)
+ {
+ int expected_bytes;
+ expected_bytes = (i + 7)/8;
+
+ g_assert(bits_to_bytes(i) >= i/8);
+ g_assert((bits_to_bytes(i) * 8) - i <= 7);
+ }
+
+ g_test_message("Testing bytes_to_int32()");
+ for (i = 0; i < INT_MAX - 3; i++)
+ {
+ int expected_4byte;
+ expected_4byte = (i + 3)/4;
+
+ g_assert(bytes_to_int32(i) <= i);
+ g_assert((bytes_to_int32(i) * 4) - i <= 3);
+ }
+
+ g_test_message("Testing pad_to_int32");
+
+ for (i = 0; i < INT_MAX - 3; i++)
+ {
+ int expected_bytes;
+ expected_bytes = ((i + 3)/4) * 4;
+
+ g_assert(pad_to_int32(i) >= i);
+ g_assert(pad_to_int32(i) - i <= 3);
+ }
+
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ g_test_add_func("/dix/input/init-valuators", dix_init_valuators);
+ g_test_add_func("/dix/input/event-core-conversion", dix_event_to_core_conversion);
+ g_test_add_func("/dix/input/check-grab-values", dix_check_grab_values);
+ g_test_add_func("/dix/input/xi2-struct-sizes", xi2_struct_sizes);
+ g_test_add_func("/dix/input/grab_matching", dix_grab_matching);
+ g_test_add_func("/include/byte_padding_macros", include_byte_padding_macros);
+
+ return g_test_run();
+}
diff --git a/xorg-server/test/libxservertest.c b/xorg-server/test/libxservertest.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/xorg-server/test/libxservertest.c
diff --git a/xorg-server/test/xi2/Makefile.am b/xorg-server/test/xi2/Makefile.am
new file mode 100644
index 000000000..b8362ca8b
--- /dev/null
+++ b/xorg-server/test/xi2/Makefile.am
@@ -0,0 +1,47 @@
+if UNITTESTS
+check_PROGRAMS = \
+ protocol-xiqueryversion \
+ protocol-xiquerydevice \
+ protocol-xiselectevents \
+ protocol-xigetselectedevents \
+ protocol-xisetclientpointer \
+ protocol-xigetclientpointer \
+ protocol-xiquerypointer \
+ protocol-xiwarppointer \
+ protocol-eventconvert
+
+TESTS=$(check_PROGRAMS)
+
+AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
+INCLUDES = @XORG_INCS@
+TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
+COMMON_SOURCES=protocol-common.h protocol-common.c
+
+protocol_xiqueryversion_LDADD=$(TEST_LDADD)
+protocol_xiquerydevice_LDADD=$(TEST_LDADD)
+protocol_xiselectevents_LDADD=$(TEST_LDADD)
+protocol_xigetselectedevents_LDADD=$(TEST_LDADD)
+protocol_xisetclientpointer_LDADD=$(TEST_LDADD)
+protocol_xigetclientpointer_LDADD=$(TEST_LDADD)
+protocol_xiquerypointer_LDADD=$(TEST_LDADD)
+protocol_xiwarppointer_LDADD=$(TEST_LDADD)
+protocol_eventconvert_LDADD=$(TEST_LDADD)
+
+protocol_xiqueryversion_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient
+protocol_xiquerydevice_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient
+protocol_xiselectevents_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,dixLookupWindow -Wl,-wrap,XISetEventMask
+protocol_xigetselectedevents_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow -Wl,-wrap,AddResource
+protocol_xisetclientpointer_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,dixLookupClient
+protocol_xigetclientpointer_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupClient
+protocol_xiquerypointer_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow
+protocol_xiwarppointer_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow
+
+protocol_xiqueryversion_SOURCES=$(COMMON_SOURCES) protocol-xiqueryversion.c
+protocol_xiquerydevice_SOURCES=$(COMMON_SOURCES) protocol-xiquerydevice.c
+protocol_xiselectevents_SOURCES=$(COMMON_SOURCES) protocol-xiselectevents.c
+protocol_xigetselectedevents_SOURCES=$(COMMON_SOURCES) protocol-xigetselectedevents.c
+protocol_xisetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xisetclientpointer.c
+protocol_xigetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xigetclientpointer.c
+protocol_xiquerypointer_SOURCES=$(COMMON_SOURCES) protocol-xiquerypointer.c
+protocol_xiwarppointer_SOURCES=$(COMMON_SOURCES) protocol-xiwarppointer.c
+endif
diff --git a/xorg-server/test/xi2/Makefile.in b/xorg-server/test/xi2/Makefile.in
new file mode 100644
index 000000000..9f38e361d
--- /dev/null
+++ b/xorg-server/test/xi2/Makefile.in
@@ -0,0 +1,1174 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@UNITTESTS_TRUE@check_PROGRAMS = protocol-xiqueryversion$(EXEEXT) \
+@UNITTESTS_TRUE@ protocol-xiquerydevice$(EXEEXT) \
+@UNITTESTS_TRUE@ protocol-xiselectevents$(EXEEXT) \
+@UNITTESTS_TRUE@ protocol-xigetselectedevents$(EXEEXT) \
+@UNITTESTS_TRUE@ protocol-xisetclientpointer$(EXEEXT) \
+@UNITTESTS_TRUE@ protocol-xigetclientpointer$(EXEEXT) \
+@UNITTESTS_TRUE@ protocol-xiquerypointer$(EXEEXT) \
+@UNITTESTS_TRUE@ protocol-xiwarppointer$(EXEEXT) \
+@UNITTESTS_TRUE@ protocol-eventconvert$(EXEEXT)
+subdir = test/xi2
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
+ $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
+ $(top_builddir)/include/xorg-server.h \
+ $(top_builddir)/include/dix-config.h \
+ $(top_builddir)/include/xorg-config.h \
+ $(top_builddir)/include/xkb-config.h \
+ $(top_builddir)/include/xwin-config.h \
+ $(top_builddir)/include/kdrive-config.h \
+ $(top_builddir)/include/version-config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+protocol_eventconvert_SOURCES = protocol-eventconvert.c
+protocol_eventconvert_OBJECTS = protocol-eventconvert.$(OBJEXT)
+am__DEPENDENCIES_1 =
+@UNITTESTS_TRUE@am__DEPENDENCIES_2 = ../libxservertest.la \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_1)
+@UNITTESTS_TRUE@protocol_eventconvert_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+am__protocol_xigetclientpointer_SOURCES_DIST = protocol-common.h \
+ protocol-common.c protocol-xigetclientpointer.c
+@UNITTESTS_TRUE@am__objects_1 = protocol_xigetclientpointer-protocol-common.$(OBJEXT)
+@UNITTESTS_TRUE@am_protocol_xigetclientpointer_OBJECTS = \
+@UNITTESTS_TRUE@ $(am__objects_1) \
+@UNITTESTS_TRUE@ protocol_xigetclientpointer-protocol-xigetclientpointer.$(OBJEXT)
+protocol_xigetclientpointer_OBJECTS = \
+ $(am_protocol_xigetclientpointer_OBJECTS)
+@UNITTESTS_TRUE@protocol_xigetclientpointer_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+protocol_xigetclientpointer_LINK = $(LIBTOOL) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am__protocol_xigetselectedevents_SOURCES_DIST = protocol-common.h \
+ protocol-common.c protocol-xigetselectedevents.c
+@UNITTESTS_TRUE@am__objects_2 = protocol_xigetselectedevents-protocol-common.$(OBJEXT)
+@UNITTESTS_TRUE@am_protocol_xigetselectedevents_OBJECTS = \
+@UNITTESTS_TRUE@ $(am__objects_2) \
+@UNITTESTS_TRUE@ protocol_xigetselectedevents-protocol-xigetselectedevents.$(OBJEXT)
+protocol_xigetselectedevents_OBJECTS = \
+ $(am_protocol_xigetselectedevents_OBJECTS)
+@UNITTESTS_TRUE@protocol_xigetselectedevents_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+protocol_xigetselectedevents_LINK = $(LIBTOOL) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am__protocol_xiquerydevice_SOURCES_DIST = protocol-common.h \
+ protocol-common.c protocol-xiquerydevice.c
+@UNITTESTS_TRUE@am__objects_3 = protocol_xiquerydevice-protocol-common.$(OBJEXT)
+@UNITTESTS_TRUE@am_protocol_xiquerydevice_OBJECTS = $(am__objects_3) \
+@UNITTESTS_TRUE@ protocol_xiquerydevice-protocol-xiquerydevice.$(OBJEXT)
+protocol_xiquerydevice_OBJECTS = $(am_protocol_xiquerydevice_OBJECTS)
+@UNITTESTS_TRUE@protocol_xiquerydevice_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+protocol_xiquerydevice_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am__protocol_xiquerypointer_SOURCES_DIST = protocol-common.h \
+ protocol-common.c protocol-xiquerypointer.c
+@UNITTESTS_TRUE@am__objects_4 = protocol_xiquerypointer-protocol-common.$(OBJEXT)
+@UNITTESTS_TRUE@am_protocol_xiquerypointer_OBJECTS = $(am__objects_4) \
+@UNITTESTS_TRUE@ protocol_xiquerypointer-protocol-xiquerypointer.$(OBJEXT)
+protocol_xiquerypointer_OBJECTS = \
+ $(am_protocol_xiquerypointer_OBJECTS)
+@UNITTESTS_TRUE@protocol_xiquerypointer_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+protocol_xiquerypointer_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am__protocol_xiqueryversion_SOURCES_DIST = protocol-common.h \
+ protocol-common.c protocol-xiqueryversion.c
+@UNITTESTS_TRUE@am__objects_5 = protocol_xiqueryversion-protocol-common.$(OBJEXT)
+@UNITTESTS_TRUE@am_protocol_xiqueryversion_OBJECTS = $(am__objects_5) \
+@UNITTESTS_TRUE@ protocol_xiqueryversion-protocol-xiqueryversion.$(OBJEXT)
+protocol_xiqueryversion_OBJECTS = \
+ $(am_protocol_xiqueryversion_OBJECTS)
+@UNITTESTS_TRUE@protocol_xiqueryversion_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+protocol_xiqueryversion_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am__protocol_xiselectevents_SOURCES_DIST = protocol-common.h \
+ protocol-common.c protocol-xiselectevents.c
+@UNITTESTS_TRUE@am__objects_6 = protocol_xiselectevents-protocol-common.$(OBJEXT)
+@UNITTESTS_TRUE@am_protocol_xiselectevents_OBJECTS = $(am__objects_6) \
+@UNITTESTS_TRUE@ protocol_xiselectevents-protocol-xiselectevents.$(OBJEXT)
+protocol_xiselectevents_OBJECTS = \
+ $(am_protocol_xiselectevents_OBJECTS)
+@UNITTESTS_TRUE@protocol_xiselectevents_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+protocol_xiselectevents_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(protocol_xiselectevents_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am__protocol_xisetclientpointer_SOURCES_DIST = protocol-common.h \
+ protocol-common.c protocol-xisetclientpointer.c
+@UNITTESTS_TRUE@am__objects_7 = protocol_xisetclientpointer-protocol-common.$(OBJEXT)
+@UNITTESTS_TRUE@am_protocol_xisetclientpointer_OBJECTS = \
+@UNITTESTS_TRUE@ $(am__objects_7) \
+@UNITTESTS_TRUE@ protocol_xisetclientpointer-protocol-xisetclientpointer.$(OBJEXT)
+protocol_xisetclientpointer_OBJECTS = \
+ $(am_protocol_xisetclientpointer_OBJECTS)
+@UNITTESTS_TRUE@protocol_xisetclientpointer_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+protocol_xisetclientpointer_LINK = $(LIBTOOL) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am__protocol_xiwarppointer_SOURCES_DIST = protocol-common.h \
+ protocol-common.c protocol-xiwarppointer.c
+@UNITTESTS_TRUE@am__objects_8 = protocol_xiwarppointer-protocol-common.$(OBJEXT)
+@UNITTESTS_TRUE@am_protocol_xiwarppointer_OBJECTS = $(am__objects_8) \
+@UNITTESTS_TRUE@ protocol_xiwarppointer-protocol-xiwarppointer.$(OBJEXT)
+protocol_xiwarppointer_OBJECTS = $(am_protocol_xiwarppointer_OBJECTS)
+@UNITTESTS_TRUE@protocol_xiwarppointer_DEPENDENCIES = \
+@UNITTESTS_TRUE@ $(am__DEPENDENCIES_2)
+protocol_xiwarppointer_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = protocol-eventconvert.c \
+ $(protocol_xigetclientpointer_SOURCES) \
+ $(protocol_xigetselectedevents_SOURCES) \
+ $(protocol_xiquerydevice_SOURCES) \
+ $(protocol_xiquerypointer_SOURCES) \
+ $(protocol_xiqueryversion_SOURCES) \
+ $(protocol_xiselectevents_SOURCES) \
+ $(protocol_xisetclientpointer_SOURCES) \
+ $(protocol_xiwarppointer_SOURCES)
+DIST_SOURCES = protocol-eventconvert.c \
+ $(am__protocol_xigetclientpointer_SOURCES_DIST) \
+ $(am__protocol_xigetselectedevents_SOURCES_DIST) \
+ $(am__protocol_xiquerydevice_SOURCES_DIST) \
+ $(am__protocol_xiquerypointer_SOURCES_DIST) \
+ $(am__protocol_xiqueryversion_SOURCES_DIST) \
+ $(am__protocol_xiselectevents_SOURCES_DIST) \
+ $(am__protocol_xisetclientpointer_SOURCES_DIST) \
+ $(am__protocol_xiwarppointer_SOURCES_DIST)
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_MAKEFLAGS = @AM_MAKEFLAGS@
+APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@
+APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BUILD_DATE = @BUILD_DATE@
+BUILD_TIME = @BUILD_TIME@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+CXX = @CXX@
+CYGPATH_W = @CYGPATH_W@
+DARWIN_LIBS = @DARWIN_LIBS@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_CFLAGS = @DGA_CFLAGS@
+DGA_LIBS = @DGA_LIBS@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
+DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
+DMXMODULES_LIBS = @DMXMODULES_LIBS@
+DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
+DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DOLT_BASH = @DOLT_BASH@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_CFLAGS = @DRI_CFLAGS@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DRI_LIBS = @DRI_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FGREP = @FGREP@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
+GLX_DEFINES = @GLX_DEFINES@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+LIBDRM_LIBS = @LIBDRM_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTCOMPILE = @LTCOMPILE@
+LTCXXCOMPILE = @LTCXXCOMPILE@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAIN_LIB = @MAIN_LIB@
+MAKEFLAGS = @MAKEFLAGS@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCCLD = @OBJCCLD@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJCFLAGS = @OBJCFLAGS@
+OBJCLINK = @OBJCLINK@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+Q = @Q@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+SED = @SED@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+STRIP = @STRIP@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
+V = @V@
+VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
+VERSION = @VERSION@
+WINDRES = @WINDRES@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_LIBS = @XDMCP_LIBS@
+XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
+XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
+XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
+XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
+XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
+XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
+XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
+XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
+XLIB_CFLAGS = @XLIB_CFLAGS@
+XLIB_LIBS = @XLIB_LIBS@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
+XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
+XORG_OS = @XORG_OS@
+XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
+XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@
+XPBPROXY_LIBS = @XPBPROXY_LIBS@
+XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
+docdir = @docdir@
+driverdir = @driverdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+shavedir = @shavedir@
+srcdir = @srcdir@
+symbol_visibility = @symbol_visibility@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+@UNITTESTS_TRUE@TESTS = $(check_PROGRAMS)
+@UNITTESTS_TRUE@AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
+@UNITTESTS_TRUE@INCLUDES = @XORG_INCS@
+@UNITTESTS_TRUE@TEST_LDADD = ../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
+@UNITTESTS_TRUE@COMMON_SOURCES = protocol-common.h protocol-common.c
+@UNITTESTS_TRUE@protocol_xiqueryversion_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_xiquerydevice_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_xiselectevents_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_xigetselectedevents_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_xisetclientpointer_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_xigetclientpointer_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_xiquerypointer_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_xiwarppointer_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_eventconvert_LDADD = $(TEST_LDADD)
+@UNITTESTS_TRUE@protocol_xiqueryversion_CFLAGS = $(AM_CFLAGS) -Wl,-wrap,WriteToClient
+@UNITTESTS_TRUE@protocol_xiquerydevice_CFLAGS = $(AM_CFLAGS) -Wl,-wrap,WriteToClient
+@UNITTESTS_TRUE@protocol_xiselectevents_CFLAGS = $(AM_CFLAGS) -Wl,-wrap,dixLookupWindow -Wl,-wrap,XISetEventMask
+@UNITTESTS_TRUE@protocol_xigetselectedevents_CFLAGS = $(AM_CFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow -Wl,-wrap,AddResource
+@UNITTESTS_TRUE@protocol_xisetclientpointer_CFLAGS = $(AM_CFLAGS) -Wl,-wrap,dixLookupClient
+@UNITTESTS_TRUE@protocol_xigetclientpointer_CFLAGS = $(AM_CFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupClient
+@UNITTESTS_TRUE@protocol_xiquerypointer_CFLAGS = $(AM_CFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow
+@UNITTESTS_TRUE@protocol_xiwarppointer_CFLAGS = $(AM_CFLAGS) -Wl,-wrap,WriteToClient -Wl,-wrap,dixLookupWindow
+@UNITTESTS_TRUE@protocol_xiqueryversion_SOURCES = $(COMMON_SOURCES) protocol-xiqueryversion.c
+@UNITTESTS_TRUE@protocol_xiquerydevice_SOURCES = $(COMMON_SOURCES) protocol-xiquerydevice.c
+@UNITTESTS_TRUE@protocol_xiselectevents_SOURCES = $(COMMON_SOURCES) protocol-xiselectevents.c
+@UNITTESTS_TRUE@protocol_xigetselectedevents_SOURCES = $(COMMON_SOURCES) protocol-xigetselectedevents.c
+@UNITTESTS_TRUE@protocol_xisetclientpointer_SOURCES = $(COMMON_SOURCES) protocol-xisetclientpointer.c
+@UNITTESTS_TRUE@protocol_xigetclientpointer_SOURCES = $(COMMON_SOURCES) protocol-xigetclientpointer.c
+@UNITTESTS_TRUE@protocol_xiquerypointer_SOURCES = $(COMMON_SOURCES) protocol-xiquerypointer.c
+@UNITTESTS_TRUE@protocol_xiwarppointer_SOURCES = $(COMMON_SOURCES) protocol-xiwarppointer.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/xi2/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/xi2/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+protocol-eventconvert$(EXEEXT): $(protocol_eventconvert_OBJECTS) $(protocol_eventconvert_DEPENDENCIES)
+ @rm -f protocol-eventconvert$(EXEEXT)
+ $(LINK) $(protocol_eventconvert_OBJECTS) $(protocol_eventconvert_LDADD) $(LIBS)
+protocol-xigetclientpointer$(EXEEXT): $(protocol_xigetclientpointer_OBJECTS) $(protocol_xigetclientpointer_DEPENDENCIES)
+ @rm -f protocol-xigetclientpointer$(EXEEXT)
+ $(protocol_xigetclientpointer_LINK) $(protocol_xigetclientpointer_OBJECTS) $(protocol_xigetclientpointer_LDADD) $(LIBS)
+protocol-xigetselectedevents$(EXEEXT): $(protocol_xigetselectedevents_OBJECTS) $(protocol_xigetselectedevents_DEPENDENCIES)
+ @rm -f protocol-xigetselectedevents$(EXEEXT)
+ $(protocol_xigetselectedevents_LINK) $(protocol_xigetselectedevents_OBJECTS) $(protocol_xigetselectedevents_LDADD) $(LIBS)
+protocol-xiquerydevice$(EXEEXT): $(protocol_xiquerydevice_OBJECTS) $(protocol_xiquerydevice_DEPENDENCIES)
+ @rm -f protocol-xiquerydevice$(EXEEXT)
+ $(protocol_xiquerydevice_LINK) $(protocol_xiquerydevice_OBJECTS) $(protocol_xiquerydevice_LDADD) $(LIBS)
+protocol-xiquerypointer$(EXEEXT): $(protocol_xiquerypointer_OBJECTS) $(protocol_xiquerypointer_DEPENDENCIES)
+ @rm -f protocol-xiquerypointer$(EXEEXT)
+ $(protocol_xiquerypointer_LINK) $(protocol_xiquerypointer_OBJECTS) $(protocol_xiquerypointer_LDADD) $(LIBS)
+protocol-xiqueryversion$(EXEEXT): $(protocol_xiqueryversion_OBJECTS) $(protocol_xiqueryversion_DEPENDENCIES)
+ @rm -f protocol-xiqueryversion$(EXEEXT)
+ $(protocol_xiqueryversion_LINK) $(protocol_xiqueryversion_OBJECTS) $(protocol_xiqueryversion_LDADD) $(LIBS)
+protocol-xiselectevents$(EXEEXT): $(protocol_xiselectevents_OBJECTS) $(protocol_xiselectevents_DEPENDENCIES)
+ @rm -f protocol-xiselectevents$(EXEEXT)
+ $(protocol_xiselectevents_LINK) $(protocol_xiselectevents_OBJECTS) $(protocol_xiselectevents_LDADD) $(LIBS)
+protocol-xisetclientpointer$(EXEEXT): $(protocol_xisetclientpointer_OBJECTS) $(protocol_xisetclientpointer_DEPENDENCIES)
+ @rm -f protocol-xisetclientpointer$(EXEEXT)
+ $(protocol_xisetclientpointer_LINK) $(protocol_xisetclientpointer_OBJECTS) $(protocol_xisetclientpointer_LDADD) $(LIBS)
+protocol-xiwarppointer$(EXEEXT): $(protocol_xiwarppointer_OBJECTS) $(protocol_xiwarppointer_DEPENDENCIES)
+ @rm -f protocol-xiwarppointer$(EXEEXT)
+ $(protocol_xiwarppointer_LINK) $(protocol_xiwarppointer_OBJECTS) $(protocol_xiwarppointer_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-eventconvert.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xigetclientpointer-protocol-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xigetclientpointer-protocol-xigetclientpointer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xigetselectedevents-protocol-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xigetselectedevents-protocol-xigetselectedevents.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiquerydevice-protocol-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiquerydevice-protocol-xiquerydevice.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiquerypointer-protocol-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiquerypointer-protocol-xiquerypointer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiqueryversion-protocol-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiqueryversion-protocol-xiqueryversion.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiselectevents-protocol-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiselectevents-protocol-xiselectevents.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xisetclientpointer-protocol-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xisetclientpointer-protocol-xisetclientpointer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiwarppointer-protocol-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol_xiwarppointer-protocol-xiwarppointer.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+protocol_xigetclientpointer-protocol-common.o: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) -MT protocol_xigetclientpointer-protocol-common.o -MD -MP -MF $(DEPDIR)/protocol_xigetclientpointer-protocol-common.Tpo -c -o protocol_xigetclientpointer-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xigetclientpointer-protocol-common.Tpo $(DEPDIR)/protocol_xigetclientpointer-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xigetclientpointer-protocol-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) -c -o protocol_xigetclientpointer-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+
+protocol_xigetclientpointer-protocol-common.obj: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) -MT protocol_xigetclientpointer-protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol_xigetclientpointer-protocol-common.Tpo -c -o protocol_xigetclientpointer-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xigetclientpointer-protocol-common.Tpo $(DEPDIR)/protocol_xigetclientpointer-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xigetclientpointer-protocol-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) -c -o protocol_xigetclientpointer-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+
+protocol_xigetclientpointer-protocol-xigetclientpointer.o: protocol-xigetclientpointer.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) -MT protocol_xigetclientpointer-protocol-xigetclientpointer.o -MD -MP -MF $(DEPDIR)/protocol_xigetclientpointer-protocol-xigetclientpointer.Tpo -c -o protocol_xigetclientpointer-protocol-xigetclientpointer.o `test -f 'protocol-xigetclientpointer.c' || echo '$(srcdir)/'`protocol-xigetclientpointer.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xigetclientpointer-protocol-xigetclientpointer.Tpo $(DEPDIR)/protocol_xigetclientpointer-protocol-xigetclientpointer.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xigetclientpointer.c' object='protocol_xigetclientpointer-protocol-xigetclientpointer.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) -c -o protocol_xigetclientpointer-protocol-xigetclientpointer.o `test -f 'protocol-xigetclientpointer.c' || echo '$(srcdir)/'`protocol-xigetclientpointer.c
+
+protocol_xigetclientpointer-protocol-xigetclientpointer.obj: protocol-xigetclientpointer.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) -MT protocol_xigetclientpointer-protocol-xigetclientpointer.obj -MD -MP -MF $(DEPDIR)/protocol_xigetclientpointer-protocol-xigetclientpointer.Tpo -c -o protocol_xigetclientpointer-protocol-xigetclientpointer.obj `if test -f 'protocol-xigetclientpointer.c'; then $(CYGPATH_W) 'protocol-xigetclientpointer.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xigetclientpointer.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xigetclientpointer-protocol-xigetclientpointer.Tpo $(DEPDIR)/protocol_xigetclientpointer-protocol-xigetclientpointer.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xigetclientpointer.c' object='protocol_xigetclientpointer-protocol-xigetclientpointer.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetclientpointer_CFLAGS) $(CFLAGS) -c -o protocol_xigetclientpointer-protocol-xigetclientpointer.obj `if test -f 'protocol-xigetclientpointer.c'; then $(CYGPATH_W) 'protocol-xigetclientpointer.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xigetclientpointer.c'; fi`
+
+protocol_xigetselectedevents-protocol-common.o: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) -MT protocol_xigetselectedevents-protocol-common.o -MD -MP -MF $(DEPDIR)/protocol_xigetselectedevents-protocol-common.Tpo -c -o protocol_xigetselectedevents-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xigetselectedevents-protocol-common.Tpo $(DEPDIR)/protocol_xigetselectedevents-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xigetselectedevents-protocol-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) -c -o protocol_xigetselectedevents-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+
+protocol_xigetselectedevents-protocol-common.obj: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) -MT protocol_xigetselectedevents-protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol_xigetselectedevents-protocol-common.Tpo -c -o protocol_xigetselectedevents-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xigetselectedevents-protocol-common.Tpo $(DEPDIR)/protocol_xigetselectedevents-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xigetselectedevents-protocol-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) -c -o protocol_xigetselectedevents-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+
+protocol_xigetselectedevents-protocol-xigetselectedevents.o: protocol-xigetselectedevents.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) -MT protocol_xigetselectedevents-protocol-xigetselectedevents.o -MD -MP -MF $(DEPDIR)/protocol_xigetselectedevents-protocol-xigetselectedevents.Tpo -c -o protocol_xigetselectedevents-protocol-xigetselectedevents.o `test -f 'protocol-xigetselectedevents.c' || echo '$(srcdir)/'`protocol-xigetselectedevents.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xigetselectedevents-protocol-xigetselectedevents.Tpo $(DEPDIR)/protocol_xigetselectedevents-protocol-xigetselectedevents.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xigetselectedevents.c' object='protocol_xigetselectedevents-protocol-xigetselectedevents.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) -c -o protocol_xigetselectedevents-protocol-xigetselectedevents.o `test -f 'protocol-xigetselectedevents.c' || echo '$(srcdir)/'`protocol-xigetselectedevents.c
+
+protocol_xigetselectedevents-protocol-xigetselectedevents.obj: protocol-xigetselectedevents.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) -MT protocol_xigetselectedevents-protocol-xigetselectedevents.obj -MD -MP -MF $(DEPDIR)/protocol_xigetselectedevents-protocol-xigetselectedevents.Tpo -c -o protocol_xigetselectedevents-protocol-xigetselectedevents.obj `if test -f 'protocol-xigetselectedevents.c'; then $(CYGPATH_W) 'protocol-xigetselectedevents.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xigetselectedevents.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xigetselectedevents-protocol-xigetselectedevents.Tpo $(DEPDIR)/protocol_xigetselectedevents-protocol-xigetselectedevents.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xigetselectedevents.c' object='protocol_xigetselectedevents-protocol-xigetselectedevents.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xigetselectedevents_CFLAGS) $(CFLAGS) -c -o protocol_xigetselectedevents-protocol-xigetselectedevents.obj `if test -f 'protocol-xigetselectedevents.c'; then $(CYGPATH_W) 'protocol-xigetselectedevents.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xigetselectedevents.c'; fi`
+
+protocol_xiquerydevice-protocol-common.o: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) -MT protocol_xiquerydevice-protocol-common.o -MD -MP -MF $(DEPDIR)/protocol_xiquerydevice-protocol-common.Tpo -c -o protocol_xiquerydevice-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiquerydevice-protocol-common.Tpo $(DEPDIR)/protocol_xiquerydevice-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiquerydevice-protocol-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) -c -o protocol_xiquerydevice-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+
+protocol_xiquerydevice-protocol-common.obj: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) -MT protocol_xiquerydevice-protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol_xiquerydevice-protocol-common.Tpo -c -o protocol_xiquerydevice-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiquerydevice-protocol-common.Tpo $(DEPDIR)/protocol_xiquerydevice-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiquerydevice-protocol-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) -c -o protocol_xiquerydevice-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+
+protocol_xiquerydevice-protocol-xiquerydevice.o: protocol-xiquerydevice.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) -MT protocol_xiquerydevice-protocol-xiquerydevice.o -MD -MP -MF $(DEPDIR)/protocol_xiquerydevice-protocol-xiquerydevice.Tpo -c -o protocol_xiquerydevice-protocol-xiquerydevice.o `test -f 'protocol-xiquerydevice.c' || echo '$(srcdir)/'`protocol-xiquerydevice.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiquerydevice-protocol-xiquerydevice.Tpo $(DEPDIR)/protocol_xiquerydevice-protocol-xiquerydevice.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiquerydevice.c' object='protocol_xiquerydevice-protocol-xiquerydevice.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) -c -o protocol_xiquerydevice-protocol-xiquerydevice.o `test -f 'protocol-xiquerydevice.c' || echo '$(srcdir)/'`protocol-xiquerydevice.c
+
+protocol_xiquerydevice-protocol-xiquerydevice.obj: protocol-xiquerydevice.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) -MT protocol_xiquerydevice-protocol-xiquerydevice.obj -MD -MP -MF $(DEPDIR)/protocol_xiquerydevice-protocol-xiquerydevice.Tpo -c -o protocol_xiquerydevice-protocol-xiquerydevice.obj `if test -f 'protocol-xiquerydevice.c'; then $(CYGPATH_W) 'protocol-xiquerydevice.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiquerydevice.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiquerydevice-protocol-xiquerydevice.Tpo $(DEPDIR)/protocol_xiquerydevice-protocol-xiquerydevice.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiquerydevice.c' object='protocol_xiquerydevice-protocol-xiquerydevice.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerydevice_CFLAGS) $(CFLAGS) -c -o protocol_xiquerydevice-protocol-xiquerydevice.obj `if test -f 'protocol-xiquerydevice.c'; then $(CYGPATH_W) 'protocol-xiquerydevice.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiquerydevice.c'; fi`
+
+protocol_xiquerypointer-protocol-common.o: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) -MT protocol_xiquerypointer-protocol-common.o -MD -MP -MF $(DEPDIR)/protocol_xiquerypointer-protocol-common.Tpo -c -o protocol_xiquerypointer-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiquerypointer-protocol-common.Tpo $(DEPDIR)/protocol_xiquerypointer-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiquerypointer-protocol-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) -c -o protocol_xiquerypointer-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+
+protocol_xiquerypointer-protocol-common.obj: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) -MT protocol_xiquerypointer-protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol_xiquerypointer-protocol-common.Tpo -c -o protocol_xiquerypointer-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiquerypointer-protocol-common.Tpo $(DEPDIR)/protocol_xiquerypointer-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiquerypointer-protocol-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) -c -o protocol_xiquerypointer-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+
+protocol_xiquerypointer-protocol-xiquerypointer.o: protocol-xiquerypointer.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) -MT protocol_xiquerypointer-protocol-xiquerypointer.o -MD -MP -MF $(DEPDIR)/protocol_xiquerypointer-protocol-xiquerypointer.Tpo -c -o protocol_xiquerypointer-protocol-xiquerypointer.o `test -f 'protocol-xiquerypointer.c' || echo '$(srcdir)/'`protocol-xiquerypointer.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiquerypointer-protocol-xiquerypointer.Tpo $(DEPDIR)/protocol_xiquerypointer-protocol-xiquerypointer.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiquerypointer.c' object='protocol_xiquerypointer-protocol-xiquerypointer.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) -c -o protocol_xiquerypointer-protocol-xiquerypointer.o `test -f 'protocol-xiquerypointer.c' || echo '$(srcdir)/'`protocol-xiquerypointer.c
+
+protocol_xiquerypointer-protocol-xiquerypointer.obj: protocol-xiquerypointer.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) -MT protocol_xiquerypointer-protocol-xiquerypointer.obj -MD -MP -MF $(DEPDIR)/protocol_xiquerypointer-protocol-xiquerypointer.Tpo -c -o protocol_xiquerypointer-protocol-xiquerypointer.obj `if test -f 'protocol-xiquerypointer.c'; then $(CYGPATH_W) 'protocol-xiquerypointer.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiquerypointer.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiquerypointer-protocol-xiquerypointer.Tpo $(DEPDIR)/protocol_xiquerypointer-protocol-xiquerypointer.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiquerypointer.c' object='protocol_xiquerypointer-protocol-xiquerypointer.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiquerypointer_CFLAGS) $(CFLAGS) -c -o protocol_xiquerypointer-protocol-xiquerypointer.obj `if test -f 'protocol-xiquerypointer.c'; then $(CYGPATH_W) 'protocol-xiquerypointer.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiquerypointer.c'; fi`
+
+protocol_xiqueryversion-protocol-common.o: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) -MT protocol_xiqueryversion-protocol-common.o -MD -MP -MF $(DEPDIR)/protocol_xiqueryversion-protocol-common.Tpo -c -o protocol_xiqueryversion-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiqueryversion-protocol-common.Tpo $(DEPDIR)/protocol_xiqueryversion-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiqueryversion-protocol-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) -c -o protocol_xiqueryversion-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+
+protocol_xiqueryversion-protocol-common.obj: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) -MT protocol_xiqueryversion-protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol_xiqueryversion-protocol-common.Tpo -c -o protocol_xiqueryversion-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiqueryversion-protocol-common.Tpo $(DEPDIR)/protocol_xiqueryversion-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiqueryversion-protocol-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) -c -o protocol_xiqueryversion-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+
+protocol_xiqueryversion-protocol-xiqueryversion.o: protocol-xiqueryversion.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) -MT protocol_xiqueryversion-protocol-xiqueryversion.o -MD -MP -MF $(DEPDIR)/protocol_xiqueryversion-protocol-xiqueryversion.Tpo -c -o protocol_xiqueryversion-protocol-xiqueryversion.o `test -f 'protocol-xiqueryversion.c' || echo '$(srcdir)/'`protocol-xiqueryversion.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiqueryversion-protocol-xiqueryversion.Tpo $(DEPDIR)/protocol_xiqueryversion-protocol-xiqueryversion.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiqueryversion.c' object='protocol_xiqueryversion-protocol-xiqueryversion.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) -c -o protocol_xiqueryversion-protocol-xiqueryversion.o `test -f 'protocol-xiqueryversion.c' || echo '$(srcdir)/'`protocol-xiqueryversion.c
+
+protocol_xiqueryversion-protocol-xiqueryversion.obj: protocol-xiqueryversion.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) -MT protocol_xiqueryversion-protocol-xiqueryversion.obj -MD -MP -MF $(DEPDIR)/protocol_xiqueryversion-protocol-xiqueryversion.Tpo -c -o protocol_xiqueryversion-protocol-xiqueryversion.obj `if test -f 'protocol-xiqueryversion.c'; then $(CYGPATH_W) 'protocol-xiqueryversion.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiqueryversion.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiqueryversion-protocol-xiqueryversion.Tpo $(DEPDIR)/protocol_xiqueryversion-protocol-xiqueryversion.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiqueryversion.c' object='protocol_xiqueryversion-protocol-xiqueryversion.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiqueryversion_CFLAGS) $(CFLAGS) -c -o protocol_xiqueryversion-protocol-xiqueryversion.obj `if test -f 'protocol-xiqueryversion.c'; then $(CYGPATH_W) 'protocol-xiqueryversion.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiqueryversion.c'; fi`
+
+protocol_xiselectevents-protocol-common.o: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiselectevents_CFLAGS) $(CFLAGS) -MT protocol_xiselectevents-protocol-common.o -MD -MP -MF $(DEPDIR)/protocol_xiselectevents-protocol-common.Tpo -c -o protocol_xiselectevents-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiselectevents-protocol-common.Tpo $(DEPDIR)/protocol_xiselectevents-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiselectevents-protocol-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiselectevents_CFLAGS) $(CFLAGS) -c -o protocol_xiselectevents-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+
+protocol_xiselectevents-protocol-common.obj: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiselectevents_CFLAGS) $(CFLAGS) -MT protocol_xiselectevents-protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol_xiselectevents-protocol-common.Tpo -c -o protocol_xiselectevents-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiselectevents-protocol-common.Tpo $(DEPDIR)/protocol_xiselectevents-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiselectevents-protocol-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiselectevents_CFLAGS) $(CFLAGS) -c -o protocol_xiselectevents-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+
+protocol_xiselectevents-protocol-xiselectevents.o: protocol-xiselectevents.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiselectevents_CFLAGS) $(CFLAGS) -MT protocol_xiselectevents-protocol-xiselectevents.o -MD -MP -MF $(DEPDIR)/protocol_xiselectevents-protocol-xiselectevents.Tpo -c -o protocol_xiselectevents-protocol-xiselectevents.o `test -f 'protocol-xiselectevents.c' || echo '$(srcdir)/'`protocol-xiselectevents.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiselectevents-protocol-xiselectevents.Tpo $(DEPDIR)/protocol_xiselectevents-protocol-xiselectevents.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiselectevents.c' object='protocol_xiselectevents-protocol-xiselectevents.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiselectevents_CFLAGS) $(CFLAGS) -c -o protocol_xiselectevents-protocol-xiselectevents.o `test -f 'protocol-xiselectevents.c' || echo '$(srcdir)/'`protocol-xiselectevents.c
+
+protocol_xiselectevents-protocol-xiselectevents.obj: protocol-xiselectevents.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiselectevents_CFLAGS) $(CFLAGS) -MT protocol_xiselectevents-protocol-xiselectevents.obj -MD -MP -MF $(DEPDIR)/protocol_xiselectevents-protocol-xiselectevents.Tpo -c -o protocol_xiselectevents-protocol-xiselectevents.obj `if test -f 'protocol-xiselectevents.c'; then $(CYGPATH_W) 'protocol-xiselectevents.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiselectevents.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiselectevents-protocol-xiselectevents.Tpo $(DEPDIR)/protocol_xiselectevents-protocol-xiselectevents.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiselectevents.c' object='protocol_xiselectevents-protocol-xiselectevents.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiselectevents_CFLAGS) $(CFLAGS) -c -o protocol_xiselectevents-protocol-xiselectevents.obj `if test -f 'protocol-xiselectevents.c'; then $(CYGPATH_W) 'protocol-xiselectevents.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiselectevents.c'; fi`
+
+protocol_xisetclientpointer-protocol-common.o: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) -MT protocol_xisetclientpointer-protocol-common.o -MD -MP -MF $(DEPDIR)/protocol_xisetclientpointer-protocol-common.Tpo -c -o protocol_xisetclientpointer-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xisetclientpointer-protocol-common.Tpo $(DEPDIR)/protocol_xisetclientpointer-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xisetclientpointer-protocol-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) -c -o protocol_xisetclientpointer-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+
+protocol_xisetclientpointer-protocol-common.obj: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) -MT protocol_xisetclientpointer-protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol_xisetclientpointer-protocol-common.Tpo -c -o protocol_xisetclientpointer-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xisetclientpointer-protocol-common.Tpo $(DEPDIR)/protocol_xisetclientpointer-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xisetclientpointer-protocol-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) -c -o protocol_xisetclientpointer-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+
+protocol_xisetclientpointer-protocol-xisetclientpointer.o: protocol-xisetclientpointer.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) -MT protocol_xisetclientpointer-protocol-xisetclientpointer.o -MD -MP -MF $(DEPDIR)/protocol_xisetclientpointer-protocol-xisetclientpointer.Tpo -c -o protocol_xisetclientpointer-protocol-xisetclientpointer.o `test -f 'protocol-xisetclientpointer.c' || echo '$(srcdir)/'`protocol-xisetclientpointer.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xisetclientpointer-protocol-xisetclientpointer.Tpo $(DEPDIR)/protocol_xisetclientpointer-protocol-xisetclientpointer.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xisetclientpointer.c' object='protocol_xisetclientpointer-protocol-xisetclientpointer.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) -c -o protocol_xisetclientpointer-protocol-xisetclientpointer.o `test -f 'protocol-xisetclientpointer.c' || echo '$(srcdir)/'`protocol-xisetclientpointer.c
+
+protocol_xisetclientpointer-protocol-xisetclientpointer.obj: protocol-xisetclientpointer.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) -MT protocol_xisetclientpointer-protocol-xisetclientpointer.obj -MD -MP -MF $(DEPDIR)/protocol_xisetclientpointer-protocol-xisetclientpointer.Tpo -c -o protocol_xisetclientpointer-protocol-xisetclientpointer.obj `if test -f 'protocol-xisetclientpointer.c'; then $(CYGPATH_W) 'protocol-xisetclientpointer.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xisetclientpointer.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xisetclientpointer-protocol-xisetclientpointer.Tpo $(DEPDIR)/protocol_xisetclientpointer-protocol-xisetclientpointer.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xisetclientpointer.c' object='protocol_xisetclientpointer-protocol-xisetclientpointer.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xisetclientpointer_CFLAGS) $(CFLAGS) -c -o protocol_xisetclientpointer-protocol-xisetclientpointer.obj `if test -f 'protocol-xisetclientpointer.c'; then $(CYGPATH_W) 'protocol-xisetclientpointer.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xisetclientpointer.c'; fi`
+
+protocol_xiwarppointer-protocol-common.o: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) -MT protocol_xiwarppointer-protocol-common.o -MD -MP -MF $(DEPDIR)/protocol_xiwarppointer-protocol-common.Tpo -c -o protocol_xiwarppointer-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiwarppointer-protocol-common.Tpo $(DEPDIR)/protocol_xiwarppointer-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiwarppointer-protocol-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) -c -o protocol_xiwarppointer-protocol-common.o `test -f 'protocol-common.c' || echo '$(srcdir)/'`protocol-common.c
+
+protocol_xiwarppointer-protocol-common.obj: protocol-common.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) -MT protocol_xiwarppointer-protocol-common.obj -MD -MP -MF $(DEPDIR)/protocol_xiwarppointer-protocol-common.Tpo -c -o protocol_xiwarppointer-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiwarppointer-protocol-common.Tpo $(DEPDIR)/protocol_xiwarppointer-protocol-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-common.c' object='protocol_xiwarppointer-protocol-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) -c -o protocol_xiwarppointer-protocol-common.obj `if test -f 'protocol-common.c'; then $(CYGPATH_W) 'protocol-common.c'; else $(CYGPATH_W) '$(srcdir)/protocol-common.c'; fi`
+
+protocol_xiwarppointer-protocol-xiwarppointer.o: protocol-xiwarppointer.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) -MT protocol_xiwarppointer-protocol-xiwarppointer.o -MD -MP -MF $(DEPDIR)/protocol_xiwarppointer-protocol-xiwarppointer.Tpo -c -o protocol_xiwarppointer-protocol-xiwarppointer.o `test -f 'protocol-xiwarppointer.c' || echo '$(srcdir)/'`protocol-xiwarppointer.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiwarppointer-protocol-xiwarppointer.Tpo $(DEPDIR)/protocol_xiwarppointer-protocol-xiwarppointer.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiwarppointer.c' object='protocol_xiwarppointer-protocol-xiwarppointer.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) -c -o protocol_xiwarppointer-protocol-xiwarppointer.o `test -f 'protocol-xiwarppointer.c' || echo '$(srcdir)/'`protocol-xiwarppointer.c
+
+protocol_xiwarppointer-protocol-xiwarppointer.obj: protocol-xiwarppointer.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) -MT protocol_xiwarppointer-protocol-xiwarppointer.obj -MD -MP -MF $(DEPDIR)/protocol_xiwarppointer-protocol-xiwarppointer.Tpo -c -o protocol_xiwarppointer-protocol-xiwarppointer.obj `if test -f 'protocol-xiwarppointer.c'; then $(CYGPATH_W) 'protocol-xiwarppointer.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiwarppointer.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/protocol_xiwarppointer-protocol-xiwarppointer.Tpo $(DEPDIR)/protocol_xiwarppointer-protocol-xiwarppointer.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol-xiwarppointer.c' object='protocol_xiwarppointer-protocol-xiwarppointer.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protocol_xiwarppointer_CFLAGS) $(CFLAGS) -c -o protocol_xiwarppointer-protocol-xiwarppointer.obj `if test -f 'protocol-xiwarppointer.c'; then $(CYGPATH_W) 'protocol-xiwarppointer.c'; else $(CYGPATH_W) '$(srcdir)/protocol-xiwarppointer.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes$$std"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/xorg-server/test/xi2/protocol-common.c b/xorg-server/test/xi2/protocol-common.c
new file mode 100644
index 000000000..2d0bc3699
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-common.c
@@ -0,0 +1,169 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdint.h>
+#include "extinit.h" /* for XInputExtensionInit */
+#include <glib.h>
+
+#include "protocol-common.h"
+
+struct devices devices;
+ScreenRec screen;
+WindowRec root;
+WindowRec window;
+
+void *userdata;
+
+extern int CorePointerProc(DeviceIntPtr pDev, int what);
+extern int CoreKeyboardProc(DeviceIntPtr pDev, int what);
+
+static void fake_init_sprite(DeviceIntPtr dev)
+{
+ SpritePtr sprite;
+ sprite = dev->spriteInfo->sprite;
+
+ sprite->spriteTraceSize = 10;
+ sprite->spriteTrace = xcalloc(sprite->spriteTraceSize, sizeof(WindowPtr));
+ sprite->spriteTraceGood = 1;
+ sprite->spriteTrace[0] = &root;
+ sprite->hot.x = SPRITE_X;
+ sprite->hot.y = SPRITE_Y;
+ sprite->hotPhys.x = sprite->hot.x;
+ sprite->hotPhys.y = sprite->hot.y;
+ sprite->win = &window;
+ sprite->hotPhys.pScreen = &screen;
+ sprite->physLimits.x1 = 0;
+ sprite->physLimits.y1 = 0;
+ sprite->physLimits.x2 = screen.width;
+ sprite->physLimits.y2 = screen.height;
+}
+
+/**
+ * Create and init 2 master devices (VCP + VCK) and two slave devices, one
+ * default mouse, one default keyboard.
+ */
+struct devices init_devices(void)
+{
+ ClientRec client;
+ struct devices devices;
+
+ client = init_client(0, NULL);
+
+ AllocDevicePair(&client, "Virtual core", &devices.vcp, &devices.vck,
+ CorePointerProc, CoreKeyboardProc, TRUE);
+ inputInfo.pointer = devices.vcp;
+ inputInfo.keyboard = devices.vck;
+ ActivateDevice(devices.vcp, FALSE);
+ ActivateDevice(devices.vck, FALSE);
+ EnableDevice(devices.vcp, FALSE);
+ EnableDevice(devices.vck, FALSE);
+
+ AllocDevicePair(&client, "", &devices.mouse, &devices.kbd,
+ CorePointerProc, CoreKeyboardProc, FALSE);
+ ActivateDevice(devices.mouse, FALSE);
+ ActivateDevice(devices.kbd, FALSE);
+ EnableDevice(devices.mouse, FALSE);
+ EnableDevice(devices.kbd, FALSE);
+
+ devices.num_devices = 4;
+ devices.num_master_devices = 2;
+
+ fake_init_sprite(devices.mouse);
+ fake_init_sprite(devices.vcp);
+
+ return devices;
+}
+
+
+/* Create minimal client, with the given buffer and len as request buffer */
+ClientRec init_client(int len, void *data)
+{
+ ClientRec client = { 0 };
+
+ /* we store the privates now and reassign it after the memset. this way
+ * we can share them across multiple test runs and don't have to worry
+ * about freeing them after each test run. */
+ PrivateRec *privates = client.devPrivates;
+
+ client.index = CLIENT_INDEX;
+ client.clientAsMask = CLIENT_MASK;
+ client.sequence = CLIENT_SEQUENCE;
+ client.req_len = len;
+
+ client.requestBuffer = data;
+ client.devPrivates = privates;
+ return client;
+}
+
+void init_window(WindowPtr window, WindowPtr parent, int id)
+{
+ memset(window, 0, sizeof(window));
+
+ window->drawable.id = id;
+ if (parent)
+ {
+ window->drawable.x = 30;
+ window->drawable.y = 50;
+ window->drawable.width = 100;
+ window->drawable.height = 200;
+ }
+ window->parent = parent;
+ window->optional = xcalloc(1, sizeof(WindowOptRec));
+ g_assert(window->optional);
+}
+
+/* Needed for the screen setup, otherwise we crash during sprite initialization */
+static Bool device_cursor_init(DeviceIntPtr dev, ScreenPtr screen) { return TRUE; }
+static Bool set_cursor_pos(DeviceIntPtr dev, ScreenPtr screen, int x, int y, Bool event) { return TRUE; };
+void init_simple(void)
+{
+ screenInfo.arraySize = MAXSCREENS;
+ screenInfo.numScreens = 1;
+ screenInfo.screens[0] = &screen;
+
+ screen.myNum = 0;
+ screen.id = 100;
+ screen.width = 640;
+ screen.height = 480;
+ screen.DeviceCursorInitialize = device_cursor_init;
+ screen.SetCursorPosition = set_cursor_pos;
+
+ dixResetPrivates();
+ XInputExtensionInit();
+ init_window(&root, NULL, ROOT_WINDOW_ID);
+ init_window(&window, &root, CLIENT_WINDOW_ID);
+
+ devices = init_devices();
+}
+
+void __wrap_WriteToClient(ClientPtr client, int len, void *data)
+{
+ g_assert(reply_handler != NULL);
+
+ (*reply_handler)(client, len, data, userdata);
+}
+
diff --git a/xorg-server/test/xi2/protocol-common.h b/xorg-server/test/xi2/protocol-common.h
new file mode 100644
index 000000000..afa08780c
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-common.h
@@ -0,0 +1,153 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "exevents.h"
+
+#ifndef PROTOCOL_COMMON_H
+#define PROTOCOL_COMMON_H
+
+extern int BadDevice;
+
+/* Check default values in a reply */
+#define reply_check_defaults(rep, len, type) \
+ { \
+ g_assert((len) >= sz_x##type##Reply); \
+ g_assert((rep)->repType == X_Reply); \
+ g_assert((rep)->RepType == X_##type); \
+ g_assert((rep)->sequenceNumber == CLIENT_SEQUENCE); \
+ g_assert((rep)->length >= (sz_x##type##Reply - 32)/4); \
+ }
+
+/* initialise default values for request */
+#define request_init(req, type) \
+ { \
+ (req)->reqType = 128; /* doesn't matter */ \
+ (req)->ReqType = X_##type; \
+ (req)->length = (sz_x##type##Req >> 2); \
+ }
+
+
+/* Various defines used in the tests. Some tests may use different values
+ * than these defaults */
+/* default client index */
+#define CLIENT_INDEX 1
+/* default client mask for resources and windows */
+#define CLIENT_MASK ((CLIENT_INDEX) << CLIENTOFFSET)
+/* default client sequence number for replies */
+#define CLIENT_SEQUENCE 0x100
+/* default root window id */
+#define ROOT_WINDOW_ID 0x10
+/* default client window id */
+#define CLIENT_WINDOW_ID 0x100001
+/* invalid window ID. use for BadWindow checks. */
+#define INVALID_WINDOW_ID 0x111111
+/* initial fake sprite position */
+#define SPRITE_X 100
+#define SPRITE_Y 200
+
+
+/* Various structs used throughout the tests */
+
+
+/* The default devices struct, contains one pointer + keyboard and the
+ * matching master devices. Initialize with init_devices() if needed. */
+struct devices {
+ DeviceIntPtr vcp;
+ DeviceIntPtr vck;
+ DeviceIntPtr mouse;
+ DeviceIntPtr kbd;
+
+ int num_devices;
+ int num_master_devices;
+} devices;
+
+/**
+ * The set of default devices available in all tests if necessary.
+ */
+extern struct devices devices;
+
+/**
+ * test-specific userdata, passed into the reply handler.
+ */
+extern void *userdata;
+/**
+ * The reply handler called from WriteToClient. Set this handler if you need
+ * to check the reply values.
+ */
+void (*reply_handler)(ClientPtr client, int len, char *data, void *userdata);
+
+/**
+ * The default screen used for the windows. Initialized by init_simple().
+ */
+extern ScreenRec screen;
+/**
+ * Semi-initialized root window. initialized by init().
+ */
+extern WindowRec root;
+/**
+ * Semi-initialized top-level window. initialized by init().
+ */
+extern WindowRec window;
+
+/* various simple functions for quick setup */
+/**
+ * Initialize the above struct with default devices and return the struct.
+ * Usually not needed if you call ::init_simple.
+ */
+struct devices init_devices(void);
+/**
+ * Init a mostly zeroed out client with default values for index and mask.
+ */
+ClientRec init_client(int request_len, void *request_data);
+/**
+ * Init a mostly zeroed out window with the given window ID.
+ * Usually not needed if you call ::init_simple which sets up root and
+ * window.
+ */
+void init_window(WindowPtr window, WindowPtr parent, int id);
+/**
+ * Create a very simple setup that provides the minimum values for most
+ * tests, including a screen, the root and client window and the default
+ * device setup.
+ */
+void init_simple(void);
+
+/* Declarations for various overrides in the test files. */
+void __wrap_WriteToClient(ClientPtr client, int len, void *data);
+int __wrap_XISetEventMask(DeviceIntPtr dev, WindowPtr win, int len, unsigned char* mask);
+int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access);
+int __real_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access);
+Bool __wrap_AddResource(XID id, RESTYPE type, pointer value);
+int __wrap_dixLookupClient(ClientPtr *c, XID id, ClientPtr client, Mask access);
+int __real_dixLookupClient(ClientPtr *c, XID id, ClientPtr client, Mask access);
+
+
+#endif /* PROTOCOL_COMMON_H */
+
diff --git a/xorg-server/test/xi2/protocol-eventconvert.c b/xorg-server/test/xi2/protocol-eventconvert.c
new file mode 100644
index 000000000..f723f7436
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-eventconvert.c
@@ -0,0 +1,904 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdint.h>
+#include <glib.h>
+
+#include "inputstr.h"
+#include "eventstr.h"
+#include "eventconvert.h"
+#include "exevents.h"
+#include <X11/extensions/XI2proto.h>
+
+
+static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
+ BOOL swap)
+{
+ int i;
+ unsigned char *ptr;
+ FP3232 *value, *raw_value;
+ int nvals = 0;
+ int bits_set;
+ int len;
+
+ if (swap)
+ {
+ char n;
+
+ swaps(&out->sequenceNumber, n);
+ swapl(&out->length, n);
+ swaps(&out->evtype, n);
+ swaps(&out->deviceid, n);
+ swapl(&out->time, n);
+ swapl(&out->detail, n);
+ swaps(&out->valuators_len, n);
+ }
+
+
+ g_assert(out->type == GenericEvent);
+ g_assert(out->extension == 0); /* IReqCode defaults to 0 */
+ g_assert(out->evtype == GetXI2Type((InternalEvent*)in));
+ g_assert(out->time == in->time);
+ g_assert(out->detail == in->detail.button);
+ g_assert(out->deviceid == in->deviceid);
+ g_assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(sizeof(in->valuators.mask))));
+ g_assert(out->flags == 0); /* FIXME: we don't set the flags yet */
+
+ ptr = (unsigned char*)&out[1];
+ bits_set = 0;
+
+ for (i = 0; out->valuators_len && i < sizeof(in->valuators.mask) * 8; i++)
+ {
+ g_assert (XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i));
+ if (XIMaskIsSet(in->valuators.mask, i))
+ bits_set++;
+ }
+
+ /* length is len of valuator mask (in 4-byte units) + the number of bits
+ * set. Each bit set represents 2 8-byte values, hence the
+ * 'bits_set * 4' */
+ len = out->valuators_len + bits_set * 4;
+ g_assert(out->length == len);
+
+ nvals = 0;
+
+ for (i = 0; out->valuators_len && i < MAX_VALUATORS; i++)
+ {
+ g_assert (XIMaskIsSet(in->valuators.mask, i) == XIMaskIsSet(ptr, i));
+ if (XIMaskIsSet(in->valuators.mask, i))
+ {
+ FP3232 vi, vo;
+ value = (FP3232*)(((unsigned char*)&out[1]) + out->valuators_len * 4);
+ value += nvals;
+
+ vi.integral = in->valuators.data[i];
+ vi.frac = in->valuators.data_frac[i];
+
+ vo.integral = value->integral;
+ vo.frac = value->frac;
+ if (swap)
+ {
+ char n;
+ swapl(&vo.integral, n);
+ swapl(&vo.frac, n);
+ }
+
+ g_assert(vi.integral == vo.integral);
+ g_assert(vi.frac == vo.frac);
+
+ raw_value = value + bits_set;
+
+ vi.integral = in->valuators.data_raw[i];
+ vi.frac = in->valuators.data_raw_frac[i];
+
+ vo.integral = raw_value->integral;
+ vo.frac = raw_value->frac;
+ if (swap)
+ {
+ char n;
+ swapl(&vo.integral, n);
+ swapl(&vo.frac, n);
+ }
+
+ g_assert(vi.integral == vo.integral);
+ g_assert(vi.frac == vo.frac);
+
+ nvals++;
+ }
+ }
+}
+
+static void test_XIRawEvent(RawDeviceEvent *in)
+{
+ xXIRawEvent *out, *swapped;
+ int rc;
+
+ rc = EventToXI2((InternalEvent*)in, (xEvent**)&out);
+ g_assert(rc == Success);
+
+ test_values_XIRawEvent(in, out, FALSE);
+
+ swapped = xcalloc(1, sizeof(xEvent) + out->length * 4);
+ XI2EventSwap((xGenericEvent*)out, (xGenericEvent*)swapped);
+ test_values_XIRawEvent(in, swapped, TRUE);
+
+ xfree(out);
+ xfree(swapped);
+}
+
+static void test_convert_XIFocusEvent(void)
+{
+ xEvent *out;
+ DeviceEvent in;
+ int rc;
+
+ in.header = ET_Internal;
+ in.type = ET_Enter;
+ rc = EventToXI2((InternalEvent*)&in, &out);
+ g_assert(rc == Success);
+ g_assert(out == NULL);
+
+ in.header = ET_Internal;
+ in.type = ET_FocusIn;
+ rc = EventToXI2((InternalEvent*)&in, &out);
+ g_assert(rc == Success);
+ g_assert(out == NULL);
+
+ in.header = ET_Internal;
+ in.type = ET_FocusOut;
+ rc = EventToXI2((InternalEvent*)&in, &out);
+ g_assert(rc == BadImplementation);
+
+ in.header = ET_Internal;
+ in.type = ET_Leave;
+ rc = EventToXI2((InternalEvent*)&in, &out);
+ g_assert(rc == BadImplementation);
+}
+
+
+static void test_convert_XIRawEvent(void)
+{
+ RawDeviceEvent in;
+ int i;
+
+ memset(&in, 0, sizeof(in));
+
+ g_test_message("Testing all event types");
+ in.header = ET_Internal;
+ in.type = ET_RawMotion;
+ test_XIRawEvent(&in);
+
+ in.header = ET_Internal;
+ in.type = ET_RawKeyPress;
+ test_XIRawEvent(&in);
+
+ in.header = ET_Internal;
+ in.type = ET_RawKeyRelease;
+ test_XIRawEvent(&in);
+
+ in.header = ET_Internal;
+ in.type = ET_RawButtonPress;
+ test_XIRawEvent(&in);
+
+ in.header = ET_Internal;
+ in.type = ET_RawButtonRelease;
+ test_XIRawEvent(&in);
+
+ g_test_message("Testing details and other fields");
+ in.detail.button = 1L;
+ test_XIRawEvent(&in);
+ in.detail.button = 1L << 8;
+ test_XIRawEvent(&in);
+ in.detail.button = 1L << 16;
+ test_XIRawEvent(&in);
+ in.detail.button = 1L << 24;
+ test_XIRawEvent(&in);
+ in.detail.button = ~0L;
+ test_XIRawEvent(&in);
+
+ in.detail.button = 0;
+
+ in.time = 1L;
+ test_XIRawEvent(&in);
+ in.time = 1L << 8;
+ test_XIRawEvent(&in);
+ in.time = 1L << 16;
+ test_XIRawEvent(&in);
+ in.time = 1L << 24;
+ test_XIRawEvent(&in);
+ in.time = ~0L;
+ test_XIRawEvent(&in);
+
+ in.deviceid = 1;
+ test_XIRawEvent(&in);
+ in.deviceid = 1 << 8;
+ test_XIRawEvent(&in);
+ in.deviceid = ~0 & 0xFF;
+ test_XIRawEvent(&in);
+
+ g_test_message("Testing valuator masks");
+ for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ {
+ XISetMask(in.valuators.mask, i);
+ test_XIRawEvent(&in);
+ XIClearMask(in.valuators.mask, i);
+ }
+
+ for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ {
+ XISetMask(in.valuators.mask, i);
+
+ in.valuators.data[i] = i;
+ in.valuators.data_raw[i] = i + 10;
+ in.valuators.data_frac[i] = i + 20;
+ in.valuators.data_raw_frac[i] = i + 30;
+ test_XIRawEvent(&in);
+ XIClearMask(in.valuators.mask, i);
+ }
+
+ for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ {
+ XISetMask(in.valuators.mask, i);
+ test_XIRawEvent(&in);
+ }
+}
+
+static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
+ BOOL swap)
+{
+ int buttons, valuators;
+ int i;
+ unsigned char *ptr;
+ FP3232 *values;
+
+ if (swap) {
+ char n;
+
+ swaps(&out->sequenceNumber, n);
+ swapl(&out->length, n);
+ swaps(&out->evtype, n);
+ swaps(&out->deviceid, n);
+ swaps(&out->sourceid, n);
+ swapl(&out->time, n);
+ swapl(&out->detail, n);
+ swapl(&out->root, n);
+ swapl(&out->event, n);
+ swapl(&out->child, n);
+ swapl(&out->root_x, n);
+ swapl(&out->root_y, n);
+ swapl(&out->event_x, n);
+ swapl(&out->event_y, n);
+ swaps(&out->buttons_len, n);
+ swaps(&out->valuators_len, n);
+ swapl(&out->mods.base_mods, n);
+ swapl(&out->mods.latched_mods, n);
+ swapl(&out->mods.locked_mods, n);
+ swapl(&out->mods.effective_mods, n);
+ }
+
+ g_assert(out->extension == 0); /* IReqCode defaults to 0 */
+ g_assert(out->evtype == GetXI2Type((InternalEvent*)in));
+ g_assert(out->time == in->time);
+ g_assert(out->detail == in->detail.button);
+ g_assert(out->length >= 12);
+
+ g_assert(out->deviceid == in->deviceid);
+ g_assert(out->sourceid == in->sourceid);
+
+ g_assert(out->flags == 0); /* FIXME: we don't set the flags yet */
+
+ g_assert(out->root == in->root);
+ g_assert(out->event == None); /* set in FixUpEventFromWindow */
+ g_assert(out->child == None); /* set in FixUpEventFromWindow */
+
+ g_assert(out->mods.base_mods == in->mods.base);
+ g_assert(out->mods.latched_mods == in->mods.latched);
+ g_assert(out->mods.locked_mods == in->mods.locked);
+ g_assert(out->mods.effective_mods == in->mods.effective);
+
+ g_assert(out->group.base_group == in->group.base);
+ g_assert(out->group.latched_group == in->group.latched);
+ g_assert(out->group.locked_group == in->group.locked);
+ g_assert(out->group.effective_group == in->group.effective);
+
+ g_assert(out->event_x == 0); /* set in FixUpEventFromWindow */
+ g_assert(out->event_y == 0); /* set in FixUpEventFromWindow */
+
+ g_assert(out->root_x == FP1616(in->root_x, in->root_x_frac));
+ g_assert(out->root_y == FP1616(in->root_y, in->root_y_frac));
+
+ buttons = 0;
+ for (i = 0; i < bits_to_bytes(sizeof(in->buttons)); i++)
+ {
+ if (XIMaskIsSet(in->buttons, i))
+ {
+ g_assert(out->buttons_len >= bytes_to_int32(bits_to_bytes(i)));
+ buttons++;
+ }
+ }
+
+ ptr = (unsigned char*)&out[1];
+ for (i = 0; i < sizeof(in->buttons) * 8; i++)
+ g_assert(XIMaskIsSet(in->buttons, i) == XIMaskIsSet(ptr, i));
+
+
+ valuators = 0;
+ for (i = 0; i < sizeof(in->valuators.mask) * 8; i++)
+ if (XIMaskIsSet(in->valuators.mask, i))
+ valuators++;
+
+ g_assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(valuators)));
+
+ ptr += out->buttons_len * 4;
+ values = (FP3232*)(ptr + out->valuators_len * 4);
+ for (i = 0; i < sizeof(in->valuators.mask) * 8 ||
+ i < (out->valuators_len * 4) * 8; i++)
+ {
+ if (i > sizeof(in->valuators.mask) * 8)
+ g_assert(!XIMaskIsSet(ptr, i));
+ else if (i > out->valuators_len * 4 * 8)
+ g_assert(!XIMaskIsSet(in->valuators.mask, i));
+ else {
+ g_assert(XIMaskIsSet(in->valuators.mask, i) ==
+ XIMaskIsSet(ptr, i));
+
+ if (XIMaskIsSet(ptr, i))
+ {
+ FP3232 vi, vo;
+
+ vi.integral = in->valuators.data[i];
+ vi.frac = in->valuators.data_frac[i];
+
+ vo = *values;
+
+ if (swap)
+ {
+ char n;
+ swapl(&vo.integral, n);
+ swapl(&vo.frac, n);
+ }
+
+
+ g_assert(vi.integral == vo.integral);
+ g_assert(vi.frac == vo.frac);
+ values++;
+ }
+ }
+ }
+}
+
+static void test_XIDeviceEvent(DeviceEvent *in)
+{
+ xXIDeviceEvent *out, *swapped;
+ int rc;
+
+ rc = EventToXI2((InternalEvent*)in, (xEvent**)&out);
+ g_assert(rc == Success);
+
+ test_values_XIDeviceEvent(in, out, FALSE);
+
+ swapped = xcalloc(1, sizeof(xEvent) + out->length * 4);
+ XI2EventSwap((xGenericEvent*)out, (xGenericEvent*)swapped);
+ test_values_XIDeviceEvent(in, swapped, TRUE);
+
+ xfree(out);
+ xfree(swapped);
+}
+
+static void test_convert_XIDeviceEvent(void)
+{
+ DeviceEvent in;
+ int i;
+
+ memset(&in, 0, sizeof(in));
+
+ g_test_message("Testing simple field values");
+ in.header = ET_Internal;
+ in.type = ET_Motion;
+ in.length = sizeof(DeviceEvent);
+ in.time = 0;
+ in.deviceid = 1;
+ in.sourceid = 2;
+ in.root = 3;
+ in.root_x = 4;
+ in.root_x_frac = 5;
+ in.root_y = 6;
+ in.root_y_frac = 7;
+ in.detail.button = 8;
+ in.mods.base = 9;
+ in.mods.latched = 10;
+ in.mods.locked = 11;
+ in.mods.effective = 11;
+ in.group.base = 12;
+ in.group.latched = 13;
+ in.group.locked = 14;
+ in.group.effective = 15;
+
+ test_XIDeviceEvent(&in);
+
+ g_test_message("Testing field ranges");
+ /* 32 bit */
+ in.detail.button = 1L;
+ test_XIDeviceEvent(&in);
+ in.detail.button = 1L << 8;
+ test_XIDeviceEvent(&in);
+ in.detail.button = 1L << 16;
+ test_XIDeviceEvent(&in);
+ in.detail.button = 1L << 24;
+ test_XIDeviceEvent(&in);
+ in.detail.button = ~0L;
+ test_XIDeviceEvent(&in);
+
+ /* 32 bit */
+ in.time = 1L;
+ test_XIDeviceEvent(&in);
+ in.time = 1L << 8;
+ test_XIDeviceEvent(&in);
+ in.time = 1L << 16;
+ test_XIDeviceEvent(&in);
+ in.time = 1L << 24;
+ test_XIDeviceEvent(&in);
+ in.time = ~0L;
+ test_XIDeviceEvent(&in);
+
+ /* 16 bit */
+ in.deviceid = 1;
+ test_XIDeviceEvent(&in);
+ in.deviceid = 1 << 8;
+ test_XIDeviceEvent(&in);
+ in.deviceid = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ /* 16 bit */
+ in.sourceid = 1;
+ test_XIDeviceEvent(&in);
+ in.deviceid = 1 << 8;
+ test_XIDeviceEvent(&in);
+ in.deviceid = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ /* 32 bit */
+ in.root = 1L;
+ test_XIDeviceEvent(&in);
+ in.root = 1L << 8;
+ test_XIDeviceEvent(&in);
+ in.root = 1L << 16;
+ test_XIDeviceEvent(&in);
+ in.root = 1L << 24;
+ test_XIDeviceEvent(&in);
+ in.root = ~0L;
+ test_XIDeviceEvent(&in);
+
+ /* 16 bit */
+ in.root_x = 1;
+ test_XIDeviceEvent(&in);
+ in.root_x = 1 << 8;
+ test_XIDeviceEvent(&in);
+ in.root_x = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ in.root_x_frac = 1;
+ test_XIDeviceEvent(&in);
+ in.root_x_frac = 1 << 8;
+ test_XIDeviceEvent(&in);
+ in.root_x_frac = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ in.root_y = 1;
+ test_XIDeviceEvent(&in);
+ in.root_y = 1 << 8;
+ test_XIDeviceEvent(&in);
+ in.root_y = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ in.root_y_frac = 1;
+ test_XIDeviceEvent(&in);
+ in.root_y_frac = 1 << 8;
+ test_XIDeviceEvent(&in);
+ in.root_y_frac = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ /* 32 bit */
+ in.mods.base = 1L;
+ test_XIDeviceEvent(&in);
+ in.mods.base = 1L << 8;
+ test_XIDeviceEvent(&in);
+ in.mods.base = 1L << 16;
+ test_XIDeviceEvent(&in);
+ in.mods.base = 1L << 24;
+ test_XIDeviceEvent(&in);
+ in.mods.base = ~0L;
+ test_XIDeviceEvent(&in);
+
+ in.mods.latched = 1L;
+ test_XIDeviceEvent(&in);
+ in.mods.latched = 1L << 8;
+ test_XIDeviceEvent(&in);
+ in.mods.latched = 1L << 16;
+ test_XIDeviceEvent(&in);
+ in.mods.latched = 1L << 24;
+ test_XIDeviceEvent(&in);
+ in.mods.latched = ~0L;
+ test_XIDeviceEvent(&in);
+
+ in.mods.locked = 1L;
+ test_XIDeviceEvent(&in);
+ in.mods.locked = 1L << 8;
+ test_XIDeviceEvent(&in);
+ in.mods.locked = 1L << 16;
+ test_XIDeviceEvent(&in);
+ in.mods.locked = 1L << 24;
+ test_XIDeviceEvent(&in);
+ in.mods.locked = ~0L;
+ test_XIDeviceEvent(&in);
+
+ in.mods.effective = 1L;
+ test_XIDeviceEvent(&in);
+ in.mods.effective = 1L << 8;
+ test_XIDeviceEvent(&in);
+ in.mods.effective = 1L << 16;
+ test_XIDeviceEvent(&in);
+ in.mods.effective = 1L << 24;
+ test_XIDeviceEvent(&in);
+ in.mods.effective = ~0L;
+ test_XIDeviceEvent(&in);
+
+ /* 8 bit */
+ in.group.base = 1;
+ test_XIDeviceEvent(&in);
+ in.group.base = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ in.group.latched = 1;
+ test_XIDeviceEvent(&in);
+ in.group.latched = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ in.group.locked = 1;
+ test_XIDeviceEvent(&in);
+ in.group.locked = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ in.mods.effective = 1;
+ test_XIDeviceEvent(&in);
+ in.mods.effective = ~0 & 0xFF;
+ test_XIDeviceEvent(&in);
+
+ g_test_message("Testing button masks");
+ for (i = 0; i < sizeof(in.buttons) * 8; i++)
+ {
+ XISetMask(in.buttons, i);
+ test_XIDeviceEvent(&in);
+ XIClearMask(in.buttons, i);
+ }
+
+ for (i = 0; i < sizeof(in.buttons) * 8; i++)
+ {
+ XISetMask(in.buttons, i);
+ test_XIDeviceEvent(&in);
+ }
+
+ g_test_message("Testing valuator masks");
+ for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ {
+ XISetMask(in.valuators.mask, i);
+ test_XIDeviceEvent(&in);
+ XIClearMask(in.valuators.mask, i);
+ }
+
+ for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ {
+ XISetMask(in.valuators.mask, i);
+
+ in.valuators.data[i] = i;
+ in.valuators.data_frac[i] = i + 20;
+ test_XIDeviceEvent(&in);
+ XIClearMask(in.valuators.mask, i);
+ }
+
+ for (i = 0; i < sizeof(in.valuators.mask) * 8; i++)
+ {
+ XISetMask(in.valuators.mask, i);
+ test_XIDeviceEvent(&in);
+ }
+}
+
+static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
+ xXIDeviceChangedEvent *out,
+ BOOL swap)
+{
+ int i, j;
+ unsigned char *ptr;
+
+ if (swap)
+ {
+ char n;
+
+ swaps(&out->sequenceNumber, n);
+ swapl(&out->length, n);
+ swaps(&out->evtype, n);
+ swaps(&out->deviceid, n);
+ swaps(&out->sourceid, n);
+ swapl(&out->time, n);
+ swaps(&out->num_classes, n);
+ }
+
+ g_assert(out->type == GenericEvent);
+ g_assert(out->extension == 0); /* IReqCode defaults to 0 */
+ g_assert(out->evtype == GetXI2Type((InternalEvent*)in));
+ g_assert(out->time == in->time);
+ g_assert(out->deviceid == in->deviceid);
+ g_assert(out->sourceid == in->sourceid);
+
+ ptr = (unsigned char*)&out[1];
+ for (i = 0; i < out->num_classes; i++)
+ {
+ xXIAnyInfo* any = (xXIAnyInfo*)ptr;
+
+ if (swap)
+ {
+ char n;
+ swaps(&any->length, n);
+ swaps(&any->type, n);
+ swaps(&any->sourceid, n);
+ }
+
+ switch(any->type)
+ {
+ case XIButtonClass:
+ {
+ xXIButtonInfo *b = (xXIButtonInfo*)any;
+ Atom *names;
+
+ if (swap)
+ {
+ char n;
+ swaps(&b->num_buttons, n);
+ }
+
+ g_assert(b->length ==
+ bytes_to_int32(sizeof(xXIButtonInfo)) +
+ bytes_to_int32(bits_to_bytes(b->num_buttons)) +
+ b->num_buttons);
+ g_assert(b->num_buttons == in->buttons.num_buttons);
+
+ names = (Atom*)((char*)&b[1] +
+ pad_to_int32(bits_to_bytes(b->num_buttons)));
+ for (j = 0; j < b->num_buttons; j++)
+ {
+ if (swap)
+ {
+ char n;
+ swapl(&names[j], n);
+ }
+ g_assert(names[j] == in->buttons.names[j]);
+ }
+ }
+ break;
+ case XIKeyClass:
+ {
+ xXIKeyInfo *k = (xXIKeyInfo*)any;
+ uint32_t *kc;
+
+ if (swap)
+ {
+ char n;
+ swaps(&k->num_keycodes, n);
+ }
+
+ g_assert(k->length ==
+ bytes_to_int32(sizeof(xXIKeyInfo)) +
+ k->num_keycodes);
+ g_assert(k->num_keycodes == in->keys.max_keycode -
+ in->keys.min_keycode + 1);
+
+ kc = (uint32_t*)&k[1];
+ for (j = 0; j < k->num_keycodes; j++)
+ {
+ if (swap)
+ {
+ char n;
+ swapl(&kc[j], n);
+ }
+ g_assert(kc[j] >= in->keys.min_keycode);
+ g_assert(kc[j] <= in->keys.max_keycode);
+ }
+ }
+ break;
+ case XIValuatorClass:
+ {
+ xXIValuatorInfo *v = (xXIValuatorInfo*)any;
+ g_assert(v->length ==
+ bytes_to_int32(sizeof(xXIValuatorInfo)));
+
+ }
+ break;
+ }
+
+ ptr += any->length * 4;
+ }
+
+}
+
+static void test_XIDeviceChangedEvent(DeviceChangedEvent *in)
+{
+ xXIDeviceChangedEvent *out, *swapped;
+ int rc;
+
+ rc = EventToXI2((InternalEvent*)in, (xEvent**)&out);
+ g_assert(rc == Success);
+
+ test_values_XIDeviceChangedEvent(in, out, FALSE);
+
+ swapped = xcalloc(1, sizeof(xEvent) + out->length * 4);
+ XI2EventSwap((xGenericEvent*)out, (xGenericEvent*)swapped);
+ test_values_XIDeviceChangedEvent(in, swapped, TRUE);
+
+ xfree(out);
+ xfree(swapped);
+}
+
+static void test_convert_XIDeviceChangedEvent(void)
+{
+ DeviceChangedEvent in;
+ int i;
+
+ g_test_message("Testing simple field values");
+ memset(&in, 0, sizeof(in));
+ in.header = ET_Internal;
+ in.type = ET_DeviceChanged;
+ in.length = sizeof(DeviceChangedEvent);
+ in.time = 0;
+ in.deviceid = 1;
+ in.sourceid = 2;
+ in.masterid = 3;
+ in.num_valuators = 4;
+ in.flags = DEVCHANGE_SLAVE_SWITCH | DEVCHANGE_POINTER_EVENT | DEVCHANGE_KEYBOARD_EVENT;
+
+ for (i = 0; i < MAX_BUTTONS; i++)
+ in.buttons.names[i] = i + 10;
+
+ in.keys.min_keycode = 8;
+ in.keys.max_keycode = 255;
+
+ test_XIDeviceChangedEvent(&in);
+
+ in.time = 1L;
+ test_XIDeviceChangedEvent(&in);
+ in.time = 1L << 8;
+ test_XIDeviceChangedEvent(&in);
+ in.time = 1L << 16;
+ test_XIDeviceChangedEvent(&in);
+ in.time = 1L << 24;
+ test_XIDeviceChangedEvent(&in);
+ in.time = ~0L;
+ test_XIDeviceChangedEvent(&in);
+
+ in.deviceid = 1L;
+ test_XIDeviceChangedEvent(&in);
+ in.deviceid = 1L << 8;
+ test_XIDeviceChangedEvent(&in);
+ in.deviceid = ~0 & 0xFFFF;
+ test_XIDeviceChangedEvent(&in);
+
+ in.sourceid = 1L;
+ test_XIDeviceChangedEvent(&in);
+ in.sourceid = 1L << 8;
+ test_XIDeviceChangedEvent(&in);
+ in.sourceid = ~0 & 0xFFFF;
+ test_XIDeviceChangedEvent(&in);
+
+ in.masterid = 1L;
+ test_XIDeviceChangedEvent(&in);
+ in.masterid = 1L << 8;
+ test_XIDeviceChangedEvent(&in);
+ in.masterid = ~0 & 0xFFFF;
+ test_XIDeviceChangedEvent(&in);
+
+ in.buttons.num_buttons = 0;
+ test_XIDeviceChangedEvent(&in);
+
+ in.buttons.num_buttons = 1;
+ test_XIDeviceChangedEvent(&in);
+
+ in.buttons.num_buttons = MAX_BUTTONS;
+ test_XIDeviceChangedEvent(&in);
+
+ in.keys.min_keycode = 0;
+ in.keys.max_keycode = 0;
+ test_XIDeviceChangedEvent(&in);
+
+ in.keys.max_keycode = 1 << 8;
+ test_XIDeviceChangedEvent(&in);
+
+ in.keys.max_keycode = 0xFFFD; /* highest range, above that the length
+ field gives up */
+ test_XIDeviceChangedEvent(&in);
+
+ in.keys.min_keycode = 1 << 8;
+ in.keys.max_keycode = 1 << 8;
+ test_XIDeviceChangedEvent(&in);
+
+ in.keys.min_keycode = 1 << 8;
+ in.keys.max_keycode = 0;
+ test_XIDeviceChangedEvent(&in);
+
+ in.num_valuators = 0;
+ test_XIDeviceChangedEvent(&in);
+
+ in.num_valuators = 1;
+ test_XIDeviceChangedEvent(&in);
+
+ in.num_valuators = MAX_VALUATORS;
+ test_XIDeviceChangedEvent(&in);
+
+ for (i = 0; i < MAX_VALUATORS; i++)
+ {
+ in.valuators[i].min = 0;
+ in.valuators[i].max = 0;
+ test_XIDeviceChangedEvent(&in);
+
+ in.valuators[i].max = 1 << 8;
+ test_XIDeviceChangedEvent(&in);
+ in.valuators[i].max = 1 << 16;
+ test_XIDeviceChangedEvent(&in);
+ in.valuators[i].max = 1 << 24;
+ test_XIDeviceChangedEvent(&in);
+ in.valuators[i].max = abs(~0);
+ test_XIDeviceChangedEvent(&in);
+
+ in.valuators[i].resolution = 1 << 8;
+ test_XIDeviceChangedEvent(&in);
+ in.valuators[i].resolution = 1 << 16;
+ test_XIDeviceChangedEvent(&in);
+ in.valuators[i].resolution = 1 << 24;
+ test_XIDeviceChangedEvent(&in);
+ in.valuators[i].resolution = abs(~0);
+ test_XIDeviceChangedEvent(&in);
+
+ in.valuators[i].name = i;
+ test_XIDeviceChangedEvent(&in);
+
+ in.valuators[i].mode = Relative;
+ test_XIDeviceChangedEvent(&in);
+
+ in.valuators[i].mode = Absolute;
+ test_XIDeviceChangedEvent(&in);
+ }
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ g_test_add_func("/xi2/eventconvert/XIRawEvent", test_convert_XIRawEvent);
+ g_test_add_func("/xi2/eventconvert/XIFocusEvent", test_convert_XIFocusEvent);
+ g_test_add_func("/xi2/eventconvert/XIDeviceEvent", test_convert_XIDeviceEvent);
+ g_test_add_func("/xi2/eventconvert/XIDeviceChangedEvent", test_convert_XIDeviceChangedEvent);
+
+ return g_test_run();
+}
diff --git a/xorg-server/test/xi2/protocol-xigetclientpointer.c b/xorg-server/test/xi2/protocol-xigetclientpointer.c
new file mode 100644
index 000000000..6b4d04957
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-xigetclientpointer.c
@@ -0,0 +1,167 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+/*
+ * Protocol testing for XIGetClientPointer request.
+ */
+#include <stdint.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include "inputstr.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "xigetclientpointer.h"
+#include "exevents.h"
+
+#include "protocol-common.h"
+#include <glib.h>
+
+struct {
+ int cp_is_set;
+ DeviceIntPtr dev;
+ int win;
+} test_data;
+
+static ClientRec client_window;
+static ClientRec client_request;
+
+int __wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access)
+{
+ if (rid == ROOT_WINDOW_ID)
+ return BadWindow;
+
+ if (rid == CLIENT_WINDOW_ID)
+ {
+ *pClient = &client_window;
+ return Success;
+ }
+
+ return __real_dixLookupClient(pClient, rid, client, access);
+}
+
+
+static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void *userdata)
+{
+ xXIGetClientPointerReply *rep = (xXIGetClientPointerReply*)data;
+
+ if (client->swapped)
+ {
+ char n;
+ swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber, n);
+ swaps(&rep->deviceid, n);
+ }
+
+ reply_check_defaults(rep, len, XIGetClientPointer);
+
+ g_assert(rep->set == test_data.cp_is_set);
+ if (rep->set)
+ g_assert(rep->deviceid == test_data.dev->id);
+}
+
+static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq* req, int error)
+{
+ char n;
+ int rc;
+
+ test_data.win = req->win;
+
+ rc = ProcXIGetClientPointer(&client_request);
+ g_assert(rc == error);
+
+ if (rc == BadWindow)
+ g_assert(client_request.errorValue == req->win);
+
+ client_request.swapped = TRUE;
+ swapl(&req->win, n);
+ swaps(&req->length, n);
+ rc = SProcXIGetClientPointer(&client_request);
+ g_assert(rc == error);
+
+ if (rc == BadWindow)
+ g_assert(client_request.errorValue == req->win);
+
+}
+
+static void test_XIGetClientPointer(void)
+{
+ xXIGetClientPointerReq request;
+
+ request_init(&request, XIGetClientPointer);
+
+ request.win = CLIENT_WINDOW_ID;
+
+
+ reply_handler = reply_XIGetClientPointer;
+
+ client_request = init_client(request.length, &request);
+
+ g_test_message("Testing invalid window");
+ request.win = INVALID_WINDOW_ID;
+ request_XIGetClientPointer(&client_request, &request, BadWindow);
+
+ test_data.cp_is_set = FALSE;
+
+ g_test_message("Testing window None, unset ClientPointer.");
+ request.win = None;
+ request_XIGetClientPointer(&client_request, &request, Success);
+
+ g_test_message("Testing valid window, unset ClientPointer.");
+ request.win = CLIENT_WINDOW_ID;
+ request_XIGetClientPointer(&client_request, &request, Success);
+
+ g_test_message("Testing valid window, set ClientPointer.");
+ client_window.clientPtr = devices.vcp;
+ test_data.dev = devices.vcp;
+ test_data.cp_is_set = TRUE;
+ request.win = CLIENT_WINDOW_ID;
+ request_XIGetClientPointer(&client_request, &request, Success);
+
+ client_window.clientPtr = NULL;
+
+ g_test_message("Testing window None, set ClientPointer.");
+ client_request.clientPtr = devices.vcp;
+ test_data.dev = devices.vcp;
+ test_data.cp_is_set = TRUE;
+ request.win = None;
+ request_XIGetClientPointer(&client_request, &request, Success);
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ init_simple();
+ client_window = init_client(0, NULL);
+
+
+ g_test_add_func("/xi2/protocol/XIGetClientPointer", test_XIGetClientPointer);
+
+ return g_test_run();
+}
diff --git a/xorg-server/test/xi2/protocol-xigetselectedevents.c b/xorg-server/test/xi2/protocol-xigetselectedevents.c
new file mode 100644
index 000000000..97aae159f
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-xigetselectedevents.c
@@ -0,0 +1,241 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+/*
+ * Protocol testing for XIGetSelectedEvents request.
+ *
+ * Tests include:
+ * BadWindow on wrong window.
+ * Zero-length masks if no masks are set.
+ * Valid masks for valid devices.
+ * Masks set on non-existent devices are not returned.
+ *
+ * Note that this test is not connected to the XISelectEvents request.
+ */
+#include <stdint.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include "inputstr.h"
+#include "windowstr.h"
+#include "extinit.h" /* for XInputExtensionInit */
+#include "scrnintstr.h"
+#include "xiselectev.h"
+#include "exevents.h"
+
+#include "protocol-common.h"
+#include <glib.h>
+
+static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, void *userdata);
+static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data, void *userdata);
+
+
+struct {
+ int num_masks_expected;
+ unsigned char mask[MAXDEVICES][XI2LASTEVENT]; /* intentionally bigger */
+ int mask_len;
+} test_data;
+
+/* dixLookupWindow requires a lot of setup not necessary for this test.
+ * Simple wrapper that returns either one of the fake root window or the
+ * fake client window. If the requested ID is neither of those wanted,
+ * return whatever the real dixLookupWindow does.
+ */
+int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
+{
+ if (id == root.drawable.id)
+ {
+ *win = &root;
+ return Success;
+ } else if (id == window.drawable.id)
+ {
+ *win = &window;
+ return Success;
+ }
+
+ return __real_dixLookupWindow(win, id, client, access);
+}
+
+/* AddResource is called from XISetSEventMask, we don't need this */
+Bool __wrap_AddResource(XID id, RESTYPE type, pointer value)
+{
+ return TRUE;
+}
+
+static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, void *userdata)
+{
+ xXIGetSelectedEventsReply *rep = (xXIGetSelectedEventsReply*)data;
+
+ if (client->swapped)
+ {
+ char n;
+ swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber, n);
+ swaps(&rep->num_masks, n);
+ }
+
+ reply_check_defaults(rep, len, XIGetSelectedEvents);
+
+ g_assert(rep->num_masks == test_data.num_masks_expected);
+
+ reply_handler = reply_XIGetSelectedEvents_data;
+}
+
+static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data, void *userdata)
+{
+ int i;
+ xXIEventMask *mask;
+ unsigned char *bitmask;
+
+ mask = (xXIEventMask*)data;
+ for (i = 0; i < test_data.num_masks_expected; i++)
+ {
+ if (client->swapped)
+ {
+ char n;
+ swaps(&mask->deviceid, n);
+ swaps(&mask->mask_len, n);
+ }
+
+ g_assert(mask->deviceid < 6);
+ g_assert(mask->mask_len <= (((XI2LASTEVENT + 8)/8) + 3)/4) ;
+
+ bitmask = (unsigned char*)&mask[1];
+ g_assert(memcmp(bitmask,
+ test_data.mask[mask->deviceid],
+ mask->mask_len * 4) == 0);
+
+ mask = (xXIEventMask*)((char*)mask + mask->mask_len * 4 + sizeof(xXIEventMask));
+ }
+
+
+}
+
+static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error)
+{
+ char n;
+ int rc;
+ ClientRec client;
+ client = init_client(req->length, req);
+
+ reply_handler = reply_XIGetSelectedEvents;
+
+ rc = ProcXIGetSelectedEvents(&client);
+ g_assert(rc == error);
+
+ reply_handler = reply_XIGetSelectedEvents;
+ client.swapped = TRUE;
+ swapl(&req->win, n);
+ swaps(&req->length, n);
+ rc = SProcXIGetSelectedEvents(&client);
+ g_assert(rc == error);
+}
+
+static void test_XIGetSelectedEvents(void)
+{
+ int i, j;
+ xXIGetSelectedEventsReq request;
+ ClientRec client = init_client(0, NULL);
+ unsigned char *mask;
+ DeviceIntRec dev;
+
+ request_init(&request, XIGetSelectedEvents);
+
+ g_test_message("Testing for BadWindow on invalid window.");
+ request.win = None;
+ request_XIGetSelectedEvents(&request, BadWindow);
+
+ g_test_message("Testing for zero-length (unset) masks.");
+ /* No masks set yet */
+ test_data.num_masks_expected = 0;
+ request.win = ROOT_WINDOW_ID;
+ request_XIGetSelectedEvents(&request, Success);
+
+ request.win = CLIENT_WINDOW_ID;
+ request_XIGetSelectedEvents(&request, Success);
+
+ memset(test_data.mask, 0,
+ sizeof(test_data.mask));
+
+ g_test_message("Testing for valid masks");
+ memset(&dev, 0, sizeof(dev)); /* dev->id is enough for XISetEventMask */
+ request.win = ROOT_WINDOW_ID;
+
+ /* devices 6 - MAXDEVICES don't exist, they mustn't be included in the
+ * reply even if a mask is set */
+ for (j = 0; j < MAXDEVICES; j++)
+ {
+ test_data.num_masks_expected = min(j + 1, devices.num_devices + 2);
+ dev.id = j;
+ mask = test_data.mask[j];
+ /* bits one-by-one */
+ for (i = 0; i < XI2LASTEVENT; i++)
+ {
+ SetBit(mask, i);
+ XISetEventMask(&dev, &root, &client, (i + 8)/8, mask);
+ request_XIGetSelectedEvents(&request, Success);
+ ClearBit(mask, i);
+ }
+
+ /* all valid mask bits */
+ for (i = 0; i < XI2LASTEVENT; i++)
+ {
+ SetBit(mask, i);
+ XISetEventMask(&dev, &root, &client, (i + 8)/8, mask);
+ request_XIGetSelectedEvents(&request, Success);
+ }
+ }
+
+ g_test_message("Testing removing all masks");
+ /* Unset all masks one-by-one */
+ for (j = MAXDEVICES - 1; j >= 0; j--)
+ {
+ if (j < devices.num_devices + 2)
+ test_data.num_masks_expected--;
+
+ mask = test_data.mask[j];
+ memset(mask, 0, XI2LASTEVENT);
+
+ dev.id = j;
+ XISetEventMask(&dev, &root, &client, 0, NULL);
+
+ request_XIGetSelectedEvents(&request, Success);
+ }
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ init_simple();
+
+ g_test_add_func("/xi2/protocol/XIGetSelectedEvents", test_XIGetSelectedEvents);
+
+ return g_test_run();
+}
+
diff --git a/xorg-server/test/xi2/protocol-xiquerydevice.c b/xorg-server/test/xi2/protocol-xiquerydevice.c
new file mode 100644
index 000000000..508fc4dfb
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-xiquerydevice.c
@@ -0,0 +1,316 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdint.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include <X11/Xatom.h>
+#include "inputstr.h"
+#include "extinit.h"
+#include "scrnintstr.h"
+#include "xkbsrv.h"
+
+#include "xiquerydevice.h"
+
+#include "protocol-common.h"
+#include <glib.h>
+/*
+ * Protocol testing for XIQueryDevice request and reply.
+ *
+ * Test approach:
+ * Wrap WriteToClient to intercept server's reply. ProcXIQueryDevice returns
+ * data in two batches, once for the request, once for the trailing data
+ * with the device information.
+ * Repeatedly test with varying deviceids and check against data in reply.
+ */
+
+struct test_data {
+ int which_device;
+ int num_devices_in_reply;
+};
+
+static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata);
+static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *userdata);
+
+/* reply handling for the first bytes that constitute the reply */
+static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *userdata)
+{
+ xXIQueryDeviceReply *rep = (xXIQueryDeviceReply*)data;
+ struct test_data *querydata = (struct test_data*)userdata;
+
+ if (client->swapped)
+ {
+ char n;
+ swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber, n);
+ swaps(&rep->num_devices, n);
+ }
+
+ reply_check_defaults(rep, len, XIQueryDevice);
+
+ if (querydata->which_device == XIAllDevices)
+ g_assert(rep->num_devices == devices.num_devices);
+ else if (querydata->which_device == XIAllMasterDevices)
+ g_assert(rep->num_devices == devices.num_master_devices);
+ else
+ g_assert(rep->num_devices == 1);
+
+ querydata->num_devices_in_reply = rep->num_devices;
+ reply_handler = reply_XIQueryDevice_data;
+}
+
+/* reply handling for the trailing bytes that constitute the device info */
+static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata)
+{
+ char n;
+ int i, j;
+ struct test_data *querydata = (struct test_data*)userdata;
+
+ DeviceIntPtr dev;
+ xXIDeviceInfo *info = (xXIDeviceInfo*)data;
+ xXIAnyInfo *any;
+
+ for (i = 0; i < querydata->num_devices_in_reply; i++)
+ {
+ if (client->swapped)
+ {
+ swaps(&info->deviceid, n);
+ swaps(&info->attachment, n);
+ swaps(&info->use, n);
+ swaps(&info->num_classes, n);
+ swaps(&info->name_len, n);
+ }
+
+ if (querydata->which_device > XIAllMasterDevices)
+ g_assert(info->deviceid == querydata->which_device);
+
+ g_assert(info->deviceid >= 2); /* 0 and 1 is reserved */
+
+
+ switch(info->deviceid)
+ {
+ case 2: /* VCP */
+ dev = devices.vcp;
+ g_assert(info->use == XIMasterPointer);
+ g_assert(info->attachment == devices.vck->id);
+ g_assert(info->num_classes == 3); /* 2 axes + button */
+ break;
+ case 3: /* VCK */
+ dev = devices.vck;
+ g_assert(info->use == XIMasterKeyboard);
+ g_assert(info->attachment == devices.vcp->id);
+ g_assert(info->num_classes == 1);
+ break;
+ case 4: /* mouse */
+ dev = devices.mouse;
+ g_assert(info->use == XISlavePointer);
+ g_assert(info->attachment == devices.vcp->id);
+ g_assert(info->num_classes == 3); /* 2 axes + button */
+ break;
+ case 5: /* keyboard */
+ dev = devices.kbd;
+ g_assert(info->use == XISlaveKeyboard);
+ g_assert(info->attachment == devices.vck->id);
+ g_assert(info->num_classes == 1);
+ break;
+
+ default:
+ /* We shouldn't get here */
+ g_assert(0);
+ break;
+ }
+ g_assert(info->enabled == dev->enabled);
+ g_assert(info->name_len == strlen(dev->name));
+ g_assert(strncmp((char*)&info[1], dev->name, info->name_len) == 0);
+
+ any = (xXIAnyInfo*)((char*)&info[1] + ((info->name_len + 3)/4) * 4);
+ for (j = 0; j < info->num_classes; j++)
+ {
+ if (client->swapped)
+ {
+ swaps(&any->type, n);
+ swaps(&any->length, n);
+ swaps(&any->sourceid, n);
+ }
+
+ switch(info->deviceid)
+ {
+ case 3: /* VCK and kbd have the same properties */
+ case 5:
+ {
+ int k;
+ xXIKeyInfo *ki = (xXIKeyInfo*)any;
+ XkbDescPtr xkb = devices.vck->key->xkbInfo->desc;
+ uint32_t *kc;
+
+ if (client->swapped)
+ swaps(&ki->num_keycodes, n);
+
+ g_assert(any->type == XIKeyClass);
+ g_assert(ki->num_keycodes == (xkb->max_key_code - xkb->min_key_code + 1));
+ g_assert(any->length == (2 + ki->num_keycodes));
+
+ kc = (uint32_t*)&ki[1];
+ for (k = 0; k < ki->num_keycodes; k++, kc++)
+ {
+ if (client->swapped)
+ swapl(kc, n);
+
+ g_assert(*kc >= xkb->min_key_code);
+ g_assert(*kc <= xkb->max_key_code);
+ }
+ break;
+ }
+ case 2: /* VCP and mouse have the same properties */
+ case 4:
+ {
+ g_assert(any->type == XIButtonClass ||
+ any->type == XIValuatorClass);
+
+ if (any->type == XIButtonClass)
+ {
+ int len;
+ xXIButtonInfo *bi = (xXIButtonInfo*)any;
+
+ if (client->swapped)
+ swaps(&bi->num_buttons, n);
+
+ g_assert(bi->num_buttons == devices.vcp->button->numButtons);
+
+ len = 2 + bi->num_buttons + bytes_to_int32(bits_to_bytes(bi->num_buttons));
+ g_assert(bi->length == len);
+ } else if (any->type == XIValuatorClass)
+ {
+ xXIValuatorInfo *vi = (xXIValuatorInfo*)any;
+
+ if (client->swapped)
+ {
+ swaps(&vi->number, n);
+ swapl(&vi->label, n);
+ swapl(&vi->min.integral, n);
+ swapl(&vi->min.frac, n);
+ swapl(&vi->max.integral, n);
+ swapl(&vi->max.frac, n);
+ swapl(&vi->resolution, n);
+ }
+
+ g_assert(vi->length == 11);
+ g_assert(vi->number == 0 ||
+ vi->number == 1);
+ g_assert(vi->mode == XIModeRelative);
+ /* device was set up as relative, so standard
+ * values here. */
+ g_assert(vi->min.integral == -1);
+ g_assert(vi->min.frac == 0);
+ g_assert(vi->max.integral == -1);
+ g_assert(vi->max.frac == 0);
+ g_assert(vi->resolution == 0);
+ }
+ }
+ break;
+ }
+ any = (xXIAnyInfo*)(((char*)any) + any->length * 4);
+ }
+
+ info = (xXIDeviceInfo*)any;
+ }
+}
+
+static void request_XIQueryDevice(struct test_data *querydata,
+ int deviceid, int error)
+{
+ int rc;
+ char n;
+ ClientRec client;
+ xXIQueryDeviceReq request;
+
+ request_init(&request, XIQueryDevice);
+ client = init_client(request.length, &request);
+ reply_handler = reply_XIQueryDevice;
+
+ querydata->which_device = deviceid;
+
+ request.deviceid = deviceid;
+ rc = ProcXIQueryDevice(&client);
+ g_assert(rc == error);
+
+ if (rc != Success)
+ g_assert(client.errorValue == deviceid);
+
+ reply_handler = reply_XIQueryDevice;
+
+ client.swapped = TRUE;
+ swaps(&request.length, n);
+ swaps(&request.deviceid, n);
+ rc = SProcXIQueryDevice(&client);
+ g_assert(rc == error);
+
+ if (rc != Success)
+ g_assert(client.errorValue == deviceid);
+}
+
+static void test_XIQueryDevice(void)
+{
+ int i;
+ xXIQueryDeviceReq request;
+ struct test_data data;
+
+ reply_handler = reply_XIQueryDevice;
+ userdata = &data;
+ request_init(&request, XIQueryDevice);
+
+ g_test_message("Testing XIAllDevices.");
+ request_XIQueryDevice(&data, XIAllDevices, Success);
+ g_test_message("Testing XIAllMasterDevices.");
+ request_XIQueryDevice(&data, XIAllMasterDevices, Success);
+
+ g_test_message("Testing existing device ids.");
+ for (i = 2; i < 6; i++)
+ request_XIQueryDevice(&data, i, Success);
+
+ g_test_message("Testing non-existing device ids.");
+ for (i = 6; i <= 0xFFFF; i++)
+ request_XIQueryDevice(&data, i, BadDevice);
+
+
+ reply_handler = NULL;
+
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ init_simple();
+
+ g_test_add_func("/dix/xi2protocol/XIQueryDevice", test_XIQueryDevice);
+
+ return g_test_run();
+}
+
diff --git a/xorg-server/test/xi2/protocol-xiquerypointer.c b/xorg-server/test/xi2/protocol-xiquerypointer.c
new file mode 100644
index 000000000..810c61575
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-xiquerypointer.c
@@ -0,0 +1,220 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+/*
+ * Protocol testing for XIQueryPointer request.
+ */
+#include <stdint.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include "inputstr.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "xiquerypointer.h"
+#include "exevents.h"
+
+#include "protocol-common.h"
+#include <glib.h>
+
+static ClientRec client_request;
+static void reply_XIQueryPointer_data(ClientPtr client, int len,
+ char *data, void *userdata);
+
+static struct {
+ DeviceIntPtr dev;
+ WindowPtr win;
+} test_data;
+
+
+/* dixLookupWindow requires a lot of setup not necessary for this test.
+ * Simple wrapper that returns either one of the fake root window or the
+ * fake client window. If the requested ID is neither of those wanted,
+ * return whatever the real dixLookupWindow does.
+ */
+int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
+{
+ if (id == root.drawable.id)
+ {
+ *win = &root;
+ return Success;
+ } else if (id == window.drawable.id)
+ {
+ *win = &window;
+ return Success;
+ }
+
+ return __real_dixLookupWindow(win, id, client, access);
+}
+
+static void reply_XIQueryPointer(ClientPtr client, int len, char *data,
+ void *userdata)
+{
+ xXIQueryPointerReply *rep = (xXIQueryPointerReply*)data;
+ SpritePtr sprite;
+
+ if (!rep->repType)
+ return;
+
+ if (client->swapped)
+ {
+ char n;
+ swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->root, n);
+ swapl(&rep->child, n);
+ swapl(&rep->root_x, n);
+ swapl(&rep->root_y, n);
+ swapl(&rep->win_x, n);
+ swapl(&rep->win_y, n);
+ swaps(&rep->buttons_len, n);
+ }
+
+ reply_check_defaults(rep, len, XIQueryPointer);
+
+ g_assert(rep->root == root.drawable.id);
+ g_assert(rep->same_screen == xTrue);
+
+ sprite = test_data.dev->spriteInfo->sprite;
+ g_assert((rep->root_x >> 16) == sprite->hot.x);
+ g_assert((rep->root_y >> 16) == sprite->hot.y);
+
+ if (test_data.win == &root)
+ {
+ g_assert(rep->root_x == rep->win_x);
+ g_assert(rep->root_y == rep->win_y);
+ g_assert(rep->child == window.drawable.id);
+ } else
+ {
+ int x, y;
+
+ x = sprite->hot.x - window.drawable.x;
+ y = sprite->hot.y - window.drawable.y;
+
+ g_assert((rep->win_x >> 16) == x);
+ g_assert((rep->win_y >> 16) == y);
+ g_assert(rep->child == None);
+ }
+
+
+ g_assert(rep->same_screen == xTrue);
+
+ reply_handler = reply_XIQueryPointer_data;
+}
+
+static void reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *userdata)
+{
+ reply_handler = reply_XIQueryPointer;
+}
+
+static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq* req, int error)
+{
+ char n;
+ int rc;
+
+ rc = ProcXIQueryPointer(&client_request);
+ g_assert(rc == error);
+
+ if (rc == BadDevice)
+ g_assert(client_request.errorValue == req->deviceid);
+
+ client_request.swapped = TRUE;
+ swaps(&req->deviceid, n);
+ swaps(&req->length, n);
+ rc = SProcXIQueryPointer(&client_request);
+ g_assert(rc == error);
+
+ if (rc == BadDevice)
+ g_assert(client_request.errorValue == req->deviceid);
+}
+
+static void test_XIQueryPointer(void)
+{
+ int i;
+ xXIQueryPointerReq request;
+
+ memset(&request, 0, sizeof(request));
+
+ request_init(&request, XIQueryPointer);
+
+ reply_handler = reply_XIQueryPointer;
+
+ client_request = init_client(request.length, &request);
+
+ request.deviceid = XIAllDevices;
+ request_XIQueryPointer(&client_request, &request, BadDevice);
+
+ request.deviceid = XIAllMasterDevices;
+ request_XIQueryPointer(&client_request, &request, BadDevice);
+
+ request.win = root.drawable.id;
+ test_data.win = &root;
+
+ test_data.dev = devices.vcp;
+ request.deviceid = devices.vcp->id;
+ request_XIQueryPointer(&client_request, &request, Success);
+ request.deviceid = devices.vck->id;
+ request_XIQueryPointer(&client_request, &request, BadDevice);
+ request.deviceid = devices.mouse->id;
+ request_XIQueryPointer(&client_request, &request, BadDevice);
+ request.deviceid = devices.kbd->id;
+ request_XIQueryPointer(&client_request, &request, BadDevice);
+
+ test_data.dev = devices.mouse;
+ devices.mouse->u.master = NULL; /* Float, kind-of */
+ request.deviceid = devices.mouse->id;
+ request_XIQueryPointer(&client_request, &request, Success);
+
+ for (i = devices.kbd->id + 1; i <= 0xFFFF; i++)
+ {
+ request.deviceid = i;
+ request_XIQueryPointer(&client_request, &request, BadDevice);
+ }
+
+ request.win = window.drawable.id;
+
+ test_data.dev = devices.vcp;
+ test_data.win = &window;
+ request.deviceid = devices.vcp->id;
+ request_XIQueryPointer(&client_request, &request, Success);
+
+ test_data.dev = devices.mouse;
+ request.deviceid = devices.mouse->id;
+ request_XIQueryPointer(&client_request, &request, Success);
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ init_simple();
+
+ g_test_add_func("/xi2/protocol/XIQueryPointer", test_XIQueryPointer);
+
+ return g_test_run();
+}
diff --git a/xorg-server/test/xi2/protocol-xiqueryversion.c b/xorg-server/test/xi2/protocol-xiqueryversion.c
new file mode 100644
index 000000000..46e62acbd
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-xiqueryversion.c
@@ -0,0 +1,186 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+/*
+ * Protocol testing for XIQueryVersion request and reply.
+ *
+ * Test approach:
+ * Wrap WriteToClient to intercept the server's reply.
+ * Repeatedly test a client/server version combination, compare version in
+ * reply with versions given. Version must be equal to either
+ * server version or client version, whichever is smaller.
+ * Client version less than 2 must return BadValue.
+ */
+
+#include <stdint.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include "inputstr.h"
+#include "extinit.h" /* for XInputExtensionInit */
+#include "scrnintstr.h"
+#include "xiqueryversion.h"
+
+#include "protocol-common.h"
+#include <glib.h>
+
+extern XExtensionVersion XIVersion;
+
+struct test_data {
+ int major_client;
+ int minor_client;
+ int major_server;
+ int minor_server;
+};
+
+static void reply_XIQueryVersion(ClientPtr client, int len, char* data, void *userdata)
+{
+ xXIQueryVersionReply *rep = (xXIQueryVersionReply*)data;
+ struct test_data *versions = (struct test_data*)userdata;
+ unsigned int sver, cver, ver;
+
+ if (client->swapped)
+ {
+ char n;
+ swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber, n);
+ swaps(&rep->major_version, n);
+ swaps(&rep->minor_version, n);
+ }
+
+ reply_check_defaults(rep, len, XIQueryVersion);
+
+ g_assert(rep->length == 0);
+
+ sver = versions->major_server * 1000 + versions->minor_server;
+ cver = versions->major_client * 1000 + versions->minor_client;
+ ver = rep->major_version * 1000 + rep->minor_version;
+
+ g_assert(ver >= 2000);
+ g_assert((sver > cver) ? ver == cver : ver == sver);
+}
+
+/**
+ * Run a single test with server version smaj.smin and client
+ * version cmaj.cmin. Verify that return code is equal to 'error'.
+ *
+ * Test is run normal, then for a swapped client.
+ */
+static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error)
+{
+ char n;
+ int rc;
+ struct test_data versions;
+ xXIQueryVersionReq request;
+ ClientRec client;
+
+ request_init(&request, XIQueryVersion);
+ client = init_client(request.length, &request);
+ userdata = (void*)&versions;
+
+ /* Change the server to support smaj.smin */
+ XIVersion.major_version = smaj;
+ XIVersion.minor_version = smin;
+
+ /* remember versions we send and expect */
+ versions.major_client = cmaj;
+ versions.minor_client = cmin;
+ versions.major_server = XIVersion.major_version;
+ versions.minor_server = XIVersion.minor_version;
+
+ request.major_version = versions.major_client;
+ request.minor_version = versions.minor_client;
+ rc = ProcXIQueryVersion(&client);
+ g_assert(rc == error);
+
+ client.swapped = TRUE;
+
+ swaps(&request.length, n);
+ swaps(&request.major_version, n);
+ swaps(&request.minor_version, n);
+
+ rc = SProcXIQueryVersion(&client);
+ g_assert(rc == error);
+}
+
+/* Client version less than 2.0 must return BadValue, all other combinations
+ * Success */
+static void test_XIQueryVersion(void)
+{
+ reply_handler = reply_XIQueryVersion;
+
+ g_test_message("Server version 2.0 - client versions [1..3].0");
+ /* some simple tests to catch common errors quickly */
+ request_XIQueryVersion(2, 0, 1, 0, BadValue);
+ request_XIQueryVersion(2, 0, 2, 0, Success);
+ request_XIQueryVersion(2, 0, 3, 0, Success);
+
+ g_test_message("Server version 3.0 - client versions [1..3].0");
+ request_XIQueryVersion(3, 0, 1, 0, BadValue);
+ request_XIQueryVersion(3, 0, 2, 0, Success);
+ request_XIQueryVersion(3, 0, 3, 0, Success);
+
+ g_test_message("Server version 2.0 - client versions [1..3].[1..3]");
+ request_XIQueryVersion(2, 0, 1, 1, BadValue);
+ request_XIQueryVersion(2, 0, 2, 2, Success);
+ request_XIQueryVersion(2, 0, 3, 3, Success);
+
+ g_test_message("Server version 2.2 - client versions [1..3].0");
+ request_XIQueryVersion(2, 2, 1, 0, BadValue);
+ request_XIQueryVersion(2, 2, 2, 0, Success);
+ request_XIQueryVersion(2, 2, 3, 0, Success);
+
+#if 0
+ /* this one takes a while */
+ unsigned int cmin, cmaj, smin, smaj;
+
+ g_test_message("Testing all combinations.");
+ for (smaj = 2; smaj <= 0xFFFF; smaj++)
+ for (smin = 0; smin <= 0xFFFF; smin++)
+ for (cmin = 0; cmin <= 0xFFFF; cmin++)
+ for (cmaj = 0; cmaj <= 0xFFFF; cmaj++)
+ {
+ int error = (cmaj < 2) ? BadValue : Success;
+ request_XIQueryVersion(smaj, smin, cmaj, cmin, error);
+ }
+
+#endif
+
+ reply_handler = NULL;
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ init_simple();
+
+ g_test_add_func("/xi2/protocol/XIQueryVersion", test_XIQueryVersion);
+
+ return g_test_run();
+}
diff --git a/xorg-server/test/xi2/protocol-xiselectevents.c b/xorg-server/test/xi2/protocol-xiselectevents.c
new file mode 100644
index 000000000..f314462b5
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-xiselectevents.c
@@ -0,0 +1,337 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+/*
+ * Protocol testing for XISelectEvents request.
+ *
+ * Test approach:
+ *
+ * Wrap XISetEventMask to intercept when the server tries to apply the event
+ * mask. Ensure that the mask passed in is equivalent to the one supplied by
+ * the client. Ensure that invalid devices and invalid masks return errors
+ * as appropriate.
+ *
+ * Tests included:
+ * BadValue for num_masks < 0
+ * BadWindow for invalid windows
+ * BadDevice for non-existing devices
+ * BadImplemenation for devices >= 0xFF
+ * BadValue if HierarchyChanged bit is set for devices other than
+ * XIAllDevices
+ * BadValue for invalid mask bits
+ * Sucecss for excessive mask lengths
+ *
+ */
+
+#include <stdint.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include "inputstr.h"
+#include "windowstr.h"
+#include "extinit.h" /* for XInputExtensionInit */
+#include "scrnintstr.h"
+#include "xiselectev.h"
+
+#include "protocol-common.h"
+#include <glib.h>
+
+static unsigned char *data[4096 * 16]; /* the request data buffer */
+
+int __wrap_XISetEventMask(DeviceIntPtr dev, WindowPtr win, int len, unsigned char* mask)
+{
+ return Success;
+}
+
+/* dixLookupWindow requires a lot of setup not necessary for this test.
+ * Simple wrapper that returns either one of the fake root window or the
+ * fake client window. If the requested ID is neither of those wanted,
+ * return whatever the real dixLookupWindow does.
+ */
+int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
+{
+ if (id == root.drawable.id)
+ {
+ *win = &root;
+ return Success;
+ } else if (id == window.drawable.id)
+ {
+ *win = &window;
+ return Success;
+ }
+
+ return __real_dixLookupWindow(win, id, client, access);
+}
+
+
+static void request_XISelectEvent(xXISelectEventsReq *req, int error)
+{
+ char n;
+ int i;
+ int rc;
+ ClientRec client;
+ xXIEventMask *mask, *next;
+
+ req->length = (sz_xXISelectEventsReq/4);
+ mask = (xXIEventMask*)&req[1];
+ for (i = 0; i < req->num_masks; i++)
+ {
+ req->length += sizeof(xXIEventMask)/4 + mask->mask_len;
+ mask = (xXIEventMask*)((char*)&mask[1] + mask->mask_len * 4);
+ }
+
+ client = init_client(req->length, req);
+
+ rc = ProcXISelectEvents(&client);
+ g_assert(rc == error);
+
+ client.swapped = TRUE;
+
+ mask = (xXIEventMask*)&req[1];
+ for (i = 0; i < req->num_masks; i++)
+ {
+ next = (xXIEventMask*)((char*)&mask[1] + mask->mask_len * 4);
+ swaps(&mask->deviceid, n);
+ swaps(&mask->mask_len, n);
+ mask = next;
+ }
+
+ swapl(&req->win, n);
+ swaps(&req->length, n);
+ swaps(&req->num_masks, n);
+ rc = SProcXISelectEvents(&client);
+ g_assert(rc == error);
+}
+
+static void request_XISelectEvents_masks(xXISelectEventsReq *req)
+{
+ int i, j;
+ xXIEventMask *mask;
+ int nmasks = (XI_LASTEVENT + 7)/8;
+ unsigned char *bits;
+
+ mask = (xXIEventMask*)&req[1];
+ req->win = ROOT_WINDOW_ID;
+
+ /* if a clients submits more than 100 masks, consider it insane and untested */
+ for (i = 1; i <= 1000; i++)
+ {
+ req->num_masks = i;
+ mask->deviceid = XIAllDevices;
+
+ /* Test 0:
+ * mask_len is 0 -> Success
+ */
+ mask->mask_len = 0;
+ request_XISelectEvent(req, Success);
+
+ /* Test 1:
+ * mask may be larger than needed for XI_LASTEVENT.
+ * Test setting each valid mask bit, while leaving unneeded bits 0.
+ * -> Success
+ */
+ bits = (unsigned char*)&mask[1];
+ mask->mask_len = (nmasks + 3)/4 * 10;
+ memset(bits, 0, mask->mask_len * 4);
+ for (j = 0; j <= XI_LASTEVENT; j++)
+ {
+ SetBit(bits, j);
+ request_XISelectEvent(req, Success);
+ ClearBit(bits, j);
+ }
+
+ /* Test 2:
+ * mask may be larger than needed for XI_LASTEVENT.
+ * Test setting all valid mask bits, while leaving unneeded bits 0.
+ * -> Success
+ */
+ bits = (unsigned char*)&mask[1];
+ mask->mask_len = (nmasks + 3)/4 * 10;
+ memset(bits, 0, mask->mask_len * 4);
+
+ for (j = 0; j <= XI_LASTEVENT; j++)
+ {
+ SetBit(bits, j);
+ request_XISelectEvent(req, Success);
+ }
+
+ /* Test 3:
+ * mask is larger than needed for XI_LASTEVENT. If any unneeded bit
+ * is set -> BadValue
+ */
+ bits = (unsigned char*)&mask[1];
+ mask->mask_len = (nmasks + 3)/4 * 10;
+ memset(bits, 0, mask->mask_len * 4);
+
+ for (j = XI_LASTEVENT + 1; j < mask->mask_len * 4; j++)
+ {
+ SetBit(bits, j);
+ request_XISelectEvent(req, BadValue);
+ ClearBit(bits, j);
+ }
+
+ /* Test 4:
+ * Mask len is a sensible length, only valid bits are set -> Success
+ */
+ bits = (unsigned char*)&mask[1];
+ mask->mask_len = (nmasks + 3)/4;
+ memset(bits, 0, mask->mask_len * 4);
+ for (j = 0; j <= XI_LASTEVENT; j++)
+ {
+ SetBit(bits, j);
+ request_XISelectEvent(req, Success);
+ }
+
+ /* Test 5:
+ * HierarchyChanged bit is BadValue for devices other than
+ * XIAllDevices
+ */
+ bits = (unsigned char*)&mask[1];
+ mask->mask_len = (nmasks + 3)/4;
+ memset(bits, 0, mask->mask_len * 4);
+ SetBit(bits, XI_HierarchyChanged);
+ mask->deviceid = XIAllDevices;
+ request_XISelectEvent(req, Success);
+ for (j = 1; j < devices.num_devices; j++)
+ {
+ mask->deviceid = j;
+ request_XISelectEvent(req, BadValue);
+ }
+
+ /* Test 6:
+ * All bits set minus hierarchy changed bit -> Success
+ */
+ bits = (unsigned char*)&mask[1];
+ mask->mask_len = (nmasks + 3)/4;
+ memset(bits, 0, mask->mask_len * 4);
+ for (j = 0; j <= XI_LASTEVENT; j++)
+ SetBit(bits, j);
+ ClearBit(bits, XI_HierarchyChanged);
+ for (j = 1; j < 6; j++)
+ {
+ mask->deviceid = j;
+ request_XISelectEvent(req, Success);
+ }
+
+ mask = (xXIEventMask*)((char*)mask + sizeof(xXIEventMask) + mask->mask_len * 4);
+ }
+}
+
+static void test_XISelectEvents(void)
+{
+ int i;
+ xXIEventMask *mask;
+ xXISelectEventsReq *req;
+ req = (xXISelectEventsReq*)data;
+
+ request_init(req, XISelectEvents);
+
+ g_test_message("Testing for BadValue on zero-length masks");
+ /* zero masks are BadValue, regardless of the window */
+ req->num_masks = 0;
+
+ req->win = None;
+ request_XISelectEvent(req, BadValue);
+
+ req->win = ROOT_WINDOW_ID;
+ request_XISelectEvent(req, BadValue);
+
+ req->win = CLIENT_WINDOW_ID;
+ request_XISelectEvent(req, BadValue);
+
+ g_test_message("Testing for BadWindow.");
+ /* None window is BadWindow, regardless of the masks.
+ * We don't actually need to set the masks here, BadWindow must occur
+ * before checking the masks.
+ */
+ req->win = None;
+ req->num_masks = 1;
+ request_XISelectEvent(req, BadWindow);
+
+ req->num_masks = 2;
+ request_XISelectEvent(req, BadWindow);
+
+ req->num_masks = 0xFF;
+ request_XISelectEvent(req, BadWindow);
+
+ /* request size is 3, so 0xFFFC is the highest num_mask that doesn't
+ * overflow req->length */
+ req->num_masks = 0xFFFC;
+ request_XISelectEvent(req, BadWindow);
+
+ g_test_message("Triggering num_masks/length overflow");
+ /* Integer overflow - req->length can't hold that much */
+ req->num_masks = 0xFFFF;
+ request_XISelectEvent(req, BadLength);
+
+ req->win = ROOT_WINDOW_ID;
+ req->num_masks = 1;
+
+ g_test_message("Triggering bogus mask length error");
+ mask = (xXIEventMask*)&req[1];
+ mask->deviceid = 0;
+ mask->mask_len = 0xFFFF;
+ request_XISelectEvent(req, BadLength);
+
+ /* testing various device ids */
+ g_test_message("Testing existing device ids.");
+ for (i = 0; i < 6; i++)
+ {
+ mask = (xXIEventMask*)&req[1];
+ mask->deviceid = i;
+ mask->mask_len = 1;
+ req->win = ROOT_WINDOW_ID;
+ req->num_masks = 1;
+ request_XISelectEvent(req, Success);
+ }
+
+ g_test_message("Testing non-existing device ids.");
+ for (i = 6; i <= 0xFFFF; i++)
+ {
+ req->win = ROOT_WINDOW_ID;
+ req->num_masks = 1;
+ mask = (xXIEventMask*)&req[1];
+ mask->deviceid = i;
+ mask->mask_len = 1;
+ request_XISelectEvent(req, BadDevice);
+ }
+
+ request_XISelectEvents_masks(req);
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ init_simple();
+
+ g_test_add_func("/xi2/protocol/XISelectEvents", test_XISelectEvents);
+
+ return g_test_run();
+}
+
diff --git a/xorg-server/test/xi2/protocol-xisetclientpointer.c b/xorg-server/test/xi2/protocol-xisetclientpointer.c
new file mode 100644
index 000000000..2e638eea7
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-xisetclientpointer.c
@@ -0,0 +1,149 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+/*
+ * Protocol testing for XISetClientPointer request.
+ *
+ * Tests include:
+ * BadDevice of all devices except master pointers.
+ * Success for a valid window.
+ * Success for window None.
+ * BadWindow for invalid windows.
+ */
+#include <stdint.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include "inputstr.h"
+#include "windowstr.h"
+#include "extinit.h" /* for XInputExtensionInit */
+#include "scrnintstr.h"
+#include "xisetclientpointer.h"
+#include "exevents.h"
+
+#include "protocol-common.h"
+#include <glib.h>
+
+static ClientRec client_window;
+static ClientRec client_request;
+
+int __wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access)
+{
+ if (rid == ROOT_WINDOW_ID)
+ return BadWindow;
+
+ if (rid == CLIENT_WINDOW_ID)
+ {
+ *pClient = &client_window;
+ return Success;
+ }
+
+ return __real_dixLookupClient(pClient, rid, client, access);
+}
+
+static void request_XISetClientPointer(xXISetClientPointerReq* req, int error)
+{
+ char n;
+ int rc;
+ client_request = init_client(req->length, req);
+
+ rc = ProcXISetClientPointer(&client_request);
+ g_assert(rc == error);
+
+ if (rc == BadDevice)
+ g_assert(client_request.errorValue == req->deviceid);
+
+ client_request.swapped = TRUE;
+ swapl(&req->win, n);
+ swaps(&req->length, n);
+ swaps(&req->deviceid, n);
+ rc = SProcXISetClientPointer(&client_request);
+ g_assert(rc == error);
+
+ if (rc == BadDevice)
+ g_assert(client_request.errorValue == req->deviceid);
+
+}
+
+static void test_XISetClientPointer(void)
+{
+ int i;
+ xXISetClientPointerReq request;
+
+ request_init(&request, XISetClientPointer);
+
+ request.win = CLIENT_WINDOW_ID;
+
+ g_test_message("Testing BadDevice error for XIAllDevices and XIMasterDevices.");
+ request.deviceid = XIAllDevices;
+ request_XISetClientPointer(&request, BadDevice);
+
+ request.deviceid = XIAllMasterDevices;
+ request_XISetClientPointer(&request, BadDevice);
+
+ g_test_message("Testing Success for VCP and VCK.");
+ request.deviceid = devices.vcp->id; /* 2 */
+ request_XISetClientPointer(&request, Success);
+ g_assert(client_window.clientPtr->id == 2);
+
+ request.deviceid = devices.vck->id; /* 3 */
+ request_XISetClientPointer(&request, Success);
+ g_assert(client_window.clientPtr->id == 2);
+
+ g_test_message("Testing BadDevice error for all other devices.");
+ for (i = 4; i <= 0xFFFF; i++)
+ {
+ request.deviceid = i;
+ request_XISetClientPointer(&request, BadDevice);
+ }
+
+ g_test_message("Testing window None");
+ request.win = None;
+ request.deviceid = devices.vcp->id; /* 2 */
+ request_XISetClientPointer(&request, Success);
+ g_assert(client_request.clientPtr->id == 2);
+
+ g_test_message("Testing invalid window");
+ request.win = INVALID_WINDOW_ID;
+ request.deviceid = devices.vcp->id;
+ request_XISetClientPointer(&request, BadWindow);
+
+}
+
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ init_simple();
+ client_window = init_client(0, NULL);
+
+ g_test_add_func("/xi2/protocol/XISetClientPointer", test_XISetClientPointer);
+
+ return g_test_run();
+}
diff --git a/xorg-server/test/xi2/protocol-xiwarppointer.c b/xorg-server/test/xi2/protocol-xiwarppointer.c
new file mode 100644
index 000000000..4f8860ea0
--- /dev/null
+++ b/xorg-server/test/xi2/protocol-xiwarppointer.c
@@ -0,0 +1,216 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+/*
+ * Protocol testing for XIWarpPointer request.
+ */
+#include <stdint.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/extensions/XI2proto.h>
+#include "inputstr.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "xiwarppointer.h"
+#include "exevents.h"
+
+#include "protocol-common.h"
+#include <glib.h>
+
+static int expected_x = SPRITE_X;
+static int expected_y = SPRITE_Y;
+
+/* dixLookupWindow requires a lot of setup not necessary for this test.
+ * Simple wrapper that returns either one of the fake root window or the
+ * fake client window. If the requested ID is neither of those wanted,
+ * return whatever the real dixLookupWindow does.
+ */
+int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access)
+{
+ if (id == root.drawable.id)
+ {
+ *win = &root;
+ return Success;
+ } else if (id == window.drawable.id)
+ {
+ *win = &window;
+ return Success;
+ }
+
+ return __real_dixLookupWindow(win, id, client, access);
+}
+
+/**
+ * This function overrides the one in the screen rec.
+ */
+static Bool ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr screen,
+ int x, int y, Bool generateEvent)
+{
+ g_assert(x == expected_x);
+ g_assert(y == expected_y);
+ return TRUE;
+}
+
+
+static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req,
+ int error)
+{
+ char n;
+ int rc;
+
+ rc = ProcXIWarpPointer(client);
+ g_assert(rc == error);
+
+ if (rc == BadDevice)
+ g_assert(client->errorValue == req->deviceid);
+ else if (rc == BadWindow)
+ g_assert(client->errorValue == req->dst_win ||
+ client->errorValue == req->src_win);
+
+
+ client->swapped = TRUE;
+
+ swapl(&req->src_win, n);
+ swapl(&req->dst_win, n);
+ swapl(&req->src_x, n);
+ swapl(&req->src_y, n);
+ swapl(&req->dst_x, n);
+ swapl(&req->dst_y, n);
+ swaps(&req->src_width, n);
+ swaps(&req->src_height, n);
+ swaps(&req->deviceid, n);
+
+ rc = SProcXIWarpPointer(client);
+ g_assert(rc == error);
+
+ if (rc == BadDevice)
+ g_assert(client->errorValue == req->deviceid);
+ else if (rc == BadWindow)
+ g_assert(client->errorValue == req->dst_win ||
+ client->errorValue == req->src_win);
+
+ client->swapped = FALSE;
+}
+
+static void test_XIWarpPointer(void)
+{
+ int i;
+ ClientRec client_request;
+ xXIWarpPointerReq request;
+
+ memset(&request, 0, sizeof(request));
+
+ request_init(&request, XIWarpPointer);
+
+ client_request = init_client(request.length, &request);
+
+ request.deviceid = XIAllDevices;
+ request_XIWarpPointer(&client_request, &request, BadDevice);
+
+ request.deviceid = XIAllMasterDevices;
+ request_XIWarpPointer(&client_request, &request, BadDevice);
+
+ request.src_win = root.drawable.id;
+ request.dst_win = root.drawable.id;
+ request.deviceid = devices.vcp->id;
+ request_XIWarpPointer(&client_request, &request, Success);
+ request.deviceid = devices.vck->id;
+ request_XIWarpPointer(&client_request, &request, BadDevice);
+ request.deviceid = devices.mouse->id;
+ request_XIWarpPointer(&client_request, &request, BadDevice);
+ request.deviceid = devices.kbd->id;
+ request_XIWarpPointer(&client_request, &request, BadDevice);
+
+ devices.mouse->u.master = NULL; /* Float, kind-of */
+ request.deviceid = devices.mouse->id;
+ request_XIWarpPointer(&client_request, &request, Success);
+
+ for (i = devices.kbd->id + 1; i <= 0xFFFF; i++)
+ {
+ request.deviceid = i;
+ request_XIWarpPointer(&client_request, &request, BadDevice);
+ }
+
+ request.src_win = window.drawable.id;
+ request.deviceid = devices.vcp->id;
+ request_XIWarpPointer(&client_request, &request, Success);
+
+ request.deviceid = devices.mouse->id;
+ request_XIWarpPointer(&client_request, &request, Success);
+
+ request.src_win = root.drawable.id;
+ request.dst_win = 0xFFFF; /* invalid window */
+ request_XIWarpPointer(&client_request, &request, BadWindow);
+
+ request.src_win = 0xFFFF; /* invalid window */
+ request.dst_win = root.drawable.id;
+ request_XIWarpPointer(&client_request, &request, BadWindow);
+
+ request.src_win = None;
+ request.dst_win = None;
+
+ request.dst_y = 0;
+ expected_y = SPRITE_Y;
+
+ request.dst_x = 1 << 16;
+ expected_x = SPRITE_X + 1;
+ request.deviceid = devices.vcp->id;
+ request_XIWarpPointer(&client_request, &request, Success);
+
+ request.dst_x = -1 << 16;
+ expected_x = SPRITE_X - 1;
+ request.deviceid = devices.vcp->id;
+ request_XIWarpPointer(&client_request, &request, Success);
+
+ request.dst_x = 0;
+ expected_x = SPRITE_X;
+
+ request.dst_y = 1 << 16;
+ expected_y = SPRITE_Y + 1;
+ request.deviceid = devices.vcp->id;
+ request_XIWarpPointer(&client_request, &request, Success);
+
+ request.dst_y = -1 << 16;
+ expected_y = SPRITE_Y - 1;
+ request.deviceid = devices.vcp->id;
+ request_XIWarpPointer(&client_request, &request, Success);
+
+ /* FIXME: src_x/y checks */
+}
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ init_simple();
+ screen.SetCursorPosition = ScreenSetCursorPosition;
+
+ g_test_add_func("/xi2/protocol/XIWarpPointer", test_XIWarpPointer);
+
+ return g_test_run();
+}
diff --git a/xorg-server/test/xkb.c b/xorg-server/test/xkb.c
new file mode 100644
index 000000000..6fbb26a01
--- /dev/null
+++ b/xorg-server/test/xkb.c
@@ -0,0 +1,173 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <xkb-config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <math.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/keysym.h>
+#include <X11/Xatom.h>
+#include "misc.h"
+#include "inputstr.h"
+#include "opaque.h"
+#include "property.h"
+#define XKBSRV_NEED_FILE_FUNCS
+#include <xkbsrv.h>
+#include "../xkb/xkbgeom.h"
+#include <X11/extensions/XKMformat.h>
+#include "xkbfile.h"
+#include "../xkb/xkb.h"
+
+#include <glib.h>
+
+/**
+ * Initialize an empty XkbRMLVOSet.
+ * Call XkbGetRulesDflts to obtain the default ruleset.
+ * Compare obtained ruleset with the built-in defaults.
+ *
+ * Result: RMLVO defaults are the same as obtained.
+ */
+static void xkb_get_rules_test(void)
+{
+ XkbRMLVOSet rmlvo = { NULL};
+ XkbGetRulesDflts(&rmlvo);
+
+
+ g_assert(rmlvo.rules);
+ g_assert(rmlvo.model);
+ g_assert(rmlvo.layout);
+ g_assert(rmlvo.variant);
+ g_assert(rmlvo.options);
+ g_assert(strcmp(rmlvo.rules, XKB_DFLT_RULES) == 0);
+ g_assert(strcmp(rmlvo.model, XKB_DFLT_MODEL) == 0);
+ g_assert(strcmp(rmlvo.layout, XKB_DFLT_LAYOUT) == 0);
+ g_assert(strcmp(rmlvo.variant, XKB_DFLT_VARIANT) == 0);
+ g_assert(strcmp(rmlvo.options, XKB_DFLT_OPTIONS) == 0);
+}
+
+/**
+ * Initialize an random XkbRMLVOSet.
+ * Call XkbGetRulesDflts to obtain the default ruleset.
+ * Compare obtained ruleset with the built-in defaults.
+ * Result: RMLVO defaults are the same as obtained.
+ */
+static void xkb_set_rules_test(void)
+{
+ XkbRMLVOSet rmlvo = {
+ .rules = "test-rules",
+ .model = "test-model",
+ .layout = "test-layout",
+ .variant = "test-variant",
+ .options = "test-options"
+ };
+ XkbRMLVOSet rmlvo_new = { NULL };
+
+ XkbSetRulesDflts(&rmlvo);
+ XkbGetRulesDflts(&rmlvo_new);
+
+ /* XkbGetRulesDflts strdups the values */
+ g_assert(rmlvo.rules != rmlvo_new.rules);
+ g_assert(rmlvo.model != rmlvo_new.model);
+ g_assert(rmlvo.layout != rmlvo_new.layout);
+ g_assert(rmlvo.variant != rmlvo_new.variant);
+ g_assert(rmlvo.options != rmlvo_new.options);
+
+ g_assert(strcmp(rmlvo.rules, rmlvo_new.rules) == 0);
+ g_assert(strcmp(rmlvo.model, rmlvo_new.model) == 0);
+ g_assert(strcmp(rmlvo.layout, rmlvo_new.layout) == 0);
+ g_assert(strcmp(rmlvo.variant, rmlvo_new.variant) == 0);
+ g_assert(strcmp(rmlvo.options, rmlvo_new.options) == 0);
+}
+
+
+/**
+ * Get the default RMLVO set.
+ * Set the default RMLVO set.
+ * Get the default RMLVO set.
+ * Repeat the last two steps.
+ *
+ * Result: RMLVO set obtained is the same as previously set.
+ */
+static void xkb_set_get_rules_test(void)
+{
+/* This test failed before XkbGetRulesDftlts changed to strdup.
+ We test this twice because the first time using XkbGetRulesDflts we obtain
+ the built-in defaults. The unexpected free isn't triggered until the second
+ XkbSetRulesDefaults.
+ */
+ XkbRMLVOSet rmlvo = { NULL };
+ XkbRMLVOSet rmlvo_backup;
+
+ XkbGetRulesDflts(&rmlvo);
+
+ /* pass 1 */
+ XkbSetRulesDflts(&rmlvo);
+ XkbGetRulesDflts(&rmlvo);
+
+ /* Make a backup copy */
+ rmlvo_backup.rules = strdup(rmlvo.rules);
+ rmlvo_backup.layout = strdup(rmlvo.layout);
+ rmlvo_backup.model = strdup(rmlvo.model);
+ rmlvo_backup.variant = strdup(rmlvo.variant);
+ rmlvo_backup.options = strdup(rmlvo.options);
+
+ /* pass 2 */
+ XkbSetRulesDflts(&rmlvo);
+
+ /* This test is iffy, because strictly we may be comparing against already
+ * freed memory */
+ g_assert(strcmp(rmlvo.rules, rmlvo_backup.rules) == 0);
+ g_assert(strcmp(rmlvo.model, rmlvo_backup.model) == 0);
+ g_assert(strcmp(rmlvo.layout, rmlvo_backup.layout) == 0);
+ g_assert(strcmp(rmlvo.variant, rmlvo_backup.variant) == 0);
+ g_assert(strcmp(rmlvo.options, rmlvo_backup.options) == 0);
+
+ XkbGetRulesDflts(&rmlvo);
+ g_assert(strcmp(rmlvo.rules, rmlvo_backup.rules) == 0);
+ g_assert(strcmp(rmlvo.model, rmlvo_backup.model) == 0);
+ g_assert(strcmp(rmlvo.layout, rmlvo_backup.layout) == 0);
+ g_assert(strcmp(rmlvo.variant, rmlvo_backup.variant) == 0);
+ g_assert(strcmp(rmlvo.options, rmlvo_backup.options) == 0);
+}
+
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ g_test_add_func("/xkb/set-get-rules", xkb_set_get_rules_test);
+ g_test_add_func("/xkb/get-rules", xkb_get_rules_test);
+ g_test_add_func("/xkb/set-rules", xkb_set_rules_test);
+
+ return g_test_run();
+}
diff --git a/xorg-server/test/xtest.c b/xorg-server/test/xtest.c
new file mode 100644
index 000000000..572f5d2df
--- /dev/null
+++ b/xorg-server/test/xtest.c
@@ -0,0 +1,116 @@
+/**
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+#include <stdint.h>
+#include <X11/Xatom.h>
+#include "input.h"
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "exevents.h"
+#include "xserver-properties.h"
+
+#include <glib.h>
+
+/**
+ */
+
+/* from Xext/xtest.c */
+extern DeviceIntPtr xtestpointer, xtestkeyboard;
+
+/* Needed for the screen setup, otherwise we crash during sprite initialization */
+static Bool device_cursor_init(DeviceIntPtr dev, ScreenPtr screen) { return TRUE; }
+
+static void xtest_init_devices(void)
+{
+ ScreenRec screen;
+
+ /* random stuff that needs initialization */
+ memset(&screen, 0, sizeof(screen));
+ screenInfo.arraySize = MAXSCREENS;
+ screenInfo.numScreens = 1;
+ screenInfo.screens[0] = &screen;
+ screen.myNum = 0;
+ screen.id = 100;
+ screen.width = 640;
+ screen.height = 480;
+ screen.DeviceCursorInitialize = device_cursor_init;
+ dixResetPrivates();
+ InitAtoms();
+
+ /* this also inits the xtest devices */
+ InitCoreDevices();
+
+ g_assert(xtestpointer);
+ g_assert(xtestkeyboard);
+ g_assert(IsXTestDevice(xtestpointer, NULL));
+ g_assert(IsXTestDevice(xtestkeyboard, NULL));
+ g_assert(IsXTestDevice(xtestpointer, inputInfo.pointer));
+ g_assert(IsXTestDevice(xtestkeyboard, inputInfo.keyboard));
+ g_assert(GetXTestDevice(inputInfo.pointer) == xtestpointer);
+ g_assert(GetXTestDevice(inputInfo.keyboard) == xtestkeyboard);
+}
+
+/**
+ * Each xtest devices has a property attached marking it. This property
+ * cannot be changed.
+ */
+static void xtest_properties(void)
+{
+ int rc;
+ char value = 1;
+ XIPropertyValuePtr prop;
+ Atom xtest_prop = XIGetKnownProperty(XI_PROP_XTEST_DEVICE);
+
+ rc = XIGetDeviceProperty(xtestpointer, xtest_prop, &prop);
+ g_assert(rc == Success);
+ g_assert(prop);
+
+ rc = XIGetDeviceProperty(xtestkeyboard, xtest_prop, &prop);
+ g_assert(rc == Success);
+ g_assert(prop != NULL);
+
+ rc = XIChangeDeviceProperty(xtestpointer, xtest_prop,
+ XA_INTEGER, 8, PropModeReplace, 1, &value, FALSE);
+ g_assert(rc == BadAccess);
+ rc = XIChangeDeviceProperty(xtestkeyboard, xtest_prop,
+ XA_INTEGER, 8, PropModeReplace, 1, &value, FALSE);
+ g_assert(rc == BadAccess);
+}
+
+
+
+int main(int argc, char** argv)
+{
+ g_test_init(&argc, &argv,NULL);
+ g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+
+ g_test_add_func("/dix/xtest/init", xtest_init_devices);
+ g_test_add_func("/dix/xtest/properties", xtest_properties);
+
+ return g_test_run();
+}
+
+