diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-11-26 22:27:27 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-11-26 22:27:27 +0000 |
commit | 0b7d5e7ee7c31b200efd8062852afac0c8d01dd5 (patch) | |
tree | ee01ace45fa2729db1a0fffbb90e1701f3e4c666 | |
parent | 6e99b8e0c8a372fc54f12feecb13e32eee4eec56 (diff) |
Import ws input driver from XF4
-rw-r--r-- | driver/openbsd-input-ws/Makefile.am | 17 | ||||
-rw-r--r-- | driver/openbsd-input-ws/Makefile.bsd-wrapper | 3 | ||||
-rw-r--r-- | driver/openbsd-input-ws/autogen.sh | 12 | ||||
-rw-r--r-- | driver/openbsd-input-ws/configure.ac | 92 | ||||
-rw-r--r-- | driver/openbsd-input-ws/man/Makefile.am | 45 | ||||
-rw-r--r-- | driver/openbsd-input-ws/man/Makefile.in | 406 | ||||
-rw-r--r-- | driver/openbsd-input-ws/man/ws.man | 97 | ||||
-rw-r--r-- | driver/openbsd-input-ws/src/Makefile.am | 21 | ||||
-rw-r--r-- | driver/openbsd-input-ws/src/Makefile.in | 491 | ||||
-rw-r--r-- | driver/openbsd-input-ws/src/ws.c | 650 |
10 files changed, 1834 insertions, 0 deletions
diff --git a/driver/openbsd-input-ws/Makefile.am b/driver/openbsd-input-ws/Makefile.am new file mode 100644 index 000000000..52b7eba15 --- /dev/null +++ b/driver/openbsd-input-ws/Makefile.am @@ -0,0 +1,17 @@ +# +# Copyright (c) 2006 Matthieu Herrb +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +AUTOMAKE_OPTIONS= foreign +SUBDIRS= src man diff --git a/driver/openbsd-input-ws/Makefile.bsd-wrapper b/driver/openbsd-input-ws/Makefile.bsd-wrapper new file mode 100644 index 000000000..b0057c567 --- /dev/null +++ b/driver/openbsd-input-ws/Makefile.bsd-wrapper @@ -0,0 +1,3 @@ +# $Xenocara: Makefile.bsd-wrapper,v 1.2 2006/04/17 13:31:18 matthieu Exp $ + +.include <bsd.xorg.mk> diff --git a/driver/openbsd-input-ws/autogen.sh b/driver/openbsd-input-ws/autogen.sh new file mode 100644 index 000000000..904cd6746 --- /dev/null +++ b/driver/openbsd-input-ws/autogen.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir + +autoreconf -v --install || exit 1 +cd $ORIGDIR || exit $? + +$srcdir/configure --enable-maintainer-mode "$@" diff --git a/driver/openbsd-input-ws/configure.ac b/driver/openbsd-input-ws/configure.ac new file mode 100644 index 000000000..636c2dee4 --- /dev/null +++ b/driver/openbsd-input-ws/configure.ac @@ -0,0 +1,92 @@ +# 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. +# +# Process this file with autoconf to produce a configure script + +AC_PREREQ(2.57) +AC_INIT([openbsd-input-ws], + 1.0, + [http://www.openbsd.org/], + openbsd-input-ws) + +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_AUX_DIR(.) +AM_INIT_AUTOMAKE([dist-bzip2]) + +AM_MAINTAINER_MODE + +DRIVER_NAME=ws +AC_SUBST([DRIVER_NAME]) + +AM_CONFIG_HEADER([config.h]) + +# Checks for programs. +AC_DISABLE_STATIC +AC_PROG_LIBTOOL +AC_PROG_CC + +AH_TOP([#include "xorg-server.h"]) + +#AC_DEFINE(XFree86LOADER,1,[Stub define for loadable drivers]) +# +AC_ARG_ENABLE(XINPUT, AS_HELP_STRING([--enable-xinput], + [Build XInput support (default: yes)]), + [XINPUT=$enableval],[XINPUT=yes]) +AM_CONDITIONAL(XINPUT, test "x$XINPUT" = "xyes") +if test "x$XINPUT" = "xyes" ; then + AC_DEFINE(XINPUT,1,[Enable XInput support]) +fi +# +#AC_ARG_ENABLE(XKB, AS_HELP_STRING([--enable-xkb], +# [Build XKB support (default: yes)]), +# [XKB=$enableval],[XKB=yes]) +#AM_CONDITIONAL(XKB, test "x$XKB" = "xyes") +#if test "x$XKB" = "xyes" ; then +# AC_DEFINE(XKB,1,[Enable XKB support]) +#fi + +AC_ARG_WITH(xorg-module-dir, + AC_HELP_STRING([--with-xorg-module-dir=DIR], + [Default xorg module directory [[default=$libdir/xorg/modules]]]), + [moduledir="$withval"], + [moduledir="$libdir/xorg/modules"]) +inputdir=${moduledir}/input +AC_SUBST(inputdir) + +# Checks for extensions +# XORG_DRIVER_CHECK_EXT(RANDR, randrproto) +XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) + +# Checks for pkg-config packages +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto $REQUIRED_MODULES) +sdkdir=$(pkg-config --variable=sdkdir xorg-server) + +CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src' +AC_SUBST([CFLAGS]) + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_STDC + +XORG_MANPAGE_SECTIONS +XORG_RELEASE_VERSION + +AC_OUTPUT([Makefile src/Makefile man/Makefile]) diff --git a/driver/openbsd-input-ws/man/Makefile.am b/driver/openbsd-input-ws/man/Makefile.am new file mode 100644 index 000000000..fe8810dfe --- /dev/null +++ b/driver/openbsd-input-ws/man/Makefile.am @@ -0,0 +1,45 @@ +# +# Copyright (c) 2006 Matthieu Herrb +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +drivermandir= $(DRIVER_MAN_DIR) +driverman_PRE= @DRIVER_NAME@.man +driverman_DATA= $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) + +EXTRA_DIST= @DRIVER_NAME@.man + +CLEANFILES= $(driverman_DATA) + +SED= sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ + XORGMANNAME = X Version 11 + +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man + +.man.$(DRIVER_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ diff --git a/driver/openbsd-input-ws/man/Makefile.in b/driver/openbsd-input-ws/man/Makefile.in new file mode 100644 index 000000000..8d33596c6 --- /dev/null +++ b/driver/openbsd-input-ws/man/Makefile.in @@ -0,0 +1,406 @@ +# 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@ + +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 = man +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 = +SOURCES = +DIST_SOURCES = +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)$(drivermandir)" +drivermanDATA_INSTALL = $(INSTALL_DATA) +DATA = $(driverman_DATA) +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@ +XINPUT_FALSE = @XINPUT_FALSE@ +XINPUT_TRUE = @XINPUT_TRUE@ +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@ + +# +# Copyright (c) 2006 Matthieu Herrb +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +drivermandir = $(DRIVER_MAN_DIR) +driverman_PRE = @DRIVER_NAME@.man +driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) +EXTRA_DIST = @DRIVER_NAME@.man +CLEANFILES = $(driverman_DATA) +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ +XORGMANNAME = X Version 11 +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man +all: all-am + +.SUFFIXES: +.SUFFIXES: .$(DRIVER_MAN_SUFFIX) .man +$(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 man/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu man/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 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-drivermanDATA: $(driverman_DATA) + @$(NORMAL_INSTALL) + test -z "$(drivermandir)" || $(mkdir_p) "$(DESTDIR)$(drivermandir)" + @list='$(driverman_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(drivermanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(drivermandir)/$$f'"; \ + $(drivermanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(drivermandir)/$$f"; \ + done + +uninstall-drivermanDATA: + @$(NORMAL_UNINSTALL) + @list='$(driverman_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(drivermandir)/$$f'"; \ + rm -f "$(DESTDIR)$(drivermandir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +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 $(DATA) +installdirs: + for dir in "$(DESTDIR)$(drivermandir)"; 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: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +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-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-drivermanDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-drivermanDATA uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-drivermanDATA \ + 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-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-drivermanDATA \ + uninstall-info-am + + +.man.$(DRIVER_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ +# 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/openbsd-input-ws/man/ws.man b/driver/openbsd-input-ws/man/ws.man new file mode 100644 index 000000000..93f2ff6c9 --- /dev/null +++ b/driver/openbsd-input-ws/man/ws.man @@ -0,0 +1,97 @@ +.\" $OpenBSD: ws.man,v 1.1 2006/11/26 22:27:26 matthieu Exp $ +.\" +.\" Copyright (c) 2005 Matthieu Herrb +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH WS __drivermansuffix__ __vendorversion__ +.SH NAME +WS \- wscons pointer input driver for *BSD +.SH SYNOPSIS +.nf +.B "Section \*qInputDevice\*q" +.BI " Identifier \*q" name \*q +.B " Driver \*qws\*q" +.BI " Option \*qButtons\*q \*q" integer \*q +.BI " Option \*qDebugLevel\*q \*q" integer \*q +.BI " Option \*qDevice\*q \*q" path \*q +.BI " Option \*qMinX\*q \*q" integer \*q +.BI " Option \*qMaxX\*q \*q" integer \*q +.BI " Option \*qMinY\*q \*q" integer \*q +.BI " Option \*qMaxY\*q \*q" integer \*q +.BI " Option \*qRotate\*q \*q" string \*q +.BI " Option \*qSwapXY\*q \*q" boolean \*q +.BI " Option \*qZAxisMapping\*q \*q" "N1 N2" \*q +.B EndSection +.fi +.SH DESCRIPTION +.B ws +is an XFree86/X.Org input driver for pointer devices (mouse, tablet, +touchscreen,...) drived by the wscons console driver on +OpenBSD. +.SH "SUPPORTED HARDWARE" +This driver supports zts(4) the touchscreen of Zaurus machines. +.SH "CONFIGURATION DETAILS" +Please refer to xorg.conf(__filemansuffix__) for general configuration +details and for options that can be used with all input drivers. +This section only covers configuration details specific to this driver. +.PP +.TP 4 +.BI "Option \*qButtons\*q \*q" integer \*q +Specifies the number of mouse buttons. +In cases where the number of buttons cannot be auto-detected, the +default value is 3. +.TP 4 +.BI "Option \*qDebugLevel\*q \*q" integer \*q +This option sets the verbosith level of the driver. +It defaults to 0, which means no extra debug output. +.TP 4 +.BI "Option \*qDevice\*q \*q" path \*q +sets the path to the special file used by the device, ususally +.I /dev/wsmouse . +This option is mandatory. +.TP 4 +.BI "Option \*qMinX\*q \*q" integer \*q +.TP 4 +.BI "Option \*qMaxX\*q \*q" integer \*q +.TP 4 +.BI "Option \*qMinY\*q \*q" integer \*q +.TP 4 +.BI "Option \*qMaxY\*q \*q" integer \*q +These options represent the coordinate space returned by the device. +They default to the screen dimensions, since the calibration is handled in +the kernel by the zts(4) driver and the ztsscale(8) utility. +.TP 4 +.B "Option \*qRotate\*q \*qCW\*q" +.TP 4 +.B "Option \*qRotate\*q \*qCCW\*q" +.TP 4 +.B "Option \*qRotate\*q \*qUD\*q" +These options rotate the screen coordinates returned by the driver +clockwise, counter-clockwise, or upside-down respectively. +.TP 4 +.BI "Option \*qSwapXY\*q \*q" boolean \*q +swaps the X and Y axis of the input device if set. Default: false. +.TP 4 +.B Option \fI"ZAxisMapping"\fP \fI"N1 N2"\fP +Set the mapping for the Z axis (wheel) motion to buttons. Button +number +.I N1 +is mapped to the negative Z axis motion and button +.I N2 +is mapped to the positive Z axis motion. +Default: no mapping. +.SH "SEE ALSO" +Xorg(1), xorg.conf(__filemansuffix__), zts(4), sysctl(8), ztsscale(8). diff --git a/driver/openbsd-input-ws/src/Makefile.am b/driver/openbsd-input-ws/src/Makefile.am new file mode 100644 index 000000000..8da7a06fe --- /dev/null +++ b/driver/openbsd-input-ws/src/Makefile.am @@ -0,0 +1,21 @@ +# +# Copyright (c) 2006 Matthieu Herrb +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +@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 = @DRIVER_NAME@.c diff --git a/driver/openbsd-input-ws/src/Makefile.in b/driver/openbsd-input-ws/src/Makefile.in new file mode 100644 index 000000000..3c5008266 --- /dev/null +++ b/driver/openbsd-input-ws/src/Makefile.in @@ -0,0 +1,491 @@ +# 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 (c) 2006 Matthieu Herrb +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +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 = @DRIVER_NAME@.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@ +XINPUT_FALSE = @XINPUT_FALSE@ +XINPUT_TRUE = @XINPUT_TRUE@ +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@ +@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 = @DRIVER_NAME@.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)/@DRIVER_NAME@.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/openbsd-input-ws/src/ws.c b/driver/openbsd-input-ws/src/ws.c new file mode 100644 index 000000000..fa93a4f10 --- /dev/null +++ b/driver/openbsd-input-ws/src/ws.c @@ -0,0 +1,650 @@ +/* + * Copyright (c) 2005 Matthieu Herrb + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +/* $OpenBSD: ws.c,v 1.1 2006/11/26 22:27:26 matthieu Exp $ */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <unistd.h> +#include <errno.h> +#include <sys/time.h> +#include <dev/wscons/wsconsio.h> + +#include <xf86.h> + +#include <xf86_OSproc.h> +#include <X11/extensions/XI.h> +#include <X11/extensions/XIproto.h> +#include <xf86Xinput.h> +#include <xisb.h> +#include <mipointer.h> +#include <extinit.h> + +#ifdef XFree86LOADER +#include "xf86Module.h" +#endif + +#define NAXES 2 /* X and Y axes only */ +#define NBUTTONS 32 /* max theoretical buttons */ +#define DFLTBUTTONS 3 /* default number of buttons */ +#define NUMEVENTS 16 /* max # of ws events to read at once */ + +typedef struct WSDevice { + char *devName; /* device name */ + unsigned int buttons; /* # of buttons */ + unsigned int lastButtons; /* last state of buttons */ + int x, y; /* current abs coordinates */ + int min_x, max_x, min_y, max_y; /* coord space */ + int swap_axes; + int inv_x, inv_y; + int screen_width, screen_height; + int screen_no; + int num, den, threshold; /* relative accel params */ + pointer buffer; + int negativeZ, positiveZ; /* mappings for Z axis */ +} WSDeviceRec, *WSDevicePtr; + +#ifdef XFree86LOADER +static MODULESETUPPROTO(SetupProc); +static void TearDownProc(pointer); +static const OptionInfoRec *wsAvailableOptions(void *); +#endif + +static InputInfoPtr wsPreInit(InputDriverPtr, IDevPtr, int); +static int wsProc(DeviceIntPtr, int); +static void wsReadInput(InputInfoPtr); +static void wsSendButtons(InputInfoPtr, int); +static int wsChangeControl(InputInfoPtr, xDeviceCtl *); +static int wsSwitchMode(ClientPtr, DeviceIntPtr, int); +static Bool wsOpen(InputInfoPtr); +static void wsClose(InputInfoPtr); +static Bool wsConvert(InputInfoPtr, int, int, int, int, int, int, int, int, + int *, int *); +static void wsControlProc(DeviceIntPtr , PtrCtrl *); + + +static XF86ModuleVersionInfo VersionRec = { + "ws", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_XINPUT, + ABI_XINPUT_VERSION, + MOD_CLASS_XINPUT, + {0, 0, 0, 0} +}; + +typedef enum { + WSOPT_DEVICE, + WSOPT_DEBUG_LEVEL, + WSOPT_MINX, + WSOPT_MAXX, + WSOPT_MINY, + WSOPT_MAXY, + WSOPT_ROTATE, + WSOPT_SWAPXY, + WSOPT_SCREENNO, + WSOPT_ZAXIS_MAPPING, +} WSOpts; + +#define WS_NOZMAP 0 + +static const OptionInfoRec WSOptions[] = { + { WSOPT_DEVICE, "device", OPTV_STRING, {0}, FALSE }, + { WSOPT_DEBUG_LEVEL, "debugLevel", OPTV_INTEGER, {0}, FALSE }, + { WSOPT_MINX, "minX", OPTV_INTEGER, {0}, FALSE }, + { WSOPT_MAXX, "maxX", OPTV_INTEGER, {0}, FALSE }, + { WSOPT_MINY, "minY", OPTV_INTEGER, {0}, FALSE }, + { WSOPT_MAXY, "maxY", OPTV_INTEGER, {0}, FALSE }, + { WSOPT_ROTATE, "rotate", OPTV_STRING, {0}, FALSE }, + { WSOPT_SWAPXY, "swapxy", OPTV_BOOLEAN, {0}, FALSE }, + { WSOPT_SCREENNO, "ScreenNo", OPTV_INTEGER, {0}, FALSE }, + { WSOPT_ZAXIS_MAPPING, "ZAxisMapping", OPTV_STRING, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } +}; + +#ifdef XFree86LOADER +XF86ModuleData wsModuleData = {&VersionRec, + SetupProc, TearDownProc }; + +ModuleInfoRec wsInfo = { + 1, + "WS", + NULL, + 0, + wsAvailableOptions, +}; +#endif + +InputDriverRec WS = { + 1, + "ws", + NULL, + wsPreInit, + NULL, + 0 +}; + +/* #undef DEBUG */ +#define DEBUG +#undef DBG +static int debug_level = 0; +#ifdef DEBUG +# define DBG(lvl, f) { if ((lvl) <= debug_level) f;} +#else +# define DBG(lvl, f) +#endif + +#ifdef XFree86LOADER +static pointer +SetupProc(pointer module, pointer options, int *errmaj, int *errmin) +{ + static Bool Initialised = FALSE; + + if (!Initialised) { +#ifndef REMOVE_LOADER_CHECK_MODULE_INFO + if (xf86LoaderCheckSymbol("xf86AddModuleInfo")) +#endif + xf86AddModuleInfo(&wsInfo, module); + xf86AddInputDriver(&WS, module, 0); + Initialised = TRUE; + } + return module; +} + +static void +TearDownProc(pointer p) +{ + DBG(1, ErrorF("WS TearDownProc called\n")); +} + +static const OptionInfoRec * +wsAvailableOptions(void *unused) +{ + return WSOptions; +} +#endif /* XFree86LOADER */ + +static InputInfoPtr +wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags) +{ + InputInfoPtr pInfo = NULL; + WSDevicePtr priv; + MessageType buttons_from = X_CONFIG; + char *s; + + pInfo = xf86AllocateInput(drv, 0); + if (pInfo == NULL) { + return NULL; + } + priv = (WSDevicePtr)xcalloc(1, sizeof(WSDeviceRec)); + if (priv == NULL) + goto fail; + pInfo->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS; + pInfo->conf_idev = dev; + pInfo->name = "ws"; + pInfo->private = priv; + + xf86CollectInputOptions(pInfo, NULL, NULL); + xf86ProcessCommonOptions(pInfo, pInfo->options); +#ifdef DEBUG + debug_level = xf86SetIntOption(pInfo->options, "DebugLevel", + debug_level); + xf86Msg(X_INFO, "%s: debuglevel %d\n", dev->identifier, debug_level); +#endif + priv->devName = xf86FindOptionValue(pInfo->options, "Device"); + if (priv->devName == NULL) { + xf86Msg(X_ERROR, "%s: No Device specified.\n", + dev->identifier); + goto fail; + } + priv->buttons = xf86SetIntOption(pInfo->options, "Buttons", 0); + if (priv->buttons == 0) { + priv->buttons = DFLTBUTTONS; + buttons_from = X_DEFAULT; + } + priv->negativeZ = priv->positiveZ = WS_NOZMAP; + s = xf86SetStrOption(pInfo->options, "ZAxisMapping", NULL); + if (s) { + int b1, b2; + + if (sscanf(s, "%d %d", &b1, &b2) == 2 && + b1 > 0 && b1 <= NBUTTONS && + b2 > 0 && b2 <= NBUTTONS) { + priv->negativeZ = b1; + priv->positiveZ = b2; + xf86Msg(X_CONFIG, + "%s: ZAxisMapping: buttons %d and %d\n", + pInfo->name, b1, b2); + } else { + xf86Msg(X_WARNING, "%s: invalid ZAxisMapping value: " + "\"%s\"\n", pInfo->name, s); + } + } + if (priv->negativeZ > priv->buttons) { + priv->buttons = priv->negativeZ; + buttons_from = X_CONFIG; + } + if (priv->positiveZ > priv->buttons) { + priv->buttons = priv->positiveZ; + buttons_from = X_CONFIG; + } + priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", 0); + xf86Msg(X_CONFIG, "%s associated screen: %d\n", + dev->identifier, priv->screen_no); + if (priv->screen_no >= screenInfo.numScreens || + priv->screen_no < 0) { + priv->screen_no = 0; + } + + priv->max_x = xf86SetIntOption(pInfo->options, "MaxX", + screenInfo.screens[priv->screen_no]->width - 1); + xf86Msg(X_INFO, "%s maximum x position: %d\n", + dev->identifier, priv->max_x); + priv->min_x = xf86SetIntOption(pInfo->options, "MinX", 0); + xf86Msg(X_INFO, "%s minimum x position: %d\n", + dev->identifier, priv->min_x); + priv->max_y = xf86SetIntOption(pInfo->options, "MaxY", + screenInfo.screens[priv->screen_no]->height - 1); + xf86Msg(X_INFO, "%s maximum y position: %d\n", + dev->identifier, priv->max_y); + priv->min_y = xf86SetIntOption(pInfo->options, "MinY", 0); + xf86Msg(X_INFO, "%s minimum y position: %d\n", + dev->identifier, priv->min_y); + + priv->swap_axes = xf86SetBoolOption(pInfo->options, "SwapXY", 0); + if (priv->swap_axes) { + xf86Msg(X_CONFIG, + "%s device will work with X and Y axes swapped\n", + dev->identifier); + } + priv->inv_x = 0; + priv->inv_y = 0; + s = xf86FindOptionValue(pInfo->options, "Rotate"); + if (s) { + if (xf86NameCmp(s, "CW") == 0) { + priv->inv_x = 1; + priv->inv_y = 0; + priv->swap_axes = 1; + } else if (xf86NameCmp(s, "CCW") == 0) { + priv->inv_x = 0; + priv->inv_y = 1; + priv->swap_axes = 1; + } else if (xf86NameCmp(s, "UD") == 0) { + priv->inv_x = 1; + priv->inv_y = 1; + } else { + xf86Msg(X_ERROR, "\"%s\" is not a valid value " + "for Option \"Rotate\"\n", s); + xf86Msg(X_ERROR, "Valid options are \"CW\", \"CCW\"," + " or \"UD\"\n"); + } + } + + pInfo->name = dev->identifier; + pInfo->type_name = "wscons pointer"; + pInfo->device_control = wsProc; + pInfo->read_input = wsReadInput; + pInfo->control_proc = wsChangeControl; + pInfo->switch_mode = wsSwitchMode; + pInfo->conversion_proc = wsConvert; + pInfo->reverse_conversion_proc = NULL; + pInfo->fd = -1; + pInfo->private = priv; + pInfo->old_x = -1; + pInfo->old_y = -1; + xf86Msg(buttons_from, "%s: Buttons: %d\n", pInfo->name, priv->buttons); + + /* mark the device configured */ + pInfo->flags |= XI86_CONFIGURED; + return pInfo; +fail: + if (priv != NULL) + xfree(priv); + if (pInfo != NULL) + xfree(pInfo); + return NULL; +} + +static int +wsProc(DeviceIntPtr pWS, int what) +{ + InputInfoPtr pInfo = (InputInfoPtr)pWS->public.devicePrivate; + WSDevicePtr priv = (WSDevicePtr)XI_PRIVATE(pWS); + unsigned char map[NBUTTONS + 1]; + int i; + + switch (what) { + case DEVICE_INIT: + DBG(1, ErrorF("WS DEVICE_INIT\n")); + + priv->screen_width = + screenInfo.screens[priv->screen_no]->width; + priv->screen_height = + screenInfo.screens[priv->screen_no]->height; + + for (i = 0; i < NBUTTONS; i++) + map[i + 1] = i + 1; + InitPointerDeviceStruct((DevicePtr)pWS, map, + min(priv->buttons, NBUTTONS), + miPointerGetMotionEvents, wsControlProc, + miPointerGetMotionBufferSize()); + xf86InitValuatorAxisStruct(pWS, 0, 0, -1, 1, 0, 1); + xf86InitValuatorDefaults(pWS, 0); + + xf86InitValuatorAxisStruct(pWS, 1, 0, -1, 1, 0, 1); + xf86InitValuatorDefaults(pWS, 1); + xf86MotionHistoryAllocate(pInfo); + AssignTypeAndName(pWS, pInfo->atom, pInfo->name); + pWS->public.on = FALSE; + /* This sould correspond to the center of the screen */ + priv->x = (priv->max_x - priv->min_x) / 2; + priv->y = (priv->max_y - priv->min_y) / 2; + if (wsOpen(pInfo) != Success) { + return !Success; + } + break; + + case DEVICE_ON: + DBG(1, ErrorF("WS DEVICE ON\n")); + if ((pInfo->fd < 0) && (wsOpen(pInfo) != Success)) { + xf86Msg(X_ERROR, "wsOpen failed %s\n", + strerror(errno)); + return !Success; + } + priv->buffer = XisbNew(pInfo->fd, + sizeof(struct wscons_event) * NUMEVENTS); + if (priv->buffer == NULL) { + xf86Msg(X_ERROR, "cannot alloc xisb buffer\n"); + wsClose(pInfo); + return !Success; + } + xf86AddEnabledDevice(pInfo); + pWS->public.on = TRUE; + + break; + + case DEVICE_OFF: + DBG(1, ErrorF("WS DEVICE OFF\n")); + if (pInfo->fd >= 0) { + xf86RemoveEnabledDevice(pInfo); + wsClose(pInfo); + } + if (priv->buffer) { + XisbFree(priv->buffer); + priv->buffer = NULL; + } + pWS->public.on = FALSE; + break; + + case DEVICE_CLOSE: + DBG(1, ErrorF("WS DEVICE_CLOSE\n")); + wsClose(pInfo); + break; + + default: + xf86Msg(X_ERROR, "WS: unknown command %d\n", what); + return !Success; + } /* switch */ + return Success; +} /* wsProc */ + +static void +wsReadInput(InputInfoPtr pInfo) +{ + WSDevicePtr priv; + static struct wscons_event eventList[NUMEVENTS]; + int n, c; + struct wscons_event *event = eventList; + unsigned char *pBuf; + int ax, ay; + + priv = pInfo->private; + + XisbBlockDuration(priv->buffer, -1); + pBuf = (unsigned char *)eventList; + n = 0; + while (n < sizeof(eventList) && (c = XisbRead(priv->buffer)) >= 0) { + pBuf[n++] = (unsigned char)c; + } + + if (n == 0) + return; + + n /= sizeof(struct wscons_event); + while( n-- ) { + int buttons = priv->lastButtons; + int dx = 0, dy = 0, dz = 0; + int zbutton = 0; + + ax = 0; ay = 0; + switch (event->type) { + case WSCONS_EVENT_MOUSE_UP: + + buttons &= ~(1 << event->value); + DBG(4, ErrorF("Button %d up %x\n", event->value, + buttons)); + break; + case WSCONS_EVENT_MOUSE_DOWN: + buttons |= (1 << event->value); + DBG(4, ErrorF("Button %d down %x\n", event->value, + buttons)); + break; + case WSCONS_EVENT_MOUSE_DELTA_X: + dx = event->value; + DBG(4, ErrorF("Relative X %d\n", event->value)); + break; + case WSCONS_EVENT_MOUSE_DELTA_Y: + dy = -event->value; + DBG(4, ErrorF("Relative Y %d\n", event->value)); + break; + case WSCONS_EVENT_MOUSE_ABSOLUTE_X: + DBG(4, ErrorF("Absolute X %d\n", event->value)); + if (event->value != 4095) { + ax = event->value; + if (priv->inv_x) + ax = priv->max_x - ax + priv->min_x; + } + break; + case WSCONS_EVENT_MOUSE_ABSOLUTE_Y: + DBG(4, ErrorF("Absolute Y %d\n", event->value)); + ay = event->value; + if (priv->inv_y) + ay = priv->max_y - ay + priv->min_y; + break; +#ifdef WSCONS_EVENT_MOUSE_DELTA_Z + case WSCONS_EVENT_MOUSE_DELTA_Z: + DBG(4, ErrorF("Relative Z %d\n", event->value)); + dz = event->value; + break; +#endif +#ifdef WSCONS_EVENT_MOUSE_ABSOLUTE_Z + case WSCONS_EVENT_MOUSE_ABSOLUTE_Z: + /* ignore those */ + ++event; + continue; + break; +#endif + default: + xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n", + pInfo->name, event->type); + ++event; + continue; + } /* case */ + + if (dx || dy) { + /* relative motion event */ + DBG(3, ErrorF("postMotionEvent dX %d dY %d\n", + dx, dy)); +#if 0 + priv->x += dx; + if (priv->x < priv->min_x) priv->x = priv->min_x; + if (priv->x > priv->max_x) priv->x = priv->max_x; + priv->y += dy; + if (priv->y < priv->min_y) priv->y = priv->min_y; + if (priv->y > priv->max_y) priv->y = priv->max_y; + xf86PostMotionEvent(pInfo->dev, 1, 0, 2, + priv->x, priv->y); +#else + xf86PostMotionEvent(pInfo->dev, 0, 0, 2, + dx, dy); +#endif + } + if (dz && priv->negativeZ != WS_NOZMAP + && priv->positiveZ != WS_NOZMAP) { + buttons &= ~(priv->negativeZ | priv->positiveZ); + if (dz < 0) { + DBG(4, ErrorF("Z -> button %d\n", + priv->negativeZ)); + zbutton = 1 << (priv->negativeZ - 1); + } else { + DBG(4, ErrorF("Z -> button %d\n", + priv->positiveZ)); + zbutton = 1 << (priv->positiveZ - 1); + } + buttons |= zbutton; + dz = 0; + } + if (priv->lastButtons != buttons) { + /* button event */ + wsSendButtons(pInfo, buttons); + } + if (zbutton != 0) { + /* generate a button up event */ + buttons &= ~zbutton; + wsSendButtons(pInfo, buttons); + } + if (ax) { + /* absolute position event */ + DBG(3, ErrorF("postMotionEvent X %d %d\n", + ax, priv->y)); + xf86PostMotionEvent(pInfo->dev, 1, 0, 2, ax, priv->y); + priv->x = ax; + } + if (ay) { + /* absolute position event */ + DBG(3, ErrorF("postMotionEvent y %d %d\n", + priv->x, ay)); + xf86PostMotionEvent(pInfo->dev, 1, 0, 2, priv->x, ay); + priv->y = ay; + } + ++event; + } + return; +} /* wsReadInput */ + +static void +wsSendButtons(InputInfoPtr pInfo, int buttons) +{ + WSDevicePtr priv = (WSDevicePtr)pInfo->private; + int button, mask; + + for (button = 1; button < NBUTTONS; button++) { + mask = 1 << (button - 1); + if ((mask & priv->lastButtons) != (mask & buttons)) { + xf86PostButtonEvent(pInfo->dev, TRUE, + button, (buttons & mask) != 0, + 0, 0); /*2, priv->x, priv->y);*/ + DBG(3, ErrorF("post button event %d %d\n", + button, (buttons & mask) != 0)) + } + } /* for */ + priv->lastButtons = buttons; +} /* wsSendButtons */ + + +static int +wsChangeControl(InputInfoPtr pInfo, xDeviceCtl *control) +{ + return BadMatch; +} + +static int +wsSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode) +{ + return BadMatch; +} + +static Bool +wsOpen(InputInfoPtr pInfo) +{ + WSDevicePtr priv = (WSDevicePtr)pInfo->private; + + DBG(1, ErrorF("WS open %s\n", priv->devName)); + pInfo->fd = xf86OpenSerial(pInfo->options); + if (pInfo->fd == -1) + xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name); + return Success; +} + +static void +wsClose(InputInfoPtr pInfo) +{ + xf86CloseSerial(pInfo->fd); + pInfo->fd = -1; +} + +static Bool +wsConvert(InputInfoPtr pInfo, int first, int num, + int v0, int v1, int v2, int v3, int v4, int v5, + int *x, int *y) +{ + WSDevicePtr priv = (WSDevicePtr) pInfo->private; + if (first != 0 || num != 2) { + return FALSE; + } + + DBG(3, ErrorF("WSConvert: v0(%d), v1(%d)\n", v0, v1)); + + if (priv->swap_axes != 0) { + *x = xf86ScaleAxis(v1, 0, priv->screen_width - 1, + priv->min_y, priv->max_y); + *y = xf86ScaleAxis(v0, 0, priv->screen_height - 1, + priv->min_x, priv->max_x); + } else { + *x = xf86ScaleAxis(v0, 0, priv->screen_width - 1, + priv->min_x, priv->max_x); + *y = xf86ScaleAxis(v1, 0, priv->screen_height - 1, + priv->min_y, priv->max_y); + } + + /* + * 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(pInfo, priv->screen_no, *x, *y); + + DBG(3, ErrorF("WSConvert: x(%d), y(%d)\n", *x, *y)); + + return TRUE; +} + +static void +wsControlProc(DeviceIntPtr device, PtrCtrl *ctrl) +{ + InputInfoPtr pInfo = device->public.devicePrivate; + WSDevicePtr priv = (WSDevicePtr)pInfo->private; + + DBG(1, ErrorF("wsControlProc\n")); + priv->num = ctrl->num; + priv->den = ctrl->den; + priv->threshold = ctrl->threshold; +} + |