From: Peter Hutterer Date: Mon, 7 Apr 2008 07:54:16 +0000 (+0930) Subject: Merge branch 'master' into mpx X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/e3b705dc15d07bbb478ced6b54a5e0553d978113?hp=ac3498c9b8a54143a9d023fe530c62e24c4651e0 Merge branch 'master' into mpx Conflicts: src/xinput.c (just a whitespace conflict) --- diff --git a/.gitignore b/.gitignore index 892c51b..1024dee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +ChangeLog +xinput-*.tar.bz2 +xinput-*.tar.gz *.o config.* Makefile diff --git a/AUTHORS b/AUTHORS index e69de29..73bc34e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -0,0 +1,2 @@ +Maintainer: Philip Langdale +Creator: Frederic Lepied diff --git a/COPYING b/COPYING index eef49c2..8662bd6 100644 --- a/COPYING +++ b/COPYING @@ -4,15 +4,15 @@ Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting -documentation, and that the name of Frederic Lepied not be used in +documentation, and that the name of the authors not be used in advertising or publicity pertaining to distribution of the software without -specific, written prior permission. Frederic Lepied makes no +specific, written prior permission. The authors make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. -FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR +EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR diff --git a/Imakefile b/Imakefile deleted file mode 100644 index 1a439f6..0000000 --- a/Imakefile +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright 1996-1997 by Frederic Lepied, France. -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of Frederic Lepied not be used in -# advertising or publicity pertaining to distribution of the software without -# specific, written prior permission. Frederic Lepied makes no -# representations about the suitability of this software for any purpose. It -# is provided "as is" without express or implied warranty. -# -# FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -# EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR -# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -# PERFORMANCE OF THIS SOFTWARE. -# -# $Id: Imakefile,v 1.7 1997/06/14 19:11:49 fred Exp $ - -# must be kept in synch with version.c -VERSION = 1.2 - -DEPLIBS = $(DEPXILIB) $(DEPXLIB) -LOCAL_LIBRARIES = $(XILIB) $(XLIB) - -OBJS = xinput.o feedback.o buttonmap.o setptr.o setmode.o list.o test.o version.o setint.o state.o -SRCS = xinput.c feedback.c buttonmap.c setptr.c setmode.c list.c test.c version.c setint.c state.c -HDRS = xinput.h -AUX = xinput.man Imakefile README ChangeLog COPYRIGHT - -ComplexProgramTarget(xinput) - -distrib: - @test -f setptr.c - rm -rf xinput-$(VERSION) xinput-$(VERSION).tar.gz - mkdir xinput-$(VERSION) - ln $(AUX) $(HDRS) $(SRCS) xinput-$(VERSION) - tar cvf xinput-$(VERSION).tar xinput-$(VERSION) - gzip --best --verbose xinput-$(VERSION).tar - -clean:: - @test -f setptr.c - rm -rf xinput-$(VERSION) xinput-$(VERSION).tar.gz - -# end of Imakefile diff --git a/Makefile.am b/Makefile.am index 7c1d8f4..b04f7aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,33 @@ -SUBDIRS=src man +# Copyright 2005 Adam Jackson. +# +# 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 +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL +# ADAM JACKSON 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. + +AUTOMAKE_OPTIONS = foreign +SUBDIRS = src man + +EXTRA_DIST=ChangeLog + +CLEANFILES=ChangeLog + +.PHONY: ChangeLog + +ChangeLog: + (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + +dist-hook: ChangeLog diff --git a/NEWS b/NEWS index e69de29..b81f91a 100644 --- a/NEWS +++ b/NEWS @@ -0,0 +1,5 @@ +xinput 1.3.0 - 2008/01/09 +========================= + + * Add support for Xorg 1.4 + * Warn if a specified device name is ambiguous. diff --git a/README b/README index 3c8605f..08a4ec9 100644 --- a/README +++ b/README @@ -1,22 +1,29 @@ - xinput 1.x by Frederic Lepied + xinput + ====== -1. Introduction -=============== +Overview +======== -xinput is an utility I have built to configure and test my XInput -devices. The functionalities aren't complete but they fill my -needs. If you have some ideas or needs for improvement, feel free to -contact me. Any feedback welcome. +xinput is a utility to configure and test XInput devices. It wasn't +originally designed to be the primary tool for doing this but it's +still pretty much the only program out there for doing it. :-) -2. Requirements -=============== +Requirements +============ -You'll need an ANSI C compiler. I know it works under Linux -ELF/XFree86 and Solaris 2.4 Sparc/X11R6.1. +xinput depends on the X11 headers and particularly the XInput headers. +As xinput now supports the new device types added in Xserver 1.4 (Xorg 7.3), +your headers must be from that version or newer. -3. Installation -=============== +Otherwise it will just require a working ANSI C compiler. -xmkmf -a +Building and Installation +========================= + +xinput uses autotools so the usual pattern applies: + +./configure +make make install -make install.man + +See the INSTALL file for details. diff --git a/configure.ac b/configure.ac index 5f57880..f38914f 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ AC_PROG_CC AC_PROG_INSTALL # Checks for pkg-config packages -PKG_CHECK_MODULES(XINPUT, x11 xext xi) +PKG_CHECK_MODULES(XINPUT, x11 xext xi [inputproto >= 1.4]) AC_SUBST(XINPUT_CFLAGS) AC_SUBST(XINPUT_LIBS) diff --git a/man/xinput.man b/man/xinput.man index 410ecd0..6f340dc 100644 --- a/man/xinput.man +++ b/man/xinput.man @@ -67,10 +67,13 @@ device. .SH COPYRIGHT Copyright 1996,1997, Frederic Lepied. +.PP +Copyright 2008, Philip Langdale. .SH AUTHOR .nf +Philip Langdale, Frederic Lepied, France .fi diff --git a/src/Makefile.am b/src/Makefile.am index 5b09539..39580a5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,8 +21,8 @@ bin_PROGRAMS = xinput -xinput_CFLAGS = $(XINPUT_CFLAGS) -xinput_LDADD = $(XINPUT_LIBS) -lm +AM_CFLAGS = $(XINPUT_CFLAGS) +xinput_LDADD = $(XINPUT_LIBS) xinput_SOURCES = \ buttonmap.c \ diff --git a/src/buttonmap.c b/src/buttonmap.c index 72afc1e..21669e3 100644 --- a/src/buttonmap.c +++ b/src/buttonmap.c @@ -5,15 +5,15 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Frederic Lepied not be used in + * documentation, and that the name of the authors not be used in * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Frederic Lepied makes no + * specific, written prior permission. The authors make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR diff --git a/src/feedback.c b/src/feedback.c index 7f4da57..3fad9a9 100644 --- a/src/feedback.c +++ b/src/feedback.c @@ -5,15 +5,15 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Frederic Lepied not be used in + * documentation, and that the name of the authors not be used in * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Frederic Lepied makes no + * specific, written prior permission. The authors make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR diff --git a/src/list.c b/src/list.c index a802c10..a509872 100644 --- a/src/list.c +++ b/src/list.c @@ -5,15 +5,15 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Frederic Lepied not be used in + * documentation, and that the name of the authors not be used in * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Frederic Lepied makes no + * specific, written prior permission. The authors make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR @@ -162,10 +162,10 @@ list(Display *display, int ret = EXIT_SUCCESS; for(loop=0; loop= IsXExtensionDevice)) && ((!is_id && strcmp(devices[loop].name, name) == 0) || (is_id && devices[loop].id == id))) { - return &devices[loop]; + if (found) { + fprintf(stderr, + "Warning: There are multiple devices named \"%s\".\n" + "To ensure the correct one is selected, please use " + "the device ID instead.\n\n", name); + } else { + found = &devices[loop]; + } } } - return NULL; + return found; } static void -usage() +usage(void) { entry *pdriver = drivers; diff --git a/src/xinput.h b/src/xinput.h index 961d1f7..add9aab 100644 --- a/src/xinput.h +++ b/src/xinput.h @@ -5,15 +5,15 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Frederic Lepied not be used in + * documentation, and that the name of the authors not be used in * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Frederic Lepied makes no + * specific, written prior permission. The authors make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR