summaryrefslogtreecommitdiff
path: root/driver/xf86-input-ur98/src
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2006-11-26 19:58:00 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2006-11-26 19:58:00 +0000
commit1404fdd11b30cf4a47356fa28cc31873c62351c7 (patch)
tree40d91601bf12131668b82dee2516193cd66330de /driver/xf86-input-ur98/src
parenta009fd9a1bdc15fd70e69eae45a3ba9af589b51f (diff)
Importing xf86-input-ur98 1.1.0
Diffstat (limited to 'driver/xf86-input-ur98/src')
-rw-r--r--driver/xf86-input-ur98/src/Makefile.am31
-rw-r--r--driver/xf86-input-ur98/src/Makefile.in499
-rw-r--r--driver/xf86-input-ur98/src/xf86Ur-98.c722
3 files changed, 1252 insertions, 0 deletions
diff --git a/driver/xf86-input-ur98/src/Makefile.am b/driver/xf86-input-ur98/src/Makefile.am
new file mode 100644
index 000000000..b410b3037
--- /dev/null
+++ b/driver/xf86-input-ur98/src/Makefile.am
@@ -0,0 +1,31 @@
+# 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.
+
+
+# this is obnoxious:
+# -module lets us name the module exactly how we want
+# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
+# _ladir passes a dummy rpath to libtool so the thing will actually link
+# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
+@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
+@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
+@DRIVER_NAME@_drv_ladir = @inputdir@
+
+@DRIVER_NAME@_drv_la_SOURCES = xf86Ur-98.c
diff --git a/driver/xf86-input-ur98/src/Makefile.in b/driver/xf86-input-ur98/src/Makefile.in
new file mode 100644
index 000000000..da5c6a089
--- /dev/null
+++ b/driver/xf86-input-ur98/src/Makefile.in
@@ -0,0 +1,499 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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 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.
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+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@
+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 =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(@DRIVER_NAME@_drv_ladir)"
+@DRIVER_NAME@_drv_laLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(@DRIVER_NAME@_drv_la_LTLIBRARIES)
+@DRIVER_NAME@_drv_la_LIBADD =
+am_@DRIVER_NAME@_drv_la_OBJECTS = xf86Ur-98.lo
+@DRIVER_NAME@_drv_la_OBJECTS = $(am_@DRIVER_NAME@_drv_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(@DRIVER_NAME@_drv_la_SOURCES)
+DIST_SOURCES = $(@DRIVER_NAME@_drv_la_SOURCES)
+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@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRIVER_NAME = @DRIVER_NAME@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+OBJEXT = @OBJEXT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_LIBS = @XORG_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+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@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+inputdir = @inputdir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+# this is obnoxious:
+# -module lets us name the module exactly how we want
+# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
+# _ladir passes a dummy rpath to libtool so the thing will actually link
+# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
+@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
+@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
+@DRIVER_NAME@_drv_ladir = @inputdir@
+@DRIVER_NAME@_drv_la_SOURCES = xf86Ur-98.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 \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu 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
+install-@DRIVER_NAME@_drv_laLTLIBRARIES: $(@DRIVER_NAME@_drv_la_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(@DRIVER_NAME@_drv_ladir)" || $(mkdir_p) "$(DESTDIR)$(@DRIVER_NAME@_drv_ladir)"
+ @list='$(@DRIVER_NAME@_drv_la_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(@DRIVER_NAME@_drv_laLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(@DRIVER_NAME@_drv_ladir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(@DRIVER_NAME@_drv_laLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(@DRIVER_NAME@_drv_ladir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-@DRIVER_NAME@_drv_laLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(@DRIVER_NAME@_drv_la_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(@DRIVER_NAME@_drv_ladir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(@DRIVER_NAME@_drv_ladir)/$$p"; \
+ done
+
+clean-@DRIVER_NAME@_drv_laLTLIBRARIES:
+ -test -z "$(@DRIVER_NAME@_drv_la_LTLIBRARIES)" || rm -f $(@DRIVER_NAME@_drv_la_LTLIBRARIES)
+ @list='$(@DRIVER_NAME@_drv_la_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
+@DRIVER_NAME@_drv.la: $(@DRIVER_NAME@_drv_la_OBJECTS) $(@DRIVER_NAME@_drv_la_DEPENDENCIES)
+ $(LINK) -rpath $(@DRIVER_NAME@_drv_ladir) $(@DRIVER_NAME@_drv_la_LDFLAGS) $(@DRIVER_NAME@_drv_la_OBJECTS) $(@DRIVER_NAME@_drv_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Ur-98.Plo@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@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(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@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@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
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+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; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(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; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ 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" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && 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)'; 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; \
+ 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 \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$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 $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(@DRIVER_NAME@_drv_ladir)"; 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:
+ $(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)
+
+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-@DRIVER_NAME@_drv_laLTLIBRARIES clean-generic \
+ clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-@DRIVER_NAME@_drv_laLTLIBRARIES
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+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: uninstall-@DRIVER_NAME@_drv_laLTLIBRARIES \
+ uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean \
+ clean-@DRIVER_NAME@_drv_laLTLIBRARIES 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-@DRIVER_NAME@_drv_laLTLIBRARIES install-am \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man 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-@DRIVER_NAME@_drv_laLTLIBRARIES \
+ uninstall-am uninstall-info-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/driver/xf86-input-ur98/src/xf86Ur-98.c b/driver/xf86-input-ur98/src/xf86Ur-98.c
new file mode 100644
index 000000000..e62ef20cd
--- /dev/null
+++ b/driver/xf86-input-ur98/src/xf86Ur-98.c
@@ -0,0 +1,722 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/ur98/xf86Ur-98.c,v 1.1tsi Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#define inline __inline__
+#include <linux/joystick.h>
+
+#undef BUS_ISA
+#undef BUS_PCI
+
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86Xinput.h"
+#include "exevents.h"
+#include "os.h"
+
+#ifdef XFree86LOADER
+#include "xf86Module.h"
+
+static const char *reqSymbols[] = {
+ "AddEnabledDevice",
+ "ErrorF",
+ "InitButtonClassDeviceStruct",
+ "InitProximityClassDeviceStruct",
+ "InitValuatorAxisStruct",
+ "InitValuatorClassDeviceStruct",
+ "InitPtrFeedbackClassDeviceStruct",
+ "RemoveEnabledDevice",
+ "Xcalloc",
+ "Xfree",
+ "XisbBlockDuration",
+ "XisbFree",
+ "XisbNew",
+ "XisbRead",
+ "XisbTrace",
+ "screenInfo",
+ "xf86AddInputDriver",
+ "xf86AllocateInput",
+ "xf86CloseSerial",
+ "xf86CollectInputOptions",
+ "xf86ErrorFVerb",
+ "xf86FindOptionValue",
+ "xf86GetMotionEvents",
+ "xf86GetVerbosity",
+ "xf86MotionHistoryAllocate",
+ "xf86NameCmp",
+ "xf86OpenSerial",
+ "xf86OptionListCreate",
+ "xf86OptionListMerge",
+ "xf86OptionListReport",
+ "xf86PostButtonEvent",
+ "xf86PostMotionEvent",
+ "xf86PostProximityEvent",
+ "xf86ProcessCommonOptions",
+ "xf86ScaleAxis",
+ "xf86SetIntOption",
+ "xf86SetStrOption",
+ "xf86XInputSetScreen",
+ "xf86XInputSetSendCoreEvents",
+ NULL
+};
+#endif
+
+
+
+/*
+ ***************************************************************************
+ *
+ * Default constants.
+ *
+ ***************************************************************************
+ */
+
+#define DEFAULT_MAX_X 32768
+#define DEFAULT_MIN_X 0
+#define DEFAULT_MAX_Y 65535
+#define DEFAULT_MIN_Y 0
+#define DEFAULT_MAX_Z 65535
+#define DEFAULT_MIN_Z 0
+#define DEFAULT_MAX_T 65535
+#define DEFAULT_MIN_T 0
+
+#define DEFAULT_HEAD_THRESH 38000
+#define DEFAULT_HEAD_LOCK 450
+
+#define XI_STYLUS "HEAD" /* X device name for the head tracking device */
+
+
+/*
+ ***************************************************************************
+ *
+ * Device private records.
+ *
+ ***************************************************************************
+ */
+
+typedef struct _UR98PrivateRec {
+ char *input_dev; /* The head screen input device */
+ int min_x; /* Minimum x reported by calibration */
+ int max_x; /* Maximum x */
+ int min_y; /* Minimum y reported by calibration */
+ int max_y; /* Maximum y */
+ int min_z; /* Minimum z */
+ int max_z; /* Maximum z */
+ int min_t; /* Minimum t */
+ int max_t; /* Maximum t */
+ int cur_x; /* Current x */
+ int cur_y; /* Current y */
+ int cur_z; /* Current z */
+ int cur_t; /* Current t */
+ int axes; /* Number of axes */
+ int button_5; /* True if axis 4 is remapped as button5 */
+ int buttons[5]; /* Button status */
+ int screen_no; /* Screen associated with the device */
+ int screen_width; /* Width of the associated X screen */
+ int screen_height; /* Height of the screen */
+ Bool inited; /* The controller has already been configured ? */
+ char state; /* Current state of report flags. */
+ LocalDevicePtr head; /* Device ptr associated with the hw. */
+ int swap_axes; /* Swap X an Y axes if != 0 */
+ int head_button; /* Z is button 0, cur_z is holds true cur_t */
+ int head_lock; /* Lock for x/y in head_button mode */
+ int head_thresh; /* Threshhold for Z as button down */
+} UR98PrivateRec, *UR98PrivatePtr;
+
+
+/*
+ ***************************************************************************
+ *
+ * xf86UR98Convert --
+ * Convert extended valuators to x and y suitable for core motion
+ * events. Return True if ok and False if the requested conversion
+ * can't be done for the specified valuators.
+ *
+ ***************************************************************************
+ */
+static Bool xf86UR98Convert(LocalDevicePtr local, int first, int num,
+ int v0,int v1,int v2,int v3, int v4, int v5, int *x, int *y)
+{
+ UR98PrivatePtr priv = (UR98PrivatePtr) local->private;
+ int width = priv->max_x - priv->min_x;
+ int height = priv->max_y - priv->min_y;
+ int input_x, input_y;
+ int tmp;
+
+ input_x = v0;
+ input_y = v1;
+
+ if (priv->swap_axes) {
+ tmp = input_x;
+ input_x = input_y;
+ input_y = tmp;
+ }
+ *x = (priv->screen_width * (input_x - priv->min_x)) / width;
+ *y = (priv->screen_height * (input_y - priv->min_y)) / height;
+ /*
+ * Need to check if still on the correct screen.
+ * This call is here so that this work can be done after
+ * calib and before posting the event.
+ */
+ xf86XInputSetScreen(local, priv->screen_no, *x, *y);
+ return TRUE;
+}
+
+static void UR98PtrCtrl(DeviceIntPtr device, PtrCtrl *ctrl)
+{
+ /* I have no clue what this does, except that registering it stops the
+ X server segfaulting in ProcGetPointerMapping()
+ Ho Hum.
+ */
+}
+
+static void xf86UR98ReadInput(LocalDevicePtr local)
+{
+ UR98PrivatePtr priv = (UR98PrivatePtr)(local->private);
+ struct js_event event;
+ int one=1;
+
+ ioctl(local->fd, FIONBIO, &one);
+
+ while(read(local->fd, &event, sizeof(event))==sizeof(event))
+ {
+ if(event.type & JS_EVENT_BUTTON)
+ {
+ /* Shift the buttons if Z is button 1 */
+ event.number += priv->head_button;
+ if(priv->buttons[event.number] != event.value)
+ {
+ priv->buttons[event.number] = event.value;
+ xf86PostButtonEvent(priv->head->dev, TRUE, event.number + 1, event.value,
+ 0, priv->axes, priv->cur_x, priv->cur_y, priv->cur_z, priv->cur_t);
+ }
+ }
+ if(event.type & JS_EVENT_AXIS)
+ {
+ int lock = 0;
+
+ if(priv->head_lock)
+ {
+ lock = priv->cur_t - priv->head_thresh;
+ ErrorF("Lock %d\n", lock);
+ if(lock < -priv->head_lock || lock > priv->head_lock)
+ lock = 0;
+ else
+ lock = priv->head_button;
+ }
+
+ switch(event.number)
+ {
+ case 0:
+ if(!lock)
+ priv->cur_x = event.value+32768;
+ break;
+ case 1:
+ if(!lock)
+ priv->cur_y = event.value+32768;
+ break;
+ case 2:
+ if(priv->button_5 == 0)
+ {
+ /* We use cur_z to hold cur_t in
+ head button mode. Hackish but saves
+ a lot of conditional code elsewhere */
+ if(priv->head_button)
+ priv->cur_z = event.value + 32768;
+ else
+ priv->cur_t = event.value +32768;
+ }
+ else
+ {
+ if(event.value > 0)
+ event.value = 1;
+ else
+ event.value = 0;
+ if(priv->buttons[4] != event.value)
+ {
+ priv->buttons[4] = event.value;
+ xf86PostButtonEvent(priv->head->dev, TRUE, 4, event.value,
+ 0, priv->axes, priv->cur_x, priv->cur_y, priv->cur_z, priv->cur_t);
+ }
+ }
+ case 3:
+ if(priv->head_button == 0)
+ priv->cur_z = event.value+32768;
+ else
+ {
+ ErrorF("Head at %d\n", event.value + 32768);
+ priv->cur_t = event.value+32768;
+ /* Low is near... */
+ if(priv->cur_t < priv->head_thresh)
+ event.value = 1;
+ else
+ event.value = 0;
+ if(priv->buttons[0] != event.value)
+ {
+ priv->buttons[0] = event.value;
+ xf86PostButtonEvent(priv->head->dev, TRUE, 1, event.value,
+ 0, priv->axes, priv->cur_x, priv->cur_y, priv->cur_z, priv->cur_t);
+ }
+ }
+ break;
+ }
+ xf86PostMotionEvent(priv->head->dev, TRUE, 0, priv->axes, priv->cur_x, priv->cur_y, priv->cur_z, priv->cur_t);
+ }
+ }
+}
+
+
+/*
+ ***************************************************************************
+ *
+ * xf86UR98Control --
+ *
+ ***************************************************************************
+ */
+static Bool
+xf86UR98Control(DeviceIntPtr dev,
+ int mode)
+{
+ static unsigned char map[] = { 0, 1, 2, 3, 4, 5};
+ LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
+ UR98PrivatePtr priv = (UR98PrivatePtr)(local->private);
+
+ switch(mode)
+ {
+
+ case DEVICE_INIT:
+ if (priv->screen_no >= screenInfo.numScreens || priv->screen_no < 0) {
+ priv->screen_no = 0;
+ }
+ priv->screen_width = screenInfo.screens[priv->screen_no]->width;
+ priv->screen_height = screenInfo.screens[priv->screen_no]->height;
+
+ /*
+ * Device reports button press for up to 5 buttons.
+ */
+ if (InitButtonClassDeviceStruct(dev, 4 + priv->button_5, map) == FALSE) {
+ ErrorF("Unable to allocate ButtonClassDeviceStruct\n");
+ return !Success;
+ }
+
+ /*
+ * Device reports motions on 3 axes in absolute coordinates.
+ * Axes min and max values are reported in raw coordinates.
+ * Resolution is computed roughly by the difference between
+ * max and min values scaled from the approximate size of the
+ * screen to fit one meter.
+ */
+
+ if (InitValuatorClassDeviceStruct(dev, priv->axes, xf86GetMotionEvents,
+ local->history_size, Absolute) == FALSE) {
+ ErrorF("Unable to allocate ValuatorClassDeviceStruct\n");
+ return !Success;
+ }
+ else
+ {
+ InitValuatorAxisStruct(dev, 0, priv->min_x, priv->max_x,
+ 65535,
+ 0 /* min_res */,
+ 65535 /* max_res */);
+ InitValuatorAxisStruct(dev, 1, priv->min_y, priv->max_y,
+ 65535, /* resolution */
+ 0 /* min_res */,
+ 65535 /* max_res */);
+ if(priv->axes > 2)
+ {
+ if(priv->head_button)
+ {
+ /* In head button mode we skip the Z axis */
+ InitValuatorAxisStruct(dev, 2, priv->min_t, priv->max_t,
+ 65535, /* resolution */
+ 0 /* min_res */,
+ 65535 /* max_res */);
+ }
+ else
+ {
+ InitValuatorAxisStruct(dev, 2, priv->min_z, priv->max_z,
+ 65535, /* resolution */
+ 0 /* min_res */,
+ 65535 /* max_res */);
+ }
+ }
+ if(priv->axes > 3)
+ InitValuatorAxisStruct(dev, 3, priv->min_t, priv->max_t,
+ 65535, /* resolution */
+ 0 /* min_res */,
+ 65535 /* max_res */);
+ }
+
+ if (InitFocusClassDeviceStruct(dev) == FALSE) {
+ ErrorF("Unable to allocate FocusClassDeviceStruct\n");
+ }
+
+ if(InitPtrFeedbackClassDeviceStruct(dev, UR98PtrCtrl) == FALSE) {
+ ErrorF("Unable to allocate PtrFeedBackClassDeviceStruct\n");
+ }
+
+ /*
+ * Allocate the motion events buffer.
+ */
+
+ xf86MotionHistoryAllocate(local);
+
+ return Success;
+
+ case DEVICE_ON:
+ if (local->fd < 0) {
+ char c;
+ int ver;
+
+ local->fd = open(priv->input_dev, O_RDONLY|O_NDELAY);
+ if (local->fd < 0) {
+ ErrorF("Unable to open UR98 headtracker device\n");
+ return !Success;
+ }
+ if(ioctl(local->fd, JSIOCGVERSION, &ver)==-1)
+ {
+ ErrorF("Unable to query headtracker interface version\n");
+ return !Success;
+ }
+ if(ioctl(local->fd, JSIOCGAXES, &c)==-1)
+ {
+ ErrorF("Unable to query headtracker parameters\n");
+ return !Success;
+ }
+ if(c!=4)
+ {
+ ErrorF("Device is not a UR-98\n");
+ return !Success;
+ }
+ if(ioctl(local->fd, JSIOCGBUTTONS, &c)==-1)
+ {
+ ErrorF("Unable to query headtracker parameters\n");
+ return !Success;
+ }
+ if(c!=4)
+ {
+ ErrorF("Device is not a UR-98\n");
+ return !Success;
+ }
+ AddEnabledDevice(local->fd);
+ }
+ dev->public.on = TRUE;
+ return Success;
+
+ case DEVICE_OFF:
+ dev->public.on = FALSE;
+ return Success;
+
+ case DEVICE_CLOSE:
+ dev->public.on = FALSE;
+ if (local->fd >= 0) {
+ xf86RemoveEnabledDevice(local);
+ close(local->fd);
+ local->fd = -1;
+ }
+ return Success;
+ default:
+ ErrorF("unsupported mode=%d\n", mode);
+ return !Success;
+ }
+}
+
+/*
+ ***************************************************************************
+ *
+ * xf86UR98ControlProc --
+ *
+ ***************************************************************************
+ */
+
+static int xf86UR98ControlProc (InputInfoPtr pInfo, xDeviceCtl * control)
+{
+ return (Success);
+}
+
+/*
+ ***************************************************************************
+ *
+ * xf86UR98Allocate --
+ *
+ ***************************************************************************
+ */
+static LocalDevicePtr xf86UR98Allocate(InputDriverPtr drv, char *name, char *type_name, int flag)
+{
+ LocalDevicePtr local = xf86AllocateInput(drv, 0);
+ UR98PrivatePtr priv = (UR98PrivatePtr) xalloc(sizeof(UR98PrivateRec));
+ int i;
+
+ if (!local || !priv)
+ {
+ if(priv)
+ xfree(priv);
+ if(local)
+ xfree(local);
+ return NULL;
+ }
+
+ priv->input_dev = strdup("/dev/js0");
+ priv->min_x = 0;
+ priv->max_x = 0;
+ priv->min_y = 0;
+ priv->max_y = 0;
+ priv->min_z = 0;
+ priv->max_z = 0;
+ priv->min_t = 0;
+ priv->max_t = 0;
+ priv->button_5 = 0;
+ priv->axes = 4;
+ priv->screen_no = 0;
+ priv->screen_width = -1;
+ priv->screen_height = -1;
+ priv->inited = 0;
+ priv->state = 0;
+ priv->swap_axes = 0;
+ for(i = 0; i < 5; i++)
+ priv->buttons[i] = 0;
+ priv->head_button = 0;
+ priv->head_thresh = 0;
+ priv->head_lock = 0;
+
+ local->name = name;
+ local->flags = 0 /* XI86_NO_OPEN_ON_INIT */;
+ local->device_control = xf86UR98Control;
+ local->read_input = xf86UR98ReadInput;
+ local->control_proc = xf86UR98ControlProc;
+ local->close_proc = NULL;
+ local->switch_mode = NULL;
+ local->conversion_proc = xf86UR98Convert;
+ local->reverse_conversion_proc = NULL;
+ local->fd = -1;
+ local->atom = 0;
+ local->dev = NULL;
+ local->private = priv;
+ local->private_flags = flag;
+ local->type_name = type_name;
+ local->history_size = 0;
+
+ return local;
+}
+
+
+/*
+ ***************************************************************************
+ *
+ * xf86UR98AllocateHeadTracker --
+ *
+ ***************************************************************************
+ */
+static LocalDevicePtr xf86UR98AllocateHeadTracker(InputDriverPtr drv)
+{
+ LocalDevicePtr local = xf86UR98Allocate(drv, XI_STYLUS, "UR98 HeadTracker", 1);
+ if (local)
+ ((UR98PrivatePtr) local->private)->head = local;
+ return local;
+}
+
+
+static void xf86UR98Uninit(InputDriverPtr drv, LocalDevicePtr local, int flags)
+{
+ UR98PrivatePtr priv = (UR98PrivatePtr) local->private;
+
+ xf86UR98Control(local->dev, DEVICE_OFF);
+
+ if (priv) {
+ priv->head->private = NULL;
+ xfree(priv->input_dev);
+ xfree(priv);
+ }
+ xfree(local->name);
+ xfree(local);
+
+ xf86DeleteInput(local, 0);
+}
+
+static InputInfoPtr xf86UR98Init(InputDriverPtr drv, IDevPtr dev, int flags)
+{
+ LocalDevicePtr local=NULL;
+ UR98PrivatePtr priv=NULL;
+ char *str;
+ int portrait=0;
+
+
+ local = xf86UR98AllocateHeadTracker(drv);
+ priv = local->private;
+ local->conf_idev = dev;
+
+ xf86CollectInputOptions(local, NULL, NULL);
+
+ str = xf86FindOptionValue(local->options, "Device");
+ if (!str) {
+ xf86Msg(X_ERROR, "%s: No Device specified in UR98 module config.\n", dev->identifier);
+ goto init_err;
+ }
+ priv->input_dev = strdup(str);
+ priv->head = local;
+
+ /* Process the common options. */
+ xf86ProcessCommonOptions(local, local->options);
+
+ str = xf86FindOptionValue(local->options, "DeviceName");
+ if (str) {
+ local->name = strdup(str);
+ }
+ xf86Msg(X_CONFIG, "UR98 X device name: %s\n", local->name);
+ priv->screen_no = xf86SetIntOption(local->options, "ScreenNo", 0);
+ xf86Msg(X_CONFIG, "UR98 associated screen: %d\n", priv->screen_no);
+ priv->max_x = xf86SetIntOption(local->options, "MaxX", DEFAULT_MAX_X);
+ xf86Msg(X_CONFIG, "UR98 maximum x position: %d\n", priv->max_x);
+ priv->min_x = xf86SetIntOption(local->options, "MinX", DEFAULT_MIN_X);
+ xf86Msg(X_CONFIG, "UR98 minimum x position: %d\n", priv->min_x);
+ priv->max_y = xf86SetIntOption(local->options, "MaxY", DEFAULT_MAX_Y);
+ xf86Msg(X_CONFIG, "UR98 maximum y position: %d\n", priv->max_y);
+ priv->min_y = xf86SetIntOption(local->options, "MinY", DEFAULT_MIN_Y);
+ xf86Msg(X_CONFIG, "UR98 minimum y position: %d\n", priv->min_y);
+ priv->max_z = xf86SetIntOption(local->options, "MaxZ", DEFAULT_MAX_Z);
+ xf86Msg(X_CONFIG, "UR98 maximum z position: %d\n", priv->max_z);
+ priv->min_z = xf86SetIntOption(local->options, "MinZ", DEFAULT_MIN_Z);
+ xf86Msg(X_CONFIG, "UR98 minimum z position: %d\n", priv->min_z);
+ priv->max_t = xf86SetIntOption(local->options, "MaxT", DEFAULT_MAX_T);
+ xf86Msg(X_CONFIG, "UR98 maximum z position: %d\n", priv->max_t);
+ priv->min_t = xf86SetIntOption(local->options, "MinT", DEFAULT_MIN_T);
+ xf86Msg(X_CONFIG, "UR98 minimum z position: %d\n", priv->min_t);
+ priv->head_button = xf86SetBoolOption(local->options, "HeadButton", 0);
+ if(priv->head_button)
+ xf86Msg(X_CONFIG, "UR98 head proximity acts as button 1\n");
+ priv->head_thresh = xf86SetIntOption(local->options, "HeadButton", DEFAULT_HEAD_THRESH);
+ if(priv->head_button)
+ xf86Msg(X_CONFIG, "UR98 proximity threshhold %d\n", priv->head_thresh);
+ if(priv->head_button)
+ {
+ priv->head_lock = xf86SetIntOption(local->options, "HeadLock", DEFAULT_HEAD_LOCK);
+ xf86Msg(X_CONFIG, "UR98 proximity lock range %d\n", priv->head_thresh);
+ }
+ priv->button_5 = xf86SetBoolOption(local->options, "Button5", 0);
+ if(priv->button_5)
+ xf86Msg(X_CONFIG, "UR98 throttle mapped as button 5\n");
+ priv->swap_axes = xf86SetBoolOption(local->options, "SwapXY", 0);
+ if (priv->swap_axes) {
+ xf86Msg(X_CONFIG, "UR98 %s device will work with X and Y axes swapped\n",
+ local->name);
+ }
+ str = xf86SetStrOption(local->options, "PortraitMode", "Landscape");
+ if (strcmp(str, "Portrait") == 0) {
+ portrait = 1;
+ }
+ else if (strcmp(str, "PortraitCCW") == 0) {
+ portrait = -1;
+ }
+ else if (strcmp(str, "Landscape") != 0) {
+ xf86Msg(X_ERROR, "UR98 portrait mode should be: Portrait, Landscape or PortraitCCW");
+ str = "Landscape";
+ }
+ xf86Msg(X_CONFIG, "UR98 device will work in %s mode\n", str);
+
+ if (priv->max_x - priv->min_x <= 0) {
+ xf86Msg(X_INFO, "UR98: reverse x mode (minimum x position >= maximum x position)\n");
+ }
+ if (priv->max_y - priv->min_y <= 0) {
+ xf86Msg(X_INFO, "UR98: reverse y mode (minimum y position >= maximum y position)\n");
+ }
+
+ if (portrait == 1) {
+ /*
+ * Portrait Clockwise: reverse Y axis and exchange X and Y.
+ */
+ int tmp;
+ tmp = priv->min_y;
+ priv->min_y = priv->max_y;
+ priv->max_y = tmp;
+ priv->swap_axes = (priv->swap_axes==0) ? 1 : 0;
+ }
+ else if (portrait == -1) {
+ /*
+ * Portrait Counter Clockwise: reverse X axis and exchange X and Y.
+ */
+ int tmp;
+ tmp = priv->min_x;
+ priv->min_x = priv->max_x;
+ priv->max_x = tmp;
+ priv->swap_axes = (priv->swap_axes==0) ? 1 : 0;
+ }
+
+ /* If we have button_5 set then we lose the 't' axis */
+ if(priv->button_5)
+ priv->axes = 3;
+ else
+ priv->axes = 4;
+
+ /* If we have head_button set then we lose the 'z' axis */
+ if(priv->head_button)
+ priv->axes--;
+
+ xf86ProcessCommonOptions(local, local->options);
+
+ /* mark the device configured */
+ local->flags |= XI86_CONFIGURED;
+ return local;
+
+init_err:
+ if (priv) {
+ if (priv->input_dev)
+ xfree(priv->input_dev);
+ xfree(priv);
+ }
+ if (local)
+ xfree(local);
+ return NULL;
+}
+
+_X_EXPORT InputDriverRec UR98 = {
+ 1, /* driver version */
+ "ur98", /* driver name */
+ NULL, /* identify */
+ xf86UR98Init, /* pre-init */
+ xf86UR98Uninit, /* un-init */
+ NULL, /* module */
+ 0 /* ref count */
+};
+
+#ifdef XFree86LOADER
+static pointer Plug(pointer module, pointer options, int *errmaj,int *errmin)
+{
+ xf86LoaderReqSymLists(reqSymbols, NULL);
+ xf86AddInputDriver(&UR98, module, 0);
+ return module;
+}
+
+static void Unplug(pointer p)
+{
+}
+
+static XF86ModuleVersionInfo version_rec = {
+ "ur98",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 1, 0,
+ ABI_CLASS_XINPUT,
+ ABI_XINPUT_VERSION,
+ MOD_CLASS_XINPUT,
+ { 0, 0, 0, 0 }
+};
+
+/*
+ * This is the entry point in the module. The name
+ * is setup after the pattern <module_name>ModuleData.
+ * Do not change it.
+ */
+_X_EXPORT XF86ModuleData ur98ModuleData = { &version_rec, Plug, Unplug };
+#endif
+