[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-input-mouse: Changes to 'upstream-unstable'



 COPYING           |   93 ++++++
 ChangeLog         |  112 -------
 Makefile.am       |   15 +
 configure.ac      |   49 +--
 man/mousedrv.man  |   75 ++++-
 src/Makefile.am   |   24 +
 src/bsd_mouse.c   |  798 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/hurd_mouse.c  |  242 ++++++++++++++++
 src/lnx_mouse.c   |  221 ++++++++++++++
 src/mouse.c       |   52 +--
 src/mouse.h       |    4 
 src/mousePriv.h   |    1 
 src/pnp.c         |   28 -
 src/sco_mouse.c   |  258 +++++++++++++++++
 src/sun_mouse.c   |  748 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/xf86OSmouse.h |  277 ++++++++++++++++++
 16 files changed, 2791 insertions(+), 206 deletions(-)

New commits:
commit 5058dc340278f2498dd1b4db129dc6dd6b0e0964
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Fri Jan 9 18:38:57 2009 -0800

    Version 1.4.0

diff --git a/configure.ac b/configure.ac
index 4b54604..9c4f034 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-input-mouse],
-        1.3.0,
+        1.4.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-input-mouse)
 

commit 194fed98fee47801f1ca8eb926bc10a57b7582cb
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Fri Jan 9 14:41:26 2009 -0800

    Add note on hal-based configuration to man page

diff --git a/man/mousedrv.man b/man/mousedrv.man
index 3bab562..bc6773f 100644
--- a/man/mousedrv.man
+++ b/man/mousedrv.man
@@ -43,7 +43,7 @@ two or three button mouse.
 .TP
 Serial mouse
 There have been numerous serial mouse models from a number of
-manufactures.
+manufacturers.
 Despite the wide range of variations, there have been relatively
 few protocols (data format) with which the serial mouse talks
 to the host computer.
@@ -72,6 +72,11 @@ be converted to another.  If you are to use such an adapter,
 remember that the connector at the very end of the mouse/adapter pair is 
 what matters.
 .SH CONFIGURATION DETAILS
+.PP
+Depending on the X server version in use, input device options may be set
+in either a __xconfigfile__ file, or in the configuration files read by the
+Hardware Abstraction Layer (HAL) daemon, hald(1).
+.PP
 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.
@@ -293,5 +298,8 @@ There are some other options that may be used to control various parameters
 for serial port communication, but they are not documented here because
 the driver sets them correctly for each mouse protocol type.
 .SH "SEE ALSO"
-__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__),
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__),
+Xserver(__appmansuffix__), X(__miscmansuffix__),
 README.mouse.
+
+hal(__miscmansuffix__), hald(__adminmansuffix__), fdi(__filemansuffix__).

commit 299bd6c164e4e91cf69c41b3c7b97879cfcc0d32
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Fri Jan 9 08:45:38 2009 -0800

    Add copyright notices for OS mouse code to COPYING file

diff --git a/COPYING b/COPYING
index 17ba88f..1fddcfc 100644
--- a/COPYING
+++ b/COPYING
@@ -43,3 +43,96 @@ 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 (c) 1999-2003 by The XFree86 Project, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 holder(s)
+and author(s) 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 holder(s) and author(s).
+
+Copyright 1997,1998 by UCHIYAMA Yasushi
+
+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 UCHIYAMA Yasushi not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission.  UCHIYAMA Yasushi makes no representations
+about the suitability of this software for any purpose.  It is provided
+"as is" without express or implied warranty.
+
+UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL UCHIYAMA YASUSHI 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 2001 by J. Kean Johnston <jkj@sco.com>
+
+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 J. Kean Johnston not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission.  J. Kean Johnston makes no
+representations about the suitability of this software for any purpose.
+It is provided "as is" without express or implied warranty.
+
+J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL J. KEAN JOHNSTON 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 2004-2005 Sun Microsystems, Inc.  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, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+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
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+

commit 0968d56233804515d347b2001bf817d0fa3611ea
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Thu Jan 8 21:48:13 2009 -0800

    Unifdef XFree86LOADER

