From: Kibum Kim Date: Fri, 6 Jan 2012 16:10:14 +0000 (+0900) Subject: Git init X-Git-Tag: accepted/2.0/20130306.221236~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e42ff05052b585c42c59c5e39bdb7225eb37a998;p=profile%2Fivi%2Fxorg-x11-drv-evdev-multitouch.git Git init --- diff --git a/10-diamondtouch.fdi b/10-diamondtouch.fdi new file mode 100644 index 0000000..dc0bc15 --- /dev/null +++ b/10-diamondtouch.fdi @@ -0,0 +1,10 @@ + + + + + + + evdevmultitouch + + + diff --git a/10-logitech.fdi b/10-logitech.fdi new file mode 100644 index 0000000..4151d70 --- /dev/null +++ b/10-logitech.fdi @@ -0,0 +1,13 @@ + + + + + + + + evdevmultitouchmultitouch + + + + + diff --git a/10-stantum.fdi b/10-stantum.fdi new file mode 100644 index 0000000..33d080d --- /dev/null +++ b/10-stantum.fdi @@ -0,0 +1,11 @@ + + + + + + + evdevmultitouch + + + + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e903784 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Sung-Jin Park +Sangjin Lee diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..b76958b --- /dev/null +++ b/COPYING @@ -0,0 +1,115 @@ +Various copyright notices found in this driver: + +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +Copyright © 2004-2008 Red Hat, Inc. + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without +fee, provided that the above copyright notice appear in all copies +and that both that copyright notice and this permission notice +appear in supporting documentation, and that the name of Red Hat +not be used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. Red +Hat makes no representations about the suitability of this software +for any purpose. It is provided "as is" without express or implied +warranty. + +THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Copyright 2005 Sun Microsystems, Inc. All rights reserved. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP 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. + +Except as contained in this notice, the name of the copyright holders shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the copyright holders. + +Copyright © 2008 University of South Australia +copyrights taken from xf86-input-mouse, partly valid for this driver. +Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. +Copyright 1993 by David Dawes +Copyright 2002 by SuSE Linux AG, Author: Egbert Eich +Copyright 1994-2002 by The XFree86 Project, Inc. +Copyright 2002 by Paul Elliott + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without +fee, provided that the above copyright notice appear in all copies +and that both that copyright notice and this permission notice +appear in supporting documentation, and that the name of the authors +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. The authors make no +representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied +warranty. + +THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +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. + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..d23f650 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,40 @@ +# Copyright 2005 Adam Jackson. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +AUTOMAKE_OPTIONS = foreign + +# Ensure headers are installed below $(prefix) for distcheck +DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg' + +SUBDIRS = src man include + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = xorg-evdev-multitouch.pc + +EXTRA_DIST = ChangeLog + +MAINTAINERCLEANFILES=ChangeLog + +.PHONY: ChangeLog + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog diff --git a/README b/README new file mode 100644 index 0000000..3b3e134 --- /dev/null +++ b/README @@ -0,0 +1,20 @@ +xf86-input-evdevmultitouch - Generic Linux input driver for the Xorg X server + +Please submit bugs & patches to the Xorg bugzilla: + + https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +All questions regarding this software should be directed at the +Xorg mailing list: + + http://lists.freedesktop.org/mailman/listinfo/xorg + +The master development code repository can be found at: + + git://anongit.freedesktop.org/git/xorg/driver/xf86-input-evdevmultitouch + + http://cgit.freedesktop.org/xorg/driver/xf86-input-evdevmultitouch + +For more information on the git code manager, see: + + http://wiki.x.org/wiki/GitPage diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..904cd67 --- /dev/null +++ b/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/configure.ac b/configure.ac new file mode 100755 index 0000000..5dabddc --- /dev/null +++ b/configure.ac @@ -0,0 +1,87 @@ +# 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([xf86-input-evdev-multitouch], + 2.3.1, + [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], + xf86-input-evdev-multitouch) + +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_AUX_DIR(.) +AM_INIT_AUTOMAKE([dist-bzip2]) + +AM_MAINTAINER_MODE + +# Require xorg-macros: XORG_DEFAULT_OPTIONS +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.3) +AM_CONFIG_HEADER([config.h]) + +# Checks for programs. +AC_DISABLE_STATIC +AC_PROG_LIBTOOL +AC_PROG_CC +XORG_DEFAULT_OPTIONS + +AH_TOP([#include "xorg-server.h"]) + +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 pkg-config packages. We need to be able to override sdkdir +# to satisfy silly distcheck requirements. +PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES) +XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS" +AC_ARG_WITH([sdkdir], [], + [sdkdir="$withval"], + [sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`]) +AC_SUBST([sdkdir]) + +# Checks for libraries. +#PKG_CHECK_MODULES(HAL,hal) +#AC_SUBST(HAL_CFLAGS) +#AC_SUBST(HAL_LIBS) + +#CFLAGS="$CFLAGS $XORG_CFLAGS $HAL_CFLAGS"' -I$(top_srcdir)/src' +#LIBS="$LIBS $XORG_LIBS $HAL_LIBS" +CFLAGS="$CFLAGS $XORG_CFLAGS"' -I$(top_srcdir)/src' +LIBS="$LIBS $XORG_LIBS" +AC_SUBST(CFLAGS) +AC_SUBST(LIBS) + +# Checks for header files. +AC_HEADER_STDC + +DRIVER_NAME=evdevmultitouch +AC_SUBST([DRIVER_NAME]) + +AC_OUTPUT([Makefile + src/Makefile + man/Makefile + include/Makefile + xorg-evdev-multitouch.pc]) diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..34ab4bf --- /dev/null +++ b/debian/README.source @@ -0,0 +1,73 @@ +------------------------------------------------------ +Quick Guide To Patching This Package For The Impatient +------------------------------------------------------ + +1. Make sure you have quilt installed +2. Unpack the package as usual with "dpkg-source -x" +3. Run the "patch" target in debian/rules +4. Create a new patch with "quilt new" (see quilt(1)) +5. Edit all the files you want to include in the patch with "quilt edit" + (see quilt(1)). +6. Write the patch with "quilt refresh" (see quilt(1)) +7. Run the "clean" target in debian/rules + +Alternatively, instead of using quilt directly, you can drop the patch in to +debian/patches and add the name of the patch to debian/patches/series. + +------------------------------------ +Guide To The X Strike Force Packages +------------------------------------ + +The X Strike Force team maintains X packages in git repositories on +git.debian.org in the pkg-xorg subdirectory. Most upstream packages +are actually maintained in git repositories as well, so they often +just need to be pulled into git.debian.org in a "upstream-*" branch. +Otherwise, the upstream sources are manually installed in the Debian +git repository. + +The .orig.tar.gz upstream source file could be generated this +"upstream-*" branch in the Debian git repository but it is actually +copied from upstream tarballs directly. + +Due to X.org being highly modular, packaging all X.org applications +as their own independent packages would have created too many Debian +packages. For this reason, some X.org applications have been grouped +into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils, +x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils. +Most packages, including the X.org server itself and all libraries +and drivers are, however maintained independently. + +The Debian packaging is added by creating the "debian-*" git branch +which contains the aforementioned "upstream-*" branch plus the debian/ +repository files. +When a patch has to be applied to the Debian package, two solutions +are involved: +* If the patch is available in one of the upstream branches, it + may be git'cherry-picked into the Debian repository. In this + case, it appears directly in the .diff.gz. +* Otherwise, the patch is added to debian/patches/ which is managed + with quilt as documented in /usr/share/doc/quilt/README.source. + +quilt is actually invoked by the Debian X packaging through a larger +set of scripts called XSFBS. XSFBS brings some other X specific +features such as managing dependencies and conflicts due to the video +and input driver ABIs. +XSFBS itself is maintained in a separate repository at + git://git.debian.org/pkg-xorg/xsfbs.git +and it is pulled inside the other Debian X repositories when needed. + +The XSFBS patching system requires a build dependency on quilt. Also +a dependency on $(STAMP_DIR)/patch has to be added to debian/rules +so that the XSFBS patching occurs before the actual build. So the +very first target of the build (likely the one running autoreconf) +should depend on $(STAMP_DIR)/patch. It should also not depend on +anything so that parallel builds are correctly supported (nothing +should probably run while patching is being done). And finally, the +clean target should depend on the xsfclean target so that patches +are unapplied on clean. + +When the upstream sources contain some DFSG-nonfree files, they are +listed in text files in debian/prune/ in the "debian-*" branch of +the Debian repository. XSFBS' scripts then take care of removing +these listed files during the build so as to generate a modified +DFSG-free .orig.tar.gz tarball. diff --git a/debian/changelog b/debian/changelog new file mode 100755 index 0000000..e19e0f9 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,236 @@ +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+24) unstable; urgency=low + + * Add EvdevMultitouchFrameSync() and related data structures for supporting X gesture driver + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+24 + + -- Sung-Jin Park Wed, 02 Nov 2011 17:49:35 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+23) unstable; urgency=low + + * Add EvdevMultitouchGetGrabInfo() to check grab status of each touch device + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+23 + + -- Sung-Jin Park Mon, 19 Sep 2011 14:15:48 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+22) unstable; urgency=low + + * oal rollback + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+22 + + -- SooChan Lim Fri, 08 Apr 2011 13:56:36 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+21) unstable; urgency=low + + * Work for oal + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+21 + + -- SooChan Lim Tue, 05 Apr 2011 10:37:29 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+20) unstable; urgency=low + + * [X11R7.6] upgrade package + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+20 + + -- SooChan Lim Thu, 03 Mar 2011 19:37:30 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+19) unstable; urgency=low + + * Remove the multitouch error filtering routine from EvdevMultitouchStoreMTData() + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+19 + + -- Sung-Jin Park Mon, 31 Jan 2011 17:30:00 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+18) unstable; urgency=low + + * Modify evdev multitouch driver to set the number of multitouch to be set + properly on "MultiTouch" property + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+18 + + -- Sung-Jin Park Wed, 26 Jan 2011 14:24:52 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+17) unstable; urgency=low + + * Modify evdevmultitouch.* to process events from both MT protocol A kernel + and MT protocol B kernel + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+17 + + -- Sung-Jin Park Thu, 23 Dec 2010 14:18:28 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+16) unstable; urgency=low + + * Do not call xf86AddEnabledDevice() for devices named "*subdev*" + * Git: 165.213.180.234:slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+16 + + -- Sung-Jin Park Tue, 07 Dec 2010 17:31:08 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+15) unstable; urgency=low + + * Add a macro _F_IGNORE_TSP_RESOLUTION_ to ignore TSP resolution when + resolution was not specified in input.conf of Xorg server + * Git: 165.213.180.234:/git/slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+15 + + -- Sung-Jin Park Fri, 26 Nov 2010 22:04:49 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+14) unstable; urgency=low + + * Add Conflicts and Replaces info in debian/control + * Git: 165.213.180.234:/git/slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+14 + + -- Sung-Jin Park Fri, 26 Nov 2010 14:53:20 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+13) unstable; urgency=low + + * Modify evdevmultitouch.c not to call ProcessInputEvents() when subdevices + were being removed + * Git: 165.213.180.234:/git/slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+13 + + -- Sung-Jin Park Tue, 23 Nov 2010 16:05:31 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+12) unstable; urgency=low + + * Add xserver-xorg-input-evdev-multitouch-dbg into debian/control + * Modify debian/rules to strip binary except xserver-xorg-input-evdev-multitouch-dbg + * Git: 165.213.180.234:/git/slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+12 + + -- Sung-Jin Park Mon, 22 Nov 2010 14:08:05 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+11) unstable; urgency=low + + [ Sung-Jin Park ] + * Add --as-needed option + * Git: 165.213.180.234:/git/slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+11 + + -- Sung-Jin Park Mon, 22 Nov 2010 14:08:02 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+10) unstable; urgency=low + + * Modify driver name from evdev to evdevmultitouch + * Git: 165.213.180.234:/git/slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+10 + + -- Sung-Jin Park Wed, 10 Nov 2010 15:43:01 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+9) unstable; urgency=low + + * Fix a checking gab bug + - If a touch coordinates pair increases/decreases suddenly over 100 px in x or y axis, + the event pair will not be processed + - There is a bug, if the jumping of the coordinates happends, + most of the following events will not be processed either, + until the touch is released from the touchscreen + * Git: 165.213.180.234:/git/slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+9 + + -- Sung-Jin Park Wed, 10 Nov 2010 11:26:57 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+8) unstable; urgency=low + + * Add EvdevMultitouchSettingTimer() to set multitouch devices after + every initialization of core evdev device + * Git: 165.213.180.234:/git/slp/pkgs/xorg/driver/xserver-xorg-input-evdev-multitouch + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+8 + + -- Sung-Jin Park Thu, 04 Nov 2010 22:17:32 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+7) unstable; urgency=low + + * Add codes for debugging multitouch event sequences from kernel driver + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11 + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+7 + + -- Sung-Jin Park Mon, 04 Oct 2010 13:58:49 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+6) unstable; urgency=low + + * Do not get absinfo if "Resolution" option exists in input.conf file + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11 + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+6 + + -- Sung-Jin Park Fri, 17 Sep 2010 11:05:57 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+5) unstable; urgency=low + + * Fix EvdevSwapAxes() for setting resolution properly. + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11 + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+5 + + -- Sung-Jin Park Tue, 29 Jun 2010 15:44:41 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+4) unstable; urgency=low + + * Add input polling with vsync + * Modify evdev.c to add an additional argument to NewInputDeviceRequest() + for xserver-1.8.0 + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11 + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+4 + + -- Sung-Jin Park Mon, 10 May 2010 16:18:28 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+3) unstable; urgency=low + + * upload package + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11 + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+3 + + -- Sung-Jin Park Tue, 04 May 2010 11:54:56 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+2) unstable; urgency=low + + * update + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11 + * Tag: xserver-xorg-input-evdev-multitouch_2.3.2-5slp2+2 + + -- Sung-Jin Park Mon, 03 May 2010 19:06:52 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5slp2+1) unstable; urgency=low + + * Change revision + + -- Sung-Jin Park Thu, 25 Mar 2010 18:14:29 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-5) unstable; urgency=low + + * Add EvdevSwapAxes() function for adjusting touch screen size properly + when screen is rotated with xrandr extension + (Adjust absinfo of max_x, min_x, max_y, min_y) + + -- Sung-Jin Park Fri, 19 Mar 2010 16:38:02 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-4) unstable; urgency=low + + * Remove evdev log related to touch gap + + -- Sung-Jin Park Tue, 09 Feb 2010 18:22:16 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-3) unstable; urgency=low + + * Add routines for applying touch screen resolution properly from options in xorg.conf + Bug fix related to InvertX, InvertY + + -- Sung-Jin Park Tue, 09 Feb 2010 09:47:05 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-2) unstable; urgency=low + + * Change not to strip binary + + -- Sung-Jin Park Thu, 04 Feb 2010 17:03:03 +0900 + +xserver-xorg-input-evdev-multitouch (2.3.2-1) unstable; urgency=low + + * Initial release + + -- Sung-Jin Park Tue, 29 Sep 2009 21:04:26 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..ea1a2d7 --- /dev/null +++ b/debian/control @@ -0,0 +1,31 @@ +Source: xserver-xorg-input-evdev-multitouch +Section: x11 +Priority: optional +Maintainer: Sung-Jin Park +Uploaders: Sung-Jin Park , SooChan Lim +#Uploaders: David Nusinow , Drew Parsons , Julien Cristau , Brice Goglin +Build-Depends: debhelper (>= 5.0.0), pkg-config, quilt, xserver-xorg-dev (>= 1.6.99.900), x11proto-core-dev, x11proto-randr-dev, x11proto-input-dev, x11proto-kb-dev, libxkbfile-dev, dpkg-dev (>= 1.14.17), automake, libtool, xutils-dev (>= 1:7.3~1) +Standards-Version: 3.8.3 + +Package: xserver-xorg-input-evdev-multitouch +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${xserver} +Provides: ${xinpdriver:Provides} +Conflicts: xserver-xorg-input-evdev-multitouch-c210 +Replaces: xserver-xorg-input-evdev-multitouch-c210, xserver-xorg (<< 6.8.2-35) +Description: X.Org X server -- evdev input multitouch driver + This package provides the driver for input devices using evdev, the Linux + kernel's event delivery mechanism. This driver allows for multiple keyboards + and mice to be treated as separate input devices. + . + More information about X.Org can be found at: + + + + . + This package is built from the X.org xf86-input-evdev driver module. + +Package: xserver-xorg-input-evdev-multitouch-dbg +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${xserver}, xserver-xorg-input-evdev-multitouch (=${Source-Version}) +Description: Debug package of xserver-xorg-input-evdev-multitouch diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..4cf9803 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,100 @@ +This package was downloaded from +git://anongit.freedesktop.org/git/xorg/driver/xf86-input-evdev. +Release tarballs are available at +http://xorg.freedesktop.org/releases/individual/driver/ + +Various copyright notices found in this driver: + +Copyright © 2004-2008 Red Hat, Inc. + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without +fee, provided that the above copyright notice appear in all copies +and that both that copyright notice and this permission notice +appear in supporting documentation, and that the name of Red Hat +not be used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. Red +Hat makes no representations about the suitability of this software +for any purpose. It is provided "as is" without express or implied +warranty. + +THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Copyright 2005 Sun Microsystems, Inc. All rights reserved. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP 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. + +Except as contained in this notice, the name of the copyright holders shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the copyright holders. + +Copyright © 2008 University of South Australia +copyrights taken from xf86-input-mouse, partly valid for this driver. +Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. +Copyright 1993 by David Dawes +Copyright 2002 by SuSE Linux AG, Author: Egbert Eich +Copyright 1994-2002 by The XFree86 Project, Inc. +Copyright 2002 by Paul Elliott + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without +fee, provided that the above copyright notice appear in all copies +and that both that copyright notice and this permission notice +appear in supporting documentation, and that the name of the authors +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. The authors make no +representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied +warranty. + +THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +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. + diff --git a/debian/local/10-x11-evdev.fdi b/debian/local/10-x11-evdev.fdi new file mode 100644 index 0000000..a7fe8cc --- /dev/null +++ b/debian/local/10-x11-evdev.fdi @@ -0,0 +1,18 @@ + + + + + + evdev + + + + + + evdev + + + + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0df75f7 --- /dev/null +++ b/debian/rules @@ -0,0 +1,110 @@ +#!/usr/bin/make -f +# debian/rules for the Debian xserver-xorg-input-evdev-multitouch package. +# Copyright © 2004 Scott James Remnant +# Copyright © 2005 Daniel Stone +# Copyright © 2005 David Nusinow + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include debian/xsfbs/xsfbs.mk + +CFLAGS = -Wall -g -D_F_IGNORE_TSP_RESOLUTION_ +CFLAGS += -D_F_GESTURE_EXTENSION_ +#CFLAGS += -D_DEBUG_MT_SEQUENCE_ +LDFLAGS += -Wl,--hash-style=both -Wl,--as-needed +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j$(NUMJOBS) +endif + +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build=$(DEB_HOST_GNU_TYPE) +else + confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) +# confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) +endif + +# kbd_drv.a isn't phenomenally useful; kbd_drv.so more so +confflags += --disable-static + +#configure: $(STAMP_DIR)/patch +configure: + autoreconf -vfi + #./autogen.sh + +obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure + mkdir -p obj-$(DEB_BUILD_GNU_TYPE) + cd obj-$(DEB_BUILD_GNU_TYPE) && \ + ../configure --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info $(confflags) \ + CFLAGS="$(CFLAGS)" \ + LDFLAGS="$(LDFLAGS)" + +build: build-stamp +build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status + dh_testdir + cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) + >$@ + +clean: xsfclean + dh_testdir + dh_testroot + rm -f build-stamp + + rm -f config.cache config.log config.status + rm -f */config.cache */config.log */config.status + rm -f conftest* */conftest* + rm -rf autom4te.cache */autom4te.cache + rm -rf obj-* + rm -f $$(find -name Makefile.in) + rm -f compile config.guess config.sub configure depcomp install-sh + rm -f ltmain.sh missing INSTALL aclocal.m4 ylwrap mkinstalldirs config.h.in + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + +# Build architecture-dependent files here. +binary-arch: build install serverabi + dh_testdir + dh_testroot + + dh_installdocs + dh_installchangelogs ChangeLog + dh_install --sourcedir=debian/tmp --list-missing --exclude=usr/share/man/man4 + #dh_install --sourcedir=debian/tmp --list-missing --exclude=evdev_drv.la --exclude=usr/share/man/man4 +# install -d debian/xserver-xorg-input-evdev/usr/share/hal/fdi/policy/20thirdparty +# install -m 644 debian/local/10-x11-evdev.fdi debian/xserver-xorg-input-evdev/usr/share/hal/fdi/policy/20thirdparty/ + dh_installman + dh_link + dh_strip --dbg-package=xserver-xorg-input-evdev-multitouch-dbg + dh_compress + dh_fixperms + dh_installdeb +# dh_shlibdeps -- --warnings=6 + dh_shlibdeps -- + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-independent files here. +binary-indep: build install +# Nothing to do + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..16cd015 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://xorg.freedesktop.org/releases/individual/driver/ xf86-input-evdev-(.*)\.tar\.gz diff --git a/debian/xserver-xorg-input-evdev-multitouch.install b/debian/xserver-xorg-input-evdev-multitouch.install new file mode 100644 index 0000000..1002d70 --- /dev/null +++ b/debian/xserver-xorg-input-evdev-multitouch.install @@ -0,0 +1,2 @@ +usr/lib/xorg/modules/input/*.so +usr/lib/xorg/modules/input/*.la diff --git a/debian/xserver-xorg-input-evdev-multitouch.links b/debian/xserver-xorg-input-evdev-multitouch.links new file mode 100644 index 0000000..7b68e25 --- /dev/null +++ b/debian/xserver-xorg-input-evdev-multitouch.links @@ -0,0 +1 @@ +usr/share/bug/xserver-xorg-core/script usr/share/bug/xserver-xorg-input-evdev-multitouch/script diff --git a/debian/xserver-xorg-input-evdev-multitouch.manpages b/debian/xserver-xorg-input-evdev-multitouch.manpages new file mode 100644 index 0000000..603f9bd --- /dev/null +++ b/debian/xserver-xorg-input-evdev-multitouch.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man4/* diff --git a/debian/xsfbs/repack.sh b/debian/xsfbs/repack.sh new file mode 100644 index 0000000..5935cc9 --- /dev/null +++ b/debian/xsfbs/repack.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e + +if ! [ -d debian/prune ]; then + exit 0 +fi + +if [ "x$1" != x--upstream-version ]; then + exit 1 +fi + +version="$2" +filename="$3" + +if [ -z "$version" ] || ! [ -f "$filename" ]; then + exit 1 +fi + +dir="$(pwd)" +tempdir="$(mktemp -d)" + +cd "$tempdir" +tar xf "$dir/$filename" +cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done + +tar czf "$dir/$filename" * +cd "$dir" +rm -rf "$tempdir" +echo "Done pruning upstream tarball" + +exit 0 diff --git a/debian/xsfbs/xsfbs.mk b/debian/xsfbs/xsfbs.mk new file mode 100644 index 0000000..f0f8953 --- /dev/null +++ b/debian/xsfbs/xsfbs.mk @@ -0,0 +1,293 @@ +#!/usr/bin/make -f + +# Debian X Strike Force Build System (XSFBS): Make portion + +# Copyright 1996 Stephen Early +# Copyright 1997 Mark Eichin +# Copyright 1998-2005, 2007 Branden Robinson +# Copyright 2005 David Nusinow +# +# Licensed under the GNU General Public License, version 2. See the file +# /usr/share/common-licenses/GPL or . + +# Originally by Stephen Early +# Modified by Mark W. Eichin +# Modified by Adam Heath +# Modified by Branden Robinson +# Modified by Fabio Massimo Di Nitto +# Modified by David Nusinow +# Acknowledgements to Manoj Srivastava. + +# Pass $(DH_OPTIONS) into the environment for debhelper's benefit. +export DH_OPTIONS + +# force quilt to not use ~/.quiltrc and to use debian/patches +QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null + +# Set up parameters for the upstream build environment. + +# Determine (source) package name from Debian changelog. +SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \ + | grep '^Source:' | awk '{print $$2}') + +# Determine package version from Debian changelog. +SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \ + | grep '^Version:' | awk '{print $$2}') + +# Determine upstream version number. +UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//') + +# Determine the source version without the epoch for make-orig-tar-gz +NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://') + +# Figure out who's building this package. +BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}}) + +# Find out if this is an official build; an official build has nothing but +# digits, dots, and/or the codename of a release in the Debian part of the +# version number. Anything else indicates an unofficial build. +OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi) + +# Set up parameters for the Debian build environment. + +# Determine our architecture. +BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) +# Work around some old-time dpkg braindamage. +BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH)) +# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy. +ifdef DEB_HOST_ARCH + ARCH:=$(DEB_HOST_ARCH) +else + # dpkg-cross sets the ARCH environment variable; if set, use it. + ifdef ARCH + ARCH:=$(ARCH) + else + ARCH:=$(BUILD_ARCH) + endif +endif + +# $(STAMP_DIR) houses stamp files for complex targets. +STAMP_DIR:=stampdir + +# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place +# their files. +DEBTREEDIR:=$(CURDIR)/debian/tmp + +# All "important" targets have four lines: +# 1) A target name that is invoked by a package-building tool or the user. +# This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart. +# 2) A line delcaring 1) as a phony target (".PHONY:"). +# 3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may +# depend on other targets. +# 4) A line declaring 3) as a member of the $(stampdir_targets) variable; the +# "$(STAMP_DIR)/" prefix is omitted. +# +# This indirection is needed so that the "stamp" files that signify when a rule +# is done can be located in a separate "stampdir". Recall that make has no way +# to know when a goal has been met for a phony target (like "build" or +# "install"). +# +# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@" +# so that the target will not be run again. Removing the file will make Make +# run the target over. + +# All phony targets should be declared as dependencies of .PHONY, even if they +# do not have "($STAMP_DIR)/"-prefixed counterparts. + +# Define a harmless default rule to keep things from going nuts by accident. +.PHONY: default +default: + +# Set up the $(STAMP_DIR) directory. +.PHONY: stampdir +stampdir_targets+=stampdir +stampdir: $(STAMP_DIR)/stampdir +$(STAMP_DIR)/stampdir: + mkdir $(STAMP_DIR) + >$@ + +# Set up the package build directory as quilt expects to find it. +.PHONY: prepare +stampdir_targets+=prepare +prepare: $(STAMP_DIR)/prepare +$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts + >$@ + +.PHONY: log +stampdir_targets+=log +log: $(STAMP_DIR)/log +$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir + mkdir -p $(STAMP_DIR)/log + +# Apply all patches to the upstream source. +.PHONY: patch +stampdir_targets+=patch +patch: $(STAMP_DIR)/patch +$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare + if ! [ `which quilt` ]; then \ + echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \ + exit 1; \ + fi; \ + if $(QUILT) next >/dev/null 2>&1; then \ + echo -n "Applying patches..."; \ + if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \ + cat $(STAMP_DIR)/log/patch; \ + echo "successful."; \ + else \ + cat $(STAMP_DIR)/log/patch; \ + echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \ + exit 1; \ + fi; \ + else \ + echo "No patches to apply"; \ + fi; \ + >$@ + +# Revert all patches to the upstream source. +.PHONY: unpatch +unpatch: $(STAMP_DIR)/log + rm -f $(STAMP_DIR)/patch + @echo -n "Unapplying patches..."; \ + if $(QUILT) applied >/dev/null 2>/dev/null; then \ + if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \ + cat $(STAMP_DIR)/log/unpatch; \ + echo "successful."; \ + else \ + cat $(STAMP_DIR)/log/unpatch; \ + echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \ + exit 1; \ + fi; \ + else \ + echo "nothing to do."; \ + fi + +# Clean the generated maintainer scripts. +.PHONY: cleanscripts +cleanscripts: + rm -f $(STAMP_DIR)/genscripts + rm -f debian/*.config \ + debian/*.postinst \ + debian/*.postrm \ + debian/*.preinst \ + debian/*.prerm + +# Clean the package build tree. +.PHONY: xsfclean +xsfclean: cleanscripts unpatch + dh_testdir + rm -rf .pc + rm -rf $(STAMP_DIR) $(SOURCE_DIR) + rm -rf imports + dh_clean debian/shlibs.local \ + debian/po/pothead + +# Generate the debconf templates POT file header. +debian/po/pothead: debian/po/pothead.in + sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \ + -e 's/DATE/$(shell date "+%F %X%z"/)' <$< >$@ + +# Update POT and PO files. +.PHONY: updatepo +updatepo: debian/po/pothead + debian/scripts/debconf-updatepo --pot-header=pothead --verbose + +# Remove files from the upstream source tree that we don't need, or which have +# licensing problems. It must be run before creating the .orig.tar.gz. +# +# Note: This rule is for Debian package maintainers' convenience, and is not +# needed for conventional build scenarios. +.PHONY: prune-upstream-tree +prune-upstream-tree: + # Ensure we're in the correct directory. + dh_testdir + grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf + +# Verify that there are no offsets or fuzz in the patches we apply. +# +# Note: This rule is for Debian package maintainers' convenience, and is not +# needed for conventional build scenarios. +.PHONY: patch-audit +patch-audit: prepare unpatch + @echo -n "Auditing patches..."; \ + >$(STAMP_DIR)/log/patch; \ + FUZZY=; \ + while [ -n "$$($(QUILT) next)" ]; do \ + RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\ + case "$$RESULT" in \ + succeeded) \ + echo "fuzzy patch: $$($(QUILT) top)" \ + | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \ + FUZZY=yes; \ + ;; \ + FAILED) \ + echo "broken patch: $$($(QUILT) next)" \ + | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \ + exit 1; \ + ;; \ + esac; \ + done; \ + if [ -n "$$FUZZY" ]; then \ + echo "there were fuzzy patches; please fix."; \ + exit 1; \ + else \ + echo "done."; \ + fi + +# Generate the maintainer scripts. +.PHONY: genscripts +stampdir_targets+=genscripts +genscripts: $(STAMP_DIR)/genscripts +$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir + for FILE in debian/*.config.in \ + debian/*.postinst.in \ + debian/*.postrm.in \ + debian/*.preinst.in \ + debian/*.prerm.in; do \ + if [ -e "$$FILE" ]; then \ + MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \ + sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \ + | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \ + cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \ + sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \ + | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \ + sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \ + -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \ + -e 's/@DEFAULT_DCRESOLUTIONS@/$(DEFAULT_DCRESOLUTIONS)/' \ + <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \ + rm $$MAINTSCRIPT.tmp; \ + fi; \ + done + # Validate syntax of generated shell scripts. + #sh debian/scripts/validate-posix-sh debian/*.config \ + # debian/*.postinst \ + # debian/*.postrm \ + # debian/*.preinst \ + # debian/*.prerm + >$@ + +# Generate the shlibs.local file. +debian/shlibs.local: + cat debian/*.shlibs >$@ + +SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null) +VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null) +INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null) +SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS)) +VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI) +INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI) +ifeq ($(PACKAGE),) +PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control) +endif + +.PHONY: serverabi +serverabi: install +ifeq ($(SERVERMINVERS),) + @echo error: xserver-xorg-dev needs to be installed + @exit 1 +else + echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars + echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars + echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars +endif + +# vim:set noet ai sts=8 sw=8 tw=0: diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh new file mode 100644 index 0000000..781826f --- /dev/null +++ b/debian/xsfbs/xsfbs.sh @@ -0,0 +1,853 @@ +# $Id$ + +# This is the X Strike Force shell library for X Window System package +# maintainer scripts. It serves to define shell functions commonly used by +# such packages, and performs some error checking necessary for proper operation +# of those functions. By itself, it does not "do" much; the maintainer scripts +# invoke the functions defined here to accomplish package installation and +# removal tasks. + +# If you are reading this within a Debian package maintainer script (e.g., +# /var/lib/dpkg)info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can +# skip past this library by scanning forward in this file to the string +# "GOBSTOPPER". + +SOURCE_VERSION=@SOURCE_VERSION@ +OFFICIAL_BUILD=@OFFICIAL_BUILD@ + +# Use special abnormal exit codes so that problems with this library are more +# easily tracked down. +SHELL_LIB_INTERNAL_ERROR=86 +SHELL_LIB_THROWN_ERROR=74 +SHELL_LIB_USAGE_ERROR=99 + +# old -> new variable names +if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then + DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE" +fi +if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then + DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF" +fi + +# initial sanity checks +if [ -z "$THIS_PACKAGE" ]; then + cat >&2 < on the World Wide Web for +instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the +"doc-debian" package, or install the "reportbug" package and use the command of +the same name to file a report against version $SOURCE_VERSION of this package. +EOF + exit $SHELL_LIB_USAGE_ERROR +fi + +if [ -z "$THIS_SCRIPT" ]; then + cat >&2 < on the World Wide Web for +instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the +"doc-debian" package, or install the "reportbug" package and use the command of +the same name to file a report against version $SOURCE_VERSION of the +"$THIS_PACKAGE" package. +EOF + exit $SHELL_LIB_USAGE_ERROR +fi + +if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then + RECONFIGURE="true" +else + RECONFIGURE= +fi + +if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then + FIRSTINST="yes" +fi + +if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then + UPGRADE="yes" +fi + +trap "message;\ + message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\ + message;\ + exit 1" HUP INT QUIT TERM + +reject_nondigits () { + # syntax: reject_nondigits [ operand ... ] + # + # scan operands (typically shell variables whose values cannot be trusted) for + # characters other than decimal digits and barf if any are found + while [ -n "$1" ]; do + # does the operand contain anything but digits? + if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then + # can't use die(), because it wraps message() which wraps this function + echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \ + "possibly malicious garbage \"$1\"" >&2 + exit $SHELL_LIB_THROWN_ERROR + fi + shift + done +} + +reject_whitespace () { + # syntax: reject_whitespace [ operand ] + # + # scan operand (typically a shell variable whose value cannot be trusted) for + # whitespace characters and barf if any are found + if [ -n "$1" ]; then + # does the operand contain any whitespace? + if expr "$1" : "[[:space:]]" > /dev/null 2>&1; then + # can't use die(), because I want to avoid forward references + echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_whitespace() encountered" \ + "possibly malicious garbage \"$1\"" >&2 + exit $SHELL_LIB_THROWN_ERROR + fi + fi +} + +reject_unlikely_path_chars () { + # syntax: reject_unlikely_path_chars [ operand ... ] + # + # scan operands (typically shell variables whose values cannot be trusted) for + # characters unlikely to be seen in a path and which the shell might + # interpret and barf if any are found + while [ -n "$1" ]; do + # does the operand contain any funny characters? + if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then + # can't use die(), because I want to avoid forward references + echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \ + "encountered possibly malicious garbage \"$1\"" >&2 + exit $SHELL_LIB_THROWN_ERROR + fi + shift + done +} + +# Query the terminal to establish a default number of columns to use for +# displaying messages to the user. This is used only as a fallback in the +# event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while +# the script is running, and this cannot, only being calculated once.) +DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true +if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then + DEFCOLUMNS=80 +fi + +message () { + # pretty-print messages of arbitrary length + reject_nondigits "$COLUMNS" + echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2 +} + +observe () { + # syntax: observe message ... + # + # issue observational message suitable for logging someday when support for + # it exists in dpkg + if [ -n "$DEBUG_XORG_PACKAGE" ]; then + message "$THIS_PACKAGE $THIS_SCRIPT note: $*" + fi +} + +warn () { + # syntax: warn message ... + # + # issue warning message suitable for logging someday when support for + # it exists in dpkg; also send to standard error + message "$THIS_PACKAGE $THIS_SCRIPT warning: $*" +} + +die () { + # syntax: die message ... + # + # exit script with error message + message "$THIS_PACKAGE $THIS_SCRIPT error: $*" + exit $SHELL_LIB_THROWN_ERROR +} + +internal_error () { + # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message + message "internal error: $*" + if [ -n "$OFFICIAL_BUILD" ]; then + message "Please report a bug in the $THIS_SCRIPT script of the" \ + "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \ + "Tracking System. Include all messages above that mention the" \ + "$THIS_PACKAGE package. Visit " \ + " on the World Wide Web for" \ + "instructions, read the file" \ + "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \ + "package, or install the reportbug package and use the command of" \ + "the same name to file a report." + fi + exit $SHELL_LIB_INTERNAL_ERROR +} + +usage_error () { + message "usage error: $*" + message "Please report a bug in the $THIS_SCRIPT script of the" \ + "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \ + "Tracking System. Include all messages above that mention the" \ + "$THIS_PACKAGE package. Visit " \ + " on the World Wide Web for" \ + "instructions, read the file" \ + "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \ + "package, or install the reportbug package and use the command of" \ + "the same name to file a report." + exit $SHELL_LIB_USAGE_ERROR +} + + +maplink () { + # returns what symlink should point to; i.e., what the "sane" answer is + # Keep this in sync with the debian/*.links files. + # This is only needed for symlinks to directories. + # + # XXX: Most of these look wrong in the X11R7 world and need to be fixed. + # If we've stopped using this function, fixing it might enable us to re-enable + # it again and catch more errors. + case "$1" in + /etc/X11/xkb/compiled) echo /var/lib/xkb ;; + /etc/X11/xkb/xkbcomp) echo /usr/X11R6/bin/xkbcomp ;; + /usr/X11R6/lib/X11/app-defaults) echo /etc/X11/app-defaults ;; + /usr/X11R6/lib/X11/fs) echo /etc/X11/fs ;; + /usr/X11R6/lib/X11/lbxproxy) echo /etc/X11/lbxproxy ;; + /usr/X11R6/lib/X11/proxymngr) echo /etc/X11/proxymngr ;; + /usr/X11R6/lib/X11/rstart) echo /etc/X11/rstart ;; + /usr/X11R6/lib/X11/twm) echo /etc/X11/twm ;; + /usr/X11R6/lib/X11/xdm) echo /etc/X11/xdm ;; + /usr/X11R6/lib/X11/xinit) echo /etc/X11/xinit ;; + /usr/X11R6/lib/X11/xkb) echo /etc/X11/xkb ;; + /usr/X11R6/lib/X11/xserver) echo /etc/X11/xserver ;; + /usr/X11R6/lib/X11/xsm) echo /etc/X11/xsm ;; + /usr/bin/X11) echo ../X11R6/bin ;; + /usr/bin/rstartd) echo ../X11R6/bin/rstartd ;; + /usr/include/X11) echo ../X11R6/include/X11 ;; + /usr/lib/X11) echo ../X11R6/lib/X11 ;; + *) internal_error "maplink() called with unknown path \"$1\"" ;; + esac +} + +analyze_path () { + # given a supplied set of pathnames, break each one up by directory and do an + # ls -dl on each component, cumulatively; i.e. + # analyze_path /usr/X11R6/bin -> ls -dl /usr /usr/X11R6 /usr/X11R6/bin + # Thanks to Randolph Chung for this clever hack. + + local f g + + while [ -n "$1" ]; do + reject_whitespace "$1" + g= + message "Analyzing $1:" + for f in $(echo "$1" | tr / \ ); do + if [ -e /$g$f ]; then + ls -dl /$g$f /$g$f.dpkg-* 2> /dev/null || true + g=$g$f/ + else + message "/$g$f: nonexistent; directory contents of /$g:" + ls -l /$g + break + fi + done + shift + done +} + +find_culprits () { + local f p dpkg_info_dir possible_culprits smoking_guns bad_packages package \ + msg + + reject_whitespace "$1" + message "Searching for overlapping packages..." + dpkg_info_dir=/var/lib/dpkg/info + if [ -d $dpkg_info_dir ]; then + if [ "$(echo $dpkg_info_dir/*.list)" != "$dpkg_info_dir/*.list" ]; then + possible_culprits=$(ls -1 $dpkg_info_dir/*.list | egrep -v \ + "(xbase-clients|x11-common|xfs|xlibs)") + if [ -n "$possible_culprits" ]; then + smoking_guns=$(grep -l "$1" $possible_culprits || true) + if [ -n "$smoking_guns" ]; then + bad_packages=$(printf "\\n") + for f in $smoking_guns; do + # too bad you can't nest parameter expansion voodoo + p=${f%*.list} # strip off the trailing ".list" + package=${p##*/} # strip off the directories + bad_packages=$(printf "%s\n%s" "$bad_packages" "$package") + done + msg=$(cat < /dev/null 2>&1; then + shortcmd=${cmd##*/} + observe "running $shortcmd in $dir font directory" + cmd_opts= + if [ "$shortcmd" = "update-fonts-alias" ]; then + cmd_opts=--x11r7-layout + fi + if [ "$shortcmd" = "update-fonts-dir" ]; then + cmd_opts=--x11r7-layout + fi + if [ "$shortcmd" = "update-fonts-scale" ]; then + cmd_opts=--x11r7-layout + fi + $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \ + "failed; font directory data may not" \ + "be up to date" + else + warn "$cmd not found; not updating corresponding $dir font" \ + "directory data" + fi + done + else + warn "$dir is not a directory; not updating font directory data" + fi + done +} + +remove_conffile_prepare () { + # syntax: remove_conffile_prepare filename official_md5sum ... + # + # Check a conffile "filename" against a list of canonical MD5 checksums. + # If the file's current MD5 checksum matches one of the "official_md5sum" + # operands provided, then prepare the conffile for removal from the system. + # We defer actual deletion until the package is configured so that we can + # roll this operation back if package installation fails. + # + # Call this function from a preinst script in the event $1 is "upgrade" or + # "install" and verify $2 to ensure the package is being upgraded from a + # version (or installed over a version removed-but-not-purged) prior to the + # one in which the conffile was obsoleted. + + local conffile current_checksum + + # validate arguments + if [ $# -lt 2 ]; then + usage_error "remove_conffile_prepare() called with wrong number of" \ + "arguments; expected at least 2, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + conffile="$1" + shift + + # does the conffile even exist? + if [ -e "$conffile" ]; then + # calculate its checksum + current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//') + # compare it to each supplied checksum + while [ -n "$1" ]; do + if [ "$current_checksum" = "$1" ]; then + # we found a match; move the confffile and stop looking + observe "preparing obsolete conffile $conffile for removal" + mv "$conffile" "$conffile.$THIS_PACKAGE-tmp" + break + fi + shift + done + fi +} + +remove_conffile_lookup () { + # syntax: remove_conffile_lookup package filename + # + # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal + # if it matches the actual file's md5sum. + # + # Call this function when you would call remove_conffile_prepare but only + # want to check against dpkg's status database instead of known checksums. + + local package conffile old_md5sum + + # validate arguments + if [ $# -ne 2 ]; then + usage_error "remove_conffile_lookup() called with wrong number of" \ + "arguments; expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + package="$1" + conffile="$2" + + if ! [ -e "$conffile" ]; then + return + fi + old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \ + awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')" + if [ -n "$old_md5sum" ]; then + remove_conffile_prepare "$conffile" "$old_md5sum" + fi +} + +remove_conffile_commit () { + # syntax: remove_conffile_commit filename + # + # Complete the removal of a conffile "filename" that has become obsolete. + # + # Call this function from a postinst script after having used + # remove_conffile_prepare() in the preinst. + + local conffile + + # validate arguments + if [ $# -ne 1 ]; then + usage_error "remove_conffile_commit() called with wrong number of" \ + "arguments; expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + conffile="$1" + + # if the temporary file created by remove_conffile_prepare() exists, remove it + if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then + observe "committing removal of obsolete conffile $conffile" + rm "$conffile.$THIS_PACKAGE-tmp" + fi +} + +remove_conffile_rollback () { + # syntax: remove_conffile_rollback filename + # + # Roll back the removal of a conffile "filename". + # + # Call this function from a postrm script in the event $1 is "abort-upgrade" + # or "abort-install" is after having used remove_conffile_prepare() in the + # preinst. + + local conffile + + # validate arguments + if [ $# -ne 1 ]; then + usage_error "remove_conffile_rollback() called with wrong number of" \ + "arguments; expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + conffile="$1" + + # if the temporary file created by remove_conffile_prepare() exists, move it + # back + if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then + observe "rolling back removal of obsolete conffile $conffile" + mv "$conffile.$THIS_PACKAGE-tmp" "$conffile" + fi +} + +replace_conffile_with_symlink_prepare () { + # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \ + # official_md5sum ... + # + # Check a conffile "oldfilename" against a list of canonical MD5 checksums. + # If the file's current MD5 checksum matches one of the "official_md5sum" + # operands provided, then prepare the conffile for removal from the system. + # We defer actual deletion until the package is configured so that we can + # roll this operation back if package installation fails. Otherwise copy it + # to newfilename and let dpkg handle it through conffiles mechanism. + # + # Call this function from a preinst script in the event $1 is "upgrade" or + # "install" and verify $2 to ensure the package is being upgraded from a + # version (or installed over a version removed-but-not-purged) prior to the + # one in which the conffile was obsoleted. + + local conffile current_checksum + + # validate arguments + if [ $# -lt 3 ]; then + usage_error "replace_conffile_with_symlink_prepare() called with wrong" \ + " number of arguments; expected at least 3, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + oldconffile="$1" + shift + newconffile="$1" + shift + + remove_conffile_prepare "$_oldconffile" "$@" + # If $oldconffile still exists, then md5sums didn't match. + # Copy it to new one. + if [ -f "$oldconffile" ]; then + cp "$oldconffile" "$newconffile" + fi + +} + +replace_conffile_with_symlink_commit () { + # syntax: replace_conffile_with_symlink_commit oldfilename + # + # Complete the removal of a conffile "oldfilename" that has been + # replaced by a symlink. + # + # Call this function from a postinst script after having used + # replace_conffile_with_symlink_prepare() in the preinst. + + local conffile + + # validate arguments + if [ $# -ne 1 ]; then + usage_error "replace_conffile_with_symlink_commit() called with wrong" \ + "number of arguments; expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + conffile="$1" + + remove_conffile_commit "$conffile" +} + +replace_conffile_with_symlink_rollback () { + # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename + # + # Roll back the replacing of a conffile "oldfilename" with symlink to + # "newfilename". + # + # Call this function from a postrm script in the event $1 is "abort-upgrade" + # or "abort-install" and verify $2 to ensure the package failed to upgrade + # from a version (or install over a version removed-but-not-purged) prior + # to the one in which the conffile was obsoleted. + # You should have used replace_conffile_with_symlink_prepare() in the + # preinst. + + local conffile + + # validate arguments + if [ $# -ne 2 ]; then + usage_error "replace_conffile_with_symlink_rollback() called with wrong" \ + "number of arguments; expected 2, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + oldconffile="$1" + newconffile="$2" + + remove_conffile_rollback "$_oldconffile" + if [ -f "$newconffile" ]; then + rm "$newconffile" + fi +} + +run () { + # syntax: run command [ argument ... ] + # + # Run specified command with optional arguments and report its exit status. + # Useful for commands whose exit status may be nonzero, but still acceptable, + # or commands whose failure is not fatal to us. + # + # NOTE: Do *not* use this function with db_get or db_metaget commands; in + # those cases the return value of the debconf command *must* be checked + # before the string returned by debconf is used for anything. + + local retval + + # validate arguments + if [ $# -lt 1 ]; then + usage_error "run() called with wrong number of arguments; expected at" \ + "least 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + "$@" || retval=$? + + if [ ${retval:-0} -ne 0 ]; then + observe "command \"$*\" exited with status $retval" + fi +} + +make_symlink_sane () { + # syntax: make_symlink_sane symlink target + # + # Ensure that the symbolic link symlink exists, and points to target. + # + # If symlink does not exist, create it and point it at target. + # + # If symlink exists but is not a symbolic link, back it up. + # + # If symlink exists, is a symbolic link, but points to the wrong location, fix + # it. + # + # If symlink exists, is a symbolic link, and already points to target, do + # nothing. + # + # This function wouldn't be needed if ln had an -I, --idempotent option. + + # Validate arguments. + if [ $# -ne 2 ]; then + usage_error "make_symlink_sane() called with wrong number of arguments;" \ + "expected 2, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + # We could just use the positional parameters as-is, but that makes things + # harder to follow. + local symlink target + + symlink="$1" + target="$2" + + if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then + observe "link from $symlink to $target already exists" + else + observe "creating symbolic link from $symlink to $target" + mkdir -p "${target%/*}" "${symlink%/*}" + ln -s -b -S ".dpkg-old" "$target" "$symlink" + fi +} + +migrate_dir_to_symlink () { + # syntax: migrate_dir_to_symlink old_location new_location + # + # Per Debian Policy section 6.5.4, "A directory will never be replaced by a + # symbolic link to a directory or vice versa; instead, the existing state + # (symlink or not) will be left alone and dpkg will follow the symlink if + # there is one." + # + # We have to do it ourselves. + # + # This function moves the contents of old_location, a directory, into + # new_location, a directory, then makes old_location a symbolic link to + # new_location. + # + # old_location need not exist, but if it does, it must be a directory (or a + # symlink to a directory). If it is not, it is backed up. If new_location + # exists already and is not a directory, it is backed up. + # + # This function should be called from a package's preinst so that other + # packages unpacked after this one --- but before this package's postinst runs + # --- are unpacked into new_location even if their payloads contain + # old_location filespecs. + + # Validate arguments. + if [ $# -ne 2 ]; then + usage_error "migrate_dir_to_symlink() called with wrong number of" + "arguments; expected 2, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + # We could just use the positional parameters as-is, but that makes things + # harder to follow. + local new old + + old="$1" + new="$2" + + # Is old location a symlink? + if [ -L "$old" ]; then + # Does it already point to new location? + if [ "$(readlink "$old")" = "$new" ]; then + # Nothing to do; migration has already been done. + observe "migration of $old to $new already done" + return 0 + else + # Back it up. + warn "backing up symbolic link $old as $old.dpkg-old" + mv -b "$old" "$old.dpkg-old" + fi + fi + + # Does old location exist, but is not a directory? + if [ -e "$old" ] && ! [ -d "$old" ]; then + # Back it up. + warn "backing up non-directory $old as $old.dpkg-old" + mv -b "$old" "$old.dpkg-old" + fi + + observe "migrating $old to $new" + + # Is new location a symlink? + if [ -L "$new" ]; then + # Does it point the wrong way, i.e., back to where we're migrating from? + if [ "$(readlink "$new")" = "$old" ]; then + # Get rid of it. + observe "removing symbolic link $new which points to $old" + rm "$new" + else + # Back it up. + warn "backing up symbolic link $new as $new.dpkg-old" + mv -b "$new" "$new.dpkg-old" + fi + fi + + # Does new location exist, but is not a directory? + if [ -e "$new" ] && ! [ -d "$new" ]; then + warn "backing up non-directory $new as $new.dpkg-old" + mv -b "$new" "$new.dpkg-old" + fi + + # Create new directory if it does not yet exist. + if ! [ -e "$new" ]; then + observe "creating $new" + mkdir -p "$new" + fi + + # Copy files in old location to new location. Back up any filenames that + # already exist in the new location with the extension ".dpkg-old". + observe "copying files from $old to $new" + if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then + die "error(s) encountered while copying files from $old to $new" + fi + + # Remove files at old location. + observe "removing $old" + rm -r "$old" + + # Create symlink from old location to new location. + make_symlink_sane "$old" "$new" +} + +# vim:set ai et sw=2 ts=2 tw=80: + +# GOBSTOPPER: The X Strike Force shell library ends here. diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..1f93750 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = evdevmultitouch-properties.h +sdk_HEADERS = evdevmultitouch-properties.h diff --git a/include/evdevmultitouch-properties.h b/include/evdevmultitouch-properties.h new file mode 100755 index 0000000..0be50c0 --- /dev/null +++ b/include/evdevmultitouch-properties.h @@ -0,0 +1,95 @@ +/* + * xserver-xorg-input-evdev-multitouch + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sung-Jin Park + * Sangjin LEE + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of Red Hat + * not be used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. Red + * Hat makes no representations about the suitability of this software + * for any purpose. It is provided "as is" without express or implied + * warranty. + * + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Copyright © 2008 Red Hat, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of Red Hat + * not be used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. Red + * Hat makes no representations about the suitability of this software + * for any purpose. It is provided "as is" without express or implied + * warranty. + * + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Authors: + * Peter Hutterer (peter.hutterer@redhat.com) + */ + + +#ifndef _EVDEVMULTITOUCH_PROPERTIES_H_ +#define _EVDEVMULTITOUCH_PROPERTIES_H_ + +/* Middle mouse button emulation */ +/* BOOL */ +#define EVDEVMULTITOUCH_PROP_MIDBUTTON "EvdevMultitouch Middle Button Emulation" +/* CARD32 */ +#define EVDEVMULTITOUCH_PROP_MIDBUTTON_TIMEOUT "EvdevMultitouch Middle Button Timeout" + +/* Wheel emulation */ +/* BOOL */ +#define EVDEVMULTITOUCH_PROP_WHEEL "EvdevMultitouch Wheel Emulation" +/* CARD8, 4 values [x up, x down, y up, y down], 0 to disable a value*/ +#define EVDEVMULTITOUCH_PROP_WHEEL_AXES "EvdevMultitouch Wheel Emulation Axes" +/* CARD16 */ +#define EVDEVMULTITOUCH_PROP_WHEEL_INERTIA "EvdevMultitouch Wheel Emulation Inertia" +/* CARD16 */ +#define EVDEVMULTITOUCH_PROP_WHEEL_TIMEOUT "EvdevMultitouch Wheel Emulation Timeout" +/* CARD8, value range 0-32, 0 to always scroll */ +#define EVDEVMULTITOUCH_PROP_WHEEL_BUTTON "EvdevMultitouch Wheel Emulation Button" + +/* Drag lock */ +/* CARD8, either 1 value or pairs, value range 0-32, 0 to disable a value*/ +#define EVDEVMULTITOUCH_PROP_DRAGLOCK "EvdevMultitouch Drag Lock Buttons" + +/* Axis inversion */ +/* BOOL, 2 values [x, y], 1 inverts axis */ +#define EVDEVMULTITOUCH_PROP_INVERT_AXES "EvdevMultitouch Axis Inversion" + +/* Reopen attempts. */ +/* CARD8 */ +#define EVDEVMULTITOUCH_PROP_REOPEN "EvdevMultitouch Reopen Attempts" + +/* Run-time calibration */ +/* CARD32, 4 values [minx, maxx, miny, maxy], or no values for unset */ +#define EVDEVMULTITOUCH_PROP_CALIBRATION "EvdevMultitouch Axis Calibration" + +/* Swap x and y axis. */ +/* BOOL */ +#define EVDEVMULTITOUCH_PROP_SWAP_AXES "EvdevMultitouch Axes Swap" + +#endif diff --git a/include/vsync_debug_info.h b/include/vsync_debug_info.h new file mode 100755 index 0000000..481b8ad --- /dev/null +++ b/include/vsync_debug_info.h @@ -0,0 +1,303 @@ +/* + * xserver-xorg-input-evdev-multitouch + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sung-Jin Park + * Sangjin LEE + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of Red Hat + * not be used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. Red + * Hat makes no representations about the suitability of this software + * for any purpose. It is provided "as is" without express or implied + * warranty. + * + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _SYNC_DEBUG_H +#define _SYNC_DEBUG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __GNUC__ +#define MAY_NOT_BE_USED __attribute__ ((unused)) +#else +#define MAY_NOT_BE_USED +#endif + + +#define SYNC_DEBUG_SHM_KEY 0xDEAD2012 +#define SHM_MESG_SIZE ( 1024 * 1024 ) + +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC 1 +#endif + +typedef struct { + int initialized; + + sem_t sem; + + int count; + + int cur_pos; + + int isLogging; + + int isPrintEnabled; + + unsigned long tvStart; + + int _shmid; + + char debug_msg[0]; +} VSYNC_DEBUG_INFO; + +static volatile VSYNC_DEBUG_INFO * _vsync_debug = NULL; + +static int +_vsync_debug_init(void) +{ + int shmid = 0; + + struct shmid_ds ds; + + shmid = shmget(SYNC_DEBUG_SHM_KEY, SHM_MESG_SIZE, IPC_CREAT | IPC_RMID); + if (shmid < 0) + { + fprintf(stderr, "\tError : shmget size:%d\n", SHM_MESG_SIZE); + goto bail; + } + + if (shmctl(shmid, IPC_STAT, &ds) < 0) + { + fprintf(stderr, "\tError : shmctl\n"); + goto bail; + } + + if (ds.shm_segsz < SHM_MESG_SIZE) + { + fprintf(stderr, "\tError : size check\n"); + goto bail; + } + + _vsync_debug = shmat(shmid, NULL, 0); + if (_vsync_debug == (void *) -1) + { + fprintf(stderr, "\tError : shmat\n"); + goto bail; + } + + return shmid; + +bail: + fprintf(stderr, "VSYNC_DEBUG.... Error\n"); + + if (_vsync_debug != NULL && _vsync_debug != (void *) -1) + shmdt((void*)_vsync_debug); + + return -1; +} + +static unsigned long +_vsync_debug_get_time(void) +{ + struct timespec tp; + + if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) + return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L); + + return 0; +} + +static void +_vsync_debug_lock(void) +{ + if (sem_wait((sem_t *) &_vsync_debug->sem) < 0) + fprintf(stderr, "sem_wait error\n"); +} + + +static void +_vsync_debug_unlock(void) +{ + if (sem_post((sem_t *) &_vsync_debug->sem) < 0) + fprintf(stderr, "sem_post error\n"); +} + +static void +_vsync_debug_set_slot(int isSync, const char * format, va_list args) +{ + unsigned long cur_time; + + if (_vsync_debug == NULL) + _vsync_debug_init(); + + if (!_vsync_debug->initialized) + return; + + if (! _vsync_debug->isLogging) + return; + + if (!_vsync_debug->isPrintEnabled) + return; + + if (_vsync_debug->cur_pos > SHM_MESG_SIZE - 1024) + return; + + cur_time = _vsync_debug_get_time(); + + _vsync_debug_lock(); + + if (isSync) + { + _vsync_debug->count++; + _vsync_debug->cur_pos += sprintf((char *) _vsync_debug->debug_msg + _vsync_debug->cur_pos, ""); + + } + _vsync_debug->cur_pos += sprintf((char *) _vsync_debug->debug_msg + _vsync_debug->cur_pos, "%6ld ", cur_time); + _vsync_debug->cur_pos += vsprintf((char *) _vsync_debug->debug_msg + _vsync_debug->cur_pos, format, args); + _vsync_debug->debug_msg[_vsync_debug->cur_pos++] = '\n'; + _vsync_debug->debug_msg[_vsync_debug->cur_pos] = '\0'; + + if (isSync) + _vsync_debug->cur_pos += sprintf((char *) _vsync_debug->debug_msg + _vsync_debug->cur_pos, ""); + + _vsync_debug_unlock(); +} + +static void MAY_NOT_BE_USED +vsync_debug_start(void) +{ + if (_vsync_debug == NULL) + _vsync_debug_init(); + + if (!_vsync_debug->initialized) + return; + + _vsync_debug->isLogging = 1; + _vsync_debug->tvStart = _vsync_debug_get_time(); +} + +static void MAY_NOT_BE_USED +vsync_debug_stop(void) +{ + unsigned long tvStop; + + if (_vsync_debug == NULL) + _vsync_debug_init(); + + if (!_vsync_debug->initialized) + return; + + _vsync_debug->isLogging = 0; + tvStop = _vsync_debug_get_time(); + + _vsync_debug_lock(); + if (_vsync_debug->isPrintEnabled) + { + //Print Debug + fprintf(stderr, "VSYNC DEBUG: count:%d, start:%6ld, end:%6ld\n", _vsync_debug->count, _vsync_debug->tvStart, tvStop); + fprintf(stderr, "%s\n", _vsync_debug->debug_msg); + } + _vsync_debug->cur_pos = 0; + _vsync_debug->debug_msg[0] = '\0'; + _vsync_debug_unlock(); +} + +static void MAY_NOT_BE_USED +vsync_debug_set_sync(const char * format, ...) +{ + va_list args; + + va_start(args, format); + + _vsync_debug_set_slot(1, format, args); + + va_end(args); +} + +static void MAY_NOT_BE_USED +vsync_debug_set_slot(const char * format, ...) +{ + va_list args; + + va_start(args, format); + + _vsync_debug_set_slot(0, format, args); + + va_end(args); +} + +static void MAY_NOT_BE_USED +vsync_debug_set_enable(int bEnable) +{ + if (_vsync_debug == NULL) + _vsync_debug_init(); + + if (!_vsync_debug->initialized) + return; + + _vsync_debug->isPrintEnabled = bEnable; +} + +static void MAY_NOT_BE_USED +vsync_debug_master_init(void) +{ + int shmid = _vsync_debug_init(); + + _vsync_debug->_shmid = shmid; + + if (sem_init((sem_t *) &_vsync_debug->sem, 1, 1) < 0) + { + fprintf(stderr, "\tError : sem_init\n"); + goto bail; + } + + _vsync_debug->initialized = 1; + + return; +bail: + fprintf(stderr, "VSYNC_DEBUG.... master Error\n"); +} + +static void MAY_NOT_BE_USED +vsync_debug_master_close(void) +{ + if (_vsync_debug == NULL) + return; + + if (shmctl(_vsync_debug->_shmid, IPC_RMID, NULL) < 0) + { + fprintf(stderr, "\tError : shmctl(IPC_RMID)\n"); + } + if (shmdt((void*)_vsync_debug) < 0) + { + fprintf(stderr, "\tError : shmdt\n"); + } + + _vsync_debug = NULL; +} + +#endif /* _SYNC_DEBUG_H */ + diff --git a/include/vsync_input_protocol.h b/include/vsync_input_protocol.h new file mode 100755 index 0000000..e4c6842 --- /dev/null +++ b/include/vsync_input_protocol.h @@ -0,0 +1,119 @@ +/* + * xserver-xorg-input-evdev-multitouch + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sung-Jin Park + * Sangjin LEE + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of Red Hat + * not be used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. Red + * Hat makes no representations about the suitability of this software + * for any purpose. It is provided "as is" without express or implied + * warranty. + * + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _SYNC_INPUT_LIB_H +#define _SYNC_INPUT_LIB_H + +#include +#include +#include +#include + +#define SYNC_INPUT_SHM_KEY 0xDEAD2010 + +typedef struct { + /* EVDEVMULTITOUCHh providing functions FBDEV will use */ + void (*sync)(int vsync_cnt); + + /* FBDEV providing functions EVDEVMULTITOUCHh will use */ + void * sync_arg; + void (*start_sync)(void * sync_arg); + void (*stop_sync)(void * sync_arg); + + /* for internal use only */ + int _shmid; + + int _reserved[16]; +} VSYNC_INPUT_DISPATCH_TABLE; + +static volatile VSYNC_INPUT_DISPATCH_TABLE * +vsync_input_init(void) +{ + VSYNC_INPUT_DISPATCH_TABLE * table = NULL; + int shmid = 0; + + struct shmid_ds ds; + + shmid = shmget(SYNC_INPUT_SHM_KEY, sizeof(VSYNC_INPUT_DISPATCH_TABLE), IPC_CREAT); + if (shmid < 0) + goto bail; + + if (shmctl(shmid, IPC_STAT, &ds) < 0) + goto bail; + + if (ds.shm_segsz < sizeof(VSYNC_INPUT_DISPATCH_TABLE)) + goto bail; + + table = shmat(shmid, NULL, 0); + if (table == (void *) -1) + goto bail; + + table->_shmid = shmid; + + return table; + +bail: + if (shmid >= 0) + shmctl(shmid, IPC_RMID, NULL); + + if (table != NULL && table != (void *) -1) + shmdt(table); + + return NULL; +} + +static int +#ifdef __GNUC__ +__attribute__ ((unused)) +#endif +vsync_input_close(volatile VSYNC_INPUT_DISPATCH_TABLE * table) +{ + if (table == NULL) + return -1; + + shmdt((void *) table); + + return 0; +} + +static int +#ifdef __GNUC__ +__attribute__ ((unused)) +#endif +vsync_input_destroy(volatile VSYNC_INPUT_DISPATCH_TABLE * table) +{ + if (table == NULL) + return -1; + + shmctl(table->_shmid, IPC_RMID, NULL); + shmdt((void *) table); + + return 0; +} + +#endif /* _SYNC_INPUT_LIB_H */ diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 0000000..276f2f0 --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,57 @@ +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation. +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE OPEN GROUP 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. +# +# Except as contained in this notice, the name of the copyright holders shall +# not be used in advertising or otherwise to promote the sale, use or +# other dealings in this Software without prior written authorization +# from the copyright holders. +# + +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/man/evdevmultitouch.man b/man/evdevmultitouch.man new file mode 100644 index 0000000..abd31e2 --- /dev/null +++ b/man/evdevmultitouch.man @@ -0,0 +1,231 @@ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH EVDEVMULTITOUCHh __drivermansuffix__ __vendorversion__ +.SH NAME +evdevmultitouch \- Generic Linux input driver +.SH SYNOPSIS +.nf +.B "Section \*qInputDevice\*q" +.BI " Identifier \*q" devname \*q +.B " Driver \*qevdevmultitouch\*q" +.BI " Option \*qDevice\*q \*q" devpath \*q +.BI " Option \*qEmulate3Buttons\*q \*q" True \*q +.BI " Option \*qEmulate3Timeout\*q \*q" 50 \*q +.BI " Option \*qGrabDevice\*q \*q" False \*q +\ \ ... +.B EndSection +.fi +.SH DESCRIPTION +.B evdevmultitouch +is an __xservername__ input driver for Linux\'s generic event devices. It +therefore supports all input devices that the kernel knows about, including +most mice and keyboards. +.PP +The +.B evdevmultitouch +driver can serve as both a pointer and a keyboard input device, and may be +used as both the core keyboard and the core pointer. Multiple input devices +are supported by multiple instances of this driver, with one Load +directive for evdevmultitouch in the Module section of your __xconfigfile__ for each +input device that will use this driver. +.PP +.SH SUPPORTED HARDWARE +In general, any input device that the kernel has a driver for can be accessed +through the +.B evdevmultitouch +driver. See the Linux kernel documentation for a complete list. +.PP +.SH CONFIGURATION DETAILS +Please refer to __xconfigfile__(__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 +The following driver +.B Options +are supported: +.TP 7 +.BI "Option \*qButtonMapping\*q \*q" string \*q +Sets the button mapping for this device. The mapping is a space-separated list +of button mappings that correspond in order to the physical buttons on the +device (i.e. the first number is the mapping for button 1, etc.). The default +mapping is "1 2 3 ... 32". A mapping of 0 deactivates the button. Multiple +buttons can have the same mapping. +For example, a left-handed mouse with deactivated scroll-wheel would use a +mapping of "3 2 1 0 0". Invalid mappings are ignored and the default mapping +is used. Buttons not specified in the user's mapping use the default mapping. +.TP 7 +.BI "Option \*qDevice\*q \*q" string \*q +Specifies the device through which the device can be accessed. This will +generally be of the form \*q/dev/input/eventX\*q, where X is some integer. +The mapping from device node to hardware is system-dependent. +.TP 7 +.BI "Option \*qDragLockButtons\*q \*q" "L1 B2 L3 B4" \*q +Sets \*qdrag lock buttons\*q that simulate holding a button down, so +that low dexterity people do not have to hold a button down at the +same time they move a mouse cursor. Button numbers occur in pairs, +with the lock button number occurring first, followed by the button +number that is the target of the lock button. Property: "EvdevMultitouch +Drag Lock Buttons". +.TP 7 +.BI "Option \*qDragLockButtons\*q \*q" "M1" \*q +Sets a \*qmaster drag lock button\*q that acts as a \*qMeta Key\*q +indicating that the next button pressed is to be +\*qdrag locked\*q. Property: "EvdevMultitouch Drag Lock Buttons". +.TP 7 +.TP 7 +.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q +Enable/disable the emulation of the third (middle) mouse button for mice +which only have two physical buttons. The third button is emulated by +pressing both buttons simultaneously. Default: on, until a middle mouse +button event is registered. Property: "EvdevMultitouch Middle Button Emulation". +.TP 7 +.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q +Sets the timeout (in milliseconds) that the driver waits before deciding +if two buttons where pressed "simultaneously" when 3 button emulation is +enabled. Default: 50. Property: "EvdevMultitouch Middle Button Timeout". +.BI "Option \*qEmulateWheel\*q \*q" boolean \*q +Enable/disable "wheel" emulation. Wheel emulation means emulating button +press/release events when the mouse is moved while a specific real button +is pressed. Wheel button events (typically buttons 4 and 5) are +usually used for scrolling. Wheel emulation is useful for getting wheel-like +behaviour with trackballs. It can also be useful for mice with 4 or +more buttons but no wheel. See the description of the +.BR EmulateWheelButton , +.BR EmulateWheelInertia , +.BR EmulateWheelTimeout , +.BR XAxisMapping , +and +.B YAxisMapping +options. Default: off. Property "EvdevMultitouch Wheel Emulation". +.TP 7 +.BI "Option \*qEmulateWheelButton\*q \*q" integer \*q +Specifies which button must be held down to enable wheel emulation mode. +While this button is down, X and/or Y pointer movement will generate button +press/release events as specified for the +.B XAxisMapping +and +.B YAxisMapping +settings. If the button is 0 and +.BR EmulateWheel +is on, any motion of the device is converted into wheel events. Default: 4. +Property: "EvdevMultitouch Wheel Emulation Button". +.TP 7 +.BI "Option \*qEmulateWheelInertia\*q \*q" integer \*q +Specifies how far (in pixels) the pointer must move to generate button +press/release events in wheel emulation mode. Default: 10. Property: "EvdevMultitouch +Wheel Emulation Inertia". +.TP 7 +.BI "Option \*qEmulateWheelTimeout\*q \*q" integer \*q +Specifies the time in milliseconds the +.BR EmulateWheelButton +must be pressed before wheel emulation is started. If the +.BR EmulateWheelButton +is released before this timeout, the original button press/release event +is sent. Default: 200. Property: "EvdevMultitouch Wheel Emulation Timeout". +.TP 7 +.BI "Option \*qGrabDevice\*q \*q" boolean \*q +Force a grab on the event device. Doing so will ensure that no other driver +can initialise the same device and it will also stop the device from sending +events to /dev/kbd or /dev/input/mice. Events from this device will not be +sent to virtual devices (e.g. rfkill or the Macintosh mouse button emulation). +Default: disabled. +.TP 7 +.BI "Option \*qInvertX\*q \*q" Bool \*q +.TP 7 +.BI "Option \*qInvertY\*q \*q" Bool \*q +Invert the given axis. Default: off. Property: "EvdevMultitouch Axis Inversion". +.TP 7 +.BI "Option \*qIgnoreRelativeAxes\*q \*q" Bool \*q +.TP 7 +.BI "Option \*qIgnoreAbsoluteAxes\*q \*q" Bool \*q +Ignore the specified type of axis. Default: unset. The X server cannot deal +with devices that have both relative and absolute axes. EvdevMultitouch tries to guess +wich axes to ignore given the device type and disables absolute axes for +mice and relative axes for tablets, touchscreens and touchpad. These options +allow to forcibly disable an axis type. Mouse wheel axes are exempt and will +work even if relative axes are ignored. No property, this configuration must +be set in the configuration. +.br +If either option is set to False, the driver will not ignore the specified +axes regardless of the presence of other axes. This may trigger buggy +behavior and events from this axis are always forwarded. Users are +discouraged from setting this option. +.TP 7 +.BI "Option \*qReopenAttempts\*q \*q" integer \*q +Number of reopen attempts after a read error occurs on the device (e.g. after +waking up from suspend). In between each attempt is a 100ms wait. Default: 10. +.TP 7 +.BI "Option \*qCalibration\*q \*q" "min-x max-x min-y max-y" \*q +Calibrates the X and Y axes for devices that need to scale to a different +coordinate system than reported to the X server. This feature is required +for devices that need to scale to a different coordinate system than +originally reported by the kernel (e.g. touchscreens). The scaling to the +custom coordinate system is done in-driver and the X server is unaware of +the transformation. Property: "EvdevMultitouch Axis Calibration". +.TP 7 +.BI "Option \*qSwapAxes\*q \*q" Bool \*q +Swap x/y axes. Default: off. Property: "EvdevMultitouch Axes Swap". +.TP 7 +.BI "Option \*qXAxisMapping\*q \*q" "N1 N2" \*q +Specifies which buttons are mapped to motion in the X direction in wheel +emulation mode. Button number +.I N1 +is mapped to the negative X axis motion and button number +.I N2 +is mapped to the positive X axis motion. Default: no mapping. Property: +"EvdevMultitouch Wheel Emulation Axes". +.TP 7 +.BI "Option \*qYAxisMapping\*q \*q" "N1 N2" \*q +Specifies which buttons are mapped to motion in the Y direction in wheel +emulation mode. Button number +.I N1 +is mapped to the negative Y axis motion and button number +.I N2 +is mapped to the positive Y axis motion. Default: "4 5". Property: +"EvdevMultitouch Wheel Emulation Axes". + +.SH SUPPORTED PROPERTIES +The following properties are provided by the +.B evdevmultitouch +driver. +.TP 7 +.BI "EvdevMultitouch Axis Calibration" +4 32-bit values, order min-x, max-x, min-y, max-y or 0 values to disable +in-driver axis calibration. +.TP 7 +.BI "EvdevMultitouch Axis Inversion" +2 boolean values (8 bit, 0 or 1), order X, Y. 1 inverts the axis. +.TP 7 +.BI "EvdevMultitouch Axes Swap" +1 boolean value (8 bit, 0 or 1). 1 swaps x/y axes. +.TP 7 +.BI "EvdevMultitouch Drag Lock Buttons" +8-bit. Either 1 value or pairs of values. Value range 0-32, 0 disables a +value. +.TP 7 +.BI "EvdevMultitouch Middle Button Emulation" +1 boolean value (8 bit, 0 or 1). +.TP 7 +.BI "EvdevMultitouch Middle Button Timeout" +1 16-bit positive value. +.TP 7 +.BI "EvdevMultitouch Wheel Emulation" +1 boolean value (8 bit, 0 or 1). +.TP 7 +.BI "EvdevMultitouch Wheel Emulation Axes" +4 8-bit values, order X up, X down, Y up, Y down. 0 disables a value. +.TP 7 +.BI "EvdevMultitouch Wheel Emulation Button" +1 8-bit value, allowed range 0-32, 0 disables the button. +.TP 7 +.BI "EvdevMultitouch Wheel Emulation Inertia" +1 16-bit positive value. +.TP 7 +.BI "EvdevMultitouch Wheel Emulation Timeout" +1 16-bit positive value. + +.SH AUTHORS +Kristian Høgsberg. +.SH "SEE ALSO" +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), +README.mouse. diff --git a/packaging/xorg-x11-drv-evdev-multitouch.spec b/packaging/xorg-x11-drv-evdev-multitouch.spec new file mode 100644 index 0000000..9973f4e --- /dev/null +++ b/packaging/xorg-x11-drv-evdev-multitouch.spec @@ -0,0 +1,49 @@ +Name: xorg-x11-drv-evdev-multitouch +Summary: X.Org evdev multitouch input driver. +Version: 2.3.2 +Release: 1 +Group: TO_BE/FILLED_IN +License: TO BE FILLED IN +Source0: xf86-input-evdev-multitouch-%{version}.tar.gz +BuildRequires: pkgconfig(xorg-server) +BuildRequires: pkgconfig(xproto) +BuildRequires: pkgconfig(randrproto) +BuildRequires: pkgconfig(inputproto) +BuildRequires: pkgconfig(kbproto) +BuildRequires: pkgconfig(xkbfile) + +%description +X.Org X server -- evdev input multitouch driver This package provides the driver for input devices using evdev, the Linux + kernel's event delivery mechanism. This driver allows for multiple keyboards + and mice to be treated as separate input devices. + . + More information about X.Org can be found at: + + + + . + This package is built from the X.org xf86-input-evdev driver module. + + +%prep +%setup -q -n xf86-input-evdev-multitouch-%{version} + +%build +export CFLAGS+=" -Wall -g -D_F_IGNORE_TSP_RESOLUTION_" + + +%autogen --disable-static +%configure --disable-static +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +%make_install + + +%files +/usr/include/xorg/evdevmultitouch-properties.h +/usr/lib/pkgconfig/xorg-evdev-multitouch.pc +/usr/lib/xorg/modules/input/evdevmultitouch_drv.so +/usr/share/man/man4/evdevmultitouch.4.gz + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..16bdf00 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,40 @@ +# 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. +AM_CFLAGS = $(XORG_CFLAGS) + +@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la +@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version +@DRIVER_NAME@_drv_ladir = @inputdir@ + +INCLUDES=-I$(top_srcdir)/include/ + +@DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c \ + @DRIVER_NAME@.h \ + emuMB.c \ + emuWheel.c \ + draglock.c + diff --git a/src/draglock.c b/src/draglock.c new file mode 100755 index 0000000..c7a983d --- /dev/null +++ b/src/draglock.c @@ -0,0 +1,329 @@ +/* + * + * xserver-xorg-input-evdev-multitouch + * + * Contact: Sung-Jin Park + * Sangjin LEE + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + * Copyright 1993 by David Dawes + * Copyright 2002 by SuSE Linux AG, Author: Egbert Eich + * Copyright 1994-2002 by The XFree86 Project, Inc. + * Copyright 2002 by Paul Elliott + * (Ported from xf86-input-mouse, above copyrights taken from there) + * Copyright © 2008 University of South Australia + * Copyright 2008 by Chris Salch + * Copyright 2008 Red Hat, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of the authors + * not be used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. The authors make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +/* Draglock code */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include "evdevmultitouch.h" + +#ifdef HAVE_PROPERTIES +static Atom prop_dlock = 0; /* Drag lock buttons. */ +#endif + +void EvdevMultitouchDragLockLockButton(InputInfoPtr pInfo, unsigned int button); + + +/* Setup and configuration code */ +void +EvdevMultitouchDragLockPreInit(InputInfoPtr pInfo) +{ + EvdevMultitouchPtr pEvdevMultitouch = (EvdevMultitouchPtr)pInfo->private; + char *option_string = NULL; + int meta_button = 0; + int lock_button = 0; + char *next_num = NULL; + char *end_str = NULL; + BOOL pairs = FALSE; + + option_string = xf86CheckStrOption(pInfo->options, "DragLockButtons",NULL); + + if (!option_string) + return; + + next_num = option_string; + + /* Loop until we hit the end of our option string */ + while (next_num != NULL) { + lock_button = 0; + meta_button = strtol(next_num, &end_str, 10); + + /* check to see if we found anything */ + if (next_num != end_str) { + /* setup for the next number */ + next_num = end_str; + } else { + /* we have nothing more to parse, drop out of the loop */ + next_num = NULL; + } + + /* Check for a button to lock if we have a meta button */ + if (meta_button != 0 && next_num != NULL ) { + lock_button = strtol(next_num, &end_str, 10); + + /* check to see if we found anything */ + if (next_num != end_str) { + /* setup for the next number */ + next_num = end_str; + } else { + /* we have nothing more to parse, drop out of the loop */ + next_num = NULL; + } + } + + /* Ok, let the user know what we found on this look */ + if (meta_button != 0) { + if (lock_button == 0) { + if (!pairs) { + /* We only have a meta button */ + pEvdevMultitouch->dragLock.meta = meta_button; + + xf86Msg(X_CONFIG, "%s: DragLockButtons : " + "%i as meta\n", + pInfo->name, meta_button); + } else { + xf86Msg(X_ERROR, "%s: DragLockButtons : " + "Incomplete pair specifying button pairs %s\n", + pInfo->name, option_string); + } + } else { + + /* Do bounds checking to make sure we don't crash */ + if ((meta_button <= EVDEVMULTITOUCH_MAXBUTTONS) && (meta_button > 0 ) && + (lock_button <= EVDEVMULTITOUCH_MAXBUTTONS) && (lock_button >= 0)) { + + xf86Msg(X_CONFIG, "%s: DragLockButtons : %i -> %i\n", + pInfo->name, meta_button, lock_button); + + pEvdevMultitouch->dragLock.lock_pair[meta_button - 1] = lock_button; + pairs=TRUE; + } else { + /* Let the user know something was wrong + with this pair of buttons */ + xf86Msg(X_CONFIG, "%s: DragLockButtons : " + "Invalid button pair %i -> %i\n", + pInfo->name, meta_button, lock_button); + } + } + } else { + xf86Msg(X_ERROR, "%s: Found DragLockButtons " + "with invalid lock button string : '%s'\n", + pInfo->name, option_string); + + /* This should be the case anyhow, just make sure */ + next_num = NULL; + } + + /* Check for end of string, to avoid annoying error */ + if (next_num != NULL && *next_num == '\0') + next_num = NULL; + } +} + +/* Updates DragLock button state and fires button event messges */ +void +EvdevMultitouchDragLockLockButton(InputInfoPtr pInfo, unsigned int button) +{ + EvdevMultitouchPtr pEvdevMultitouch = (EvdevMultitouchPtr)pInfo->private; + BOOL state = 0; + + /* update button state */ + state = pEvdevMultitouch->dragLock.lock_state[button - 1] ? FALSE : TRUE; + pEvdevMultitouch->dragLock.lock_state[button - 1] = state; + + EvdevMultitouchQueueButtonEvent(pInfo, button, state); +} + +/* Filter button presses looking for either a meta button or the + * control of a button pair. + * + * @param button button number (1 for left, 3 for right) + * @param value TRUE if button press, FALSE if release + * + * @return TRUE if the event was swallowed here, FALSE otherwise. + */ +BOOL +EvdevMultitouchDragLockFilterEvent(InputInfoPtr pInfo, unsigned int button, int value) +{ + EvdevMultitouchPtr pEvdevMultitouch = (EvdevMultitouchPtr)pInfo->private; + + if (button == 0) + return FALSE; + + /* Do we have a single meta key or + several button pairings? */ + if (pEvdevMultitouch->dragLock.meta != 0) { + + if (pEvdevMultitouch->dragLock.meta == button) { + + /* setup up for button lock */ + if (value) + pEvdevMultitouch->dragLock.meta_state = TRUE; + + return TRUE; + } else if (pEvdevMultitouch->dragLock.meta_state) { /* waiting to lock */ + + pEvdevMultitouch->dragLock.meta_state = FALSE; + + EvdevMultitouchDragLockLockButton(pInfo, button); + + return TRUE; + } + } else if (pEvdevMultitouch->dragLock.lock_pair[button - 1] && value) { + /* A meta button in a meta/lock pair was pressed */ + EvdevMultitouchDragLockLockButton(pInfo, pEvdevMultitouch->dragLock.lock_pair[button - 1]); + return TRUE; + } + + /* Eat events for buttons that are locked */ + if (pEvdevMultitouch->dragLock.lock_state[button - 1]) + return TRUE; + + return FALSE; +} + +#ifdef HAVE_PROPERTIES +/** + * Set the drag lock property. + * If only one value is supplied, then this is used as the meta button. + * If more than one value is supplied, then each value is the drag lock button + * for the pair. 0 disables a pair. + * i.e. to set bt 3 to draglock button 1, supply 0,0,1 + */ +static int +EvdevMultitouchDragLockSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, + BOOL checkonly) +{ + InputInfoPtr pInfo = dev->public.devicePrivate; + EvdevMultitouchPtr pEvdevMultitouch = pInfo->private; + + if (atom == prop_dlock) + { + int i; + + if (val->format != 8 || val->type != XA_INTEGER) + return BadMatch; + + /* Don't allow changes while a lock is active */ + if (pEvdevMultitouch->dragLock.meta) + { + if (pEvdevMultitouch->dragLock.meta_state) + return BadAccess; + } else + { + for (i = 0; i < EVDEVMULTITOUCH_MAXBUTTONS; i++) + if (pEvdevMultitouch->dragLock.lock_state[i]) + return BadValue; + } + + if (val->size == 0) + return BadMatch; + else if (val->size == 1) + { + int meta = *((CARD8*)val->data); + if (meta > EVDEVMULTITOUCH_MAXBUTTONS) + return BadValue; + + if (!checkonly) + { + pEvdevMultitouch->dragLock.meta = meta; + memset(pEvdevMultitouch->dragLock.lock_pair, 0, sizeof(pEvdevMultitouch->dragLock.lock_pair)); + } + } else if ((val->size % 2) == 0) + { + CARD8* vals = (CARD8*)val->data; + + for (i = 0; i < val->size && i < EVDEVMULTITOUCH_MAXBUTTONS; i++) + if (vals[i] > EVDEVMULTITOUCH_MAXBUTTONS) + return BadValue; + + if (!checkonly) + { + pEvdevMultitouch->dragLock.meta = 0; + memset(pEvdevMultitouch->dragLock.lock_pair, 0, sizeof(pEvdevMultitouch->dragLock.lock_pair)); + + for (i = 0; i < val->size && i < EVDEVMULTITOUCH_MAXBUTTONS; i += 2) + pEvdevMultitouch->dragLock.lock_pair[vals[i] - 1] = vals[i + 1]; + } + } else + return BadMatch; + } + + return Success; +} + +/** + * Initialise property for drag lock buttons setting. + */ +void +EvdevMultitouchDragLockInitProperty(DeviceIntPtr dev) +{ + InputInfoPtr pInfo = dev->public.devicePrivate; + EvdevMultitouchPtr pEvdevMultitouch = pInfo->private; + + if (!dev->button) /* don't init prop for keyboards */ + return; + + prop_dlock = MakeAtom(EVDEVMULTITOUCH_PROP_DRAGLOCK, strlen(EVDEVMULTITOUCH_PROP_DRAGLOCK), TRUE); + if (pEvdevMultitouch->dragLock.meta) + { + XIChangeDeviceProperty(dev, prop_dlock, XA_INTEGER, 8, + PropModeReplace, 1, &pEvdevMultitouch->dragLock.meta, + FALSE); + } else { + int highest = 0; + int i; + CARD8 pair[EVDEVMULTITOUCH_MAXBUTTONS] = {0}; + + for (i = 0; i < EVDEVMULTITOUCH_MAXBUTTONS; i++) + { + if (pEvdevMultitouch->dragLock.lock_pair[i]) + highest = i; + pair[i] = pEvdevMultitouch->dragLock.lock_pair[i]; + } + + XIChangeDeviceProperty(dev, prop_dlock, XA_INTEGER, 8, PropModeReplace, + highest + 1, pair, FALSE); + } + + XISetDevicePropertyDeletable(dev, prop_dlock, FALSE); + + XIRegisterPropertyHandler(dev, EvdevMultitouchDragLockSetProperty, NULL, NULL); +} + +#endif diff --git a/src/emuMB.c b/src/emuMB.c new file mode 100755 index 0000000..6d03e83 --- /dev/null +++ b/src/emuMB.c @@ -0,0 +1,429 @@ +/* + * + * xserver-xorg-input-evdev-multitouch + * + * Contact: Sung-Jin Park + * Sangjin LEE + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + * Copyright 1993 by David Dawes + * Copyright 2002 by SuSE Linux AG, Author: Egbert Eich + * Copyright 1994-2002 by The XFree86 Project, Inc. + * Copyright 2002 by Paul Elliott + * (Ported from xf86-input-mouse, above copyrights taken from there) + * Copyright © 2008 University of South Australia + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without + * fee, provided that the above copyright notice appear in all copies + * and that both that copyright notice and this permission notice + * appear in supporting documentation, and that the name of the authors + * not be used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. The authors make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +/* Middle mouse button emulation code. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include "evdevmultitouch.h" + +enum { + MBEMU_DISABLED = 0, + MBEMU_ENABLED, + MBEMU_AUTO +}; + +#ifdef HAVE_PROPERTIES +static Atom prop_mbemu = 0; /* Middle button emulation on/off property */ +static Atom prop_mbtimeout = 0; /* Middle button timeout property */ +#endif +/* + * Lets create a simple finite-state machine for 3 button emulation: + * + * We track buttons 1 and 3 (left and right). There are 11 states: + * 0 ground - initial state + * 1 delayed left - left pressed, waiting for right + * 2 delayed right - right pressed, waiting for left + * 3 pressed middle - right and left pressed, emulated middle sent + * 4 pressed left - left pressed and sent + * 5 pressed right - right pressed and sent + * 6 released left - left released after emulated middle + * 7 released right - right released after emulated middle + * 8 repressed left - left pressed after released left + * 9 repressed right - right pressed after released right + * 10 pressed both - both pressed, not emulating middle + * + * At each state, we need handlers for the following events + * 0: no buttons down + * 1: left button down + * 2: right button down + * 3: both buttons down + * 4: emulate3Timeout passed without a button change + * Note that button events are not deltas, they are the set of buttons being + * pressed now. It's possible (ie, mouse hardware does it) to go from (eg) + * left down to right down without anything in between, so all cases must be + * handled. + * + * a handler consists of three values: + * 0: action1 + * 1: action2 + * 2: new emulation state + * + * action > 0: ButtonPress + * action = 0: nothing + * action < 0: ButtonRelease + * + * The comment preceeding each section is the current emulation state. + * The comments to the right are of the form + *