xf86-input-ws 1.3.0:

- API compatibility with Xserver 1.10
- sync build system with other Xorg input modules
This commit is contained in:
matthieu 2011-04-24 15:55:12 +00:00
parent 8c0d9c0f01
commit 1bf60a502f
13 changed files with 2524 additions and 2656 deletions

View File

@ -0,0 +1,15 @@
Copyright © 2005-2009 Matthieu Herrb
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -35,10 +35,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure config.guess config.sub depcomp \
install-sh ltmain.sh missing
$(top_srcdir)/configure COPYING config.guess config.sub \
depcomp install-sh ltmain.sh missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@ -70,12 +70,14 @@ am__remove_distdir = \
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -112,6 +114,7 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -128,6 +131,7 @@ MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
NMEDIT = @NMEDIT@
@ -146,10 +150,9 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XINPUT_FALSE = @XINPUT_FALSE@
XINPUT_TRUE = @XINPUT_TRUE@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
@ -170,7 +173,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@

View File

@ -0,0 +1 @@
xf86-input-ws - Xorg X server driver for NetBSD and OpenBSD wscons pointers

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,5 @@
/* config.h.in. Generated from configure.ac by autoheader. */
#include "xorg-server.h"
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@ -64,6 +62,3 @@
/* Version number of package */
#undef VERSION
/* Enable XInput support */
#undef XINPUT

File diff suppressed because it is too large Load Diff

View File

