diff -urN xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.c xc/programs/Xserver/hw/xfree86/input/acecad/acecad.c --- xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.c 2004-04-12 15:24:40.000000000 -0400 +++ xc/programs/Xserver/hw/xfree86/input/acecad/acecad.c 2004-04-12 15:29:18.000000000 -0400 @@ -1,7 +1,10 @@ /* - * Copyright (c) 2001 Edouard TISSERANT + * Copyright (c) 2001 Edouard TISSERANT * Parts inspired from Shane Watts XFree86 3 Acecad Driver * Thanks to Emily, from AceCad, For giving me documents. + * + * Modified by Carlo Vittoli for compatibility with + * the A-Series tablet. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -131,6 +134,11 @@ } #endif +/* AceCad buttons scheme as is */ +static int acecadButtonMap[8] = {0, 1, 2, 3, 4, 5, 6, 7}; +/* Maps to standard mouse scheme (at least for a1212) */ +static int standardButtonMap[8] = {0, 1, 4, 3, 2, 5, 6, 7}; + static const char *default_options[] = { "BaudRate", "9600", @@ -205,6 +213,26 @@ } xf86ErrorFVerb( 6, "tty port opened successfully\n" ); + s = xf86FindOptionValue(local->options, "Model"); + if (s && (xf86NameCmp(s, "Flair") == 0)) { + priv->packet_size = FLAIR_PACKET_SIZE; + } + else if (s && (xf86NameCmp(s, "A-Series") == 0)) { + priv->packet_size = A_SERIES_PACKET_SIZE; + } + else { + if (s) { + xf86Msg(X_ERROR, "%s: invalid model (should be " + "Flair or A-Series).\n", + local->name); + goto SetupProc_fail; + } + /* this should work anyway */ + priv->packet_size = FLAIR_PACKET_SIZE; + } + xf86Msg(X_CONFIG, "%s Tablet model is %s \n", local->name, + s ? s: "unspecified"); + #ifdef LINUX_INPUT if(IsUSBLine(local->fd)){ priv->acecadUSB=1; @@ -245,7 +273,7 @@ xf86Msg(X_CONFIG, "Acecad Tablet: ReportSpeed possible values:\n 120, 85, 10, 2 \n"); } - xf86Msg(X_CONFIG, "Acecad Tablet report %d points/s\n", speed); + xf86Msg(X_CONFIG, "Acecad Tablet reports %d points/s\n", speed); priv->buffer = XisbNew (local->fd, 200); @@ -272,6 +300,24 @@ xf86Msg(X_CONFIG, "Acecad Tablet is in %s mode\n",(priv->flags & ABSOLUTE_FLAG) ? "absolute" : "relative"); DBG (9, XisbTrace (priv->buffer, 1)); + s = xf86FindOptionValue(local->options, "ButtonMap"); + if (s && (xf86NameCmp(s, "AceCad") == 0)) { + priv->buttonMap = acecadButtonMap; + } + else if (s && (xf86NameCmp(s, "Standard") == 0)) { + priv->buttonMap = standardButtonMap; + } + else { + if (s) { + xf86Msg(X_ERROR, "%s: invalid ButtonMap (should be " + "AceCad or Standard). Using default.\n", + local->name); + } + priv->buttonMap = standardButtonMap; + } + xf86Msg(X_CONFIG, "%s Tablet is using %s button map\n", local->name, + (xf86NameCmp(s, "AceCad") == 0) ? "AceCad" : "standard"); + local->history_size = xf86SetIntOption(local->options , "HistorySize", 0); xf86ProcessCommonOptions(local, local->options); @@ -316,8 +362,7 @@ switch (mode) { case DEVICE_INIT: - DeviceInit (dev); - RetValue = Success; + RetValue = DeviceInit (dev); break; case DEVICE_ON: RetValue = DeviceOn( dev ); diff -urN xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.h xc/programs/Xserver/hw/xfree86/input/acecad/acecad.h --- xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.h 2004-04-12 15:24:40.000000000 -0400 +++ xc/programs/Xserver/hw/xfree86/input/acecad/acecad.h 2004-04-12 15:28:53.000000000 -0400 @@ -1,7 +1,10 @@ /* - * Copyright (c) 2001 Edouard TISSERANT - * Parts inspired from Shane Watts Xfree 3 Acecad Driver + * Copyright (c) 2001 Edouard TISSERANT + * Parts inspired from Shane Watts XFree86 3 Acecad Driver * Thanks to Emily, from AceCad, For giving me documents. + * + * Modified by Carlo Vittoli for compatibility with + * the A-Series tablet. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -33,6 +36,8 @@ * structs, typedefs, #defines, enums *****************************************************************************/ #define ACECAD_PACKET_SIZE 7 +#define FLAIR_PACKET_SIZE 7 +#define A_SERIES_PACKET_SIZE 5 #define ACECAD_CONFIG "a" /* Send configuration (max coords) */ @@ -81,6 +86,8 @@ int flags; /* various flags */ int packeti; /* number of bytes read */ int PacketSize; /* number of bytes read */ + int *buttonMap; /* defines button mapping */ + int packet_size; /* model-specific */ unsigned char packet[ACECAD_PACKET_SIZE]; /* data read on the device */ } AceCadPrivateRec, *AceCadPrivatePtr; diff -urN xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.man xc/programs/Xserver/hw/xfree86/input/acecad/acecad.man --- xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.man 2004-04-12 15:24:40.000000000 -0400 +++ xc/programs/Xserver/hw/xfree86/input/acecad/acecad.man 2004-04-12 15:28:53.000000000 -0400 @@ -3,7 +3,7 @@ .ds q \N'34' .TH ACECAD __drivermansuffix__ __vendorversion__ .SH NAME -acecad \- Acecad Flair input driver +acecad \- Acecad input driver .SH SYNOPSIS .B "Section \*qInputDevice\*q" .br @@ -24,17 +24,37 @@ .B acecad driver functions as a pointer input device, and may be used as the X server's core pointer. -THIS MAN PAGE NEEDS TO BE FILLED IN. .SH SUPPORTED HARDWARE -What is supported... +This driver supports the Flair and A-Series tablets. .SH CONFIGURATION DETAILS Please refer to __xconfigfile__(__filemansuffix__) for general configuration details and for options that can be used with all input drivers. This section only covers configuration details specific to this driver. .PP -Config details... +.RS 8 +.TP 4 +.B Option \fI"Device"\fP \fI"path"\fP +sets the path to the special file which represents serial line where +the tablet is plugged. This option is mandatory. +.TP 4 +.B Option \fI"Model"\fP \fI"Flair"|"A-Series"\fP +selects the tablet model. Default is Flair. +.TP 4 +.B Option \fI"Mode"\fP \fI"Relative"|"Absolute"\fP +sets the mode of the device. Default is Absolute. +.TP 4 +.B Option \fI"ReportSpeed"\fP \fI"2"|"10"|"85"|"120"\fP +sets the report speed of the device. Default is 85. +.TP 4 +.B Option \fI"ButtonMap"\fP \fI"Standard"|"Acecad"\fP +sets the button mapping (only tested for the A-Series tablet). Standard mapping+is similar to a standard mouse. Acecad mapping is an identity transformation; +if you want the same button mapping as in Xfree86 version 3, use this option. +Default is Standard. .SH "SEE ALSO" __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__). .SH AUTHORS -Authors include... -Edouard TISSERANT +.br +Edouard Tisserant , original driver for +Flair tablet +.br +Carlo Vittoli , modifications for A-Series tablet