Contents of /trunk/xorg-old/patches-6.8.2-r10/5900_all_6.7.0-acecad-v2.patch
Parent Directory | Revision Log
Revision 167 -
(show annotations)
(download)
Tue May 8 20:58:51 2007 UTC (17 years, 4 months ago) by niro
File size: 7366 byte(s)
Tue May 8 20:58:51 2007 UTC (17 years, 4 months ago) by niro
File size: 7366 byte(s)
-import
1 | diff -urN xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.c xc/programs/Xserver/hw/xfree86/input/acecad/acecad.c |
2 | --- xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.c 2004-04-12 15:24:40.000000000 -0400 |
3 | +++ xc/programs/Xserver/hw/xfree86/input/acecad/acecad.c 2004-04-12 15:29:18.000000000 -0400 |
4 | @@ -1,7 +1,10 @@ |
5 | /* |
6 | - * Copyright (c) 2001 Edouard TISSERANT <tissered@esstin.u-nancy.fr> |
7 | + * Copyright (c) 2001 Edouard TISSERANT <edouard.tisserant@wanadoo.fr> |
8 | * Parts inspired from Shane Watts <shane@bofh.asn.au> XFree86 3 Acecad Driver |
9 | * Thanks to Emily, from AceCad, For giving me documents. |
10 | + * |
11 | + * Modified by Carlo Vittoli <carlo@abila.it> for compatibility with |
12 | + * the A-Series tablet. |
13 | * |
14 | * Permission is hereby granted, free of charge, to any person obtaining a |
15 | * copy of this software and associated documentation files (the "Software"), |
16 | @@ -131,6 +134,11 @@ |
17 | } |
18 | #endif |
19 | |
20 | +/* AceCad buttons scheme as is */ |
21 | +static int acecadButtonMap[8] = {0, 1, 2, 3, 4, 5, 6, 7}; |
22 | +/* Maps to standard mouse scheme (at least for a1212) */ |
23 | +static int standardButtonMap[8] = {0, 1, 4, 3, 2, 5, 6, 7}; |
24 | + |
25 | static const char *default_options[] = |
26 | { |
27 | "BaudRate", "9600", |
28 | @@ -205,6 +213,26 @@ |
29 | } |
30 | xf86ErrorFVerb( 6, "tty port opened successfully\n" ); |
31 | |
32 | + s = xf86FindOptionValue(local->options, "Model"); |
33 | + if (s && (xf86NameCmp(s, "Flair") == 0)) { |
34 | + priv->packet_size = FLAIR_PACKET_SIZE; |
35 | + } |
36 | + else if (s && (xf86NameCmp(s, "A-Series") == 0)) { |
37 | + priv->packet_size = A_SERIES_PACKET_SIZE; |
38 | + } |
39 | + else { |
40 | + if (s) { |
41 | + xf86Msg(X_ERROR, "%s: invalid model (should be " |
42 | + "Flair or A-Series).\n", |
43 | + local->name); |
44 | + goto SetupProc_fail; |
45 | + } |
46 | + /* this should work anyway */ |
47 | + priv->packet_size = FLAIR_PACKET_SIZE; |
48 | + } |
49 | + xf86Msg(X_CONFIG, "%s Tablet model is %s \n", local->name, |
50 | + s ? s: "unspecified"); |
51 | + |
52 | #ifdef LINUX_INPUT |
53 | if(IsUSBLine(local->fd)){ |
54 | priv->acecadUSB=1; |
55 | @@ -245,7 +273,7 @@ |
56 | xf86Msg(X_CONFIG, "Acecad Tablet: ReportSpeed possible values:\n 120, 85, 10, 2 \n"); |
57 | } |
58 | |
59 | - xf86Msg(X_CONFIG, "Acecad Tablet report %d points/s\n", speed); |
60 | + xf86Msg(X_CONFIG, "Acecad Tablet reports %d points/s\n", speed); |
61 | |
62 | priv->buffer = XisbNew (local->fd, 200); |
63 | |
64 | @@ -272,6 +300,24 @@ |
65 | xf86Msg(X_CONFIG, "Acecad Tablet is in %s mode\n",(priv->flags & ABSOLUTE_FLAG) ? "absolute" : "relative"); |
66 | DBG (9, XisbTrace (priv->buffer, 1)); |
67 | |
68 | + s = xf86FindOptionValue(local->options, "ButtonMap"); |
69 | + if (s && (xf86NameCmp(s, "AceCad") == 0)) { |
70 | + priv->buttonMap = acecadButtonMap; |
71 | + } |
72 | + else if (s && (xf86NameCmp(s, "Standard") == 0)) { |
73 | + priv->buttonMap = standardButtonMap; |
74 | + } |
75 | + else { |
76 | + if (s) { |
77 | + xf86Msg(X_ERROR, "%s: invalid ButtonMap (should be " |
78 | + "AceCad or Standard). Using default.\n", |
79 | + local->name); |
80 | + } |
81 | + priv->buttonMap = standardButtonMap; |
82 | + } |
83 | + xf86Msg(X_CONFIG, "%s Tablet is using %s button map\n", local->name, |
84 | + (xf86NameCmp(s, "AceCad") == 0) ? "AceCad" : "standard"); |
85 | + |
86 | local->history_size = xf86SetIntOption(local->options , "HistorySize", 0); |
87 | |
88 | xf86ProcessCommonOptions(local, local->options); |
89 | @@ -316,8 +362,7 @@ |
90 | switch (mode) |
91 | { |
92 | case DEVICE_INIT: |
93 | - DeviceInit (dev); |
94 | - RetValue = Success; |
95 | + RetValue = DeviceInit (dev); |
96 | break; |
97 | case DEVICE_ON: |
98 | RetValue = DeviceOn( dev ); |
99 | diff -urN xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.h xc/programs/Xserver/hw/xfree86/input/acecad/acecad.h |
100 | --- xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.h 2004-04-12 15:24:40.000000000 -0400 |
101 | +++ xc/programs/Xserver/hw/xfree86/input/acecad/acecad.h 2004-04-12 15:28:53.000000000 -0400 |
102 | @@ -1,7 +1,10 @@ |
103 | /* |
104 | - * Copyright (c) 2001 Edouard TISSERANT <tissered@esstin.u-nancy.fr> |
105 | - * Parts inspired from Shane Watts <shane@bofh.asn.au> Xfree 3 Acecad Driver |
106 | + * Copyright (c) 2001 Edouard TISSERANT <edouard.tisserant@wanadoo.fr> |
107 | + * Parts inspired from Shane Watts <shane@bofh.asn.au> XFree86 3 Acecad Driver |
108 | * Thanks to Emily, from AceCad, For giving me documents. |
109 | + * |
110 | + * Modified by Carlo Vittoli <carlo@abila.it> for compatibility with |
111 | + * the A-Series tablet. |
112 | * |
113 | * Permission is hereby granted, free of charge, to any person obtaining a |
114 | * copy of this software and associated documentation files (the "Software"), |
115 | @@ -33,6 +36,8 @@ |
116 | * structs, typedefs, #defines, enums |
117 | *****************************************************************************/ |
118 | #define ACECAD_PACKET_SIZE 7 |
119 | +#define FLAIR_PACKET_SIZE 7 |
120 | +#define A_SERIES_PACKET_SIZE 5 |
121 | |
122 | #define ACECAD_CONFIG "a" /* Send configuration (max coords) */ |
123 | |
124 | @@ -81,6 +86,8 @@ |
125 | int flags; /* various flags */ |
126 | int packeti; /* number of bytes read */ |
127 | int PacketSize; /* number of bytes read */ |
128 | + int *buttonMap; /* defines button mapping */ |
129 | + int packet_size; /* model-specific */ |
130 | unsigned char packet[ACECAD_PACKET_SIZE]; /* data read on the device */ |
131 | } AceCadPrivateRec, *AceCadPrivatePtr; |
132 | |
133 | diff -urN xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.man xc/programs/Xserver/hw/xfree86/input/acecad/acecad.man |
134 | --- xc.orig/programs/Xserver/hw/xfree86/input/acecad/acecad.man 2004-04-12 15:24:40.000000000 -0400 |
135 | +++ xc/programs/Xserver/hw/xfree86/input/acecad/acecad.man 2004-04-12 15:28:53.000000000 -0400 |
136 | @@ -3,7 +3,7 @@ |
137 | .ds q \N'34' |
138 | .TH ACECAD __drivermansuffix__ __vendorversion__ |
139 | .SH NAME |
140 | -acecad \- Acecad Flair input driver |
141 | +acecad \- Acecad input driver |
142 | .SH SYNOPSIS |
143 | .B "Section \*qInputDevice\*q" |
144 | .br |
145 | @@ -24,17 +24,37 @@ |
146 | .B acecad |
147 | driver functions as a pointer input device, and may be used as the |
148 | X server's core pointer. |
149 | -THIS MAN PAGE NEEDS TO BE FILLED IN. |
150 | .SH SUPPORTED HARDWARE |
151 | -What is supported... |
152 | +This driver supports the Flair and A-Series tablets. |
153 | .SH CONFIGURATION DETAILS |
154 | Please refer to __xconfigfile__(__filemansuffix__) for general configuration |
155 | details and for options that can be used with all input drivers. This |
156 | section only covers configuration details specific to this driver. |
157 | .PP |
158 | -Config details... |
159 | +.RS 8 |
160 | +.TP 4 |
161 | +.B Option \fI"Device"\fP \fI"path"\fP |
162 | +sets the path to the special file which represents serial line where |
163 | +the tablet is plugged. This option is mandatory. |
164 | +.TP 4 |
165 | +.B Option \fI"Model"\fP \fI"Flair"|"A-Series"\fP |
166 | +selects the tablet model. Default is Flair. |
167 | +.TP 4 |
168 | +.B Option \fI"Mode"\fP \fI"Relative"|"Absolute"\fP |
169 | +sets the mode of the device. Default is Absolute. |
170 | +.TP 4 |
171 | +.B Option \fI"ReportSpeed"\fP \fI"2"|"10"|"85"|"120"\fP |
172 | +sets the report speed of the device. Default is 85. |
173 | +.TP 4 |
174 | +.B Option \fI"ButtonMap"\fP \fI"Standard"|"Acecad"\fP |
175 | +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; |
176 | +if you want the same button mapping as in Xfree86 version 3, use this option. |
177 | +Default is Standard. |
178 | .SH "SEE ALSO" |
179 | __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__). |
180 | .SH AUTHORS |
181 | -Authors include... |
182 | -Edouard TISSERANT |
183 | +.br |
184 | +Edouard Tisserant <edouard.tisserant@wanadoo.fr>, original driver for |
185 | +Flair tablet |
186 | +.br |
187 | +Carlo Vittoli <carlo@abila.it>, modifications for A-Series tablet |