Commit 2fa1308110639d89c63a197efb53bd3b3791a51f
- Diff rendering mode:
- inline
- side by side
src/wcmCommon.c
(5 / 5)
|   | |||
| 1088 | 1088 | } | |
| 1089 | 1089 | ||
| 1090 | 1090 | /***************************************************************************** | |
| 1091 | * xf86WcmEvent - | ||
| 1091 | * wcmEvent - | ||
| 1092 | 1092 | * Handles suppression, transformation, filtering, and event dispatch. | |
| 1093 | 1093 | ****************************************************************************/ | |
| 1094 | 1094 | ||
| 1095 | void xf86WcmEvent(WacomCommonPtr common, unsigned int channel, | ||
| 1095 | void wcmEvent(WacomCommonPtr common, unsigned int channel, | ||
| 1096 | 1096 | const WacomDeviceState* pState) | |
| 1097 | 1097 | { | |
| 1098 | 1098 | WacomDeviceState* pLast; | |
| … | … | ||
| 1104 | 1104 | pChannel = common->wcmChannel + channel; | |
| 1105 | 1105 | pLast = &pChannel->valid.state; | |
| 1106 | 1106 | ||
| 1107 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmEvent at channel = %d\n", channel)); | ||
| 1107 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmEvent at channel = %d\n", channel)); | ||
| 1108 | 1108 | ||
| 1109 | 1109 | /* sanity check the channel */ | |
| 1110 | 1110 | if (channel >= MAX_CHANNELS) | |
| … | … | ||
| 1116 | 1116 | ||
| 1117 | 1117 | /* timestamp the state for velocity and acceleration analysis */ | |
| 1118 | 1118 | ds.sample = (int)GetTimeInMillis(); | |
| 1119 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmEvent: " | ||
| 1119 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmEvent: " | ||
| 1120 | 1120 | "c=%d i=%d t=%d s=%u x=%d y=%d b=%d " | |
| 1121 | 1121 | "p=%d rz=%d tx=%d ty=%d aw=%d rw=%d " | |
| 1122 | 1122 | "t=%d df=%d px=%d st=%d cs=%d \n", | |
| … | … | ||
| 1423 | 1423 | * access errors to the device */ | |
| 1424 | 1424 | if (pDev && !miPointerGetScreen(pDev->dev)) | |
| 1425 | 1425 | { | |
| 1426 | xf86Msg(X_ERROR, "xf86WcmEvent: Wacom driver can not get Current Screen ID\n"); | ||
| 1426 | xf86Msg(X_ERROR, "wcmEvent: Wacom driver can not get Current Screen ID\n"); | ||
| 1427 | 1427 | xf86Msg(X_ERROR, "Please remove Wacom tool from the tablet and bring it back again.\n"); | |
| 1428 | 1428 | return; | |
| 1429 | 1429 | } |
src/wcmFilter.c
(9 / 9)
|   | |||
| 36 | 36 | static void filterIntuosStylus(WacomCommonPtr common, WacomFilterStatePtr state, WacomDeviceStatePtr ds); | |
| 37 | 37 | ||
| 38 | 38 | /***************************************************************************** | |
| 39 | * xf86WcmSetPressureCurve -- apply user-defined curve to pressure values | ||
| 39 | * wcmSetPressureCurve -- apply user-defined curve to pressure values | ||
| 40 | 40 | ****************************************************************************/ | |
| 41 | 41 | ||
| 42 | void xf86WcmSetPressureCurve(WacomDevicePtr pDev, int x0, int y0, | ||
| 42 | void wcmSetPressureCurve(WacomDevicePtr pDev, int x0, int y0, | ||
| 43 | 43 | int x1, int y1) | |
| 44 | 44 | { | |
| 45 | 45 | int i; | |
| … | … | ||
| 55 | 55 | (FILTER_PRESSURE_RES + 1)); | |
| 56 | 56 | if (!pDev->pPressCurve) | |
| 57 | 57 | { | |
| 58 | xf86Msg(X_ERROR, "%s: xf86WcmSetPressureCurve: failed to " | ||
| 58 | xf86Msg(X_ERROR, "%s: wcmSetPressureCurve: failed to " | ||
| 59 | 59 | "allocate memory for curve\n", pDev->local->name); | |
| 60 | 60 | return; | |
| 61 | 61 | } | |
| … | … | ||
| 236 | 236 | } | |
| 237 | 237 | ||
| 238 | 238 | /***************************************************************************** | |
| 239 | * xf86WcmFilterCoord -- provide noise correction to all transducers | ||
| 239 | * wcmFilterCoord -- provide noise correction to all transducers | ||
| 240 | 240 | ****************************************************************************/ | |
| 241 | 241 | ||
| 242 | int xf86WcmFilterCoord(WacomCommonPtr common, WacomChannelPtr pChannel, | ||
| 242 | int wcmFilterCoord(WacomCommonPtr common, WacomChannelPtr pChannel, | ||
| 243 | 243 | WacomDeviceStatePtr ds) | |
| 244 | 244 | { | |
| 245 | 245 | /* Only noise correction should happen here. If there's a problem that | |
| … | … | ||
| 248 | 248 | WacomDeviceState *pLast; | |
| 249 | 249 | int *x, *y, i; | |
| 250 | 250 | ||
| 251 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmFilterCoord with " | ||
| 251 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmFilterCoord with " | ||
| 252 | 252 | "common->wcmRawSample = %d \n", common->wcmRawSample)); | |
| 253 | 253 | x = pChannel->rawFilter.x; | |
| 254 | 254 | y = pChannel->rawFilter.y; | |
| … | … | ||
| 269 | 269 | } | |
| 270 | 270 | ||
| 271 | 271 | /***************************************************************************** | |
| 272 | * xf86WcmFilterIntuos -- provide error correction to Intuos and Intuos2 | ||
| 272 | * wcmFilterIntuos -- provide error correction to Intuos and Intuos2 | ||
| 273 | 273 | ****************************************************************************/ | |
| 274 | 274 | ||
| 275 | int xf86WcmFilterIntuos(WacomCommonPtr common, WacomChannelPtr pChannel, | ||
| 275 | int wcmFilterIntuos(WacomCommonPtr common, WacomChannelPtr pChannel, | ||
| 276 | 276 | WacomDeviceStatePtr ds) | |
| 277 | 277 | { | |
| 278 | 278 | /* Only error correction should happen here. If there's a problem that | |
| … | … | ||
| 281 | 281 | if (ds->device_type != CURSOR_ID) | |
| 282 | 282 | filterIntuosStylus(common, &pChannel->rawFilter, ds); | |
| 283 | 283 | else | |
| 284 | xf86WcmFilterCoord(common, pChannel, ds); | ||
| 284 | wcmFilterCoord(common, pChannel, ds); | ||
| 285 | 285 | ||
| 286 | 286 | return 0; /* lookin' good */ | |
| 287 | 287 | } |
src/wcmFilter.h
(3 / 3)
|   | |||
| 24 | 24 | ||
| 25 | 25 | /****************************************************************************/ | |
| 26 | 26 | ||
| 27 | void xf86WcmSetPressureCurve(WacomDevicePtr pDev, int x0, int y0, | ||
| 27 | void wcmSetPressureCurve(WacomDevicePtr pDev, int x0, int y0, | ||
| 28 | 28 | int x1, int y1); | |
| 29 | int xf86WcmFilterIntuos(WacomCommonPtr common, WacomChannelPtr pChannel, | ||
| 29 | int wcmFilterIntuos(WacomCommonPtr common, WacomChannelPtr pChannel, | ||
| 30 | 30 | WacomDeviceStatePtr ds); | |
| 31 | int xf86WcmFilterCoord(WacomCommonPtr common, WacomChannelPtr pChannel, | ||
| 31 | int wcmFilterCoord(WacomCommonPtr common, WacomChannelPtr pChannel, | ||
| 32 | 32 | WacomDeviceStatePtr ds); | |
| 33 | 33 | ||
| 34 | 34 | /****************************************************************************/ |
src/wcmISDV4.c
(21 / 21)
|   | |||
| 35 | 35 | static int isdv4GetRanges(LocalDevicePtr); | |
| 36 | 36 | static int isdv4StartTablet(LocalDevicePtr); | |
| 37 | 37 | static int isdv4Parse(LocalDevicePtr, const unsigned char* data); | |
| 38 | static int xf86WcmSerialValidate(WacomCommonPtr common, const unsigned char* data); | ||
| 39 | static int xf86WcmWaitForTablet(int fd, char * data, int size); | ||
| 40 | static int xf86WcmWriteWait(int fd, const char* request); | ||
| 38 | static int wcmSerialValidate(WacomCommonPtr common, const unsigned char* data); | ||
| 39 | static int wcmWaitForTablet(int fd, char * data, int size); | ||
| 40 | static int wcmWriteWait(int fd, const char* request); | ||
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | 43 | WacomDeviceClass gWacomISDV4Device = | |
| 44 | 44 | { | |
| 45 | 45 | isdv4Detect, | |
| 46 | 46 | isdv4Init, | |
| 47 | xf86WcmReadPacket, | ||
| 47 | wcmReadPacket, | ||
| 48 | 48 | }; | |
| 49 | 49 | ||
| 50 | 50 | static WacomModel isdv4General = | |
| … | … | ||
| 65 | 65 | * XFree86 V4 Functions | |
| 66 | 66 | ****************************************************************************/ | |
| 67 | 67 | ||
| 68 | static int xf86WcmWait(int t) | ||
| 68 | static int wcmWait(int t) | ||
| 69 | 69 | { | |
| 70 | 70 | int err = xf86WaitForInput(-1, ((t) * 1000)); | |
| 71 | 71 | if (err != -1) | |
| … | … | ||
| 76 | 76 | } | |
| 77 | 77 | ||
| 78 | 78 | /***************************************************************************** | |
| 79 | * xf86WcmSerialValidate -- validates serial packet; returns 0 on success, | ||
| 79 | * wcmSerialValidate -- validates serial packet; returns 0 on success, | ||
| 80 | 80 | * positive number of bytes to skip on error. | |
| 81 | 81 | ****************************************************************************/ | |
| 82 | 82 | ||
| 83 | static int xf86WcmSerialValidate(WacomCommonPtr common, const unsigned char* data) | ||
| 83 | static int wcmSerialValidate(WacomCommonPtr common, const unsigned char* data) | ||
| 84 | 84 | { | |
| 85 | 85 | int i, bad = 0; | |
| 86 | 86 | ||
| … | … | ||
| 92 | 92 | { | |
| 93 | 93 | bad = 1; | |
| 94 | 94 | if (i!=0 && (data[i] & HEADER_BIT)) { | |
| 95 | xf86Msg(X_WARNING, "xf86WcmSerialValidate: " | ||
| 95 | xf86Msg(X_WARNING, "wcmSerialValidate: " | ||
| 96 | 96 | "bad magic at %d v=%x l=%d\n", i, | |
| 97 | 97 | data[i], common->wcmPktLength); | |
| 98 | 98 | return i; | |
| … | … | ||
| 162 | 162 | } | |
| 163 | 163 | ||
| 164 | 164 | /* Wait 250 mSecs */ | |
| 165 | if (xf86WcmWait(250)) | ||
| 165 | if (wcmWait(250)) | ||
| 166 | 166 | return !Success; | |
| 167 | 167 | ||
| 168 | 168 | /* Send query command to the tablet */ | |
| 169 | if (!xf86WcmWriteWait(local->fd, query)) | ||
| 169 | if (!wcmWriteWait(local->fd, query)) | ||
| 170 | 170 | { | |
| 171 | 171 | xf86Msg(X_WARNING, "%s: unable to xf86WcmWrite request %s " | |
| 172 | 172 | "ISDV4 query command after %d tries\n", local->name, | |
| … | … | ||
| 175 | 175 | } | |
| 176 | 176 | ||
| 177 | 177 | /* Read the control data */ | |
| 178 | if (!xf86WcmWaitForTablet(local->fd, data, WACOM_PKGLEN_TPCCTL)) | ||
| 178 | if (!wcmWaitForTablet(local->fd, data, WACOM_PKGLEN_TPCCTL)) | ||
| 179 | 179 | { | |
| 180 | 180 | /* Try 19200 if it is not a touch query */ | |
| 181 | 181 | if (common->wcmISDV4Speed != 19200 && strcmp(query, WC_ISDV4_TOUCH_QUERY)) | |
| … | … | ||
| 208 | 208 | else | |
| 209 | 209 | { | |
| 210 | 210 | /* Reread the control data since it may fail the first time */ | |
| 211 | xf86WcmWaitForTablet(local->fd, data, WACOM_PKGLEN_TPCCTL); | ||
| 211 | wcmWaitForTablet(local->fd, data, WACOM_PKGLEN_TPCCTL); | ||
| 212 | 212 | if ( !(data[0] & 0x40) ) | |
| 213 | 213 | { | |
| 214 | 214 | xf86Msg(X_WARNING, "%s: ISDV4 control data " | |
| … | … | ||
| 421 | 421 | /* let touch go */ | |
| 422 | 422 | WacomDeviceState out = { 0 }; | |
| 423 | 423 | out.device_type = TOUCH_ID; | |
| 424 | xf86WcmEvent(common, channel, &out); | ||
| 424 | wcmEvent(common, channel, &out); | ||
| 425 | 425 | } | |
| 426 | 426 | } | |
| 427 | 427 | ||
| … | … | ||
| 434 | 434 | /* Coordinate data bit check */ | |
| 435 | 435 | if (data[0] & 0x40) /* control data */ | |
| 436 | 436 | return common->wcmPktLength; | |
| 437 | else if ((n = xf86WcmSerialValidate(common,data)) > 0) | ||
| 437 | else if ((n = wcmSerialValidate(common,data)) > 0) | ||
| 438 | 438 | return n; | |
| 439 | 439 | ||
| 440 | 440 | /* pick up where we left off, minus relative values */ | |
| … | … | ||
| 466 | 466 | if ((ds->proximity && !last->proximity) || | |
| 467 | 467 | (!ds->proximity && last->proximity)) | |
| 468 | 468 | ds->sample = (int)GetTimeInMillis(); | |
| 469 | xf86WcmEvent(common, channel, ds); | ||
| 469 | wcmEvent(common, channel, ds); | ||
| 470 | 470 | } | |
| 471 | 471 | ||
| 472 | 472 | channel = 1; | |
| … | … | ||
| 519 | 519 | { | |
| 520 | 520 | /* send a prox-out for old device */ | |
| 521 | 521 | WacomDeviceState out = { 0 }; | |
| 522 | xf86WcmEvent(common, 0, &out); | ||
| 522 | wcmEvent(common, 0, &out); | ||
| 523 | 523 | ds->device_type = cur_type; | |
| 524 | 524 | } | |
| 525 | 525 | } | |
| … | … | ||
| 540 | 540 | ds->device_type == ERASER_ID ? "ERASER " : | |
| 541 | 541 | ds->device_type == STYLUS_ID ? "STYLUS" : "NONE")); | |
| 542 | 542 | } | |
| 543 | xf86WcmEvent(common, channel, ds); | ||
| 543 | wcmEvent(common, channel, ds); | ||
| 544 | 544 | return common->wcmPktLength; | |
| 545 | 545 | } | |
| 546 | 546 | ||
| … | … | ||
| 549 | 549 | * send a request | |
| 550 | 550 | ****************************************************************************/ | |
| 551 | 551 | ||
| 552 | static int xf86WcmWriteWait(int fd, const char* request) | ||
| 552 | static int wcmWriteWait(int fd, const char* request) | ||
| 553 | 553 | { | |
| 554 | 554 | int len, maxtry = MAXTRY; | |
| 555 | 555 | ||
| … | … | ||
| 559 | 559 | len = xf86WriteSerial(fd, request, strlen(request)); | |
| 560 | 560 | if ((len == -1) && (errno != EAGAIN)) | |
| 561 | 561 | { | |
| 562 | xf86Msg(X_ERROR, "Wacom xf86WcmWriteWait error : %s", strerror(errno)); | ||
| 562 | xf86Msg(X_ERROR, "Wacom wcmWriteWait error : %s", strerror(errno)); | ||
| 563 | 563 | return 0; | |
| 564 | 564 | } | |
| 565 | 565 | ||
| … | … | ||
| 571 | 571 | } | |
| 572 | 572 | ||
| 573 | 573 | /***************************************************************************** | |
| 574 | * xf86WcmWaitForTablet -- | ||
| 574 | * wcmWaitForTablet -- | ||
| 575 | 575 | * wait for tablet data | |
| 576 | 576 | ****************************************************************************/ | |
| 577 | 577 | ||
| 578 | static int xf86WcmWaitForTablet(int fd, char* answer, int size) | ||
| 578 | static int wcmWaitForTablet(int fd, char* answer, int size) | ||
| 579 | 579 | { | |
| 580 | 580 | int len, maxtry = MAXTRY; | |
| 581 | 581 |
src/wcmUSB.c
(18 / 18)
|   | |||
| 53 | 53 | { | |
| 54 | 54 | usbDetect, | |
| 55 | 55 | usbWcmInit, | |
| 56 | xf86WcmReadPacket, | ||
| 56 | wcmReadPacket, | ||
| 57 | 57 | }; | |
| 58 | 58 | ||
| 59 | 59 | static WacomModel usbUnknown = | |
| … | … | ||
| 84 | 84 | NULL, /* link speed unsupported */ | |
| 85 | 85 | NULL, /* start not supported */ | |
| 86 | 86 | usbParse, | |
| 87 | xf86WcmFilterCoord, /* input filtering */ | ||
| 87 | wcmFilterCoord, /* input filtering */ | ||
| 88 | 88 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 89 | 89 | }; | |
| 90 | 90 | ||
| … | … | ||
| 100 | 100 | NULL, /* link speed unsupported */ | |
| 101 | 101 | NULL, /* start not supported */ | |
| 102 | 102 | usbParse, | |
| 103 | xf86WcmFilterCoord, /* input filtering */ | ||
| 103 | wcmFilterCoord, /* input filtering */ | ||
| 104 | 104 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 105 | 105 | }; | |
| 106 | 106 | ||
| … | … | ||
| 116 | 116 | NULL, /* link speed unsupported */ | |
| 117 | 117 | NULL, /* start not supported */ | |
| 118 | 118 | usbParse, | |
| 119 | xf86WcmFilterCoord, /* input filtering */ | ||
| 119 | wcmFilterCoord, /* input filtering */ | ||
| 120 | 120 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 121 | 121 | }; | |
| 122 | 122 | ||
| … | … | ||
| 132 | 132 | NULL, /* link speed unsupported */ | |
| 133 | 133 | NULL, /* start not supported */ | |
| 134 | 134 | usbParse, | |
| 135 | xf86WcmFilterCoord, /* input filtering */ | ||
| 135 | wcmFilterCoord, /* input filtering */ | ||
| 136 | 136 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 137 | 137 | }; | |
| 138 | 138 | ||
| … | … | ||
| 148 | 148 | NULL, /* link speed unsupported */ | |
| 149 | 149 | NULL, /* start not supported */ | |
| 150 | 150 | usbParse, | |
| 151 | xf86WcmFilterCoord, /* input filtering */ | ||
| 151 | wcmFilterCoord, /* input filtering */ | ||
| 152 | 152 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 153 | 153 | }; | |
| 154 | 154 | ||
| … | … | ||
| 164 | 164 | NULL, /* link speed unsupported */ | |
| 165 | 165 | NULL, /* start not supported */ | |
| 166 | 166 | usbParse, | |
| 167 | xf86WcmFilterCoord, /* input filtering */ | ||
| 167 | wcmFilterCoord, /* input filtering */ | ||
| 168 | 168 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 169 | 169 | }; | |
| 170 | 170 | ||
| … | … | ||
| 180 | 180 | NULL, /* link speed unsupported */ | |
| 181 | 181 | NULL, /* start not supported */ | |
| 182 | 182 | usbParse, | |
| 183 | xf86WcmFilterCoord, /* input filtering */ | ||
| 183 | wcmFilterCoord, /* input filtering */ | ||
| 184 | 184 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 185 | 185 | }; | |
| 186 | 186 | ||
| … | … | ||
| 196 | 196 | NULL, /* link speed unsupported */ | |
| 197 | 197 | NULL, /* start not supported */ | |
| 198 | 198 | usbParse, | |
| 199 | xf86WcmFilterCoord, /* input filtering */ | ||
| 199 | wcmFilterCoord, /* input filtering */ | ||
| 200 | 200 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 201 | 201 | }; | |
| 202 | 202 | ||
| … | … | ||
| 244 | 244 | NULL, /* link speed unsupported */ | |
| 245 | 245 | NULL, /* start not supported */ | |
| 246 | 246 | usbParse, | |
| 247 | xf86WcmFilterIntuos, /* input filtering recommended */ | ||
| 247 | wcmFilterIntuos, /* input filtering recommended */ | ||
| 248 | 248 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 249 | 249 | }; | |
| 250 | 250 | ||
| … | … | ||
| 260 | 260 | NULL, /* link speed unsupported */ | |
| 261 | 261 | NULL, /* start not supported */ | |
| 262 | 262 | usbParse, | |
| 263 | xf86WcmFilterIntuos, /* input filtering recommended */ | ||
| 263 | wcmFilterIntuos, /* input filtering recommended */ | ||
| 264 | 264 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 265 | 265 | }; | |
| 266 | 266 | ||
| … | … | ||
| 276 | 276 | NULL, /* link speed unsupported */ | |
| 277 | 277 | NULL, /* start not supported */ | |
| 278 | 278 | usbParse, | |
| 279 | xf86WcmFilterIntuos, /* input filtering recommended */ | ||
| 279 | wcmFilterIntuos, /* input filtering recommended */ | ||
| 280 | 280 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 281 | 281 | }; | |
| 282 | 282 | ||
| … | … | ||
| 292 | 292 | NULL, /* link speed unsupported */ | |
| 293 | 293 | NULL, /* start not supported */ | |
| 294 | 294 | usbParse, | |
| 295 | xf86WcmFilterIntuos, /* input filtering recommended */ | ||
| 295 | wcmFilterIntuos, /* input filtering recommended */ | ||
| 296 | 296 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 297 | 297 | }; | |
| 298 | 298 | ||
| … | … | ||
| 308 | 308 | NULL, /* link speed unsupported */ | |
| 309 | 309 | NULL, /* start not supported */ | |
| 310 | 310 | usbParse, | |
| 311 | xf86WcmFilterCoord, /* input filtering */ | ||
| 311 | wcmFilterCoord, /* input filtering */ | ||
| 312 | 312 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 313 | 313 | }; | |
| 314 | 314 | ||
| … | … | ||
| 324 | 324 | NULL, /* link speed unsupported */ | |
| 325 | 325 | NULL, /* start not supported */ | |
| 326 | 326 | usbParse, | |
| 327 | xf86WcmFilterCoord, /* input filtering */ | ||
| 327 | wcmFilterCoord, /* input filtering */ | ||
| 328 | 328 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 329 | 329 | }; | |
| 330 | 330 | ||
| … | … | ||
| 340 | 340 | NULL, /* link speed unsupported */ | |
| 341 | 341 | NULL, /* start not supported */ | |
| 342 | 342 | usbParse, | |
| 343 | xf86WcmFilterIntuos, /* input filtering recommended */ | ||
| 343 | wcmFilterIntuos, /* input filtering recommended */ | ||
| 344 | 344 | usbDetectConfig, /* detect hardware buttons etc */ | |
| 345 | 345 | }; | |
| 346 | 346 | ||
| … | … | ||
| 810 | 810 | { | |
| 811 | 811 | common->wcmChannel[i].work.proximity = 0; | |
| 812 | 812 | /* dispatch event */ | |
| 813 | xf86WcmEvent(common, i, &common->wcmChannel[i].work); | ||
| 813 | wcmEvent(common, i, &common->wcmChannel[i].work); | ||
| 814 | 814 | } | |
| 815 | 815 | } | |
| 816 | 816 | DBG(1, common->debugLevel, xf86Msg(X_INFO, "usbParse (device with serial number: %u)" | |
| … | … | ||
| 1121 | 1121 | } | |
| 1122 | 1122 | ||
| 1123 | 1123 | /* dispatch event */ | |
| 1124 | xf86WcmEvent(common, channel, ds); | ||
| 1124 | wcmEvent(common, channel, ds); | ||
| 1125 | 1125 | } | |
| 1126 | 1126 | /* vim: set noexpandtab shiftwidth=8: */ |
src/wcmValidateDevice.c
(2 / 2)
|   | |||
| 495 | 495 | local->name); | |
| 496 | 496 | else | |
| 497 | 497 | { | |
| 498 | xf86WcmSetPressureCurve(priv,a,b,c,d); | ||
| 498 | wcmSetPressureCurve(priv,a,b,c,d); | ||
| 499 | 499 | } | |
| 500 | 500 | } | |
| 501 | 501 | ||
| … | … | ||
| 714 | 714 | if ((!common->wcmDevice || !strcmp (common->wcmDevice, "auto-dev"))) | |
| 715 | 715 | { | |
| 716 | 716 | common->wcmFlags |= AUTODEV_FLAG; | |
| 717 | if (! (common->wcmDevice = xf86WcmEventAutoDevProbe (local))) | ||
| 717 | if (! (common->wcmDevice = wcmEventAutoDevProbe (local))) | ||
| 718 | 718 | { | |
| 719 | 719 | xf86Msg(X_ERROR, "%s: unable to probe device\n", | |
| 720 | 720 | local->name); |
src/wcmXCommand.c
(1 / 1)
|   | |||
| 372 | 372 | return BadValue; | |
| 373 | 373 | ||
| 374 | 374 | if (!checkonly) | |
| 375 | xf86WcmSetPressureCurve (priv, pcurve[0], pcurve[1], | ||
| 375 | wcmSetPressureCurve (priv, pcurve[0], pcurve[1], | ||
| 376 | 376 | pcurve[2], pcurve[3]); | |
| 377 | 377 | } else if (property == prop_suppress) | |
| 378 | 378 | { |
src/xf86Wacom.c
(7 / 7)
|   | |||
| 924 | 924 | } | |
| 925 | 925 | ||
| 926 | 926 | /***************************************************************************** | |
| 927 | * xf86WcmEventAutoDevProbe -- Probe for right input device | ||
| 927 | * wcmEventAutoDevProbe -- Probe for right input device | ||
| 928 | 928 | ****************************************************************************/ | |
| 929 | 929 | #define DEV_INPUT_EVENT "/dev/input/event%d" | |
| 930 | 930 | #define EVDEV_MINORS 32 | |
| 931 | char *xf86WcmEventAutoDevProbe (LocalDevicePtr local) | ||
| 931 | char *wcmEventAutoDevProbe (LocalDevicePtr local) | ||
| 932 | 932 | { | |
| 933 | 933 | /* We are trying to find the right eventX device */ | |
| 934 | 934 | int i, wait = 0; | |
| … | … | ||
| 1046 | 1046 | { | |
| 1047 | 1047 | /* Autoprobe if necessary */ | |
| 1048 | 1048 | if ((common->wcmFlags & AUTODEV_FLAG) && | |
| 1049 | !(common->wcmDevice = xf86WcmEventAutoDevProbe (local))) | ||
| 1049 | !(common->wcmDevice = wcmEventAutoDevProbe (local))) | ||
| 1050 | 1050 | xf86Msg(X_ERROR, "%s: Cannot probe device\n", local->name); | |
| 1051 | 1051 | ||
| 1052 | 1052 | if ((xf86WcmOpen (local) != Success) || (local->fd < 0) || | |
| … | … | ||
| 1135 | 1135 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevReadInput: Read (%d)\n",loop)); | |
| 1136 | 1136 | } | |
| 1137 | 1137 | ||
| 1138 | void xf86WcmReadPacket(LocalDevicePtr local) | ||
| 1138 | void wcmReadPacket(LocalDevicePtr local) | ||
| 1139 | 1139 | { | |
| 1140 | 1140 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1141 | 1141 | WacomCommonPtr common = priv->common; | |
| 1142 | 1142 | int len, pos, cnt, remaining; | |
| 1143 | 1143 | unsigned char * data; | |
| 1144 | 1144 | ||
| 1145 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmReadPacket: device=%s" | ||
| 1145 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmReadPacket: device=%s" | ||
| 1146 | 1146 | " fd=%d \n", common->wcmDevice, local->fd)); | |
| 1147 | 1147 | ||
| 1148 | 1148 | remaining = sizeof(common->buffer) - common->bufpos; | |
| 1149 | 1149 | ||
| 1150 | DBG(1, common->debugLevel, xf86Msg(X_INFO, "xf86WcmReadPacket: pos=%d" | ||
| 1150 | DBG(1, common->debugLevel, xf86Msg(X_INFO, "wcmReadPacket: pos=%d" | ||
| 1151 | 1151 | " remaining=%d\n", common->bufpos, remaining)); | |
| 1152 | 1152 | ||
| 1153 | 1153 | /* fill buffer with as much data as we can handle */ | |
| … | … | ||
| 1171 | 1171 | ||
| 1172 | 1172 | /* account for new data */ | |
| 1173 | 1173 | common->bufpos += len; | |
| 1174 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmReadPacket buffer has %d bytes\n", | ||
| 1174 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmReadPacket buffer has %d bytes\n", | ||
| 1175 | 1175 | common->bufpos)); | |
| 1176 | 1176 | ||
| 1177 | 1177 | pos = 0; |
src/xf86Wacom.h
(3 / 3)
|   | |||
| 146 | 146 | #define RESET_RELATIVE(ds) do { (ds).relwheel = 0; } while (0) | |
| 147 | 147 | ||
| 148 | 148 | /* device autoprobing */ | |
| 149 | char *xf86WcmEventAutoDevProbe (LocalDevicePtr local); | ||
| 149 | char *wcmEventAutoDevProbe (LocalDevicePtr local); | ||
| 150 | 150 | ||
| 151 | 151 | /* common tablet initialization regime */ | |
| 152 | 152 | int xf86WcmInitTablet(LocalDevicePtr local, const char* id, float version); | |
| 153 | 153 | ||
| 154 | 154 | /* standard packet handler */ | |
| 155 | void xf86WcmReadPacket(LocalDevicePtr local); | ||
| 155 | void wcmReadPacket(LocalDevicePtr local); | ||
| 156 | 156 | ||
| 157 | 157 | /* handles suppression, filtering, and dispatch. */ | |
| 158 | void xf86WcmEvent(WacomCommonPtr common, unsigned int channel, const WacomDeviceState* ds); | ||
| 158 | void wcmEvent(WacomCommonPtr common, unsigned int channel, const WacomDeviceState* ds); | ||
| 159 | 159 | ||
| 160 | 160 | /* dispatches data to XInput event system */ | |
| 161 | 161 | void xf86WcmSendEvents(LocalDevicePtr local, const WacomDeviceState* ds); |