diff --git a/src/mouse.c b/src/mouse.c
index 3f0eb86..347afc6 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -124,9 +124,7 @@ typedef struct _DragLockRec {
 
 
 
-#ifdef XFree86LOADER
 static const OptionInfoRec *MouseAvailableOptions(void *unused);
-#endif
 static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags);
 #if 0
 static void MouseUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
@@ -215,7 +213,6 @@ typedef enum {
     OPTION_SENSITIVITY
 } MouseOpts;
 
-#ifdef XFree86LOADER
 static const OptionInfoRec mouseOptions[] = {
     { OPTION_ALWAYS_CORE,	"AlwaysCore",	  OPTV_BOOLEAN,	{0}, FALSE },
     { OPTION_SEND_CORE_EVENTS,	"SendCoreEvents", OPTV_BOOLEAN,	{0}, FALSE },
@@ -259,7 +256,6 @@ static const OptionInfoRec mouseOptions[] = {
     { OPTION_SENSITIVITY,      "Sensitivity",     OPTV_REAL,    {0}, FALSE },
     { -1,			NULL,		  OPTV_NONE,	{0}, FALSE }
 };
-#endif
 
 #define RETRY_COUNT 4
 
@@ -376,14 +372,12 @@ static MouseProtocolRec mouseProtocols[] = {
     { NULL,			MSE_NONE,	NULL,		PROT_UNKNOWN }
 };
 
-#ifdef XFree86LOADER
 /*ARGSUSED*/
 static const OptionInfoRec *
 MouseAvailableOptions(void *unused)
 {
     return (mouseOptions);
 }
-#endif
 
 /* Process options common to all mouse types. */
 static void
@@ -3757,7 +3751,6 @@ collectData(MouseDevPtr pMse, unsigned char u)
 
 
 
-#ifdef XFree86LOADER
 ModuleInfoRec MouseInfo = {
     1,
     "MOUSE",
@@ -3810,6 +3803,3 @@ _X_EXPORT XF86ModuleData mouseModuleData = {
 /*
   Look at hitachi device stuff.
 */
-#endif /* XFree86LOADER */
-
-

commit 47c5e3a368a2922c4cc5e3a9769501fe399287ae
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Thu Jan 8 21:43:58 2009 -0800

    Remove some #if 1 statements

diff --git a/src/mouse.c b/src/mouse.c
index 5e52dd0..3f0eb86 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -1190,12 +1190,11 @@ MouseReadInput(InputInfoPtr pInfo)
 	ErrorF("mouse byte: %2.2x\n",u);
 #endif
 
-#if 1
 	/* if we do autoprobing collect the data */
 	if (pMse->collectData && pMse->autoProbe)
 	    if (pMse->collectData(pMse,u))
 		continue;
-#endif
+
 #ifdef SUPPORT_MOUSE_RESET
 	if (mouseReset(pInfo,u)) {
 	    pBufP = 0;
@@ -3675,10 +3674,10 @@ checkForErraticMovements(InputInfoPtr pInfo, int dx, int dy)
 {
     MouseDevPtr pMse = pInfo->private;
     mousePrivPtr mPriv = (mousePrivPtr)pMse->mousePriv;
-#if 1
+
     if (!mPriv->goodCount)
 	return;
-#endif
+
 #if 0
     if (abs(dx - mPriv->prevDx) > 300 
 	|| abs(dy - mPriv->prevDy) > 300)
diff --git a/src/pnp.c b/src/pnp.c
index a45cb52..0e95ac3 100644
--- a/src/pnp.c
+++ b/src/pnp.c
@@ -187,7 +187,6 @@ MouseGetPnpProtocol(InputInfoPtr pInfo)
 	    return val;
     }
 
-#if 1
     last = mPriv->pnpLast;
     mPriv->pnpLast = currentTime.milliseconds;
 
@@ -213,9 +212,6 @@ MouseGetPnpProtocol(InputInfoPtr pInfo)
 	return getPs2ProtocolPnP(pInfo);
     else
 	return probePs2ProtocolPnP(pInfo);
-#else
-    return PROT_UNKNOWN;
-#endif
 }
 
 /*

commit 7039165d70079f2e8573ada9323fbc582c825248
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Thu Jan 8 21:38:54 2009 -0800

    Comment typo fixes

diff --git a/src/mouse.c b/src/mouse.c
index 45d7b85..5e52dd0 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -3050,7 +3050,7 @@ mouseReset(InputInfoPtr pInfo, unsigned char val)
     ErrorF("Mouse Current: %i 0x%x\n",mousepriv->current, val);
 #endif
     
-    /* here we put the mouse specific reset detction */
+    /* here we put the mouse specific reset detection */
     /* They need to do three things:                 */
     /*  Check if byte may be a reset byte            */
     /*  If so: Set expectReset TRUE                  */
diff --git a/src/pnp.c b/src/pnp.c
index 70d68ef..a45cb52 100644
--- a/src/pnp.c
+++ b/src/pnp.c
@@ -68,7 +68,7 @@ typedef struct {
 
 /* PnP EISA/product IDs */
 static symtab_t pnpprod[] = {
-    { "KML0001",  PROT_THINKING },	/* Kensignton ThinkingMouse */
+    { "KML0001",  PROT_THINKING },	/* Kensington ThinkingMouse */
     { "MSH0001",  PROT_IMSERIAL },	/* MS IntelliMouse */
     { "MSH0004",  PROT_IMSERIAL },	/* MS IntelliMouse TrackBall */
     { "KYEEZ00",  PROT_MS },		/* Genius EZScroll */
@@ -101,14 +101,14 @@ static symtab_t pnpprod[] = {
     { "PNP0F09",  PROT_MS },		/* MS BallPoint serial */
     { "PNP0F0A",  PROT_MS },		/* MS PnP serial */
     { "PNP0F0B",  PROT_MS },		/* MS PnP BallPoint serial */
-    { "PNP0F0C",  PROT_MS },		/* MS serial comatible */
-    { "PNP0F0D",  PROT_BM },		/* MS InPort comatible */
-    { "PNP0F0E",  PROT_PS2 },		/* MS PS/2 comatible */
-    { "PNP0F0F",  PROT_MS },		/* MS BallPoint comatible */
+    { "PNP0F0C",  PROT_MS },		/* MS serial compatible */
+    { "PNP0F0D",  PROT_BM },		/* MS InPort compatible */
+    { "PNP0F0E",  PROT_PS2 },		/* MS PS/2 compatible */
+    { "PNP0F0F",  PROT_MS },		/* MS BallPoint compatible */
 #ifdef notyet
     { "PNP0F10",  PROT_??? },		/* TI QuickPort */
 #endif
-    { "PNP0F11",  PROT_BM },		/* MS bus comatible */
+    { "PNP0F11",  PROT_BM },		/* MS bus compatible */
     { "PNP0F12",  PROT_PS2 },		/* Logitech PS/2 */
     { "PNP0F13",  PROT_PS2 },		/* PS/2 */
 #ifdef notyet
@@ -244,7 +244,7 @@ pnpgets(InputInfoPtr pInfo, char *buf, Bool *prePNP)
 #if 0
     /* 
      * This is the procedure described in rev 1.0 of PnP COM device spec.
-     * Unfortunately, some devices which comform to earlier revisions of
+     * Unfortunately, some devices which conform to earlier revisions of
      * the spec gets confused and do not return the ID string...
      */
 
@@ -283,7 +283,7 @@ pnpgets(InputInfoPtr pInfo, char *buf, Bool *prePNP)
 	xf86SerialModemClearBits(pInfo->fd, i);
         usleep(200000);
 
-	/* wait for respose, 2nd phase (2.1.6) */
+	/* wait for response, 2nd phase (2.1.6) */
 	xf86FlushInput(pInfo->fd);
         i = TIOCM_DTR | TIOCM_RTS;	/* DTR = 1, RTS = 1 */
 	xf86SerialModemSetBits(pInfo->fd, i);
@@ -308,7 +308,7 @@ pnpgets(InputInfoPtr pInfo, char *buf, Bool *prePNP)
     pnpOpts = xf86OptionListCreate(pnpSerial, -1, 1);
     xf86SetSerial(pInfo->fd, pnpOpts);
 
-    /* wait for respose */
+    /* wait for response */
     xf86FlushInput(pInfo->fd);
     i = XF86_M_DTR | XF86_M_RTS;	/* DTR = 1, RTS = 1 */
     xf86SerialModemSetBits(pInfo->fd, i);

commit a61f0f92299037fe818a54c2cd9a2d3836698b43
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Thu Jan 8 21:29:00 2009 -0800

    sun_mouse: fallback to commonOptions for StreamsModule too

diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index 1f01f17..ac40e07 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -630,6 +630,10 @@ solarisMouseAutoProbe(InputInfoPtr pInfo, const char **protocol,
 
     if (*device != NULL) {
 	strmod = xf86CheckStrOption(pInfo->options, "StreamsModule", NULL);
+	if (strmod == NULL) {
+	    strmod = xf86CheckStrOption(pInfo->conf_idev->commonOptions,
+					"StreamsModule", NULL);
+	}
 	if (strmod) {
 	    /* if a device name is already known, and a StreamsModule is
 	       specified to convert events to VUID, then we don't need to

commit 4623258b48f01306309ff9d39a85565bce57946e
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Thu Jan 8 21:21:18 2009 -0800

    Clear assorted compiler, sparse & lint warnings
    
    mouse.c:1004:35: warning: Using plain integer as NULL pointer
    sun_mouse.c:325: warning: 'absX' might be used uninitialized in this function
    sun_mouse.c:325: warning: 'absY' might be used uninitialized in this function
    sun_mouse.c: (158) warning: constant truncated by assignment
    
    declared global, could be static:
        hardProtocolList    mouse.c(3151)
        softProtocolList    mouse.c(3163)
        serialDefaultsList  mouse.c(3366)

diff --git a/src/mouse.c b/src/mouse.c
index 8adfba4..45d7b85 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -1001,7 +1001,7 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
     pInfo->fd = -1;
     pInfo->dev = NULL;
     pInfo->private_flags = 0;
-    pInfo->always_core_feedback = 0;
+    pInfo->always_core_feedback = NULL;
     pInfo->conf_idev = dev;
 
     /* Check if SendDragEvents has been disabled. */
@@ -3148,6 +3148,7 @@ ps2WakeupHandler(pointer data, int i, pointer LastSelectMask)
 #  define AP_DBGC(x)
 #endif
 
+static
 MouseProtocolID hardProtocolList[] = { 	PROT_MSC, PROT_MM, PROT_LOGI, 
 					PROT_LOGIMAN, PROT_MMHIT,
 					PROT_GLIDE, PROT_IMSERIAL,
@@ -3160,6 +3161,7 @@ MouseProtocolID hardProtocolList[] = { 	PROT_MSC, PROT_MM, PROT_LOGI,
 					PROT_UNKNOWN
 };
 
+static
 MouseProtocolID softProtocolList[] = { 	PROT_MSC, PROT_MM, PROT_LOGI, 
 					PROT_LOGIMAN, PROT_MMHIT,
 					PROT_GLIDE, PROT_IMSERIAL,
@@ -3287,7 +3289,7 @@ createProtoList(MouseDevPtr pMse, MouseProtocolID *protoList)
 		    break;
 		} else {
 		    /* 
-		     * Bail ot if number of bytes per package have
+		     * Bail out if number of bytes per package have
 		     * been tested for header.
 		     * Take bytes per package of leading garbage into
 		     * account.
@@ -3363,7 +3365,7 @@ createProtoList(MouseDevPtr pMse, MouseProtocolID *protoList)
 
 
 /* This only needs to be done once */
-void **serialDefaultsList = NULL;
+static void **serialDefaultsList = NULL;
 
 /*
  * createSerialDefaultsLists() - create a list of the different default
diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index 827af34..1f01f17 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -155,7 +155,7 @@ vuidMouseWheelInit(InputInfoPtr pInfo)
 
     wstate.vers = VUID_WHEEL_STATE_VERS;
     wstate.id = 0;
-    wstate.stateflags = -1;
+    wstate.stateflags = (uint32_t) -1;
 
     SYSCALL(i = ioctl(pInfo->fd, VUIDGWHEELCOUNT, &nwheel));
     if (i != 0)
@@ -322,7 +322,7 @@ vuidReadInput(InputInfoPtr pInfo)
     unsigned int n;
     int c; 
     unsigned char *pBuf;
-    int absX, absY;
+    int absX = 0, absY = 0;
     Bool absXset = FALSE, absYset = FALSE;
 
     pMse = pInfo->private;

commit 6f14e8569150b0d6fac7186968cde8b031a1fefc
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Thu Jan 8 21:20:58 2009 -0800

    Add XORG_CWARNFLAGS & XORG_WITH_LINT for more compiler checking

diff --git a/Makefile.am b/Makefile.am
index bc61af6..6acb949 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,3 +36,9 @@ ChangeLog:
 	$(CHANGELOG_CMD)
 
 dist-hook: ChangeLog
+
+if LINT
+# Check source code with tools like lint & sparse
+lint:
+	(cd src && $(MAKE) $(MAKEFLAGS) lint)
+endif LINT
diff --git a/configure.ac b/configure.ac
index f929468..4b54604 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,7 @@ AM_CONFIG_HEADER([config.h])
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 AC_PROG_CC
+XORG_CWARNFLAGS
 
 AH_TOP([#include "xorg-server.h"])
 
@@ -64,9 +65,6 @@ XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto $REQUIRED_MODULES)
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
-CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
-AC_SUBST([CFLAGS])
-
 # Checks for libraries.
 
 # Checks for header files.
@@ -89,6 +87,9 @@ case $host_os in
 esac
 AC_SUBST([OS_MOUSE_NAME])
 
+dnl Allow checking code with lint, sparse, etc.
+XORG_WITH_LINT
+
 XORG_MANPAGE_SECTIONS
 XORG_RELEASE_VERSION
 XORG_CHANGELOG
diff --git a/src/Makefile.am b/src/Makefile.am
index 9f42679..da0dba5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,6 +18,8 @@
 #  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.
 
+AM_CFLAGS = $(CWARNFLAGS) 
+AM_CPPFLAGS = $(XORG_CFLAGS) -I$(top_srcdir)/src
 
 # this is obnoxious:
 # -module lets us name the module exactly how we want
@@ -41,3 +43,11 @@ OS_SRCS = bsd_mouse.c hurd_mouse.c lnx_mouse.c sun_mouse.c
 	@OS_MOUSE_NAME@_mouse.c
 
 EXTRA_DIST = $(OS_SRCS)
+
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+                $(AM_CPPFLAGS) $(CPPFLAGS)
+
+lint:
+	$(LINT) $(ALL_LINT_FLAGS) $(@DRIVER_NAME@_drv_la_SOURCES)
+endif LINT

commit 24d9306546d325089c5fb6b78b90c24b38c86338
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Thu Jan 8 20:40:10 2009 -0800

    Replace static changelog with one generated via XORG_CHANGELOG

diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index b0ff392..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,112 +0,0 @@
-2006-05-15  Matthias Hopf  <mhopf@suse.de>
-
-	* configure.ac,src/mouse.c:
-	Bump to 1.1.1.
-
-2006-04-21  Matthias Hopf  <mhopf@suse.de>
-
-	* man/mouse.man:
-	Fixed default for YAxisMapping.
-	Changed default for ZAxisMapping. Added short explanation.
-	* src/mouse.c: (MouseCommonOptions), (MouseReadInput):
-	Autodetect (one way only) single wheel only for EXPS2.
-	Use singlebit protocol for multiwheel EXPS2 mice.
-
-2006-04-20  Matthias Hopf  <mhopf@suse.de>
-
-	* src/mouse.c: (MousePostEvent):
-	Overhaul of wheel processing. Does work correctly with multibit
-	zaxis events now.
-
-2006-04-06  Adam Jackson  <ajax@freedesktop.org>
-
-	* configure.ac:
-	* src/mouse.c:
-	* src/pnp.c:
-	Unlibcwrap.  Bump server version requirement.  Bump to 1.1.0.
-
-2006-03-09  Eric Anholt  <anholt@FreeBSD.org>
-
-	* src/mouse.c: (MouseCommonOptions):
-	Coverity #875: Correct several memory leaks in options parsing.
-
-2006-02-28  Adam Jackson  <ajax@freedesktop.org>
-
-	* configure.ac:
-	* src/mouse.c:
-	Bump to 1.0.4.
-
-2006-02-02  Matthias Hopf  <mhopf@suse.de>
-
-	* man/mouse.man:
-	Fixed ButtonMapping default.
-
-2006-01-17  Matthias Hopf  <mhopf@suse.de>
-
-	* src/mouse.c: (MouseDoPostEvent):
-	Bug #5071: EmulateWheelTimeout didn't work as anticipated.
-
-2006-01-09  Daniel Stone  <daniel@freedesktop.org>
-
-	* src/mouse.c:
-	Remove #ifdef PNP_MOUSE blocks, as it was always defined in the
-	monolith.
-
-2005-12-20  Kevin E. Martin  <kem-at-freedesktop-dot-org>
-
-	* configure.ac:
-	Update package version for X11R7 release.
-
-2005-12-19  Alan Coopersmith  <alan.coopersmith@sun.com>
-
-	* man/mouse.man:
-	Update URL for mouse docs online.
-	Add VUID to supported protocols (used on Solaris).
-
-	* README.sgml:
-	Update docs for X11R6.9 & 7.0 releases.
-	Add note about new ButtonMapping option.
-	Explain changes due to "virtual mouse" support in Solaris 10.
-	Change "mices" to "mice".
-
-2005-12-14  Kevin E. Martin  <kem-at-freedesktop-dot-org>
-
-	* configure.ac:
-	* src/mouse.c:
-	Update package version number for final X11R7 release candidate.
-	Bump driver version number.
-
-2005-12-06  Kevin E. Martin  <kem-at-freedesktop-dot-org>
-
-	* man/Makefile.am:
-	Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
-
-2005-12-03  Kevin E. Martin  <kem-at-freedesktop-dot-org>
-
-	* configure.ac:
-	Update package version number for X11R7 RC3 release.
-
-2005-12-01  Kevin E. Martin  <kem-at-freedesktop-dot-org>
-
-	* configure.ac:
-	Remove extraneous AC_MSG_RESULT.
-
-2005-11-29  Adam Jackson  <ajax@freedesktop.org>
-
-	* configure.ac:
-	Only build dlloader modules by default.
-
-2005-11-22  Daniel Stone  <daniel@freedesktop.org>
-
-	* configure.ac:
-	Update dependency on xorg-server to >= 0.99.3, for MouseDriverRec changes.
-
-2005-11-09  Kevin E. Martin  <kem-at-freedesktop-dot-org>
-
-	* configure.ac:
-	Update package version number for X11R7 RC2 release.
-
-2005-11-01  Kevin E. Martin  <kem-at-freedesktop-dot-org>
-
-	* configure.ac:
-	Update pkgcheck dependencies to work with separate build roots.
diff --git a/Makefile.am b/Makefile.am
index 2b6c46a..bc61af6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,3 +27,12 @@ README: README.sgml
 endif
 
 EXTRA_DIST = README.sgml
+
+MAINTAINERCLEANFILES=ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+	$(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
index 80ab886..f929468 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,10 @@ AC_INIT([xf86-input-mouse],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-input-mouse)
 
+# Require xorg-macros version >= 1.2.0 for XORG_CWARNFLAGS & XORG_CHANGELOG
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.2)
+
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([dist-bzip2])
@@ -87,6 +91,7 @@ AC_SUBST([OS_MOUSE_NAME])
 
 XORG_MANPAGE_SECTIONS
 XORG_RELEASE_VERSION
+XORG_CHANGELOG
 
 XORG_CHECK_LINUXDOC
 

commit cd476cc0932bf9440a05e460cd22dbe584585746
Author: Peter Breitenlohner <peb@mppmu.mpg.de>
Date:   Wed Nov 19 22:23:34 2008 +0100

    Fix linux build
    
    HAVE_XORG_CONFIG_H is a leftover from the server sources (where this file used
    to reside).
    
    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>

diff --git a/src/lnx_mouse.c b/src/lnx_mouse.c
index d282215..c317f5d 100644
--- a/src/lnx_mouse.c
+++ b/src/lnx_mouse.c
@@ -3,8 +3,8 @@
  * Copyright 1999 by The XFree86 Project, Inc.
  */
 
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
 #endif
 
 #include <X11/X.h>

commit 003c297d2902092074ede131db0dbc08d9116a5b
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Mon Dec 1 14:36:06 2008 -0800

    sun_mouse: check for Device in commonOptions if pInfo->options isn't set yet

diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index 13ce074..827af34 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -622,6 +622,10 @@ solarisMouseAutoProbe(InputInfoPtr pInfo, const char **protocol,
     if (*device == NULL) {
 	/* Check to see if xorg.conf or HAL specified a device to use */
 	*device = xf86CheckStrOption(pInfo->options, "Device", NULL);
+	if (*device == NULL) {
+	    *device = xf86CheckStrOption(pInfo->conf_idev->commonOptions,
+					 "Device", NULL);
+	}
     }
 
     if (*device != NULL) {

commit 1e23b944aae3ef50cc764e6d2f0198deabe790ad
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
Date:   Sat Nov 22 17:36:14 2008 +0100

    W axis support for bsd_mouse.

diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c
index ede7612..83054eb 100644
--- a/src/bsd_mouse.c
+++ b/src/bsd_mouse.c
@@ -429,6 +429,11 @@ wsconsReadInput(InputInfoPtr pInfo)
 	    dz = event->value;
 	    break;
 #endif
+#ifdef WSCONS_EVENT_MOUSE_DELTA_W
+	case WSCONS_EVENT_MOUSE_DELTA_W:
+	    dw = event->value;
+	    break;
+#endif
 	default:
 	    xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n", pInfo->name,
 		    event->type);
@@ -491,6 +496,7 @@ typedef struct _UsbMseRec {
     hid_item_t loc_x;		/* x locator item */
     hid_item_t loc_y;		/* y locator item */
     hid_item_t loc_z;		/* z (wheel) locator item */
+    hid_item_t loc_w;		/* z (wheel) locator item */
     hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
    unsigned char *buffer;
 } UsbMseRec, *UsbMsePtr;
@@ -610,6 +616,7 @@ usbReadInput(InputInfoPtr pInfo)
     dx = hid_get_data(pBuf, &pUsbMse->loc_x);
     dy = hid_get_data(pBuf, &pUsbMse->loc_y);
     dz = hid_get_data(pBuf, &pUsbMse->loc_z);
+    dw = hid_get_data(pBuf, &pUsbMse->loc_w);
 
     buttons = 0;
     for (n = 0; n < pMse->buttons; n++) {

commit e7e3cd9bed2bfeb848d62062d0859aa813bf786d
Author: Matthieu Herrb <matthieu@deville.herrb.net>
Date:   Fri Nov 21 19:59:22 2008 +0100

    prevent a double free of mouse private structure.
    
    Mark pInfo->private as NULL after freeing it on the error path.

diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c
index 886a6ff..ede7612 100644
--- a/src/bsd_mouse.c
+++ b/src/bsd_mouse.c
@@ -464,6 +464,7 @@ wsconsPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
 	else {
 	    xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
 	    xfree(pMse);
+	    pInfo->private = NULL;
 	    return FALSE;
 	}
     }

commit c98bc45557174f771b031d4a003b54d06b857785
Author: Matthieu Herrb <matthieu@deville.herrb.net>
Date:   Fri Nov 21 16:14:01 2008 +0100

    Include xorg-server.h to get the WSCONS_SUPPORT define from
    xerver SDK configuration.

diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c
index 1b9d8a0..886a6ff 100644
--- a/src/bsd_mouse.c
+++ b/src/bsd_mouse.c
@@ -26,9 +26,7 @@
  * authorization from the copyright holder(s) and author(s).
  */
 
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
+#include <xorg-server.h>
 
 #include <X11/X.h>
 #include "xf86.h"

commit 87f20b0c06bc13ed603d36cca881ccf69ac0a68a
Author: Matthieu Herrb <matthieu@deville.herrb.net>
Date:   Fri Nov 21 15:42:31 2008 +0100

    Build fix: Add a prototype for FindDevice function.

diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c
index ca2c1bb..1b9d8a0 100644
--- a/src/bsd_mouse.c
+++ b/src/bsd_mouse.c
@@ -70,6 +70,7 @@
 #ifdef USBMOUSE_SUPPORT
 static void usbSigioReadInput (int fd, void *closure);
 #endif
+static const char *FindDevice(InputInfoPtr, const char *, int);
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 /* These are for FreeBSD and DragonFly */

commit 790a78d3b3d81ea06fc1a31108a330adba8cc069
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Wed Nov 5 21:47:30 2008 -0800

    Fix solarisMouseAutoProbe to use device name & protocol specified by HAL

diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index ee3ddd5..13ce074 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -617,6 +617,24 @@ solarisMouseAutoProbe(InputInfoPtr pInfo, const char **protocol,
     const char **pdev, **pproto;
     int fd = -1;
     Bool found;
+    char *strmod;
+
+    if (*device == NULL) {
+	/* Check to see if xorg.conf or HAL specified a device to use */
+	*device = xf86CheckStrOption(pInfo->options, "Device", NULL);
+    }
+
+    if (*device != NULL) {
+	strmod = xf86CheckStrOption(pInfo->options, "StreamsModule", NULL);
+	if (strmod) {
+	    /* if a device name is already known, and a StreamsModule is
+	       specified to convert events to VUID, then we don't need to
+	       probe further */
+	    *protocol = "VUID";
+	    return TRUE;
+	}
+    }
+
 
     for (pdev = solarisMouseDevs; *pdev; pdev += 2) {
 	pproto = pdev + 1;

commit daac081f34baab7388a8c42e5a80a42cd6810d75
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Wed Nov 5 19:26:38 2008 -0800

    sun_mouse.c: Use miPointerGetScreen instead of miPointerCurrentScreen

diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index d0867f1..ee3ddd5 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -397,9 +397,16 @@ vuidReadInput(InputInfoPtr pInfo)
 #endif
 #ifdef HAVE_ABSOLUTE_MOUSE_SCALING
 	else if (pVuidMse->event.id == MOUSE_TYPE_ABSOLUTE) {
+	    ScreenPtr 	ptrCurScreen;
+
 	    /* force sending absolute resolution scaling ioctl */
 	    pVuidMse->absres.height = pVuidMse->absres.width = 0;
-	    vuidMouseSendScreenSize(miPointerCurrentScreen(), pVuidMse);
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+	    ptrCurScreen = miPointerCurrentScreen();
+#else
+	    ptrCurScreen = miPointerGetScreen(pInfo->dev);
+#endif	    
+	    vuidMouseSendScreenSize(ptrCurScreen, pVuidMse);
 	}
 #endif
 
@@ -457,6 +464,7 @@ static void vuidMouseAdjustFrame(int index, int x, int y, int flags)
       xf86AdjustFrameProc *wrappedAdjustFrame 
 	  = (xf86AdjustFrameProc *) vuidMouseGetScreenPrivate(pScreen);
       VuidMsePtr	m;
+      ScreenPtr 	ptrCurScreen;
 
       if(wrappedAdjustFrame) {
         pScrn->AdjustFrame = wrappedAdjustFrame;
@@ -464,8 +472,16 @@ static void vuidMouseAdjustFrame(int index, int x, int y, int flags)
         pScrn->AdjustFrame = vuidMouseAdjustFrame;
       }
 
-      if (miPointerCurrentScreen() == pScreen) {
-	  for (m = vuidMouseList; m != NULL ; m = m->next) {
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+      ptrCurScreen = miPointerCurrentScreen();
+#endif
+      
+      for (m = vuidMouseList; m != NULL ; m = m->next) {
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 0
+	  ptrCurScreen = miPointerGetScreen(m->pInfo->dev);
+#endif
+	  if (ptrCurScreen == pScreen)
+	  {
 	      vuidMouseSendScreenSize(pScreen, m);
 	  }
       }

commit 431982e7c04ec076eeafd57190db4d7d901efa7c
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Wed Nov 5 19:04:32 2008 -0800

    sun_mouse.c: remove unused variables

diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index 4913942..d0867f1 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c


Reply to: