Hello community,
here is the log from the commit of package xorg-x11-driver-input
checked in at Thu Mar 15 01:51:19 CET 2007.
--------
--- xorg-x11-driver-input/xorg-x11-driver-input.changes 2007-03-01 15:33:08.000000000 +0100
+++ /mounts/work_src_done/STABLE/xorg-x11-driver-input/xorg-x11-driver-input.changes 2007-03-14 08:48:56.920289000 +0100
@@ -1,0 +2,7 @@
+Wed Mar 14 08:48:12 CET 2007 - sndirsch@suse.de
+
+- updated joystick driver to release 1.1.1:
+ * Bugfix release. Made the module work again after a long while
+ * No features added. Improvements will follow in next releases
+
+-------------------------------------------------------------------
Old:
----
xf86-input-joystick-X11R7.1-1.1.0.tar.bz2
New:
----
xf86-input-joystick-1.1.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xorg-x11-driver-input.spec ++++++
--- /var/tmp/diff_new_pack.Tq5357/_old 2007-03-15 01:51:02.000000000 +0100
+++ /var/tmp/diff_new_pack.Tq5357/_new 2007-03-15 01:51:02.000000000 +0100
@@ -15,7 +15,7 @@
BuildRequires: Mesa-devel pkgconfig xorg-x11-proto-devel xorg-x11-server-sdk
Url: http://xorg.freedesktop.org/
Version: 7.2
-Release: 38
+Release: 41
License: X11/MIT
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: System/X11/Servers/XF86_4
@@ -34,7 +34,7 @@
Source10: xf86-input-fpit-X11R7.1-1.1.0.tar.bz2
Source11: xf86-input-hyperpen-X11R7.1-1.1.0.tar.bz2
Source12: xf86-input-jamstudio-X11R7.1-1.1.0.tar.bz2
-Source13: xf86-input-joystick-X11R7.1-1.1.0.tar.bz2
+Source13: xf86-input-joystick-1.1.1.tar.bz2
Source14: xf86-input-keyboard-1.1.1.tar.bz2
Source15: xf86-input-magellan-X11R7.1-1.1.0.tar.bz2
Source16: xf86-input-magictouch-X11R7.1-1.0.0.5.tar.bz2
@@ -135,6 +135,10 @@
%{_mandir}/man4/*
%changelog
+* Wed Mar 14 2007 - sndirsch@suse.de
+- updated joystick driver to release 1.1.1:
+ * Bugfix release. Made the module work again after a long while
+ * No features added. Improvements will follow in next releases
* Thu Mar 01 2007 - sndirsch@suse.de
- xf86-input-fpit-update1.diff:
* Make the docs reflect more accurately what the code actually
++++++ xf86-input-joystick-X11R7.1-1.1.0.tar.bz2 -> xf86-input-joystick-1.1.1.tar.bz2 ++++++
++++ 21239 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xf86-input-joystick-X11R7.1-1.1.0/ChangeLog new/xf86-input-joystick-1.1.1/ChangeLog
--- old/xf86-input-joystick-X11R7.1-1.1.0/ChangeLog 2006-04-07 19:40:06.000000000 +0200
+++ new/xf86-input-joystick-1.1.1/ChangeLog 2007-03-13 15:40:55.000000000 +0100
@@ -1,3 +1,9 @@
+2007-03-13 Sascha Hlusiak
+
+ * src/xf86Jstk.c:
+ Cleaning and rearranging of code.
+ Made the module actually work at all.
+
2006-04-06 Adam Jackson
* configure.ac:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xf86-input-joystick-X11R7.1-1.1.0/config.h.in new/xf86-input-joystick-1.1.1/config.h.in
--- old/xf86-input-joystick-X11R7.1-1.1.0/config.h.in 2006-05-23 05:19:19.000000000 +0200
+++ new/xf86-input-joystick-1.1.1/config.h.in 2007-03-13 15:45:10.000000000 +0100
@@ -50,6 +50,15 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xf86-input-joystick-X11R7.1-1.1.0/configure.ac new/xf86-input-joystick-1.1.1/configure.ac
--- old/xf86-input-joystick-X11R7.1-1.1.0/configure.ac 2006-04-07 19:40:06.000000000 +0200
+++ new/xf86-input-joystick-1.1.1/configure.ac 2007-03-13 18:56:52.000000000 +0100
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-input-joystick],
- 1.1.0,
+ 1.1.1,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-input-joystick)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xf86-input-joystick-X11R7.1-1.1.0/man/Makefile.am new/xf86-input-joystick-1.1.1/man/Makefile.am
--- old/xf86-input-joystick-X11R7.1-1.1.0/man/Makefile.am 2005-12-06 23:48:30.000000000 +0100
+++ new/xf86-input-joystick-1.1.1/man/Makefile.am 2007-03-13 15:36:47.000000000 +0100
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.6 2005/11/28 22:04:07 alanc Exp $
+# $Id$
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
#
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xf86-input-joystick-X11R7.1-1.1.0/missing new/xf86-input-joystick-1.1.1/missing
--- old/xf86-input-joystick-X11R7.1-1.1.0/missing 2006-05-23 05:19:21.000000000 +0200
+++ new/xf86-input-joystick-1.1.1/missing 2007-03-13 15:45:11.000000000 +0100
@@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2005-06-08.21
+scriptversion=2006-05-10.23
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
@@ -33,6 +33,8 @@
fi
run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -44,7 +46,7 @@
msg="missing on your system"
-case "$1" in
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -77,6 +79,7 @@
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -106,7 +109,7 @@
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
-case "$1" in
+case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
@@ -135,7 +138,7 @@
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
-case "$1" in
+case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@@ -164,7 +167,7 @@
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -192,8 +195,8 @@
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -214,25 +217,25 @@
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
@@ -244,18 +247,18 @@
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
@@ -267,11 +270,9 @@
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
@@ -289,11 +290,17 @@
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
@@ -317,13 +324,13 @@
fi
firstarg="$1"
if shift; then
- case "$firstarg" in
+ case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
- case "$firstarg" in
+ case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/xf86-input-joystick-X11R7.1-1.1.0/src/xf86Jstk.c new/xf86-input-joystick-1.1.1/src/xf86Jstk.c
--- old/xf86-input-joystick-X11R7.1-1.1.0/src/xf86Jstk.c 2006-04-07 19:40:06.000000000 +0200
+++ new/xf86-input-joystick-1.1.1/src/xf86Jstk.c 2007-03-13 18:58:13.000000000 +0100
@@ -1,20 +1,20 @@
-/* $XConsortium: xf86Jstk.c /main/14 1996/10/25 14:11:36 kaleb $ */
/*
+ * Copyright 2007 by Sascha Hlusiak.
* Copyright 1995-1999 by Frederic Lepied, France.
*
* 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 Frederic Lepied not be used in
+ * documentation, and that the name of Sascha Hlusiak not be used in
* advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Frederic Lepied makes no
+ * specific, written prior permission. Sascha Hlusiak makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
- * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * EVENT SHALL SASCHA HLUSIAK 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
@@ -22,7 +22,6 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/joystick/xf86Jstk.c,v 1.5 2001/11/26 16:25:53 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -30,13 +29,6 @@
#include
-#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
-#define XFREE86_V4 1
-#endif
-
-#ifdef XFREE86_V4
-/* post 3.9 headers */
-
#include
#include
#include
@@ -45,6 +37,11 @@
#include /* Needed for InitValuator/Proximity stuff */
#include
+#include
+#include
+#include
+#include
+
#ifdef XFree86LOADER
#include
#endif
@@ -59,29 +56,7 @@
#define XCONFIG_GIVEN "(**)"
#define xf86Verbose 1
-#else /* pre 3.9 headers */
-
-#define NEED_EVENTS
-#include
-#include
-#include "misc.h"
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include
-#include
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Xinput.h"
-#include "xf86_OSlib.h"
-#include "atKeynames.h"
-#include "xf86Version.h"
-#include "osdep.h"
-
-#endif /* pre 3.9 headers */
/******************************************************************************
* debugging macro
@@ -123,219 +98,128 @@
int jstkDelta; /* delta cursor */
} JoystickDevRec, *JoystickDevPtr;
-#ifndef XFREE86_V4
-/******************************************************************************
- * configuration stuff
- *****************************************************************************/
-#define DEVICENAME 1
-#define TIMEOUT 2
-#define MAXX 3
-#define MAXY 4
-#define MINX 5
-#define MINY 6
-#define CENTERX 7
-#define CENTERY 8
-#define DELTA 9
-#define PORT 10
-#define DEBUG_LEVEL 11
-#define HISTORY_SIZE 12
-#define ALWAYS_CORE 13
-
-static SymTabRec JstkTab[] = {
- { ENDSUBSECTION, "endsubsection" },
- { DEVICENAME, "devicename" },
- { TIMEOUT, "timeout" },
- { MAXX, "maximumxposition" },
- { MAXY, "maximumyposition" },
- { MINX, "minimumxposition" },
- { MINY, "minimumyposition" },
- { CENTERX, "centerx" },
- { CENTERY, "centery" },
- { DELTA, "delta" },
- { PORT, "port" },
- { DEBUG_LEVEL, "debuglevel" },
- { HISTORY_SIZE, "historysize" },
- { ALWAYS_CORE, "alwayscore" },
- { -1, "" },
-};
-/******************************************************************************
- * external declarations
- *****************************************************************************/
-extern void xf86eqEnqueue(
- xEventPtr /*e*/
-);
-
-extern void miPointerDeltaCursor(
- int /*dx*/,
- int /*dy*/,
- unsigned long /*time*/
-);
-
-#endif /* ! XFREE86_V4 */
-
-extern int xf86JoystickGetState(
- int /*fd*/,
- int * /*x*/,
- int * /*y*/,
- int * /*buttons*/
- );
-
-extern void xf86JoystickInit(void);
-
-extern int xf86JoystickOff(
-int * /*fd*/,
-int /*doclose*/
-);
-
-extern int xf86JoystickOn(
-char * /*name*/,
-int * /*timeout*/,
-int * /*centerX*/,
-int * /*centerY*/
-);
-#ifndef XFREE86_V4
-/*
- * xf86JstkConfig --
- * Configure the device.
- */
-static Bool
-xf86JstkConfig(LocalDevicePtr *array,
- int index,
- int max,
- LexPtr val)
-{
- LocalDevicePtr dev = array[index];
- JoystickDevPtr priv = (JoystickDevPtr)(dev->private);
- int token;
-
- DBG(1, ErrorF("xf86JstkConfig\n"));
-
- /* Set defaults */
- priv->jstkOldX = -1;
- priv->jstkOldY = -1;
- priv->jstkOldButtons = -1;
- priv->jstkFd = -1;
- priv->jstkTimeout = 0;
-
- while ((token = xf86GetToken(JstkTab)) != ENDSUBSECTION) {
- switch(token) {
- case DEVICENAME:
- if (xf86GetToken(NULL) != STRING) xf86ConfigError("Option string expected");
- dev->name = strdup(val->str);
- break;
-
- case PORT:
- if (xf86GetToken(NULL) != STRING) xf86ConfigError("Option string expected");
- priv->jstkDevice = strdup(val->str);
- break;
+#if !defined(JSIOCGTIMELIMIT)
+/* make 2.1.x joystick.h backward compatable */
+#define JSIOCGTIMELIMIT JS_GET_TIMELIMIT
+#define JSIOCSTIMELIMIT JS_SET_TIMELIMIT
+#define js_status JS_DATA_TYPE
+#endif
- case TIMEOUT:
- if (xf86GetToken(NULL) != NUMBER) xf86ConfigError("Joystick Timeout expected");
- priv->jstkTimeout = val->num;
- break;
-
- case MAXX:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Joystick MaximumXPosition expected");
- priv->jstkMaxX = val->num;
- break;
-
- case MAXY:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Joystick MaximumYPosition expected");
- priv->jstkMaxY = val->num;
- break;
-
- case MINX:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Joystick MinimumXPosition expected");
- priv->jstkMinX = val->num;
- break;
-
- case MINY:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Joystick MinimumYPosition expected");
- priv->jstkMinY = val->num;
- break;
-
- case CENTERX:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Joystick CenterX expected");
- priv->jstkCenterX = val->num;
- break;
-
- case CENTERY:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Joystick CenterY expected");
- priv->jstkCenterY = val->num;
- break;
-
- case DELTA:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Joystick Delta expected");
- priv->jstkDelta = val->num;
- break;
-
- case DEBUG_LEVEL:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Option number expected");
- debug_level = val->num;
- if (xf86Verbose) {
-#if DEBUG
- ErrorF("%s Joystick debug level sets to %d\n", XCONFIG_GIVEN,
- debug_level);
-#else
- ErrorF("%s Joystick debug level not sets to %d because debugging is not compiled\n",
- XCONFIG_GIVEN, debug_level);
+int
+xf86JoystickOn(char *name, int *timeout, int *centerX, int *centerY)
+{
+ int fd;
+ struct js_status js;
+
+#ifdef DEBUG
+ ErrorF("xf86JoystickOn %s\n", name);
#endif
- }
- break;
- case HISTORY_SIZE:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("Option number expected");
- dev->history_size = val->num;
- if (xf86Verbose)
- ErrorF("%s Joystick Motion history size is %d\n", XCONFIG_GIVEN,
- dev->history_size);
- break;
-
- case ALWAYS_CORE:
- xf86AlwaysCore(dev, TRUE);
- if (xf86Verbose)
- ErrorF("%s Joystick device always stays core pointer\n",
- XCONFIG_GIVEN);
- break;
-
- case EOF:
- FatalError("Unexpected EOF (missing EndSubSection)");
- break; /* :-) */
+ if ((fd = open(name, O_RDWR | O_NDELAY, 0)) < 0)
+ {
+ xf86Msg(X_WARNING, "Cannot open joystick '%s' (%s)\n", name,
+ strerror(errno));
+ return -1;
+ }
- default:
- xf86ConfigError("Joystick subsection keyword expected");
- break;
+ if (*timeout == 0) {
+ if (ioctl (fd, JSIOCGTIMELIMIT, timeout) == -1) {
+ Error("joystick JSIOCGTIMELIMIT ioctl");
+ }
+ else {
+ xf86Msg(X_CONFIG, "Joystick: timeout value = %d\n", *timeout);
+ }
+ }
+ else {
+ if (ioctl(fd, JSIOCSTIMELIMIT, timeout) == -1) {
+ Error("joystick JSIOCSTIMELIMIT ioctl");
}
}
+
+ /* Assume the joystick is centred when this is called */
+ read(fd, &js, JS_RETURN);
+ if (*centerX < 0) {
+ *centerX = js.x;
+ xf86Msg(X_CONFIG, "Joystick: CenterX set to %d\n", *centerX);
+ }
+ if (*centerY < 0) {
+ *centerY = js.y;
+ xf86Msg(X_CONFIG, "Joystick: CenterY set to %d\n", *centerY);
+ }
+
+ return fd;
+}
+
+/***********************************************************************
+ *
+ * xf86JoystickInit --
+ *
+ * called when X device is initialized.
+ *
+ ***********************************************************************
+ */
+
+void
+xf86JoystickInit()
+{
+ return;
+}
+
+/***********************************************************************
+ *
+ * xf86JoystickOff --
+ *
+ * close the handle.
+ *
+ ***********************************************************************
+ */
+
+int
+xf86JoystickOff(int *fd, int doclose)
+{
+ int oldfd;
- DBG(1, ErrorF("xf86JstkConfig timeout=%d name=%s maxx=%d maxy=%d minx=%d miny=%d "
- "centerx=%d centery=%d delta=%d\n",
- priv->jstkTimeout, priv->jstkDevice, priv->jstkMaxX, priv->jstkMaxY,
- priv->jstkMinX, priv->jstkMinY, priv->jstkCenterX, priv->jstkCenterY,
- priv->jstkDelta));
-
- if (xf86Verbose) {
- ErrorF("%s %s: timeout=%d port=%s maxx=%d maxy=%d minx=%d miny=%d\n"
- "\tcenterx=%d centery=%d delta=%d\n", XCONFIG_GIVEN, dev->name,
- priv->jstkTimeout, priv->jstkDevice, priv->jstkMaxX, priv->jstkMaxY,
- priv->jstkMinX, priv->jstkMinY, priv->jstkCenterX, priv->jstkCenterY,
- priv->jstkDelta);
+ if (((oldfd = *fd) >= 0) && doclose) {
+ close(*fd);
+ *fd = -1;
}
- return Success;
+ return oldfd;
}
-#endif
+
+/***********************************************************************
+ *
+ * xf86JoystickGetState --
+ *
+ * return the state of buttons and the position of the joystick.
+ *
+ ***********************************************************************
+ */
+
+int
+xf86JoystickGetState(int fd, int *x, int *y, int *buttons)
+{
+ struct js_status js;
+ int status;
+
+ status = read(fd, &js, JS_RETURN);
+
+ if (status != JS_RETURN)
+ {
+ Error("Joystick read");
+ return 0;
+ }
+
+ *x = js.x;
+ *y = js.y;
+ *buttons = js.buttons;
+
+ return 1;
+}
+
+
/*
***************************************************************************
@@ -377,14 +261,17 @@
pointer arg)
{
DeviceIntPtr device = (DeviceIntPtr)arg;
- JoystickDevPtr priv = (JoystickDevPtr) PRIVATE(device);
+ JoystickDevPtr priv = (JoystickDevPtr) XI_PRIVATE(device);
int timeout = priv->jstkTimeout;
int x, y, buttons;
+ int sigstate;
+
+
DBG(5, ErrorF("xf86JstkEvents BEGIN device=0x%x priv=0x%x"
" timeout=%d timer=0x%x\n",
device, priv, timeout, priv->jstkTimer));
-
+
if (xf86JoystickGetState(priv->jstkFd, &x, &y, &buttons)) {
int loop;
int length = priv->jstkMaxX - priv->jstkMinX;
@@ -399,6 +286,7 @@
x, y, priv->jstkCenterX, priv->jstkCenterY,
v0, v1, buttons));
+ sigstate = xf86BlockSIGIO ();
if ((abs(v0) > (priv->jstkDelta / 20)) ||
(abs(v1) > (priv->jstkDelta / 20)))
{
@@ -407,14 +295,15 @@
priv->jstkOldX = x;
priv->jstkOldY = y;
}
- for(loop=1; loop<3; loop++)
+ for(loop=0; loop<5; loop++)
{
- if ((priv->jstkOldButtons & loop) != (buttons & loop))
+ if ((priv->jstkOldButtons & (1<jstkOldButtons = buttons;
}
@@ -436,7 +325,7 @@
* xf86JstkProc --
* Handle the initialization, etc. of a joystick
*/
-static int
+static Bool
xf86JstkProc(DeviceIntPtr pJstk,
int what)
{
@@ -445,7 +334,7 @@
int nbbuttons;
int jstkfd;
LocalDevicePtr local = (LocalDevicePtr)pJstk->public.devicePrivate;
- JoystickDevPtr priv = (JoystickDevPtr)PRIVATE(pJstk);
+ JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(pJstk);
DBG(2, ErrorF("BEGIN xf86JstkProc dev=0x%x priv=0x%x xf86JstkEvents=0x%x\n",
pJstk, priv, xf86JstkEvents));
@@ -457,9 +346,10 @@
map[1] = 1;
map[2] = 2;
+ map[3] = 3;
nbaxes = 2;
- nbbuttons = 2;
+ nbbuttons = 3;
if (InitButtonClassDeviceStruct(pJstk,
nbbuttons,
@@ -513,9 +403,6 @@
xf86MotionHistoryAllocate(local);
xf86JoystickInit();
-#ifndef XFREE86_V4
- AssignTypeAndName(pJstk, local->atom, local->name);
-#endif
}
break;
@@ -523,8 +410,8 @@
case DEVICE_ON:
priv->jstkFd = jstkfd = xf86JoystickOn(priv->jstkDevice,
&(priv->jstkTimeout),
- &(priv->jstkCenterX),
- &(priv->jstkCenterY));
+ &(priv->jstkCenterX),
+ &(priv->jstkCenterY));
DBG(1, ErrorF("xf86JstkProc pJstk=0x%x what=ON name=%s\n", pJstk,
priv->jstkDevice));
@@ -547,6 +434,8 @@
DBG(1, ErrorF("xf86JstkProc pJstk=0x%x what=%s\n", pJstk,
(what == DEVICE_CLOSE) ? "CLOSE" : "OFF"));
+ TimerFree(priv->jstkTimer);
+ priv->jstkTimer = NULL;
jstkfd = xf86JoystickOff(&(priv->jstkFd), (what == DEVICE_CLOSE));
pJstk->public.on = FALSE;
break;
@@ -561,86 +450,7 @@
return Success;
}
-/*
- * xf86JstkAllocate --
- * Allocate Joystick device structures.
- */
-static LocalDevicePtr
-xf86JstkAllocate(void)
-{
- LocalDevicePtr local = xalloc(sizeof(LocalDeviceRec));
- JoystickDevPtr priv = xalloc(sizeof(JoystickDevRec));
-
- local->name = "JOYSTICK";
- local->flags = 0;
-#ifndef XFREE86_V4
- local->device_config = xf86JstkConfig;
-#endif
- local->device_control = xf86JstkProc;
- local->read_input = NULL;
- local->close_proc = NULL;
- local->control_proc = NULL;
- local->switch_mode = NULL;
- local->conversion_proc = xf86JstkConvert;
- local->fd = -1;
- local->atom = 0;
- local->dev = NULL;
- local->private = priv;
- local->type_name = "Joystick";
- local->history_size = 0;
-
- priv->jstkFd = -1;
- priv->jstkTimer = NULL;
- priv->jstkTimeout = 0;
- priv->jstkDevice = NULL;
- priv->jstkOldX = -1;
- priv->jstkOldY = -1;
- priv->jstkOldButtons = -1;
- priv->jstkMaxX = 1000;
- priv->jstkMaxY = 1000;
- priv->jstkMinX = 0;
- priv->jstkMinY = 0;
- priv->jstkCenterX = -1;
- priv->jstkCenterY = -1;
- priv->jstkDelta = 100;
-
- return local;
-}
-/*
- * joystick association
- */
-DeviceAssocRec joystick_assoc =
-{
- "joystick", /* config_section_name */
- xf86JstkAllocate /* device_allocate */
-};
-
-#ifndef XFREE86_V4
-
-#ifdef DYNAMIC_MODULE
-/*
- * entry point of dynamic loading
- */
-int
-#ifndef DLSYM_BUG
-init_module(unsigned long server_version)
-#else
-init_xf86Jstk(unsigned long server_version)
-#endif
-{
- xf86AddDeviceAssoc(&joystick_assoc);
-
- if (server_version != XF86_VERSION_CURRENT) {
- ErrorF("Warning: Joystick module compiled for version%s\n", XF86_VERSION);
- return 0;
- } else {
- return 1;
- }
-}
-#endif
-
-#else /* ! XFREE86_V4 */
/*
***************************************************************************
@@ -659,15 +469,15 @@
static void
xf86JstkUnplug(pointer p)
{
- LocalDevicePtr local = (LocalDevicePtr) p;
+/* LocalDevicePtr local = (LocalDevicePtr) p;
JoystickDevPtr priv = (JoystickDevPtr) local->private;
- ErrorF("xf86JstckUnplug\n");
xf86JstkProc(local->dev, DEVICE_OFF);
xfree (priv);
- xfree (local);
+ xfree (local);*/
+ ErrorF("xf86JstckUnplug\n");
}
/*
@@ -675,98 +485,170 @@
*
* called when the module subsection is found in XF86Config
*/
-static pointer
-xf86JstkPlug(pointer module,
- pointer options,
- int *errmaj,
- int *errmin )
+
+static InputInfoPtr
+xf86JstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
{
LocalDevicePtr local = NULL;
JoystickDevPtr priv = NULL;
char *s;
- local = xf86JstkAllocate();
-
- if (!local || !priv) {
- *errmaj = LDR_NOMEM;
- goto SetupProc_fail;
+ local = xf86AllocateInput(drv, 0);
+ if (!local) {
+ goto SetupProc_fail;
}
+ local->private = (JoystickDevPtr)xalloc(sizeof(JoystickDevRec));
priv = (JoystickDevPtr) local->private;
+
+ local->name = dev->identifier;
+ local->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;
+ local->device_control = xf86JstkProc;
+ local->read_input = NULL;
+ local->close_proc = NULL;
+ local->control_proc = NULL;
+ local->switch_mode = NULL;
+ local->conversion_proc = xf86JstkConvert;
+ local->fd = -1;
+ local->dev = NULL;
+ local->private = priv;
+ local->type_name = "JOYSTICK";
+ local->history_size = 0;
+ local->always_core_feedback = 0;
+ local->conf_idev = dev;
+
+ priv->jstkFd = -1;
+ priv->jstkTimer = NULL;
+ priv->jstkTimeout = 1;
+ priv->jstkDevice = NULL;
+ priv->jstkOldX = -1;
+ priv->jstkOldY = -1;
+ priv->jstkOldButtons = -1;
+ priv->jstkMaxX = 1000;
+ priv->jstkMaxY = 1000;
+ priv->jstkMinX = 0;
+ priv->jstkMinY = 0;
+ priv->jstkCenterX = 0;
+ priv->jstkCenterY = 0;
+ priv->jstkDelta = 100;
+ xf86CollectInputOptions(local, NULL, NULL);
+ xf86OptionListReport(local->options);
+
/* Joytsick device is mandatory */
- priv->jstkDevice = xf86FindOptionValue(options, "Device");
+ priv->jstkDevice = xf86CheckStrOption(dev->commonOptions, "Device", NULL);
if (!priv->jstkDevice) {
- xf86Msg (X_ERROR, "WACOM: No Device specified.\n");
- *errmaj = LDR_BADUSAGE;
+ xf86Msg (X_ERROR, "JOYSTICK: No Device specified.\n");
+/* *errmaj = LDR_BADUSAGE;*/
goto SetupProc_fail;
}
/* Optional configuration */
- s = xf86SetStrOption(options, "DeviceName", NULL);
+ s = xf86CheckStrOption(dev->commonOptions, "DeviceName", NULL);
if (s != NULL)
local->name = s;
xf86Msg(X_CONFIG, "%s name is %s\n", local->type_name, local->name);
xf86Msg(X_CONFIG, "JOYSTICK device is %s\n", priv->jstkDevice);
- debug_level = xf86SetIntOption(options, "DebugLevel", 0);
+ xf86ProcessCommonOptions(local, local->options);
+
+ debug_level = xf86SetIntOption(dev->commonOptions, "DebugLevel", 0);
if (debug_level > 0) {
xf86Msg(X_CONFIG, "JOYSTICK: debug level set to %d\n", debug_level);
}
- priv->jstkMaxX = xf86SetIntOption(options, "MaxX", 1000);
+ priv->jstkMaxX = xf86SetIntOption(local->options, "MaxX", 1000);
if (priv->jstkMaxX != 1000) {
xf86Msg(X_CONFIG, "JOYSTICK: max x = %d\n", priv->jstkMaxX);
}
- priv->jstkMaxY = xf86SetIntOption(options, "MaxY", 1000);
+ priv->jstkMaxY = xf86SetIntOption(local->options, "MaxY", 1000);
if (priv->jstkMaxY != 1000) {
xf86Msg(X_CONFIG, "JOYSTICK: max y = %d\n", priv->jstkMaxY);
}
- priv->jstkMinX = xf86SetIntOption(options, "MinX", 0);
+ priv->jstkMinX = xf86SetIntOption(local->options, "MinX", 0);
if (priv->jstkMinX != 0) {
xf86Msg(X_CONFIG, "JOYSTICK: min x = %d\n", priv->jstkMinX);
}
- priv->jstkMinY = xf86SetIntOption(options, "MinY", 0);
+ priv->jstkMinY = xf86SetIntOption(local->options, "MinY", 0);
if (priv->jstkMinY != 0) {
xf86Msg(X_CONFIG, "JOYSTICK: min y = %d\n", priv->jstkMinY);
}
- priv->jstkCenterX = xf86SetIntOption(options, "CenterX", -1);
- if (priv->jstkCenterX != -1) {
+ priv->jstkCenterX = xf86SetIntOption(local->options, "CenterX", 128);
+ if (priv->jstkCenterX != 128) {
xf86Msg(X_CONFIG, "JOYSTICK: center x = %d\n", priv->jstkCenterX);
}
- priv->jstkCenterY = xf86SetIntOption(options, "CenterY", -1);
- if (priv->jstkCenterY != 0) {
+ priv->jstkCenterY = xf86SetIntOption(local->options, "CenterY", 128);
+ if (priv->jstkCenterY != 128) {
xf86Msg(X_CONFIG, "JOYSTICK: center y = %d\n", priv->jstkCenterY);
}
- priv->jstkTimeout = xf86SetIntOption(options, "Timeout", -1);
- if (priv->jstkTimeout != -1) {
- xf86Msg(X_CONFIG, "JOYSTICK: timeout = %d\n", priv->jstkTimeout);
- }
+ priv->jstkTimeout = xf86SetIntOption(local->options, "Timeout", -1);
+ if (priv->jstkTimeout != -1) {
+ xf86Msg(X_CONFIG, "JOYSTICK: timeout = %d\n", priv->jstkTimeout);
+ }
- priv->jstkDelta = xf86SetIntOption(options, "Delta", 0);
+ priv->jstkDelta = xf86SetIntOption(local->options, "Delta", 0);
if (priv->jstkDelta != 0) {
xf86Msg(X_CONFIG, "JOYSTICK: delta = %d\n", priv->jstkDelta);
}
- /* Register the device into XFree86 XInput layer */
- xf86AddLocalDevice(local, options);
-
/* return the LocalDevice */
- return (local);
+ local->flags |= XI86_CONFIGURED ;
+ return (local);
SetupProc_fail:
if (priv)
- xfree(priv);
+ xfree(priv);
if (local)
- xfree(local);
+ xfree(local);
return NULL;
}
+
+/*
+ * xf86AiptekUninit --
+ *
+ * called when the driver is unloaded.
+ */
+static void
+xf86JstkCoreUnInit(InputDriverPtr drv,
+ LocalDevicePtr local,
+ int flags)
+{
+ JoystickDevPtr device = (JoystickDevPtr) local->private;
+
+ DBG(1, ErrorF("xf86JstkUninit\n"));
+
+ xf86JstkProc(local->dev, DEVICE_OFF);
+
+ xfree (device);
+ xf86DeleteInput(local, 0);
+}
+
+_X_EXPORT InputDriverRec JOYSTICK = {
+ 1,
+ "joystick",
+ NULL,
+ xf86JstkCorePreInit,
+ xf86JstkCoreUnInit,
+ NULL,
+ 0
+};
+
+static pointer
+xf86JstkPlug(pointer module,
+ pointer options,
+ int *errmaj,
+ int *errmin)
+{
+ xf86AddInputDriver(&JOYSTICK, module, 0);
+ return module;
+}
+
static XF86ModuleVersionInfo xf86JstkVersionRec =
{
"joystick",
@@ -774,7 +656,7 @@
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
- 1, 1, 0,
+ 1, 1, 1,
ABI_CLASS_XINPUT,
ABI_XINPUT_VERSION,
MOD_CLASS_XINPUT,
@@ -789,7 +671,5 @@
};
#endif /* XFree86LOADER */
-#endif /* ! XFREE86_V4 */
-
/* end of xf86Jstk.c */
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org