diff options
author | Changyeon Lee <cyeon.lee@samsung.com> | 2014-04-17 14:39:57 +0900 |
---|---|---|
committer | Changyeon Lee <cyeon.lee@samsung.com> | 2014-04-17 14:46:35 +0900 |
commit | d5f1069578c6f2b707d463c197163613bc502853 (patch) | |
tree | 836035c7bd81e5d15a5fe0ebd5dba6803cf682ef /src | |
parent | ab7662b5f2bf3d79acd759fbbe7ee0ac26e88e09 (diff) | |
parent | 15bf21e12a253075023da08719a9d0110d87e287 (diff) | |
download | xinput-tizen.tar.gz xinput-tizen.tar.bz2 xinput-tizen.zip |
Merge branch 'devel/upgrade' into tizenHEADtizen_3.0.2014.q3_common_releasesubmit/tizen_mobile/20141120.000000submit/tizen/20140819.234625submit/tizen/20140818.144456submit/tizen/20140818.084211submit/tizen/20140417.073530submit/devel/x11/20140718.035926accepted/tizen/mobile/20140519.083100tizen_3.0.2015.q2_commontizen_3.0.2015.q1_commontizen_3.0.2014.q4_commontizen_3.0.2014.q3_commontizendevel/x11accepted/tizen_wearableaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_commonaccepted/tizen_3.0.2014.q3_common
Change-Id: Iccf631e1ee192532419cf513fcb8dccfc2f6182c
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/.gitignore | 2 | ||||
-rw-r--r-- | src/Makefile.in | 570 | ||||
-rw-r--r-- | src/list.c | 7 | ||||
-rw-r--r-- | src/property.c | 25 | ||||
-rw-r--r-- | src/test.c | 2 | ||||
-rw-r--r-- | src/test_xi2.c | 117 | ||||
-rw-r--r-- | src/transform.c | 78 | ||||
-rw-r--r-- | src/xinput.c | 19 |
8 files changed, 168 insertions, 652 deletions
diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..f391ad5 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,2 @@ +# Add & Override for this directory and it's subdirectories +xinput diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index 545c0b1..0000000 --- a/src/Makefile.in +++ /dev/null @@ -1,570 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ - -# Copyright © 2007 Peter Hutterer -# 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. - -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@ -bin_PROGRAMS = xinput$(EXEEXT) -subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -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 = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -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 \ - hierarchy.c setcp.c test_xi2.c transform.c -@HAVE_XI2_TRUE@am__objects_1 = hierarchy.$(OBJEXT) setcp.$(OBJEXT) \ -@HAVE_XI2_TRUE@ test_xi2.$(OBJEXT) transform.$(OBJEXT) -am_xinput_OBJECTS = buttonmap.$(OBJEXT) feedback.$(OBJEXT) \ - list.$(OBJEXT) setint.$(OBJEXT) setmode.$(OBJEXT) \ - setptr.$(OBJEXT) state.$(OBJEXT) property.$(OBJEXT) \ - test.$(OBJEXT) xinput.$(OBJEXT) $(am__objects_1) -xinput_OBJECTS = $(am_xinput_OBJECTS) -am__DEPENDENCIES_1 = -xinput_DEPENDENCIES = $(am__DEPENDENCIES_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_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -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_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(xinput_SOURCES) -DIST_SOURCES = $(am__xinput_SOURCES_DIST) -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@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APP_MAN_DIR = @APP_MAN_DIR@ -APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_CFLAGS = @BASE_CFLAGS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CHANGELOG_CMD = @CHANGELOG_CMD@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CWARNFLAGS = @CWARNFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ -DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FILE_MAN_DIR = @FILE_MAN_DIR@ -FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -GREP = @GREP@ -HAVE_XI2 = @HAVE_XI2@ -INSTALL = @INSTALL@ -INSTALL_CMD = @INSTALL_CMD@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIB_MAN_DIR = @LIB_MAN_DIR@ -LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -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@ -STRICT_CFLAGS = @STRICT_CFLAGS@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XI21_CFLAGS = @XI21_CFLAGS@ -XI21_LIBS = @XI21_LIBS@ -XI22_CFLAGS = @XI22_CFLAGS@ -XI22_LIBS = @XI22_LIBS@ -XI2_CFLAGS = @XI2_CFLAGS@ -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__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@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -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@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -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 -xinput_SOURCES = \ - buttonmap.c \ - feedback.c \ - list.c \ - setint.c \ - setmode.c \ - setptr.c \ - state.c \ - property.c \ - test.c \ - xinput.c \ - xinput.h \ - $(xinput2_files) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .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 src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/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): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - 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)'; 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) $(EXTRA_xinput_DEPENDENCIES) - @rm -f xinput$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(xinput_OBJECTS) $(xinput_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buttonmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/feedback.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hierarchy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setcp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setmode.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_xi2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transform.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xinput.Po@am__quote@ - -.c.o: -@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@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@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@ $(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; 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 - -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 -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -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: - 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" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic 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-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 - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-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 \ - 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-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 - - -# 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: @@ -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/src/property.c b/src/property.c index 14e4308..66a3842 100644 --- a/src/property.c +++ b/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; } @@ -98,6 +98,8 @@ print_events(Display *dpy) { XEvent Event; + setvbuf(stdout, NULL, _IOLBF, 0); + while(1) { XNextEvent(dpy, &Event); diff --git a/src/test_xi2.c b/src/test_xi2.c index bcb4880..c8dbf34 100644 --- a/src/test_xi2.c +++ b/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/src/transform.c b/src/transform.c index f80a592..d85b071 100644 --- a/src/transform.c +++ b/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/src/xinput.c b/src/xinput.c index 0f86720..b0e0e7f 100644 --- a/src/xinput.c +++ b/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 |