Hello community,
here is the log from the commit of package xorg-x11-driver-input
checked in at Mon Oct 6 16:44:53 CEST 2008.
--------
--- xorg-x11-driver-input/xorg-x11-driver-input.changes 2008-09-29 19:23:05.000000000 +0200
+++ /mounts/work_src_done/STABLE/xorg-x11-driver-input/xorg-x11-driver-input.changes 2008-10-02 05:50:57.867279561 +0200
@@ -1,0 +2,9 @@
+Thu Oct 2 05:49:14 CEST 2008 - sndirsch@suse.de
+
+- xf86-input-mutouch 1.2.1
+ * "mutouch 1.2.0 has issues with the current X server as it does
+ not handle inverted axes (or handles them as inverted even
+ when they aren't). This is fixed now, and I have anecdotal
+ evidence that it even works."
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
xf86-input-mutouch-1.2.0.tar.bz2
New:
----
xf86-input-mutouch-1.2.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xorg-x11-driver-input.spec ++++++
--- /var/tmp/diff_new_pack.M16341/_old 2008-10-06 16:44:34.000000000 +0200
+++ /var/tmp/diff_new_pack.M16341/_new 2008-10-06 16:44:34.000000000 +0200
@@ -23,7 +23,7 @@
BuildRequires: Mesa-devel pkgconfig xorg-x11-proto-devel xorg-x11-server-sdk
Url: http://xorg.freedesktop.org/
Version: 7.4
-Release: 4
+Release: 5
License: X11/MIT
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: System/X11/Servers/XF86_4
@@ -48,7 +48,7 @@
Source16: xf86-input-magictouch-7f90f6a.tar.bz2
Source17: xf86-input-microtouch-1.2.0.tar.bz2
Source18: xf86-input-mouse-1.3.0.tar.bz2
-Source19: xf86-input-mutouch-1.2.0.tar.bz2
+Source19: xf86-input-mutouch-1.2.1.tar.bz2
Source20: xf86-input-palmax-1.2.0.tar.bz2
Source21: xf86-input-penmount-1.3.0.tar.bz2
Source22: xf86-input-spaceorb-1.1.1.tar.bz2
@@ -145,6 +145,12 @@
%{_mandir}/man4/*
%changelog
+* Thu Oct 02 2008 sndirsch@suse.de
+- xf86-input-mutouch 1.2.1
+ * "mutouch 1.2.0 has issues with the current X server as it does
+ not handle inverted axes (or handles them as inverted even
+ when they aren't). This is fixed now, and I have anecdotal
+ evidence that it even works."
* Mon Sep 29 2008 sndirsch@suse.de
- xf86-input-vmmouse-grab.diff
* Grab mouse from kernel if possible. Avoids mouse event
++++++ xf86-input-mutouch-1.2.0.tar.bz2 -> xf86-input-mutouch-1.2.1.tar.bz2 ++++++
++++ 6570 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-mutouch-1.2.0/configure.ac new/xf86-input-mutouch-1.2.1/configure.ac
--- old/xf86-input-mutouch-1.2.0/configure.ac 2008-03-20 21:30:22.000000000 +0100
+++ new/xf86-input-mutouch-1.2.1/configure.ac 2008-10-02 01:40:13.000000000 +0200
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-input-mutouch],
- 1.2.0,
+ 1.2.1,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-input-mutouch)
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-mutouch-1.2.0/src/xf86MuTouch.c new/xf86-input-mutouch-1.2.1/src/xf86MuTouch.c
--- old/xf86-input-mutouch-1.2.0/src/xf86MuTouch.c 2008-03-20 19:55:24.000000000 +0100
+++ new/xf86-input-mutouch-1.2.1/src/xf86MuTouch.c 2008-08-14 08:15:31.000000000 +0200
@@ -1,6 +1,6 @@
/*
* Copyright 1996, 1999 by Patrick Lecoanet, 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
@@ -9,8 +9,8 @@
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Patrick Lecoanet makes no
* representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
+ * is provided "as is" without express or implied warranty.
+ *
* PATRICK LECOANET DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL PATRICK LECOANET BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -49,12 +49,8 @@
#include
#include
-#include "xf86Version.h"
-#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
-#define XFREE86_V4
-#endif
+#include "xorgVersion.h"
-#ifdef XFREE86_V4
#include "misc.h"
#include "xf86.h"
#if !defined(DGUX)
@@ -67,110 +63,8 @@
#include "xf86Module.h"
#endif
-#else /* XFREE86_V4 */
-
-#include
-#include
-#include
-
-#define NEED_EVENTS
-#include
-#include
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include
-#include
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Procs.h"
-#include "xf86_OSlib.h"
-#include "xf86_Config.h"
-#include "xf86Xinput.h"
-
-#include "os.h"
-#include "osdep.h"
-#include "exevents.h"
-
-#include "extnsionst.h"
-#include "extinit.h"
-
-#endif /* XFREE86_V4 */
-#ifndef XFREE86_V4
-/*
- ***************************************************************************
- *
- * Configuration descriptor.
- *
- ***************************************************************************
- */
-#define FINGER_SECTION_NAME "microtouchfinger"
-#define STYLUS_SECTION_NAME "microtouchstylus"
-
-#define PORT 1
-#define DEVICENAME 2
-#define SCREEN_NO 3
-#define MAXX 5
-#define MAXY 6
-#define MINX 7
-#define MINY 8
-#define DEBUG_LEVEL 9
-#define HISTORY_SIZE 10
-#define LINK_SPEED 11
-#define ALWAYS_CORE 12
-#define SWAP_AXES 13
-#define FREQUENCY 14
-#define PORTRAIT_MODE 15
-
-static SymTabRec MuTTab[] = {
- { ENDSUBSECTION, "endsubsection" },
- { PORT, "port" },
- { DEVICENAME, "devicename" },
- { SCREEN_NO, "screenno" },
- { MAXX, "maximumxposition" },
- { MAXY, "maximumyposition" },
- { MINX, "minimumxposition" },
- { MINY, "minimumyposition" },
- { DEBUG_LEVEL, "debuglevel" },
- { HISTORY_SIZE, "historysize" },
- { LINK_SPEED, "linkspeed" },
- { ALWAYS_CORE, "alwayscore" },
- { SWAP_AXES, "swapxy" },
- { FREQUENCY, "frequency" },
- { PORTRAIT_MODE, "portraitmode" },
- { -1, "" },
-};
-
-#define LS300 1
-#define LS1200 2
-#define LS2400 3
-#define LS9600 4
-#define LS19200 5
-
-static SymTabRec LinkSpeedTab[] = {
- { LS300, "b300" },
- { LS1200, "b1200" },
- { LS2400, "b2400" },
- { LS9600, "b9600" },
- { LS19200, "b19200" }
-};
-
-
-typedef struct {
- int speed;
-} LinkParameterStruct;
-
-static LinkParameterStruct LinkSpeedValues[] = {
- { B300 },
- { B1200 },
- { B2400 },
- { B9600 },
- { B19200 }
-};
-#endif /* XFREE86_V4 */
/*
@@ -217,7 +111,7 @@
#define MuT_RESTORE_DEFAULTS "RD" /* Restore factory settings. */
#define MuT_FORMAT_TABLET "FT" /* Report events using tablet format. */
#define MuT_FORMAT_RAW "FR" /* Report events in raw mode (no corrections). */
-#define MuT_CALIBRATE_RAW "CR" /* Calibration in raw mode. */
+#define MuT_CALIBRATE_RAW "CR" /* Calibration in raw mode. */
#define MuT_CALIBRATE_EXT "CX" /* Calibration in extended mode (cooked). */
#define MuT_OUTPUT_IDENT "OI" /* Ask some infos about the firmware. */
#define MuT_UNIT_TYPE "UT" /* Ask some more infos about the firmware. */
@@ -291,7 +185,6 @@
#define DBG(lvl, f)
#endif
-#ifdef XFREE86_V4
#undef SYSCALL
#undef read
#undef write
@@ -300,7 +193,6 @@
#define read(fd, ptr, num) xf86ReadSerial(fd, ptr, num)
#define write(fd, ptr, num) xf86WriteSerial(fd, ptr, num)
#define close(fd) xf86CloseSerial(fd)
-#endif
/*
@@ -313,16 +205,15 @@
#define FINGER_ID 1
#define STYLUS_ID 2
#define DEVICE_ID(flags) ((flags) & 0x03)
-
+
typedef struct _MuTPrivateRec {
char *input_dev; /* The touchscreen input tty */
int min_x; /* Minimum x reported by calibration */
int max_x; /* Maximum x */
int min_y; /* Minimum y reported by calibration */
int max_y; /* Maximum y */
-#ifndef XFREE86_V4
- int link_speed; /* Speed of the RS232 link connecting the ts. */
-#endif
+ int x_inverted; /* X axis inverted? */
+ int y_inverted; /* Y axis inverted? */
int frequency; /* Frequency for ThruGlass */
int screen_no; /* Screen associated with the device */
int screen_width; /* Width of the associated X screen */
@@ -337,257 +228,6 @@
} MuTPrivateRec, *MuTPrivatePtr;
-#ifndef XFREE86_V4
-/*
- ***************************************************************************
- *
- * xf86MuTConfig --
- * Configure the driver from the configuration data.
- *
- ***************************************************************************
- */
-static Bool
-xf86MuTConfig(LocalDevicePtr *array,
- int inx,
- int max,
- LexPtr val)
-{
- LocalDevicePtr local = array[inx];
- MuTPrivatePtr priv = (MuTPrivatePtr)(local->private);
- int token;
- int portrait=0;
-
- while ((token = xf86GetToken(MuTTab)) != ENDSUBSECTION) {
- switch(token) {
-
- case PORT:
- if (xf86GetToken(NULL) != STRING)
- xf86ConfigError("MicroTouch input port expected");
- else {
- /*
- * See if another X device share the same physical
- * device and set up the links so that they share
- * the same private structure (the one that controls
- * the physical device).
- */
- int i;
- for (i = 0; i < max; i++) {
- if (i == inx)
- continue;
- if (array[i]->device_config == xf86MuTConfig &&
- (strcmp(((MuTPrivatePtr) array[i]->private)->input_dev,
- val->str) == 0)) {
- ErrorF("%s MicroTouch config detected a device share between %s and %s\n",
- XCONFIG_GIVEN, local->name, array[i]->name);
- xfree(priv);
- priv = local->private = array[i]->private;
- switch (DEVICE_ID(local->private_flags)) {
- case FINGER_ID:
- priv->finger = local;
- break;
- case STYLUS_ID:
- priv->stylus = local;
- break;
- }
- break;
- }
- }
- if (i == max) {
- priv->input_dev = strdup(val->str);
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s input port: %s\n",
- XCONFIG_GIVEN, local->name, priv->input_dev);
- }
- }
- break;
-
- case DEVICENAME:
- if (xf86GetToken(NULL) != STRING)
- xf86ConfigError("MicroTouch device name expected");
- local->name = strdup(val->str);
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s X device name: %s\n",
- XCONFIG_GIVEN, local->name, local->name);
- break;
-
- case SCREEN_NO:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("MicroTouch screen number expected");
- priv->screen_no = val->num;
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s associated screen: %d\n",
- XCONFIG_GIVEN, local->name, priv->screen_no);
- break;
-
- case LINK_SPEED:
- {
- int ltoken = xf86GetToken(LinkSpeedTab);
- if (ltoken == EOF ||
- ltoken == STRING ||
- ltoken == NUMBER)
- xf86ConfigError("MicroTouch link speed expected");
- priv->link_speed = LinkSpeedValues[ltoken-1].speed;
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s link speed: %s bps\n",
- XCONFIG_GIVEN, local->name, (LinkSpeedTab[ltoken-1].name)+1);
- }
- break;
-
- case MAXX:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("MicroTouch maximum x position expected");
- priv->max_x = val->num;
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s maximum x position: %d\n",
- XCONFIG_GIVEN, local->name, priv->max_x);
- break;
-
- case MAXY:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("MicroTouch maximum y position expected");
- priv->max_y = val->num;
- if (xf86Verbose)
- ErrorF("%s Microtouch %s maximum y position: %d\n",
- XCONFIG_GIVEN, local->name, priv->max_y);
- break;
-
- case MINX:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("MicroTouch minimum x position expected");
- priv->min_x = val->num;
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s minimum x position: %d\n",
- XCONFIG_GIVEN, local->name, priv->min_x);
- break;
-
- case MINY:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("MicroTouch minimum y position expected");
- priv->min_y = val->num;
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s minimum y position: %d\n",
- XCONFIG_GIVEN, local->name, priv->min_y);
- break;
-
- case DEBUG_LEVEL:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("MicroTouch driver debug expected");
- debug_level = val->num;
- if (xf86Verbose) {
-#if DEBUG
- ErrorF("%s MicroTouch %s debug level sets to %d\n", XCONFIG_GIVEN,
- local->name, debug_level);
-#else
- ErrorF("%s MicroTouch %s debug not available\n",
- XCONFIG_GIVEN, local->name, debug_level);
-#endif
- }
- break;
-
- case HISTORY_SIZE:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("MicroTouch motion history size expected");
- local->history_size = val->num;
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s motion history size is %d\n", XCONFIG_GIVEN,
- local->name, local->history_size);
- break;
-
- case FREQUENCY:
- if (xf86GetToken(NULL) != NUMBER)
- xf86ConfigError("MicroTouch ThruGlass frequency expected");
- priv->frequency = val->num;
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s frequency is %d\n", XCONFIG_GIVEN,
- local->name, priv->frequency);
- break;
-
- case ALWAYS_CORE:
- xf86AlwaysCore(local, TRUE);
- if (xf86Verbose)
- ErrorF("%s MicroTouch %s device will always stays core pointer\n",
- XCONFIG_GIVEN, local->name);
- break;
-
- case SWAP_AXES:
- priv->swap_axes = 1;
- if (xf86Verbose) {
- ErrorF("%s Microtouch %s device will work with X and Y axes swapped\n",
- XCONFIG_GIVEN, local->name);
- }
- break;
-
- case PORTRAIT_MODE:
- if (xf86GetToken(NULL) != STRING) {
- portrait_mode_err:
- xf86ConfigError("Microtouch portrait mode should be: Portrait, Landscape or PortraitCCW");
- }
- if (strcmp(val->str, "portrait") == 0) {
- portrait = 1;
- }
- else if (strcmp(val->str, "portraitccw") == 0) {
- portrait = -1;
- }
- else if (strcmp(val->str, "landscape") != 0) {
- goto portrait_mode_err;
- }
- if (xf86Verbose) {
- ErrorF("%s Microtouch %s device will work in %s mode\n",
- XCONFIG_GIVEN, local->name, val->str);
- }
- break;
-
- case EOF:
- FatalError("Unexpected EOF (missing EndSubSection)");
- break;
-
- default:
- xf86ConfigError("MicroTouch subsection keyword expected");
- break;
- }
- }
-
- if (priv->max_x - priv->min_x <=0) {
- ErrorF("%s MicroTouch: reverse x mode (minimum x position >= maximum x position)\n",
- XCONFIG_GIVEN);
- }
- if (priv->max_y - priv->min_y <=0) {
- ErrorF("%s MicroTouch: reverse y mode (minimum y position >= maximum y position)\n",
- XCONFIG_GIVEN);
- }
-
- /*
- * The portrait adjustments need to be done after axis reversing
- * and axes swap. This way the driver can cope with deffective
- * hardware and still do the correct processing depending on the
- * actual display orientation.
- */
- if (portrait == 1) {
- /*
- * Portrait Clockwise: reverse Y axis and exchange X and Y.
- */
- int tmp;
- tmp = priv->min_y;
- priv->min_y = priv->max_y;
- priv->max_y = tmp;
- priv->swap_axes = (priv->swap_axes==0) ? 1 : 0;
- }
- else if (portrait == -1) {
- /*
- * Portrait Counter Clockwise: reverse X axis and exchange X and Y.
- */
- int tmp;
- tmp = priv->min_x;
- priv->min_x = priv->max_x;
- priv->max_x = tmp;
- priv->swap_axes = (priv->swap_axes==0) ? 1 : 0;
- }
-
- DBG(2, ErrorF("xf86MuTConfig port name=%s\n", priv->input_dev))
-
- return Success;
-}
-#endif
/*
@@ -632,15 +272,13 @@
*x = (priv->screen_width * (input_x - priv->min_x)) / width;
*y = (priv->screen_height -
(priv->screen_height * (input_y - priv->min_y)) / height);
-
-#ifdef XFREE86_V4
+
/*
* Need to check if still on the correct screen.
* This call is here so that this work can be done after
* calib and before posting the event.
*/
xf86XInputSetScreen(local, priv->screen_no, *x, *y);
-#endif
return TRUE;
}
@@ -680,9 +318,9 @@
int num_bytes;
int bytes_in_packet;
unsigned char *ptr, *start_ptr;
-
+
DBG(4, ErrorF("Entering ReadInput\n"));
-
+
/*
* Try to get a buffer full of report packets.
*/
@@ -737,19 +375,19 @@
if (bytes_in_packet == 5) {
LocalDevicePtr local_to_use;
-
+
/*
* First stick together the various pieces.
*/
state = start_ptr[0] & 0x7F;
cur_x = WORD_ASSEMBLY(start_ptr[1], start_ptr[2]);
cur_y = WORD_ASSEMBLY(start_ptr[3], start_ptr[4]);
-
+
DBG(3, ErrorF("Packet: 0x%X 0x%X 0x%X 0x%X 0x%X\n",
start_ptr[0], start_ptr[1], start_ptr[2], start_ptr[3], start_ptr[4]));
start_ptr = ptr;
bytes_in_packet = 0;
-
+
/*
* Send events.
*
@@ -770,25 +408,29 @@
if (!local_to_use) {
/*
* We have received an event for a device which we don't care
- * about. Drop it, but whinge first, just in case it's a
+ * about. Drop it, but whinge first, just in case it's a
* misconfiguration.
*/
static int whinged = 0;
if (!whinged) {
whinged++;
- ErrorF("MicroTouch screen sent %s event, but that device is not configured.\n",
+ ErrorF("MicroTouch screen sent %s event, but that device is not configured.\n",
(state & MuT_WHICH_DEVICE)?"stylus":"finger");
ErrorF("You might want to consider altering your config accordingly.\n");
- }
+ }
}
else {
/*
* Emit a motion. If in core pointer mode we need to calibrate
* or we will feed X with quite bogus event positions.
*/
+ if (priv->x_inverted)
+ cur_x = priv->max_x - cur_x;
+ if (priv->y_inverted)
+ cur_y = priv->max_y - cur_y;
xf86PostMotionEvent(local_to_use->dev, TRUE, 0, 2, cur_x, cur_y);
-
+
/*
* Emit a button press or release.
*/
@@ -890,7 +532,7 @@
int num_bytes;
DBG(4, ErrorF("Entering xf86MuTGetReply with buffer_p == %d\n", *buffer_p));
-
+
/*
* Try to read enough bytes to fill up the packet buffer.
*/
@@ -899,7 +541,7 @@
SYSCALL(num_bytes = read(fd,
(char *) (buffer + *buffer_p),
MuT_BUFFER_SIZE - *buffer_p));
-
+
/*
* Okay, give up.
*/
@@ -908,7 +550,7 @@
return !Success;
}
DBG(4, ErrorF("Read %d bytes of reply\n", num_bytes));
-
+
while (num_bytes) {
/*
* Sync with the start of a packet.
@@ -953,24 +595,6 @@
*
***************************************************************************
*/
-#ifndef XFREE86_V4
-static int
-xf86WaitForInput(int fd,
- int timeout)
-{
- fd_set readfds;
- struct timeval to;
- int r;
-
- FD_ZERO(&readfds);
- FD_SET(fd, &readfds);
- to.tv_sec = 0;
- to.tv_usec = timeout;
-
- SYSCALL(r = select(FD_SETSIZE, &readfds, NULL, NULL, &to));
- return r;
-}
-#endif
static Bool
xf86MuTWaitReply(unsigned char *reply,
@@ -985,7 +609,7 @@
i = MuT_MAX_TRIALS;
do {
ok = !Success;
-
+
/*
* Wait half a second for the reply. The fuse counts down each
* timeout and each wrong packet.
@@ -1007,7 +631,7 @@
else {
DBG(3, ErrorF("No answer from port : %d\n", result));
}
-
+
if (result == 0)
i--;
} while(ok != Success && i);
@@ -1036,7 +660,7 @@
int fd)
{
Bool ok;
-
+
if (xf86MuTSendPacket(request, len, fd) == Success) {
ok = xf86MuTWaitReply(reply, fd);
return ok;
@@ -1059,8 +683,7 @@
xf86MuTPrintIdent(unsigned char *packet)
{
int vers, rev;
-
-#ifdef XFREE86_V4
+
xf86Msg(X_PROBED, "MicroTouch touchscreen is a ");
if (strncmp((char *) &packet[1], MuT_TOUCH_PEN_IDENT, 2) == 0) {
xf86Msg(X_NONE, "TouchPen");
@@ -1074,21 +697,6 @@
xf86Msg(X_NONE, ", connected through a serial port.\n");
sscanf((char *) &packet[3], "%2d%2d", &vers, &rev);
xf86Msg(X_PROBED, "MicroTouch controller firmware revision is %d.%d.\n", vers, rev);
-#else
- ErrorF("%s MicroTouch touchscreen is a ", XCONFIG_PROBED);
- if (strncmp((char *) &packet[1], MuT_TOUCH_PEN_IDENT, 2) == 0) {
- ErrorF("TouchPen");
- }
- else if (strncmp((char *) &packet[1], MuT_SMT3_IDENT, 2) == 0) {
- ErrorF("Serial/SMT3");
- }
- else if (strncmp((char *) &packet[1], MuT_THRU_GLASS_IDENT, 2) == 0) {
- ErrorF("ThruGlass");
- }
- ErrorF(", connected through a serial port.\n");
- sscanf((char *) &packet[3], "%2d%2d", &vers, &rev);
- ErrorF("%s MicroTouch controller firmware revision is %d.%d.\n", XCONFIG_PROBED, vers, rev);
-#endif
}
@@ -1104,11 +712,7 @@
static void
xf86MuTPrintHwStatus(unsigned char *packet)
{
-#ifdef XFREE86_V4
xf86Msg(X_PROBED, "MicroTouch status of errors: %c%c.\n", packet[7], packet[8]);
-#else
- ErrorF("%s MicroTouch status of errors: %c%c.\n", XCONFIG_PROBED, packet[7], packet[8]);
-#endif
}
@@ -1145,7 +749,7 @@
unsigned char req[MuT_PACKET_SIZE];
unsigned char reply[MuT_BUFFER_SIZE];
char *id_string = DEVICE_ID(local->private_flags) == FINGER_ID ? "finger" : "stylus";
-
+
switch(mode) {
case DEVICE_INIT:
@@ -1166,7 +770,7 @@
ErrorF("Unable to allocate ButtonClassDeviceStruct\n");
return !Success;
}
-
+
/*
* Device reports motions on 2 axes in absolute coordinates.
* Axes min and max values are reported in raw coordinates.
@@ -1174,7 +778,10 @@
* max and min values scaled from the approximate size of the
* screen to fit one meter.
*/
- if (InitValuatorClassDeviceStruct(dev, 2, xf86GetMotionEvents,
+ if (InitValuatorClassDeviceStruct(dev, 2,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
+ xf86GetMotionEvents,
+#endif
local->history_size, Absolute) == FALSE) {
ErrorF("Unable to allocate ValuatorClassDeviceStruct\n");
return !Success;
@@ -1189,32 +796,29 @@
0 /* min_res */,
10500 /* max_res */);
}
-
+
if (InitFocusClassDeviceStruct(dev) == FALSE) {
ErrorF("Unable to allocate FocusClassDeviceStruct\n");
}
-
+
/*
* Allocate the motion events buffer.
*/
xf86MotionHistoryAllocate(local);
-
+
/*
* This once has caused the server to crash after doing an xalloc & strcpy ??
*/
-#ifndef XFREE86_V4
- AssignTypeAndName(dev, local->atom, local->name);
-#endif
-
+
DBG(2, ErrorF("Done.\n"));
return Success;
}
-
+
case DEVICE_ON:
{
Bool already_open = FALSE;
char *report_what = "";
-
+
DBG(2, ErrorF("MicroTouch %s on...\n", id_string));
/*
@@ -1241,51 +845,20 @@
}
}
if (!already_open) {
-#ifndef XFREE86_V4
- struct termios termios_tty;
- int result;
-#endif
-
+
DBG(2, ErrorF("MicroTouch touchscreen opening : %s\n", priv->input_dev));
-#ifdef XFREE86_V4
local->fd = xf86OpenSerial(local->options);
if (local->fd < 0) {
Error("Unable to open MicroTouch touchscreen device");
return !Success;
}
-#else
- SYSCALL(local->fd = open(priv->input_dev, O_RDWR|O_NDELAY, 0));
- if (local->fd < 0) {
- Error("Unable to open MicroTouch touchscreen device");
- return !Success;
- }
-
- /*
- * Try to see if the link is at the specified rate and
- * reset the controller. The wait time needed by the
- * controller after reset should be compensated by the
- * timeouts in the receive section.
- */
- DBG(3, ErrorF("Try to see if the link is at the specified rate\n"));
- memset(&termios_tty, 0, sizeof(termios_tty));
- termios_tty.c_cflag = priv->link_speed | CS8 | CREAD | CLOCAL;
-#ifdef CRTSCTS
- termios_tty.c_cflag &= ~CRTSCTS;
-#endif
- termios_tty.c_cc[VMIN] = 1;
- SYSCALL(result = tcsetattr(local->fd, TCSANOW, &termios_tty));
- if (result < 0) {
- Error("Unable to configure MicroTouch touchscreen port");
- goto not_success;
- }
-#endif
memset(req, 0, MuT_PACKET_SIZE);
strncpy((char *) &req[1], MuT_RESET, strlen(MuT_RESET));
if (xf86MuTSendCommand(req, strlen(MuT_RESET), NULL, local->fd) != Success) {
DBG(3, ErrorF("Not at the specified rate, giving up\n"));
goto not_success;
}
-
+
/*
* ask the controller to report identity and status.
*/
@@ -1305,7 +878,7 @@
goto not_success;
}
xf86MuTPrintHwStatus(reply);
-
+
/*
* Set the operating mode: Format Tablet, Mode stream, Pen.
*/
@@ -1332,11 +905,7 @@
goto not_success;
}
/* goto not_success;*/
-#ifndef XFREE86_V4
- xf86AddEnabledDevice(local);
-#else
AddEnabledDevice(local->fd);
-#endif
}
/*
@@ -1369,7 +938,7 @@
((strcmp(report_what, MuT_PEN_ONLY) == 0) ? "Pen Only" : "Finger Only"));
goto not_success;
}
- dev->public.on = TRUE;
+ dev->public.on = TRUE;
/*
* Set frequency for ThruGlass
*/
@@ -1385,16 +954,16 @@
}
}
-
+
DBG(2, ErrorF("Done\n"));
return Success;
-
+
not_success:
SYSCALL(close(local->fd));
local->fd = -1;
return !Success;
}
-
+
/*
* Deactivate the device.
*/
@@ -1403,7 +972,7 @@
dev->public.on = FALSE;
DBG(2, ErrorF("Done\n"));
return Success;
-
+
/*
* Final close before server exit. This is used during server shutdown.
* Close the port and free all the resources.
@@ -1412,11 +981,7 @@
DBG(2, ErrorF("MicroTouch %s close...\n", id_string));
dev->public.on = FALSE;
if (local->fd >= 0) {
-#ifdef XFREE86_V4
xf86RemoveEnabledDevice(local);
-#else
- RemoveEnabledDevice(local->fd);
-#endif
SYSCALL(close(local->fd));
local->fd = -1;
/*
@@ -1434,7 +999,7 @@
}
}
}
- DBG(2, ErrorF("Done\n"));
+ DBG(2, ErrorF("Done\n"));
return Success;
default:
@@ -1451,24 +1016,14 @@
***************************************************************************
*/
static LocalDevicePtr
-#ifndef XFREE86_V4
-xf86MuTAllocate(char *name,
- char *type_name,
- int flag)
-#else
xf86MuTAllocate(InputDriverPtr drv,
char *name,
char *type_name,
int flag)
-#endif
{
-#ifndef XFREE86_V4
- LocalDevicePtr local = (LocalDevicePtr) xalloc(sizeof(LocalDeviceRec));
-#else
LocalDevicePtr local = xf86AllocateInput(drv, 0);
-#endif
MuTPrivatePtr priv = (MuTPrivatePtr) xalloc(sizeof(MuTPrivateRec));
-
+
if (!local) {
if (priv) {
xfree(priv);
@@ -1483,9 +1038,6 @@
}
priv->input_dev = strdup(MuT_PORT);
-#ifndef XFREE86_V4
- priv->link_speed = MuT_LINK_SPEED;
-#endif
priv->min_x = 0;
priv->max_x = 0;
priv->min_y = 0;
@@ -1500,12 +1052,9 @@
priv->finger = NULL;
priv->swap_axes = 0;
priv->frequency = 0;
-
+
local->name = name;
local->flags = 0 /* XI86_NO_OPEN_ON_INIT */;
-#ifndef XFREE86_V4
- local->device_config = xf86MuTConfig;
-#endif
local->device_control = xf86MuTControl;
local->read_input = xf86MuTReadInput;
local->control_proc = NULL;
@@ -1520,7 +1069,7 @@
local->private_flags = flag;
local->type_name = type_name;
local->history_size = 0;
-
+
return local;
}
@@ -1533,22 +1082,14 @@
***************************************************************************
*/
static LocalDevicePtr
-#ifndef XFREE86_V4
-xf86MuTAllocateFinger(void)
-#else
-xf86MuTAllocateFinger(InputDriverPtr drv)
-#endif
+xf86MuTAllocateFinger(InputDriverPtr drv)
{
-#ifndef XFREE86_V4
- LocalDevicePtr local = xf86MuTAllocate(XI_FINGER, "MicroTouch Finger", FINGER_ID);
-#else
LocalDevicePtr local = xf86MuTAllocate(drv, XI_FINGER, "MicroTouch Finger", FINGER_ID);
-#endif
if (local) {
((MuTPrivatePtr) local->private)->finger = local;
}
- return local;
+ return local;
}
@@ -1560,17 +1101,9 @@
***************************************************************************
*/
static LocalDevicePtr
-#ifndef XFREE86_V4
-xf86MuTAllocateStylus(void)
-#else
-xf86MuTAllocateStylus(InputDriverPtr drv)
-#endif
+xf86MuTAllocateStylus(InputDriverPtr drv)
{
-#ifndef XFREE86_V4
- LocalDevicePtr local = xf86MuTAllocate(XI_STYLUS, "MicroTouch Stylus", STYLUS_ID);
-#else
LocalDevicePtr local = xf86MuTAllocate(drv, XI_STYLUS, "MicroTouch Stylus", STYLUS_ID);
-#endif
if (local) {
((MuTPrivatePtr) local->private)->stylus = local;
@@ -1579,70 +1112,13 @@
}
-#ifndef XFREE86_V4
-/*
- ***************************************************************************
- *
- * MicroTouch finger device association --
- *
- ***************************************************************************
- */
-DeviceAssocRec MuT_finger_assoc =
-{
- FINGER_SECTION_NAME, /* config_section_name */
- xf86MuTAllocateFinger /* device_allocate */
-};
-
-/*
- ***************************************************************************
- *
- * MicroTouch stylus device association --
- *
- ***************************************************************************
- */
-DeviceAssocRec MuT_stylus_assoc =
-{
- STYLUS_SECTION_NAME, /* config_section_name */
- xf86MuTAllocateStylus /* device_allocate */
-};
-
-
-#ifdef DYNAMIC_MODULE
-/*
- ***************************************************************************
- *
- * entry point of dynamic loading
- *
- ***************************************************************************
- */
-int
-#ifndef DLSYM_BUG
-init_module(unsigned long server_version)
-#else
-init_xf86MuTouch(unsigned long server_version)
-#endif
-{
- xf86AddDeviceAssoc(&MuT_finger_assoc);
- xf86AddDeviceAssoc(&MuT_stylus_assoc);
-
- if (server_version != XF86_VERSION_CURRENT) {
- ErrorF("Warning: MicroTouch module compiled for version%s\n", XF86_VERSION);
- return 0;
- }
- else {
- return 1;
- }
-}
-#endif
-
-#else /* XFREE86_V4 */
static void
xf86MuTUninit(InputDriverPtr drv,
LocalDevicePtr local,
int flags)
{
MuTPrivatePtr priv = (MuTPrivatePtr) local->private;
-
+
xf86MuTControl(local->dev, DEVICE_OFF);
if (priv) {
@@ -1683,7 +1159,7 @@
goto init_err;
}
fake_local->conf_idev = dev;
-
+
xf86CollectInputOptions(fake_local, default_options, NULL);
str = xf86FindOptionValue(fake_local->options, "Type");
@@ -1706,7 +1182,7 @@
local->conf_idev = fake_local->conf_idev;
xfree(fake_local);
fake_local = NULL;
-
+
str = xf86FindOptionValue(local->options, "Device");
if (!str) {
xf86Msg(X_ERROR, "%s: No Device specified in Microtouch module config.\n",
@@ -1749,14 +1225,14 @@
/* Process the common options. */
xf86ProcessCommonOptions(local, local->options);
-
+
str = xf86FindOptionValue(local->options, "DeviceName");
if (str) {
local->name = strdup(str);
}
- xf86Msg(X_CONFIG, "Microtouch X device name: %s\n", local->name);
+ xf86Msg(X_CONFIG, "Microtouch X device name: %s\n", local->name);
priv->screen_no = xf86SetIntOption(local->options, "ScreenNo", 0);
- xf86Msg(X_CONFIG, "Microtouch associated screen: %d\n", priv->screen_no);
+ xf86Msg(X_CONFIG, "Microtouch associated screen: %d\n", priv->screen_no);
priv->max_x = xf86SetIntOption(local->options, "MaxX", 3000);
xf86Msg(X_CONFIG, "Microtouch maximum x position: %d\n", priv->max_x);
priv->min_x = xf86SetIntOption(local->options, "MinX", 0);
@@ -1775,9 +1251,9 @@
debug_level = xf86SetIntOption(local->options, "DebugLevel", 0);
if (debug_level) {
#if DEBUG
- xf86Msg(X_CONFIG, "Microtouch debug level sets to %d\n", debug_level);
+ xf86Msg(X_CONFIG, "Microtouch debug level sets to %d\n", debug_level);
#else
- xf86Msg(X_INFO, "Microtouch debug not available\n");
+ xf86Msg(X_INFO, "Microtouch debug not available\n");
#endif
}
str = xf86SetStrOption(local->options, "PortraitMode", "Landscape");
@@ -1791,14 +1267,27 @@
xf86Msg(X_ERROR, "Microtouch portrait mode should be: Portrait, Landscape or PortraitCCW");
str = "Landscape";
}
- xf86Msg(X_CONFIG, "Microtouch device will work in %s mode\n", str);
-
+ xf86Msg(X_CONFIG, "Microtouch device will work in %s mode\n", str);
+
if (priv->max_x - priv->min_x <= 0) {
+ int tmp;
xf86Msg(X_INFO, "MicroTouch: reverse x mode (minimum x position >= maximum x position)\n");
- }
+ tmp = priv->max_x; /* X server doesn't do inverted by itself*/
+ priv->max_x = priv->min_x;
+ priv->min_x = tmp;
+ priv->x_inverted = TRUE;
+ } else
+ priv->x_inverted = FALSE;
+
if (priv->max_y - priv->min_y <= 0) {
- xf86Msg(X_INFO, "MicroTouch: reverse y mode (minimum y position >= maximum y position)\n");
- }
+ int tmp;
+ xf86Msg(X_INFO, "MicroTouch: reverse y mode (minimum y position >= maximum y position)\n");
+ tmp = priv->max_y;
+ priv->max_y = priv->min_y;
+ priv->min_y = tmp;
+ priv->y_inverted = TRUE;
+ } else
+ priv->y_inverted = FALSE;
if (portrait == 1) {
/*
@@ -1890,4 +1379,3 @@
_X_EXPORT XF86ModuleData mutouchModuleData = { &version_rec, Plug, Unplug };
#endif
-#endif /* XFREE86_V4 */
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org