69-touchscreen.rules | 49 ++++++++++++++++++++---- ChangeLog | 8 ++++ Makefile.am | 2 - Makefile.in | 2 - configure | 20 +++++----- configure.ac | 2 - evtouch.c | 102 +++++++++++++++++++++++++++++++-------------------- evtouch.h | 10 +---- 8 files changed, 127 insertions(+), 68 deletions(-)
New commits: commit ce8962fbf2f2861a63431d7325227248f279d60e Author: Mattia Dongili <[EMAIL PROTECTED]> Date: Wed Jun 13 22:34:40 2007 +0900 Imported upstream sources (version 0.8.6) Signed-off-by: Mattia Dongili <[EMAIL PROTECTED]> diff --git a/69-touchscreen.rules b/69-touchscreen.rules index e0ebec4..536c8c5 100644 --- a/69-touchscreen.rules +++ b/69-touchscreen.rules @@ -3,12 +3,45 @@ # Because Evtouch can't autoprobe devices we assume that we only # Have one device so we can make it like this :P # -# List here your touchscreen, check if it works and send it to rpms_AT_ilmi_DOT_fi -# Name can be found in /proc/bus/input/devices (In console make command 'cat /proc/bus/input/devices') -# -# Tested on Telepeak Model 800-Y-Y-V (http://www.telepeak.com). Should work on most eGalax based stuff! -KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="eGalax Inc. USB TouchController", SYMLINK+="input/evtouch_event" -# -# This could be also like this (eGalax Inc. USB TouchController) -# KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0eef", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# List here your touchscreen, check if it works and send it to lifebook_AT_conan_DOT_de +# Name can be found in /proc/bus/input/devices ('cat /proc/bus/input/devices') # + +# These are the touchscreens supported by kernel's "usbtouchscreen" module + +# eGalax Inc. USB TouchController) +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="3823", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# eGalax Inc. USB TouchController) +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="3823", ATTRS{idProduct}=="0002", SYMLINK+="input/evtouch_event" +# eGalax Inc. USB TouchController) +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0123", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# eGalax Inc. USB TouchController) +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0123", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# eGalax Inc. USB TouchController) +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0eef", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# eGalax Inc. USB TouchController) +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0eef", ATTRS{idProduct}=="0002", SYMLINK+="input/evtouch_event" +# eGalax Inc. USB TouchController) +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="1234", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# eGalax Inc. USB TouchController) +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="1234", ATTRS{idProduct}=="0002", SYMLINK+="input/evtouch_event" +# eTurboTouch +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="1234", ATTRS{idProduct}=="5678", SYMLINK+="input/evtouch_event" +# PanJit Touchset +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="134C", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# PanJit Touchset +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="134C", ATTRS{idProduct}=="0002", SYMLINK+="input/evtouch_event" +# PanJit Touchset +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="134C", ATTRS{idProduct}=="0003", SYMLINK+="input/evtouch_event" +# PanJit Touchset +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="134C", ATTRS{idProduct}=="0004", SYMLINK+="input/evtouch_event" +# 3M Microtouch EX II +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0596", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# ITM Touchscreens +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="F9E9", SYMLINK+="input/evtouch_event" +# Gunze AHL61 +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0637", ATTRS{idProduct}=="0001", SYMLINK+="input/evtouch_event" +# DMC TSC-10/25 +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="0AFA", ATTRS{idProduct}=="03E8", SYMLINK+="input/evtouch_event" +# Lifebook B-Series +KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="LBPS/2 Fujitsu Lifebook TouchScreen", SYMLINK+="input/evtouch_event" diff --git a/ChangeLog b/ChangeLog index 751dbba..2cbf76f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +0.8.6 + - replaced old udev-rules with a more complete one (Thomas Bartosik) + - Added Lifebook B-series to udev-rules + - Fixed classic rotation (again) + - Fixed wrong handling of wrong / fixed default screen size + - little code-cleanup (removed obsolete variables) + - Fixed segv when switching to VT (Mattia Dongili) + 0.8.5 - Made Events in libtouch configurable (experimental) - Changed initialization for Xorg 7.2 diff --git a/Makefile.am b/Makefile.am index 376de75..56dfdaa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -34,7 +34,7 @@ endif @[EMAIL PROTECTED] = @[EMAIL PROTECTED] @[EMAIL PROTECTED] = -module -avoid-version [EMAIL PROTECTED]@_drv_la_CFLAGS = -DXINPUT -DDEBUG=y @EVTOUCH_CFLAGS@ [EMAIL PROTECTED]@_drv_la_CFLAGS = -DXINPUT @EVTOUCH_CFLAGS@ @[EMAIL PROTECTED] = @inputdir@ @[EMAIL PROTECTED] = @[EMAIL PROTECTED] libtouch.c diff --git a/Makefile.in b/Makefile.in index bd20a6d..5a03534 100644 --- a/Makefile.in +++ b/Makefile.in @@ -258,7 +258,7 @@ noinst_HEADERS = libtouch.h evtouch.h ev_calibrate.h @[EMAIL PROTECTED] = @EVCALIBRATE_CFLAGS@ -DCURSORDIR=\"$(pkgdatadir)\" @[EMAIL PROTECTED] = @[EMAIL PROTECTED] @[EMAIL PROTECTED] = -module -avoid-version [EMAIL PROTECTED]@_drv_la_CFLAGS = -DXINPUT -DDEBUG=y @EVTOUCH_CFLAGS@ [EMAIL PROTECTED]@_drv_la_CFLAGS = -DXINPUT @EVTOUCH_CFLAGS@ @[EMAIL PROTECTED] = @inputdir@ @[EMAIL PROTECTED] = @[EMAIL PROTECTED] libtouch.c all: config.h diff --git a/configure b/configure index 63fc9c6..4c8c73f 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for xf86-input-evtouch 0.8.5. +# Generated by GNU Autoconf 2.61 for xf86-input-evtouch 0.8.6. # # Report bugs to <http://www.conan.de/touchscreen/evtouch.html>. # @@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xf86-input-evtouch' PACKAGE_TARNAME='xf86-input-evtouch' -PACKAGE_VERSION='0.8.5' -PACKAGE_STRING='xf86-input-evtouch 0.8.5' +PACKAGE_VERSION='0.8.6' +PACKAGE_STRING='xf86-input-evtouch 0.8.6' PACKAGE_BUGREPORT='http://www.conan.de/touchscreen/evtouch.html' ac_unique_file="Makefile.am" @@ -1409,7 +1409,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xf86-input-evtouch 0.8.5 to adapt to many kinds of systems. +\`configure' configures xf86-input-evtouch 0.8.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1479,7 +1479,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-input-evtouch 0.8.5:";; + short | recursive ) echo "Configuration of xf86-input-evtouch 0.8.6:";; esac cat <<\_ACEOF @@ -1595,7 +1595,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-input-evtouch configure 0.8.5 +xf86-input-evtouch configure 0.8.6 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1609,7 +1609,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xf86-input-evtouch $as_me 0.8.5, which was +It was created by xf86-input-evtouch $as_me 0.8.6, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2281,7 +2281,7 @@ fi # Define the identity of the package. PACKAGE='xf86-input-evtouch' - VERSION='0.8.5' + VERSION='0.8.6' cat >>confdefs.h <<_ACEOF @@ -21160,7 +21160,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-input-evtouch $as_me 0.8.5, which was +This file was extended by xf86-input-evtouch $as_me 0.8.6, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21213,7 +21213,7 @@ Report bugs to <[EMAIL PROTECTED]>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xf86-input-evtouch config.status 0.8.5 +xf86-input-evtouch config.status 0.8.6 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 0450ba6..d0ab57e 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # Process this file with autoconf to produce a configure script AC_PREREQ(2.59) -AC_INIT([xf86-input-evtouch],[0.8.5],[http://www.conan.de/touchscreen/evtouch.html],[xf86-input-evtouch]) +AC_INIT([xf86-input-evtouch],[0.8.6],[http://www.conan.de/touchscreen/evtouch.html],[xf86-input-evtouch]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_AUX_DIR(.) diff --git a/evtouch.c b/evtouch.c index 92fd7eb..e13df06 100644 --- a/evtouch.c +++ b/evtouch.c @@ -29,12 +29,23 @@ #endif #define _evdev_touch_C_ + +#include <xf86Version.h> +#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0) +#define XFREE86_V4 +#endif + /***************************************************************************** * Standard Headers ****************************************************************************/ -#include <string.h> +#ifdef XFREE86_V4 +#include <unistd.h> +#else #include <stdio.h> #include <stdlib.h> +#endif +#include <string.h> +#include <errno.h> #include <sys/types.h> #include <sys/stat.h> @@ -55,9 +66,11 @@ #include "inputstr.h" #endif -#include "xf86Xinput.h" #include "xf86_OSproc.h" +#include "xf86Xinput.h" +#include "exevents.h" #include "xf86OSmouse.h" +#include "randrstr.h" #ifndef NEED_XF86_TYPES #define NEED_XF86_TYPES /* for xisb.h when !XFree86LOADER */ @@ -67,7 +80,6 @@ #include "xisb.h" - /***************************************************************************** * Local Headers ****************************************************************************/ @@ -117,12 +129,12 @@ static XF86ModuleVersionInfo VersionRec = MODINFOSTRING1, MODINFOSTRING2, XF86_VERSION_CURRENT, - 0, 8, 5, + 0, 8, 6, ABI_CLASS_XINPUT, ABI_XINPUT_VERSION, MOD_CLASS_XINPUT, - {0, 0, 0, 0} /* signature, to be patched into the file by - * a tool */ + {0, 0, 0, 0} /* signature, to be patched into the file by + * a tool */ }; @@ -161,8 +173,8 @@ static const char *default_options[] = "FlowControl", "None" }; -static void -ControlProc(DeviceIntPtr device, PtrCtrl *ctrl); +static int +ControlProc(LocalDevicePtr device, xDeviceCtl *ctrl); /***************************************************************************** * Function Definitions @@ -272,8 +284,6 @@ void EVTouchProcessAbs(EVTouchPrivatePtr priv) struct input_event *ev; /* packet being/just read */ ev = &priv->ev; - priv->old_x = priv->cur_x; - priv->old_y = priv->cur_y; if (ev->code == ABS_X) { priv->cur_x = ev->value; @@ -322,8 +332,6 @@ void EVTouchProcessRel(EVTouchPrivatePtr priv) struct input_event *ev; /* packet being/just read */ ev = &priv->ev; - priv->old_x = priv->cur_x; - priv->old_y = priv->cur_y; if ( ev->code == REL_X ) { priv->cur_x += ev->value; if (priv->cur_x > priv->max_x) @@ -530,7 +538,6 @@ DeviceOff (DeviceIntPtr dev) local->fd = -1; } - xf86RemoveEnabledDevice (local); dev->public.on = FALSE; if ( (priv->calibrate) && (priv->fifo>0) ){ @@ -563,9 +570,6 @@ DeviceInit (DeviceIntPtr dev) */ ScrnInfoPtr pScrn = xf86Screens[priv->screen_num]; - - priv->phys_width = pScrn->currentMode->HDisplay; /* physical screen resolution */ - priv->phys_height = pScrn->currentMode->VDisplay; priv->screen_width = pScrn->virtualX; /* It's the virtual screen size ! */ priv->screen_height = pScrn->virtualY; priv->pViewPort_X0 = &(pScrn->frameX0); /* initialize the pointers to the viewport coords */ @@ -771,8 +775,6 @@ static void ReadInput (LocalDevicePtr local) priv->cur_x, priv->cur_y); - priv->old_x = priv->cur_x; - priv->old_y = priv->cur_y; switch (ev->type) { case EV_ABS: EVTouchProcessAbs(priv); @@ -820,10 +822,19 @@ static void ReadInput (LocalDevicePtr local) -static void -ControlProc(DeviceIntPtr device, PtrCtrl *ctrl) +static int +ControlProc(LocalDevicePtr device, xDeviceCtl *ctrl) { DBGOUT(2, "EVTouch: %s\n", __FUNCTION__); + +/* xDeviceTSCalibrationCtl *c = (xDeviceTSCalibrationCtl *) ctrl; */ +/* EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private); */ + +/* priv->min_x = c->min_x; */ +/* priv->max_x = c->max_x; */ +/* priv->min_y = c->min_y; */ +/* priv->max_y = c->max_y; */ + return (Success); } @@ -882,16 +893,17 @@ ConvertProc ( LocalDevicePtr local, ScrnInfoPtr pScrn = xf86Screens[priv->screen_num]; Rotation rotation = RRGetRotation(pScrn->pScreen); - DBGOUT(2, "FIRST: v0=%d v1=%d\n", v0, v1); + DBGOUT(2, "EVTouch: FIRST: v0=%d v1=%d\n", v0, v1); /*correction of raw coordinates*/ if ( (priv->fifo>0) && (priv->calibrate) ){ - DBGOUT(2, "writing to FIFO\n"); + DBGOUT(2, "EVTouch: writing to FIFO\n"); write (priv->fifo, &v0, sizeof(v0)); write (priv->fifo, &v1, sizeof(v1)); } if (!priv->calibrate) { + DBGOUT(2, "EVTouch: Scaling coordinates\n"); xc = v0 - priv->min_x; yc = v1 - priv->min_y; @@ -973,7 +985,6 @@ ConvertProc ( LocalDevicePtr local, (float)(cx[1] * cy[1] * priv->diff[5][1]) + (float)(cx[0] * cy[1] * priv->diff[4][1])); - DBGOUT(2, "TEST: dx=%f dy=%f\n", dx, dy); } else { /* lower @@ -1001,10 +1012,10 @@ ConvertProc ( LocalDevicePtr local, xf86ErrorFVerb(2, "cx[%d]=%f cy[%d]=%f\n", i, cx[i] ,i, cy[i]); - DBGOUT(2, "ViewPort_X0=%d ViewPort_Y0=%d\n", + DBGOUT(2, "EVTouch: ViewPort_X0=%d ViewPort_Y0=%d\n", *(priv->pViewPort_X0), *(priv->pViewPort_Y0)); - DBGOUT(2, "dx=%f dy=%f\n", dx, dy); + DBGOUT(2, "EVTouch: dx=%f dy=%f\n", dx, dy); #endif xc = ( ((float)xc / max_x) * screen_width ) + dx; @@ -1018,38 +1029,43 @@ ConvertProc ( LocalDevicePtr local, if (priv->swap_x == TRUE) xc = screen_width - xc; + int tmp = 0; /* rotation mixes x and y up a bit */ if (priv->rotate == EV_ROTATE_CW) { - v0 = yc; - v1 = screen_width - xc; + tmp = xc; + xc = yc; + yc = screen_width - tmp; } else if (priv->rotate == EV_ROTATE_CCW) { - v0 = screen_height - yc; - v1 = xc; + tmp = xc; + xc = screen_height - yc; + yc = tmp; } switch (rotation) { case RR_Rotate_0: - v0 = xc; - v1 = yc; + v0 = xc; + v1 = yc; break; case RR_Rotate_180: v0 = screen_width - xc; v1 = screen_height - yc; break; case RR_Rotate_90: - v0 = screen_height - yc; - v1 = xc; + tmp = xc; + v0 = screen_height - yc; + v1 = tmp; break; case RR_Rotate_270: + tmp = xc; v0 = yc; - v1 = screen_width - xc; + v1 = screen_width - tmp; break; default: break; } } - DBGOUT(2, "FINAL: v0=%d v1=%d\n", v0, v1); + DBGOUT(2, "EVTouch: FINAL: v0=%d v1=%d\n", v0, v1); *x = v0; *y = v1; @@ -1066,6 +1082,7 @@ EVTouchPreInit(InputDriverPtr drv, IDevPtr dev, int flags) /* LocalDevicePtr local; */ InputInfoPtr local; EVTouchPrivatePtr priv; + ScrnInfoPtr pScrn; int i = 0; char *s; @@ -1088,7 +1105,7 @@ EVTouchPreInit(InputDriverPtr drv, IDevPtr dev, int flags) local->type_name = XI_TOUCHSCREEN; local->device_control = DeviceControl; local->read_input = ReadInput; - local->control_proc = NULL; /* ControlProc; */ + local->control_proc = ControlProc; local->close_proc = CloseProc; local->switch_mode = SwitchMode; local->conversion_proc = ConvertProc; @@ -1107,12 +1124,19 @@ EVTouchPreInit(InputDriverPtr drv, IDevPtr dev, int flags) priv->libtouch = xcalloc(1, sizeof(LibTouchRec)); libtouchInit(priv->libtouch, local); + priv->screen_num = xf86SetIntOption(local->options, "ScreenNumber", 0 ); + priv->calibrate = xf86SetIntOption(local->options, "Calibrate", 0); + + pScrn = xf86Screens[priv->screen_num]; + priv->phys_width = pScrn->currentMode->HDisplay; /* physical screen resolution */ + priv->phys_height = pScrn->currentMode->VDisplay; + priv->min_x = xf86SetIntOption(local->options, "MinX", 0 ); - priv->max_x = xf86SetIntOption(local->options, "MaxX", EV_SCREEN_WIDTH ); + priv->max_x = xf86SetIntOption(local->options, "MaxX", priv->phys_width ); priv->min_y = xf86SetIntOption(local->options, "MinY", 0 ); - priv->max_y = xf86SetIntOption(local->options, "MaxY", EV_SCREEN_HEIGHT ); - priv->screen_num = xf86SetIntOption(local->options, "ScreenNumber", 0 ); + priv->max_y = xf86SetIntOption(local->options, "MaxY", priv->phys_height ); + priv->button_number = xf86SetIntOption(local->options, "ButtonNumber", 2 ); priv->emulate3 = xf86SetBoolOption(local->options, "Emulate3Buttons", TRUE); diff --git a/evtouch.h b/evtouch.h index 8283484..110855b 100644 --- a/evtouch.h +++ b/evtouch.h @@ -40,13 +40,9 @@ * structs, typedefs, #defines, enums *****************************************************************************/ #define EV_ROTATE_NONE 0 -#define EV_ROTATE_CW 1 -#define EV_ROTATE_CCW 2 +#define EV_ROTATE_CW 1 +#define EV_ROTATE_CCW 2 -/* Physical Screen Dimensions. (for default values) - For the Lifebook B Series currently 800x600 pixels */ -#define EV_SCREEN_WIDTH 800 -#define EV_SCREEN_HEIGHT 600 #define EV_AXIS_MIN_RES 0 #define EV_AXIS_MAX_RES 1024 #define EV_PAN_BORDER 12 @@ -140,8 +136,6 @@ typedef struct _EVTouchPrivateRec int cur_x; int cur_y; - int old_x; - int old_y; /* pointers to the current viewport coordinates */ int *pViewPort_X0; /* Min X */ int *pViewPort_X1; /* Max X */ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]