@ -20,46 +20,35 @@
#
# Process this file with autoconf to produce a configure script
AC_PREREQ(2.57)
AC_PREREQ([2.60])
AC_INIT([xf86-input-ws],
1.2.9,
[1.3.0],
[http://www.openbsd.org/],
xf86-input-ws)
[xf86-input-ws])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([foreign dist-bzip2])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
DRIVER_NAME=ws
AC_SUBST([DRIVER_NAME])
# Require xorg-macros: XORG_DEFAULT_OPTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.3 or later before running autoco
nf/autogen])])
XORG_MACROS_VERSION(1.3)
XORG_DEFAULT_OPTIONS
AM_CONFIG_HEADER([config.h])
# Checks for programs.
# Initialize libtool
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_CC
AH_TOP([#include "xorg-server.h"])
# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by
# XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
#
AC_ARG_ENABLE(XINPUT, AS_HELP_STRING([--enable-xinput],
[Build XInput support (default: yes)]),
[XINPUT=$enableval],[XINPUT=yes])
AM_CONDITIONAL(XINPUT, test "x$XINPUT" = "xyes")
if test "x$XINPUT" = "xyes" ; then
AC_DEFINE(XINPUT,1,[Enable XInput support])
fi
# Obtain compiler/linker options from server and required extensions
PKG_CHECK_MODULES(XORG, xorg-server xproto inputproto)
# Define a configure option for an alternate input module directory
AC_ARG_WITH(xorg-module-dir,
AC_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
@ -68,21 +57,21 @@ AC_ARG_WITH(xorg-module-dir,
inputdir=${moduledir}/input
AC_SUBST(inputdir)
# Checks for extensions
# XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
# X Server SDK location is required to install evdev header files
# This location is also relayed in the xorg-evdev.pc file
sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
# Checks for pkg-config packages
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`])
# Workaround overriding sdkdir to be able to create a tarball when user has no
# write permission in sdkdir. See DISTCHECK_CONFIGURE_FLAGS in Makefile.am
AC_ARG_WITH([sdkdir], [], [sdkdir="$withval"])
AC_SUBST([sdkdir])
# Checks for libraries.
DRIVER_NAME=ws
AC_SUBST([DRIVER_NAME])
# Checks for header files.
AC_HEADER_STDC
AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile
include/Makefile])
AC_OUTPUT([Makefile src/Makefile man/Makefile include/Makefile])
AC_OUTPUT

View File

@ -66,6 +66,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -102,6 +103,7 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -118,6 +120,7 @@ MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
NMEDIT = @NMEDIT@
@ -136,10 +139,9 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XINPUT_FALSE = @XINPUT_FALSE@
XINPUT_TRUE = @XINPUT_TRUE@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
@ -160,7 +162,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@

View File

@ -63,6 +63,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -99,6 +100,7 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -115,6 +117,18 @@ MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
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'
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
NMEDIT = @NMEDIT@
@ -133,10 +147,9 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XINPUT_FALSE = @XINPUT_FALSE@
XINPUT_TRUE = @XINPUT_TRUE@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
@ -157,7 +170,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@ -212,18 +224,6 @@ CLEANFILES = $(driverman_DATA)
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
all: all-am

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: ws.man,v 1.6 2010/06/06 20:38:03 matthieu Exp $
.\" $OpenBSD: ws.man,v 1.7 2011/04/24 15:55:12 matthieu Exp $
.\"
.\" Copyright (c) 2005,2009 Matthieu Herrb
.\"

View File

@ -79,6 +79,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -115,6 +116,7 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -131,6 +133,7 @@ MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
NMEDIT = @NMEDIT@
@ -149,10 +152,9 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XINPUT_FALSE = @XINPUT_FALSE@
XINPUT_TRUE = @XINPUT_TRUE@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
@ -173,7 +175,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@

View File

@ -1,4 +1,4 @@
/* $OpenBSD: emumb.c,v 1.2 2009/11/26 18:18:34 matthieu Exp $ */
/* $OpenBSD: emumb.c,v 1.3 2011/04/24 15:55:12 matthieu Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
* Copyright 1993 by David Dawes <dawes@xfree86.org>

View File

@ -13,7 +13,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $OpenBSD: ws.c,v 1.31 2010/01/10 16:33:44 matthieu Exp $ */
/* $OpenBSD: ws.c,v 1.32 2011/04/24 15:55:12 matthieu Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@ -25,8 +25,8 @@
#include <sys/time.h>
#include <dev/wscons/wsconsio.h>
#include <xorg-server.h>
#include <xf86.h>
#include <xf86_OSproc.h>
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
@ -36,6 +36,17 @@
#include <mipointer.h>
#include <extinit.h>
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 10
#undef xalloc
#undef xcalloc
#define xcalloc calloc
#define xalloc malloc
#define Xcalloc calloc
#define Xalloc malloc
#define Xfree free
#endif
#include "ws.h"
#ifdef HAVE_PROPERTIES
@ -52,7 +63,10 @@
static MODULESETUPPROTO(SetupProc);
static void TearDownProc(pointer);
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static InputInfoPtr wsPreInit(InputDriverPtr, IDevPtr, int);
#endif
static int wsPreInit12(InputDriverPtr, InputInfoPtr, int);
static int wsProc(DeviceIntPtr, int);
static int wsDeviceInit(DeviceIntPtr);
static int wsDeviceOn(DeviceIntPtr);
@ -102,7 +116,11 @@ InputDriverRec WS = {
1,
"ws",
NULL,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
wsPreInit,
#else
wsPreInit12,
#endif
NULL,
NULL,
0
@ -126,38 +144,39 @@ TearDownProc(pointer p)
DBG(1, ErrorF("WS TearDownProc called\n"));
}
static InputInfoPtr
wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
static int
wsPreInit12(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
{
InputInfoPtr pInfo = NULL;
WSDevicePtr priv;
MessageType buttons_from = X_CONFIG;
char *s;
int rc;
pInfo = xf86AllocateInput(drv, 0);
if (pInfo == NULL) {
return NULL;
}
priv = (WSDevicePtr)xcalloc(1, sizeof(WSDeviceRec));
if (priv == NULL)
if (priv == NULL) {
rc = BadAlloc;
goto fail;
pInfo->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;
pInfo->conf_idev = dev;
pInfo->name = "ws";
}
pInfo->private = priv;
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
xf86CollectInputOptions(pInfo, NULL, NULL);
xf86ProcessCommonOptions(pInfo, pInfo->options);
#else
xf86CollectInputOptions(pInfo, NULL);
#endif
#ifdef DEBUG
ws_debug_level = xf86SetIntOption(pInfo->options, "DebugLevel",
ws_debug_level);
xf86Msg(X_INFO, "%s: debuglevel %d\n", dev->identifier,
xf86Msg(X_INFO, "%s: debuglevel %d\n", pInfo->name,
ws_debug_level);
#endif
priv->devName = xf86FindOptionValue(pInfo->options, "Device");
if (priv->devName == NULL) {
xf86Msg(X_ERROR, "%s: No Device specified.\n",
dev->identifier);
pInfo->name);
rc = BadValue;
goto fail;
}
priv->buttons = xf86SetIntOption(pInfo->options, "Buttons", 0);
@ -220,7 +239,7 @@ wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", 0);
xf86Msg(X_CONFIG, "%s associated screen: %d\n",
dev->identifier, priv->screen_no);
pInfo->name, priv->screen_no);
if (priv->screen_no >= screenInfo.numScreens ||
priv->screen_no < 0) {
priv->screen_no = 0;
@ -231,7 +250,7 @@ wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
if (priv->swap_axes) {
xf86Msg(X_CONFIG,
"%s device will work with X and Y axes swapped\n",
dev->identifier);
pInfo->name);
}
priv->inv_x = 0;
priv->inv_y = 0;
@ -256,10 +275,12 @@ wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
}
}
if (wsOpen(pInfo) != Success) {
rc = BadValue;
goto fail;
}
if (ioctl(pInfo->fd, WSMOUSEIO_GTYPE, &priv->type) != 0) {
wsClose(pInfo);
rc = BadValue;
goto fail;
}
if (priv->type == WSMOUSE_TYPE_TPANEL) {
@ -277,7 +298,7 @@ wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
if (priv->raw) {
xf86Msg(X_CONFIG,
"%s device will work in raw mode\n",
dev->identifier);
pInfo->name);
}
if (priv->type == WSMOUSE_TYPE_TPANEL && priv->raw) {
@ -286,6 +307,7 @@ wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
xf86Msg(X_ERROR, "GCALIBCOORS failed %s\n",
strerror(errno));
wsClose(pInfo);
rc = BadValue;
goto fail;
}
@ -304,47 +326,70 @@ wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
/* Allow options to override this */
priv->min_x = xf86SetIntOption(pInfo->options, "MinX", priv->min_x);
xf86Msg(X_INFO, "%s minimum x position: %d\n",
dev->identifier, priv->min_x);
pInfo->name, priv->min_x);
priv->max_x = xf86SetIntOption(pInfo->options, "MaxX", priv->max_x);
xf86Msg(X_INFO, "%s maximum x position: %d\n",
dev->identifier, priv->max_x);
pInfo->name, priv->max_x);
priv->min_y = xf86SetIntOption(pInfo->options, "MinY", priv->min_y);
xf86Msg(X_INFO, "%s minimum y position: %d\n",
dev->identifier, priv->min_y);
pInfo->name, priv->min_y);
priv->max_y = xf86SetIntOption(pInfo->options, "MaxY", priv->max_y);
xf86Msg(X_INFO, "%s maximum y position: %d\n",
dev->identifier, priv->max_y);
pInfo->name, priv->max_y);
pInfo->name = dev->identifier;
pInfo->device_control = wsProc;
pInfo->read_input = wsReadInput;
pInfo->control_proc = wsChangeControl;
pInfo->switch_mode = wsSwitchMode;
pInfo->private = priv;
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
pInfo->conversion_proc = NULL;
pInfo->reverse_conversion_proc = NULL;
pInfo->private = priv;
pInfo->old_x = -1;
pInfo->old_y = -1;
#endif
xf86Msg(buttons_from, "%s: Buttons: %d\n", pInfo->name, priv->buttons);
wsClose(pInfo);
wsmbEmuPreInit(pInfo);
return Success;
/* mark the device configured */
pInfo->flags |= XI86_CONFIGURED;
return pInfo;
fail:
if (priv != NULL) {
xfree(priv);
pInfo->private = NULL;
}
if (pInfo != NULL) {
xf86DeleteInput(pInfo, 0);
}
return NULL;
return rc;
}
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static InputInfoPtr
wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
{
InputInfoPtr pInfo = NULL;
pInfo = xf86AllocateInput(drv, 0);
if (pInfo == NULL) {
return NULL;
}
pInfo->name = dev->identifier;
pInfo->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;
pInfo->conf_idev = dev;
pInfo->close_proc = NULL;
pInfo->private_flags = 0;
pInfo->always_core_feedback = NULL;
if (wsPreInit12(drv, pInfo, flags) != Success) {
xf86DeleteInput(pInfo, 0);
return NULL;
}
/* mark the device configured */
pInfo->flags |= XI86_CONFIGURED;
return pInfo;
}
#endif
static int
wsProc(DeviceIntPtr pWS, int what)
{
@ -377,7 +422,7 @@ static int
wsDeviceInit(DeviceIntPtr pWS)
{
InputInfoPtr pInfo = (InputInfoPtr)pWS->public.devicePrivate;
WSDevicePtr priv = (WSDevicePtr)XI_PRIVATE(pWS);
WSDevicePtr priv = (WSDevicePtr)pInfo->private;
unsigned char map[NBUTTONS + 1];
int i, xmin, xmax, ymin, ymax;
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
@ -451,18 +496,28 @@ wsDeviceInit(DeviceIntPtr pWS)
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
axes_labels[0],
#endif
xmin, xmax, 1, 0, 1);
xmin, xmax, 1, 0, 1
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
, priv->type == WSMOUSE_TYPE_TPANEL ? Absolute : Relative
#endif
);
xf86InitValuatorDefaults(pWS, 0);
xf86InitValuatorAxisStruct(pWS, 1,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
axes_labels[1],
#endif
ymin, ymax, 1, 0, 1);
ymin, ymax, 1, 0, 1
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
, priv->type == WSMOUSE_TYPE_TPANEL ? Absolute : Relative
#endif
);
xf86InitValuatorDefaults(pWS, 1);
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
xf86MotionHistoryAllocate(pInfo);
AssignTypeAndName(pWS, pInfo->atom, pInfo->name);
#endif
pWS->public.on = FALSE;
if (wsOpen(pInfo) != Success) {
return !Success;
@ -479,7 +534,7 @@ static int
wsDeviceOn(DeviceIntPtr pWS)
{
InputInfoPtr pInfo = (InputInfoPtr)pWS->public.devicePrivate;
WSDevicePtr priv = (WSDevicePtr)XI_PRIVATE(pWS);
WSDevicePtr priv = (WSDevicePtr)pInfo->private;
struct wsmouse_calibcoords coords;
DBG(1, ErrorF("WS DEVICE ON\n"));
@ -525,7 +580,7 @@ static void
wsDeviceOff(DeviceIntPtr pWS)
{
InputInfoPtr pInfo = (InputInfoPtr)pWS->public.devicePrivate;
WSDevicePtr priv = (WSDevicePtr)XI_PRIVATE(pWS);
WSDevicePtr priv = pInfo->private;
struct wsmouse_calibcoords coords;
DBG(1, ErrorF("WS DEVICE OFF\n"));