summaryrefslogtreecommitdiff
path: root/app/xinput/src
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2014-05-03 19:37:23 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2014-05-03 19:37:23 +0000
commit57263d0be3a654462180f9d6f5cbdba2f7f102e8 (patch)
treeb4838c3fa947a7604fff3256c3b13eaeb829d0a0 /app/xinput/src
parent0bc8e54d3d74af5dd5472dd378c70743ef1456f3 (diff)
Update to xinput 1.6.1
Diffstat (limited to 'app/xinput/src')
-rw-r--r--app/xinput/src/Makefile.in312
-rw-r--r--app/xinput/src/list.c7
-rw-r--r--app/xinput/src/property.c25
-rw-r--r--app/xinput/src/test.c2
-rw-r--r--app/xinput/src/test_xi2.c117
-rw-r--r--app/xinput/src/transform.c78
-rw-r--r--app/xinput/src/xinput.c19
7 files changed, 380 insertions, 180 deletions
diff --git a/app/xinput/src/Makefile.in b/app/xinput/src/Makefile.in
index 6d6bb4ff5..8d1bf4da2 100644
--- a/app/xinput/src/Makefile.in
+++ b/app/xinput/src/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.6 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 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.
@@ -36,18 +36,32 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
-install_sh_PROGRAM = ${SHELL} $(install_sh) -c
-install_sh_SCRIPT = ${SHELL} $(install_sh) -c
+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 = :
@@ -60,16 +74,17 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = xinput$(EXEEXT)
subdir = src
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(install_sh) -d
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am__xinput_SOURCES_DIST = buttonmap.c feedback.c list.c setint.c \
setmode.c setptr.c state.c property.c test.c xinput.c xinput.h \
@@ -83,23 +98,47 @@ am_xinput_OBJECTS = buttonmap.$(OBJEXT) feedback.$(OBJEXT) \
xinput_OBJECTS = $(am_xinput_OBJECTS)
am__DEPENDENCIES_1 =
xinput_DEPENDENCIES = $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
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)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
SOURCES = $(xinput_SOURCES)
DIST_SOURCES = $(am__xinput_SOURCES_DIST)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
@@ -130,8 +169,7 @@ FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
HAVE_XI2 = @HAVE_XI2@
-HAVE_XI2_FALSE = @HAVE_XI2_FALSE@
-HAVE_XI2_TRUE = @HAVE_XI2_TRUE@
+INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -144,21 +182,23 @@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -174,9 +214,11 @@ XI2_LIBS = @XI2_LIBS@
XINPUT_CFLAGS = @XINPUT_CFLAGS@
XINPUT_LIBS = @XINPUT_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
+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@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -188,6 +230,7 @@ build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
+builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
@@ -215,8 +258,12 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
AM_CFLAGS = $(XINPUT_CFLAGS)
xinput_LDADD = $(XINPUT_LIBS)
@HAVE_XI2_TRUE@xinput2_files = hierarchy.c setcp.c test_xi2.c transform.c
@@ -242,14 +289,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( 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 src/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -267,32 +314,50 @@ $(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):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-xinput$(EXEEXT): $(xinput_OBJECTS) $(xinput_DEPENDENCIES)
+xinput$(EXEEXT): $(xinput_OBJECTS) $(xinput_DEPENDENCIES) $(EXTRA_xinput_DEPENDENCIES)
@rm -f xinput$(EXEEXT)
- $(LINK) $(xinput_LDFLAGS) $(xinput_OBJECTS) $(xinput_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(xinput_OBJECTS) $(xinput_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -316,92 +381,112 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xinput.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
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; } \
- END { for (i in files) print i; }'`; \
+ $(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)
- tags=; \
+ 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; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ $(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; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ 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)
- tags=; \
- 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; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ $(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) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
+ @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; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- 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 -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -410,7 +495,7 @@ check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
@@ -422,16 +507,22 @@ install-am: all-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
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
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"
@@ -452,18 +543,38 @@ 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-binPROGRAMS
+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
@@ -483,18 +594,23 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
- clean-generic ctags distclean distclean-compile \
+ clean-generic cscopelist ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
- install-data install-data-am install-exec install-exec-am \
- install-info install-info-am install-man install-strip \
+ 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 pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-binPROGRAMS uninstall-info-am
+ uninstall-am uninstall-binPROGRAMS
+
# 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.
diff --git a/app/xinput/src/list.c b/app/xinput/src/list.c
index fcdc9bcc7..f17634286 100644
--- a/app/xinput/src/list.c
+++ b/app/xinput/src/list.c
@@ -80,8 +80,11 @@ print_info(Display* dpy, XDeviceInfo *info, enum print_format format)
if (format == FORMAT_SHORT)
return;
- if(info->type != None)
- printf("\tType is %s\n", XGetAtomName(dpy, info->type));
+ if (info->type != None) {
+ char *type = XGetAtomName(dpy, info->type);
+ printf("\tType is %s\n", type);
+ XFree(type);
+ }
if (info->num_classes > 0) {
any = (XAnyClassPtr) (info->inputclassinfo);
diff --git a/app/xinput/src/property.c b/app/xinput/src/property.c
index 14e43085d..66a384285 100644
--- a/app/xinput/src/property.c
+++ b/app/xinput/src/property.c
@@ -60,6 +60,7 @@ print_property(Display *dpy, XDevice* dev, Atom property)
name = XGetAtomName(dpy, property);
printf("\t%s (%ld):\t", name, property);
+ XFree(name);
if (XGetDeviceProperty(dpy, dev, property, 0, 1000, False,
AnyPropertyType, &act_type, &act_format,
@@ -127,9 +128,9 @@ print_property(Display *dpy, XDevice* dev, Atom property)
case XA_ATOM:
{
Atom a = *(Atom*)ptr;
- printf("\"%s\" (%d)",
- (a) ? XGetAtomName(dpy, a) : "None",
- (int)a);
+ name = (a) ? XGetAtomName(dpy, a) : NULL;
+ printf("\"%s\" (%d)", name ? name : "None", (int)a);
+ XFree(name);
break;
}
default:
@@ -139,8 +140,9 @@ print_property(Display *dpy, XDevice* dev, Atom property)
break;
}
- printf("\t... of unknown type '%s'\n",
- XGetAtomName(dpy, act_type));
+ name = XGetAtomName(dpy, act_type);
+ printf("\t... of unknown type '%s'\n", name);
+ XFree(name);
done = True;
break;
}
@@ -250,6 +252,7 @@ int watch_props(Display *dpy, int argc, char** argv, char* n, char *desc)
name = XGetAtomName(dpy, dpev->atom);
printf("Property '%s' changed.\n", name);
+ XFree(name);
print_property(dpy, dev, dpev->atom);
}
@@ -427,6 +430,7 @@ print_property_xi2(Display *dpy, int deviceid, Atom property)
name = XGetAtomName(dpy, property);
printf("\t%s (%ld):\t", name, property);
+ XFree(name);
if (XIGetProperty(dpy, deviceid, property, 0, 1000, False,
AnyPropertyType, &act_type, &act_format,
@@ -487,9 +491,9 @@ print_property_xi2(Display *dpy, int deviceid, Atom property)
case XA_ATOM:
{
Atom a = *(uint32_t*)ptr;
- printf("\"%s\" (%ld)",
- (a) ? XGetAtomName(dpy, a) : "None",
- a);
+ name = (a) ? XGetAtomName(dpy, a) : NULL;
+ printf("\"%s\" (%ld)", name ? name : "None", a);
+ XFree(name);
break;
}
break;
@@ -500,8 +504,9 @@ print_property_xi2(Display *dpy, int deviceid, Atom property)
break;
}
- printf("\t... of unknown type %s\n",
- XGetAtomName(dpy, act_type));
+ name = XGetAtomName(dpy, act_type);
+ printf("\t... of unknown type %s\n", name);
+ XFree(name);
done = True;
break;
}
diff --git a/app/xinput/src/test.c b/app/xinput/src/test.c
index 97305c570..efd268acc 100644
--- a/app/xinput/src/test.c
+++ b/app/xinput/src/test.c
@@ -98,6 +98,8 @@ print_events(Display *dpy)
{
XEvent Event;
+ setvbuf(stdout, NULL, _IOLBF, 0);
+
while(1) {
XNextEvent(dpy, &Event);
diff --git a/app/xinput/src/test_xi2.c b/app/xinput/src/test_xi2.c
index bcb4880a9..c8dbf3469 100644
--- a/app/xinput/src/test_xi2.c
+++ b/app/xinput/src/test_xi2.c
@@ -321,84 +321,87 @@ test_xi2(Display *display,
char *name,
char *desc)
{
- XIEventMask mask;
+ XIEventMask mask[2];
+ XIEventMask *m;
Window win;
int deviceid = -1;
+ int use_root = 0;
int rc;
+ setvbuf(stdout, NULL, _IOLBF, 0);
+
+ if (argc >= 1 && strcmp(argv[0], "--root") == 0) {
+ use_root = 1;
+
+ argc--;
+ argv++;
+ }
+
rc = list(display, argc, argv, name, desc);
if (rc != EXIT_SUCCESS)
return rc;
+ if (use_root)
+ win = DefaultRootWindow(display);
+ else
+ win = create_win(display);
+
if (argc >= 1) {
XIDeviceInfo *info;
info = xi2_find_device_info(display, argv[0]);
deviceid = info->deviceid;
}
- win = create_win(display);
/* Select for motion events */
- mask.deviceid = (deviceid == -1) ? XIAllDevices : deviceid;
- mask.mask_len = XIMaskLen(XI_LASTEVENT);
- mask.mask = calloc(mask.mask_len, sizeof(char));
- XISetMask(mask.mask, XI_ButtonPress);
- XISetMask(mask.mask, XI_ButtonRelease);
- XISetMask(mask.mask, XI_KeyPress);
- XISetMask(mask.mask, XI_KeyRelease);
- XISetMask(mask.mask, XI_Motion);
- XISetMask(mask.mask, XI_DeviceChanged);
- XISetMask(mask.mask, XI_Enter);
- XISetMask(mask.mask, XI_Leave);
- XISetMask(mask.mask, XI_FocusIn);
- XISetMask(mask.mask, XI_FocusOut);
+ m = &mask[0];
+ m->deviceid = (deviceid == -1) ? XIAllDevices : deviceid;
+ m->mask_len = XIMaskLen(XI_LASTEVENT);
+ m->mask = calloc(m->mask_len, sizeof(char));
+ XISetMask(m->mask, XI_ButtonPress);
+ XISetMask(m->mask, XI_ButtonRelease);
+ XISetMask(m->mask, XI_KeyPress);
+ XISetMask(m->mask, XI_KeyRelease);
+ XISetMask(m->mask, XI_Motion);
+ XISetMask(m->mask, XI_DeviceChanged);
+ XISetMask(m->mask, XI_Enter);
+ XISetMask(m->mask, XI_Leave);
+ XISetMask(m->mask, XI_FocusIn);
+ XISetMask(m->mask, XI_FocusOut);
#ifdef HAVE_XI22
- XISetMask(mask.mask, XI_TouchBegin);
- XISetMask(mask.mask, XI_TouchUpdate);
- XISetMask(mask.mask, XI_TouchEnd);
+ XISetMask(m->mask, XI_TouchBegin);
+ XISetMask(m->mask, XI_TouchUpdate);
+ XISetMask(m->mask, XI_TouchEnd);
#endif
- if (mask.deviceid == XIAllDevices)
- XISetMask(mask.mask, XI_HierarchyChanged);
- XISetMask(mask.mask, XI_PropertyEvent);
- XISelectEvents(display, win, &mask, 1);
- XMapWindow(display, win);
- XSync(display, False);
-
- {
- XIGrabModifiers modifiers[] = {{0, 0}, {0, 0x10}, {0, 0x1}, {0, 0x11}};
- int nmods = sizeof(modifiers)/sizeof(modifiers[0]);
-
- mask.deviceid = 2;
- memset(mask.mask, 0, mask.mask_len);
- XISetMask(mask.mask, XI_KeyPress);
- XISetMask(mask.mask, XI_KeyRelease);
- XISetMask(mask.mask, XI_ButtonPress);
- XISetMask(mask.mask, XI_ButtonRelease);
- XISetMask(mask.mask, XI_Motion);
- XIGrabButton(display, 2, 1, win, None, GrabModeAsync, GrabModeAsync,
- False, &mask, nmods, modifiers);
- XIGrabKeycode(display, 3, 24 /* q */, win, GrabModeAsync, GrabModeAsync,
- False, &mask, nmods, modifiers);
- XIUngrabButton(display, 3, 1, win, nmods - 2, &modifiers[2]);
- XIUngrabKeycode(display, 3, 24 /* q */, win, nmods - 2, &modifiers[2]);
- }
-
- mask.deviceid = (deviceid == -1) ? XIAllMasterDevices : deviceid;
- memset(mask.mask, 0, mask.mask_len);
- XISetMask(mask.mask, XI_RawKeyPress);
- XISetMask(mask.mask, XI_RawKeyRelease);
- XISetMask(mask.mask, XI_RawButtonPress);
- XISetMask(mask.mask, XI_RawButtonRelease);
- XISetMask(mask.mask, XI_RawMotion);
+ if (m->deviceid == XIAllDevices)
+ XISetMask(m->mask, XI_HierarchyChanged);
+ XISetMask(m->mask, XI_PropertyEvent);
+
+ m = &mask[1];
+ m->deviceid = (deviceid == -1) ? XIAllMasterDevices : deviceid;
+ m->mask_len = XIMaskLen(XI_LASTEVENT);
+ m->mask = calloc(m->mask_len, sizeof(char));
+ XISetMask(m->mask, XI_RawKeyPress);
+ XISetMask(m->mask, XI_RawKeyRelease);
+ XISetMask(m->mask, XI_RawButtonPress);
+ XISetMask(m->mask, XI_RawButtonRelease);
+ XISetMask(m->mask, XI_RawMotion);
#ifdef HAVE_XI22
- XISetMask(mask.mask, XI_RawTouchBegin);
- XISetMask(mask.mask, XI_RawTouchUpdate);
- XISetMask(mask.mask, XI_RawTouchEnd);
+ XISetMask(m->mask, XI_RawTouchBegin);
+ XISetMask(m->mask, XI_RawTouchUpdate);
+ XISetMask(m->mask, XI_RawTouchEnd);
#endif
- XISelectEvents(display, DefaultRootWindow(display), &mask, 1);
- free(mask.mask);
+ XISelectEvents(display, win, &mask[0], use_root ? 2 : 1);
+ if (!use_root) {
+ XISelectEvents(display, DefaultRootWindow(display), &mask[1], 1);
+ XMapWindow(display, win);
+ }
+ XSync(display, False);
- {
+ free(mask[0].mask);
+ free(mask[1].mask);
+
+ if (!use_root) {
XEvent event;
XMaskEvent(display, ExposureMask, &event);
XSelectInput(display, win, 0);
diff --git a/app/xinput/src/transform.c b/app/xinput/src/transform.c
index f80a592f8..d85b07150 100644
--- a/app/xinput/src/transform.c
+++ b/app/xinput/src/transform.c
@@ -107,10 +107,30 @@ apply_matrix(Display *dpy, int deviceid, Matrix *m)
}
static void
+matrix_s4(Matrix *m, float x02, float x12, float d1, float d2, int main_diag)
+{
+ matrix_set(m, 0, 2, x02);
+ matrix_set(m, 1, 2, x12);
+
+ if (main_diag) {
+ matrix_set(m, 0, 0, d1);
+ matrix_set(m, 1, 1, d2);
+ } else {
+ matrix_set(m, 0, 0, 0);
+ matrix_set(m, 1, 1, 0);
+ matrix_set(m, 0, 1, d1);
+ matrix_set(m, 1, 0, d2);
+ }
+}
+
+#define RR_Reflect_All (RR_Reflect_X|RR_Reflect_Y)
+
+static void
set_transformation_matrix(Display *dpy, Matrix *m, int offset_x, int offset_y,
- int screen_width, int screen_height)
+ int screen_width, int screen_height,
+ int rotation)
{
- /* offset */
+ /* total display size */
int width = DisplayWidth(dpy, DefaultScreen(dpy));
int height = DisplayHeight(dpy, DefaultScreen(dpy));
@@ -124,11 +144,49 @@ set_transformation_matrix(Display *dpy, Matrix *m, int offset_x, int offset_y,
matrix_set_unity(m);
- matrix_set(m, 0, 2, x);
- matrix_set(m, 1, 2, y);
-
- matrix_set(m, 0, 0, w);
- matrix_set(m, 1, 1, h);
+ /*
+ * There are 16 cases:
+ * Rotation X Reflection
+ * Rotation: 0 | 90 | 180 | 270
+ * Reflection: None | X | Y | XY
+ *
+ * They are spelled out instead of doing matrix multiplication to avoid
+ * any floating point errors.
+ */
+ switch (rotation) {
+ case RR_Rotate_0:
+ case RR_Rotate_180 | RR_Reflect_All:
+ matrix_s4(m, x, y, w, h, 1);
+ break;
+ case RR_Reflect_X|RR_Rotate_0:
+ case RR_Reflect_Y|RR_Rotate_180:
+ matrix_s4(m, x + w, y, -w, h, 1);
+ break;
+ case RR_Reflect_Y|RR_Rotate_0:
+ case RR_Reflect_X|RR_Rotate_180:
+ matrix_s4(m, x, y + h, w, -h, 1);
+ break;
+ case RR_Rotate_90:
+ case RR_Rotate_270 | RR_Reflect_All: /* left limited - correct in working zone. */
+ matrix_s4(m, x + w, y, -w, h, 0);
+ break;
+ case RR_Rotate_270:
+ case RR_Rotate_90 | RR_Reflect_All: /* left limited - correct in working zone. */
+ matrix_s4(m, x, y + h, w, -h, 0);
+ break;
+ case RR_Rotate_90 | RR_Reflect_X: /* left limited - correct in working zone. */
+ case RR_Rotate_270 | RR_Reflect_Y: /* left limited - correct in working zone. */
+ matrix_s4(m, x, y, w, h, 0);
+ break;
+ case RR_Rotate_90 | RR_Reflect_Y: /* right limited - correct in working zone. */
+ case RR_Rotate_270 | RR_Reflect_X: /* right limited - correct in working zone. */
+ matrix_s4(m, x + w, y + h, -w, -h, 0);
+ break;
+ case RR_Rotate_180:
+ case RR_Reflect_All|RR_Rotate_0:
+ matrix_s4(m, x + w, y + h, -w, -h, 1);
+ break;
+ }
#if DEBUG
matrix_print(m);
@@ -186,7 +244,8 @@ map_output_xrandr(Display *dpy, int deviceid, const char *output_name)
matrix_set_unity(&m);
crtc_info = XRRGetCrtcInfo (dpy, res, output_info->crtc);
set_transformation_matrix(dpy, &m, crtc_info->x, crtc_info->y,
- crtc_info->width, crtc_info->height);
+ crtc_info->width, crtc_info->height,
+ crtc_info->rotation);
rc = apply_matrix(dpy, deviceid, &m);
XRRFreeCrtcInfo(crtc_info);
XRRFreeOutputInfo(output_info);
@@ -242,7 +301,8 @@ map_output_xinerama(Display *dpy, int deviceid, const char *output_name)
matrix_set_unity(&m);
set_transformation_matrix(dpy, &m,
screens[head].x_org, screens[head].y_org,
- screens[head].width, screens[head].height);
+ screens[head].width, screens[head].height,
+ RR_Rotate_0);
rc = apply_matrix(dpy, deviceid, &m);
out:
diff --git a/app/xinput/src/xinput.c b/app/xinput/src/xinput.c
index 0f8672022..b0e0e7f75 100644
--- a/app/xinput/src/xinput.c
+++ b/app/xinput/src/xinput.c
@@ -101,7 +101,7 @@ static entry drivers[] =
set_clientpointer
},
{ "test-xi2",
- "<device>",
+ "[--root] <device>",
test_xi2,
},
{ "map-to-output",
@@ -202,15 +202,26 @@ xinput_version(Display *display)
/* Announce our supported version so the server treats us correctly. */
if (vers >= XI_2_Major)
{
+ const char *forced_version;
int maj = 2,
min = 0;
-#if HAVE_XI21
- min = 1;
-#elif HAVE_XI22
+#if HAVE_XI22
min = 2;
+#elif HAVE_XI21
+ min = 1;
#endif
+ forced_version = getenv("XINPUT_XI2_VERSION");
+ if (forced_version) {
+ if (sscanf(forced_version, "%d.%d", &maj, &min) != 2) {
+ fprintf(stderr, "Invalid format of XINPUT_XI2_VERSION "
+ "environment variable. Need major.minor\n");
+ exit(1);
+ }
+ printf("Overriding XI2 version to: %d.%d\n", maj, min);
+ }
+
XIQueryVersion(display, &maj, &min);
}
#endif