Commit 0501b9977050dbec74c72dbd8c78f2b72df43ab9
- Diff rendering mode:
- inline
- side by side
src/wcmCommon.c
(60 / 61)
|   | |||
| 57 | 57 | { | |
| 58 | 58 | WacomDevicePtr priv = (WacomDevicePtr) local->private; | |
| 59 | 59 | ||
| 60 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmMappingFactor \n")); | ||
| 60 | DBG(10, priv->debugLevel, "xf86WcmMappingFactor \n"); | ||
| 61 | 61 | ||
| 62 | 62 | xf86WcmVirtualTabletSize(local); | |
| 63 | 63 | ||
| … | … | ||
| 81 | 81 | if (priv->currentScreen == -1) /* tool on the tablet */ | |
| 82 | 82 | priv->currentScreen = 0; | |
| 83 | 83 | ||
| 84 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmMappingFactor" | ||
| 84 | DBG(10, priv->debugLevel, "xf86WcmMappingFactor" | ||
| 85 | 85 | " Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d) map" | |
| 86 | 86 | " to maxWidth =%d maxHeight =%d\n", | |
| 87 | 87 | priv->bottomX, priv->bottomY, priv->sizeX, priv->sizeY, | |
| 88 | priv->maxWidth, priv->maxHeight)); | ||
| 88 | priv->maxWidth, priv->maxHeight); | ||
| 89 | 89 | ||
| 90 | 90 | priv->factorX = (double)priv->maxWidth / (double)priv->sizeX; | |
| 91 | 91 | priv->factorY = (double)priv->maxHeight / (double)priv->sizeY; | |
| 92 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, "X factor = %.3g, Y factor = %.3g\n", | ||
| 93 | priv->factorX, priv->factorY)); | ||
| 92 | DBG(2, priv->debugLevel, "X factor = %.3g, Y factor = %.3g\n", | ||
| 93 | priv->factorX, priv->factorY); | ||
| 94 | 94 | } | |
| 95 | 95 | ||
| 96 | 96 | /***************************************************************************** | |
| … | … | ||
| 106 | 106 | WacomDevicePtr priv = (WacomDevicePtr) local->private; | |
| 107 | 107 | int screenToSet = -1, i, j, x, y, tabletSize = 0; | |
| 108 | 108 | ||
| 109 | DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen v0=%d v1=%d " | ||
| 110 | "currentScreen=%d\n", v0, v1, priv->currentScreen)); | ||
| 109 | DBG(6, priv->debugLevel, "xf86WcmSetScreen v0=%d v1=%d " | ||
| 110 | "currentScreen=%d\n", v0, v1, priv->currentScreen); | ||
| 111 | 111 | ||
| 112 | 112 | if (priv->screen_no != -1 && priv->screen_no >= priv->numScreen) | |
| 113 | 113 | { | |
| … | … | ||
| 152 | 152 | if (v0 > priv->topY && v0 <= priv->topY + priv->tvoffsetY) | |
| 153 | 153 | priv->currentScreen = 1; | |
| 154 | 154 | } | |
| 155 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen TwinView setup screenToSet=%d\n", | ||
| 156 | priv->currentScreen)); | ||
| 155 | DBG(10, priv->debugLevel, "xf86WcmSetScreen TwinView setup screenToSet=%d\n", | ||
| 156 | priv->currentScreen); | ||
| 157 | 157 | } | |
| 158 | 158 | ||
| 159 | 159 | xf86WcmMappingFactor(local); | |
| … | … | ||
| 194 | 194 | ||
| 195 | 195 | if (screenToSet == -1) | |
| 196 | 196 | { | |
| 197 | DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen Error: " | ||
| 197 | DBG(3, priv->debugLevel, "xf86WcmSetScreen Error: " | ||
| 198 | 198 | "Can not find valid screen (currentScreen=%d)\n", | |
| 199 | priv->currentScreen)); | ||
| 199 | priv->currentScreen); | ||
| 200 | 200 | return; | |
| 201 | 201 | } | |
| 202 | 202 | ||
| … | … | ||
| 210 | 210 | y = screenInfo.screens[screenToSet]->height - 1; | |
| 211 | 211 | ||
| 212 | 212 | xf86XInputSetScreen(local, screenToSet, x, y); | |
| 213 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen current=%d ToSet=%d\n", | ||
| 214 | priv->currentScreen, screenToSet)); | ||
| 213 | DBG(10, priv->debugLevel, "xf86WcmSetScreen current=%d ToSet=%d\n", | ||
| 214 | priv->currentScreen, screenToSet); | ||
| 215 | 215 | priv->currentScreen = screenToSet; | |
| 216 | 216 | } | |
| 217 | 217 | ||
| … | … | ||
| 227 | 227 | int button, mask; | |
| 228 | 228 | WacomDevicePtr priv = (WacomDevicePtr) local->private; | |
| 229 | 229 | WacomCommonPtr common = priv->common; | |
| 230 | DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSendButtons " | ||
| 231 | "buttons=%d for %s\n", buttons, local->name)); | ||
| 230 | DBG(6, priv->debugLevel, "xf86WcmSendButtons " | ||
| 231 | "buttons=%d for %s\n", buttons, local->name); | ||
| 232 | 232 | ||
| 233 | 233 | /* Tablet PC buttons only apply to penabled devices */ | |
| 234 | 234 | if (common->wcmTPCButton && (priv->flags & STYLUS_ID)) | |
| … | … | ||
| 461 | 461 | if (!priv->button[button]) /* ignore this button event */ | |
| 462 | 462 | return; | |
| 463 | 463 | ||
| 464 | DBG(4, priv->debugLevel, xf86Msg(X_INFO, | ||
| 465 | "sendAButton TPCButton(%s) button=%d state=%d " | ||
| 464 | DBG(4, priv->debugLevel, "sendAButton TPCButton(%s) button=%d state=%d " | ||
| 466 | 465 | "code=%08x, for %s coreEvent=%s \n", | |
| 467 | 466 | common->wcmTPCButton ? "on" : "off", | |
| 468 | 467 | button, mask, priv->button[button], | |
| 469 | local->name, (priv->button[button] & AC_CORE) ? "yes" : "no")); | ||
| 468 | local->name, (priv->button[button] & AC_CORE) ? "yes" : "no"); | ||
| 470 | 469 | ||
| 471 | 470 | if (!priv->keys[button][0]) | |
| 472 | 471 | { | |
| … | … | ||
| 578 | 578 | unsigned *keyP = 0; | |
| 579 | 579 | int is_absolute = priv->flags & ABSOLUTE_FLAG; | |
| 580 | 580 | ||
| 581 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "sendWheelStripEvents for %s \n", local->name)); | ||
| 581 | DBG(10, priv->debugLevel, "sendWheelStripEvents for %s \n", local->name); | ||
| 582 | 582 | ||
| 583 | 583 | /* emulate events for relative wheel */ | |
| 584 | 584 | if ( ds->relwheel ) | |
| … | … | ||
| 668 | 668 | ||
| 669 | 669 | if (!fakeButton) return; | |
| 670 | 670 | ||
| 671 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "sendWheelStripEvents " | ||
| 671 | DBG(10, priv->debugLevel, "sendWheelStripEvents " | ||
| 672 | 672 | "send fakeButton %x with value = %d \n", | |
| 673 | fakeButton, value)); | ||
| 673 | fakeButton, value); | ||
| 674 | 674 | ||
| 675 | 675 | switch (fakeButton & AC_TYPE) | |
| 676 | 676 | { | |
| … | … | ||
| 747 | 747 | ||
| 748 | 748 | if (priv->serial && serial != priv->serial) | |
| 749 | 749 | { | |
| 750 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "[%s] serial number" | ||
| 750 | DBG(10, priv->debugLevel, "[%s] serial number" | ||
| 751 | 751 | " is %u but your system configured %u", | |
| 752 | local->name, serial, (int)priv->serial)); | ||
| 752 | local->name, serial, (int)priv->serial); | ||
| 753 | 753 | return; | |
| 754 | 754 | } | |
| 755 | 755 | ||
| … | … | ||
| 767 | 767 | ty = ds->stripy; | |
| 768 | 768 | } | |
| 769 | 769 | ||
| 770 | DBG(7, priv->debugLevel, xf86Msg(X_INFO, "[%s] o_prox=%s x=%d y=%d z=%d " | ||
| 770 | DBG(7, priv->debugLevel, "[%s] o_prox=%s x=%d y=%d z=%d " | ||
| 771 | 771 | "b=%s b=%d tx=%d ty=%d wl=%d rot=%d th=%d\n", | |
| 772 | 772 | (type == STYLUS_ID) ? "stylus" : | |
| 773 | 773 | (type == CURSOR_ID) ? "cursor" : | |
| … | … | ||
| 775 | 775 | (type == TOUCH_ID) ? "touch" : "pad", | |
| 776 | 776 | priv->oldProximity ? "true" : "false", | |
| 777 | 777 | x, y, z, is_button ? "true" : "false", buttons, | |
| 778 | tx, ty, wheel, rot, throttle)); | ||
| 778 | tx, ty, wheel, rot, throttle); | ||
| 779 | 779 | ||
| 780 | 780 | /* rotation mixes x and y up a bit */ | |
| 781 | 781 | if (common->wcmRotate == ROTATE_CW) | |
| … | … | ||
| 822 | 822 | } | |
| 823 | 823 | v5 = wheel; | |
| 824 | 824 | ||
| 825 | DBG(6, priv->debugLevel, xf86Msg(X_INFO, "[%s] %s prox=%d\tx=%d" | ||
| 825 | DBG(6, priv->debugLevel, "[%s] %s prox=%d\tx=%d" | ||
| 826 | 826 | "\ty=%d\tz=%d\tv3=%d\tv4=%d\tv5=%d\tid=%d" | |
| 827 | 827 | "\tserial=%u\tbutton=%s\tbuttons=%d\n", | |
| 828 | 828 | local->name, | |
| 829 | 829 | is_absolute ? "abs" : "rel", | |
| 830 | 830 | is_proximity, | |
| 831 | 831 | x, y, z, v3, v4, v5, id, serial, | |
| 832 | is_button ? "true" : "false", buttons)); | ||
| 832 | is_button ? "true" : "false", buttons); | ||
| 833 | 833 | ||
| 834 | 834 | priv->currentX = x; | |
| 835 | 835 | priv->currentY = y; | |
| … | … | ||
| 1068 | 1068 | dsNew->y = dsOrig->y; | |
| 1069 | 1069 | } | |
| 1070 | 1070 | ||
| 1071 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "xf86WcmSuppress at level = %d" | ||
| 1072 | " return value = %d\n", suppress, returnV)); | ||
| 1071 | DBG(10, common->debugLevel, "xf86WcmSuppress at level = %d" | ||
| 1072 | " return value = %d\n", suppress, returnV); | ||
| 1073 | 1073 | return returnV; | |
| 1074 | 1074 | } | |
| 1075 | 1075 | ||
| … | … | ||
| 1103 | 1103 | pChannel = common->wcmChannel + channel; | |
| 1104 | 1104 | pLast = &pChannel->valid.state; | |
| 1105 | 1105 | ||
| 1106 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmEvent at channel = %d\n", channel)); | ||
| 1106 | DBG(10, common->debugLevel, "wcmEvent at channel = %d\n", channel); | ||
| 1107 | 1107 | ||
| 1108 | 1108 | /* sanity check the channel */ | |
| 1109 | 1109 | if (channel >= MAX_CHANNELS) | |
| … | … | ||
| 1115 | 1115 | ||
| 1116 | 1116 | /* timestamp the state for velocity and acceleration analysis */ | |
| 1117 | 1117 | ds.sample = (int)GetTimeInMillis(); | |
| 1118 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmEvent: " | ||
| 1118 | DBG(10, common->debugLevel, "wcmEvent: " | ||
| 1119 | 1119 | "c=%d i=%d t=%d s=%u x=%d y=%d b=%d " | |
| 1120 | 1120 | "p=%d rz=%d tx=%d ty=%d aw=%d rw=%d " | |
| 1121 | 1121 | "t=%d df=%d px=%d st=%d cs=%d \n", | |
| … | … | ||
| 1127 | 1127 | ds.pressure, ds.rotation, ds.tiltx, | |
| 1128 | 1128 | ds.tilty, ds.abswheel, ds.relwheel, ds.throttle, | |
| 1129 | 1129 | ds.discard_first, ds.proximity, ds.sample, | |
| 1130 | pChannel->nSamples)); | ||
| 1130 | pChannel->nSamples); | ||
| 1131 | 1131 | ||
| 1132 | 1132 | /* Discard the first 2 USB packages due to events delay */ | |
| 1133 | 1133 | if ( (pChannel->nSamples < 2) && (common->wcmDevCls == &gWacomUSBDevice) && | |
| 1134 | 1134 | ds.device_type != PAD_ID && (ds.device_type != TOUCH_ID) ) | |
| 1135 | 1135 | { | |
| 1136 | DBG(11, common->debugLevel, | ||
| 1137 | xf86Msg(X_INFO, "discarded %dth USB data.\n", | ||
| 1138 | pChannel->nSamples)); | ||
| 1136 | DBG(11, common->debugLevel, | ||
| 1137 | "discarded %dth USB data.\n", | ||
| 1138 | pChannel->nSamples); | ||
| 1139 | 1139 | ++pChannel->nSamples; | |
| 1140 | 1140 | return; /* discard */ | |
| 1141 | 1141 | } | |
| … | … | ||
| 1149 | 1149 | fs = &pChannel->rawFilter; | |
| 1150 | 1150 | if (!fs->npoints && ds.proximity) | |
| 1151 | 1151 | { | |
| 1152 | DBG(11, common->debugLevel, xf86Msg(X_INFO, "initialize Channel data.\n")); | ||
| 1152 | DBG(11, common->debugLevel, "initialize Channel data.\n"); | ||
| 1153 | 1153 | /* store channel device state for later use */ | |
| 1154 | 1154 | for (i=common->wcmRawSample - 1; i>=0; i--) | |
| 1155 | 1155 | { | |
| … | … | ||
| 1182 | 1182 | { | |
| 1183 | 1183 | if (common->wcmModel->FilterRaw(common,pChannel,&ds)) | |
| 1184 | 1184 | { | |
| 1185 | DBG(10, common->debugLevel, xf86Msg(X_INFO, | ||
| 1186 | "Raw filtering discarded data.\n")); | ||
| 1185 | DBG(10, common->debugLevel, | ||
| 1186 | "Raw filtering discarded data.\n"); | ||
| 1187 | 1187 | resetSampleCounter(pChannel); | |
| 1188 | 1188 | return; /* discard */ | |
| 1189 | 1189 | } | |
| … | … | ||
| 1337 | 1337 | } | |
| 1338 | 1338 | } | |
| 1339 | 1339 | ||
| 1340 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "commonDispatchDevice device type = %d\n", ds->device_type)); | ||
| 1340 | DBG(10, common->debugLevel, "commonDispatchDevice device type = %d\n", ds->device_type); | ||
| 1341 | 1341 | /* Find the device the current events are meant for */ | |
| 1342 | 1342 | /* 1: Find the tool (the one with correct serial or in second | |
| 1343 | 1343 | * hand, the one with serial set to 0 if no match with the | |
| … | … | ||
| 1400 | 1400 | LocalDevicePtr oDev = outprox->device; | |
| 1401 | 1401 | WacomDeviceState out = { 0 }; | |
| 1402 | 1402 | out.device_type = DEVICE_ID(((WacomDevicePtr)(oDev->private))->flags); | |
| 1403 | DBG(2, common->debugLevel, xf86Msg(X_INFO, "Soft prox-out for %s\n", | ||
| 1404 | outprox->device->name)); | ||
| 1403 | DBG(2, common->debugLevel, "Soft prox-out for %s\n", | ||
| 1404 | outprox->device->name); | ||
| 1405 | 1405 | xf86WcmSendEvents(oDev, &out); | |
| 1406 | 1406 | } | |
| 1407 | 1407 | else | |
| … | … | ||
| 1412 | 1412 | if(tool->current) | |
| 1413 | 1413 | { | |
| 1414 | 1414 | pDev = tool->current->device; | |
| 1415 | DBG(11, common->debugLevel, xf86Msg(X_INFO, "tool id=%d for %s\n", | ||
| 1416 | ds->device_type, pDev->name)); | ||
| 1415 | DBG(11, common->debugLevel, "tool id=%d for %s\n", | ||
| 1416 | ds->device_type, pDev->name); | ||
| 1417 | 1417 | } | |
| 1418 | 1418 | } | |
| 1419 | 1419 | /* X: InputDevice selection done! */ | |
| … | … | ||
| 1470 | 1470 | /* Send soft prox-out for touch first */ | |
| 1471 | 1471 | WacomDeviceState out = { 0 }; | |
| 1472 | 1472 | out.device_type = DEVICE_ID(temppriv->flags); | |
| 1473 | DBG(2, common->debugLevel, xf86Msg(X_INFO, | ||
| 1473 | DBG(2, common->debugLevel, | ||
| 1474 | 1474 | "Send soft prox-out for %s first\n", | |
| 1475 | localDevices->name)); | ||
| 1475 | localDevices->name); | ||
| 1476 | 1476 | xf86WcmSendEvents(localDevices, &out); | |
| 1477 | 1477 | } | |
| 1478 | 1478 | } | |
| … | … | ||
| 1543 | 1543 | } | |
| 1544 | 1544 | else /* no other events to send */ | |
| 1545 | 1545 | { | |
| 1546 | DBG(10, common->debugLevel, xf86Msg(X_INFO, | ||
| 1547 | "Ignore non-movement relative data \n")); | ||
| 1546 | DBG(10, common->debugLevel, "Ignore non-movement relative data \n"); | ||
| 1548 | 1547 | return; | |
| 1549 | 1548 | } | |
| 1550 | 1549 | } | |
| … | … | ||
| 1572 | 1572 | if (common->wcmMaxCursorDist < filtered.distance) | |
| 1573 | 1573 | common->wcmMaxCursorDist = filtered.distance; | |
| 1574 | 1574 | } | |
| 1575 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "Distance over" | ||
| 1575 | DBG(10, common->debugLevel, "Distance over" | ||
| 1576 | 1576 | " the tablet: %d, ProxoutDist: %d current" | |
| 1577 | 1577 | " min/max %d hard prox: %d\n", | |
| 1578 | 1578 | filtered.distance, | |
| 1579 | 1579 | common->wcmCursorProxoutDist, | |
| 1580 | 1580 | common->wcmMaxCursorDist, | |
| 1581 | ds->proximity)); | ||
| 1581 | ds->proximity); | ||
| 1582 | 1582 | ||
| 1583 | 1583 | if (priv->oldProximity) | |
| 1584 | 1584 | { | |
| … | … | ||
| 1606 | 1606 | /* otherwise, if no device matched... */ | |
| 1607 | 1607 | else | |
| 1608 | 1608 | { | |
| 1609 | DBG(11, common->debugLevel, xf86Msg(X_INFO, "no device matches with" | ||
| 1609 | DBG(11, common->debugLevel, "no device matches with" | ||
| 1610 | 1610 | " id=%d, serial=%u\n", | |
| 1611 | ds->device_type, ds->serial_num)); | ||
| 1611 | ds->device_type, ds->serial_num); | ||
| 1612 | 1612 | } | |
| 1613 | 1613 | } | |
| 1614 | 1614 | ||
| … | … | ||
| 1804 | 1804 | priv->screenBottomY[1] = priv->tvResolution[1]; | |
| 1805 | 1805 | } | |
| 1806 | 1806 | ||
| 1807 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialTVScreens for \"%s\" " | ||
| 1807 | DBG(10, priv->debugLevel, "xf86WcmInitialTVScreens for \"%s\" " | ||
| 1808 | 1808 | "topX0=%d topY0=%d bottomX0=%d bottomY0=%d " | |
| 1809 | 1809 | "topX1=%d topY1=%d bottomX1=%d bottomY1=%d \n", | |
| 1810 | 1810 | local->name, priv->screenTopX[0], priv->screenTopY[0], | |
| 1811 | 1811 | priv->screenBottomX[0], priv->screenBottomY[0], | |
| 1812 | 1812 | priv->screenTopX[1], priv->screenTopY[1], | |
| 1813 | priv->screenBottomX[1], priv->screenBottomY[1])); | ||
| 1813 | priv->screenBottomX[1], priv->screenBottomY[1]); | ||
| 1814 | 1814 | } | |
| 1815 | 1815 | ||
| 1816 | 1816 | /***************************************************************************** | |
| … | … | ||
| 1822 | 1822 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1823 | 1823 | int i; | |
| 1824 | 1824 | ||
| 1825 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialScreens for \"%s\" " | ||
| 1826 | "number of screen=%d \n", local->name, screenInfo.numScreens)); | ||
| 1825 | DBG(2, priv->debugLevel, "xf86WcmInitialScreens for \"%s\" " | ||
| 1826 | "number of screen=%d \n", local->name, screenInfo.numScreens); | ||
| 1827 | 1827 | priv->tvoffsetX = 0; | |
| 1828 | 1828 | priv->tvoffsetY = 0; | |
| 1829 | 1829 | if (priv->twinview != TV_NONE) | |
| … | … | ||
| 1847 | 1847 | priv->screenBottomX[i] = dixScreenOrigins[i].x; | |
| 1848 | 1848 | priv->screenBottomY[i] = dixScreenOrigins[i].y; | |
| 1849 | 1849 | ||
| 1850 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialScreens from dix for \"%s\" " | ||
| 1850 | DBG(10, priv->debugLevel, "xf86WcmInitialScreens from dix for \"%s\" " | ||
| 1851 | 1851 | "ScreenOrigins[%d].x=%d ScreenOrigins[%d].y=%d \n", | |
| 1852 | local->name, i, priv->screenTopX[i], i, priv->screenTopY[i])); | ||
| 1852 | local->name, i, priv->screenTopX[i], i, | ||
| 1853 | priv->screenTopY[i]); | ||
| 1853 | 1854 | } | |
| 1854 | 1855 | ||
| 1855 | 1856 | priv->screenBottomX[i] += screenInfo.screens[i]->width; | |
| 1856 | 1857 | priv->screenBottomY[i] += screenInfo.screens[i]->height; | |
| 1857 | 1858 | ||
| 1858 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialScreens for \"%s\" " | ||
| 1859 | DBG(10, priv->debugLevel, "xf86WcmInitialScreens for \"%s\" " | ||
| 1859 | 1860 | "topX[%d]=%d topY[%d]=%d bottomX[%d]=%d bottomY[%d]=%d \n", | |
| 1860 | 1861 | local->name, i, priv->screenTopX[i], i, priv->screenTopY[i], | |
| 1861 | i, priv->screenBottomX[i], i, priv->screenBottomY[i])); | ||
| 1862 | i, priv->screenBottomX[i], i, priv->screenBottomY[i]); | ||
| 1862 | 1863 | } | |
| 1863 | 1864 | } | |
| 1864 | 1865 | ||
| … | … | ||
| 1873 | 1873 | WacomToolAreaPtr area = priv->toolarea; | |
| 1874 | 1874 | int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY; | |
| 1875 | 1875 | ||
| 1876 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "rotateOneTool for \"%s\" \n", priv->local->name)); | ||
| 1876 | DBG(10, priv->debugLevel, "rotateOneTool for \"%s\" \n", priv->local->name); | ||
| 1877 | 1877 | ||
| 1878 | 1878 | if (!IsTouch(priv)) | |
| 1879 | 1879 | { | |
| … | … | ||
| 1950 | 1950 | int oldRotation; | |
| 1951 | 1951 | int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY; | |
| 1952 | 1952 | ||
| 1953 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmRotateTablet for \"%s\" \n", local->name)); | ||
| 1953 | DBG(10, priv->debugLevel, "xf86WcmRotateTablet for \"%s\" \n", local->name); | ||
| 1954 | 1954 | ||
| 1955 | 1955 | if (common->wcmRotate == value) /* initialization */ | |
| 1956 | 1956 | { |
src/wcmConfig.c
(3 / 3)
|   | |||
| 229 | 229 | WacomDevicePtr dev; | |
| 230 | 230 | WacomDevicePtr *prev; | |
| 231 | 231 | ||
| 232 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmUninit\n")); | ||
| 232 | DBG(1, priv->debugLevel, "xf86WcmUninit\n"); | ||
| 233 | 233 | ||
| 234 | 234 | if (priv->isParent) | |
| 235 | 235 | { | |
| … | … | ||
| 289 | 289 | strstr(pMatch->drv->driverName, "wacom") && | |
| 290 | 290 | !strcmp(privMatch->common->wcmDevice, common->wcmDevice)) | |
| 291 | 291 | { | |
| 292 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, | ||
| 292 | DBG(2, priv->debugLevel, | ||
| 293 | 293 | "xf86WcmInit wacom port share between" | |
| 294 | " %s and %s\n", pLocal->name, pMatch->name)); | ||
| 294 | " %s and %s\n", pLocal->name, pMatch->name); | ||
| 295 | 295 | type = xf86FindOptionValue(pMatch->options, "Type"); | |
| 296 | 296 | if ( type && (strstr(type, "eraser")) ) | |
| 297 | 297 | privMatch->common->wcmEraserID=pMatch->name; |
src/wcmFilter.c
(2 / 2)
|   | |||
| 248 | 248 | WacomDeviceState *pLast; | |
| 249 | 249 | int *x, *y, i; | |
| 250 | 250 | ||
| 251 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmFilterCoord with " | ||
| 252 | "common->wcmRawSample = %d \n", common->wcmRawSample)); | ||
| 251 | DBG(10, common->debugLevel, "wcmFilterCoord with " | ||
| 252 | "common->wcmRawSample = %d \n", common->wcmRawSample); | ||
| 253 | 253 | x = pChannel->rawFilter.x; | |
| 254 | 254 | y = pChannel->rawFilter.y; | |
| 255 | 255 |
src/wcmISDV4.c
(12 / 12)
|   | |||
| 123 | 123 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 124 | 124 | WacomCommonPtr common = priv->common; | |
| 125 | 125 | ||
| 126 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "initializing ISDV4 tablet\n")); | ||
| 126 | DBG(1, priv->debugLevel, "initializing ISDV4 tablet\n"); | ||
| 127 | 127 | ||
| 128 | 128 | /* Initial baudrate is 38400 */ | |
| 129 | 129 | if (xf86SetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0) | |
| … | … | ||
| 150 | 150 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 151 | 151 | WacomCommonPtr common = priv->common; | |
| 152 | 152 | ||
| 153 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "Querying ISDV4 tablet\n")); | ||
| 153 | DBG(1, priv->debugLevel, "Querying ISDV4 tablet\n"); | ||
| 154 | 154 | ||
| 155 | 155 | /* Send stop command to the tablet */ | |
| 156 | 156 | err = xf86WriteSerial(local->fd, WC_ISDV4_STOP, strlen(WC_ISDV4_STOP)); | |
| … | … | ||
| 256 | 256 | WacomCommonPtr common = priv->common; | |
| 257 | 257 | int ret = Success; | |
| 258 | 258 | ||
| 259 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, "getting ISDV4 Ranges\n")); | ||
| 259 | DBG(2, priv->debugLevel, "getting ISDV4 Ranges\n"); | ||
| 260 | 260 | ||
| 261 | 261 | /* Send query command to the tablet */ | |
| 262 | 262 | ret = isdv4Query(local, WC_ISDV4_QUERY, data); | |
| … | … | ||
| 281 | 281 | if (!common->wcmMaxX || !common->wcmMaxY) | |
| 282 | 282 | common->tablet_id = 0xE2; | |
| 283 | 283 | ||
| 284 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, "isdv4GetRanges Pen speed=%d " | ||
| 284 | DBG(2, priv->debugLevel, "isdv4GetRanges Pen speed=%d " | ||
| 285 | 285 | "maxX=%d maxY=%d maxZ=%d resX=%d resY=%d \n", | |
| 286 | 286 | common->wcmISDV4Speed, common->wcmMaxX, common->wcmMaxY, | |
| 287 | common->wcmMaxZ, common->wcmResolX, common->wcmResolY)); | ||
| 287 | common->wcmMaxZ, common->wcmResolX, common->wcmResolY); | ||
| 288 | 288 | } | |
| 289 | 289 | ||
| 290 | 290 | /* Touch might be supported. Send a touch query command */ | |
| … | … | ||
| 367 | 367 | common->wcmVersion = ( data[10] | (data[9] << 7) ); | |
| 368 | 368 | ret = Success; | |
| 369 | 369 | ||
| 370 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, "isdv4GetRanges touch speed=%d " | ||
| 370 | DBG(2, priv->debugLevel, "isdv4GetRanges touch speed=%d " | ||
| 371 | 371 | "maxTouchX=%d maxTouchY=%d TouchresX=%d TouchresY=%d \n", | |
| 372 | 372 | common->wcmISDV4Speed, common->wcmMaxTouchX, | |
| 373 | 373 | common->wcmMaxTouchY, common->wcmTouchResolX, | |
| 374 | common->wcmTouchResolY)); | ||
| 374 | common->wcmTouchResolY); | ||
| 375 | 375 | } | |
| 376 | 376 | return ret; | |
| 377 | 377 | } | |
| … | … | ||
| 401 | 401 | WacomDeviceState* ds; | |
| 402 | 402 | int n, cur_type, channel = 0; | |
| 403 | 403 | ||
| 404 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "isdv4Parse \n")); | ||
| 404 | DBG(10, common->debugLevel, "isdv4Parse \n"); | ||
| 405 | 405 | ||
| 406 | 406 | /* determine the type of message (touch or stylus) */ | |
| 407 | 407 | if (data[0] & 0x10) /* a touch data */ | |
| … | … | ||
| 484 | 484 | } | |
| 485 | 485 | } | |
| 486 | 486 | ||
| 487 | DBG(8, priv->debugLevel, xf86Msg(X_INFO, "isdv4Parse MultiTouch " | ||
| 488 | "%s proximity \n", ds->proximity ? "in" : "out of")); | ||
| 487 | DBG(8, priv->debugLevel, "isdv4Parse MultiTouch " | ||
| 488 | "%s proximity \n", ds->proximity ? "in" : "out of"); | ||
| 489 | 489 | } | |
| 490 | 490 | else | |
| 491 | 491 | { | |
| … | … | ||
| 536 | 536 | ds->device_id = ERASER_DEVICE_ID; | |
| 537 | 537 | } | |
| 538 | 538 | ||
| 539 | DBG(8, priv->debugLevel, xf86Msg(X_INFO, "isdv4Parse %s\n", | ||
| 539 | DBG(8, priv->debugLevel, "isdv4Parse %s\n", | ||
| 540 | 540 | ds->device_type == ERASER_ID ? "ERASER " : | |
| 541 | ds->device_type == STYLUS_ID ? "STYLUS" : "NONE")); | ||
| 541 | ds->device_type == STYLUS_ID ? "STYLUS" : "NONE"); | ||
| 542 | 542 | } | |
| 543 | 543 | wcmEvent(common, channel, ds); | |
| 544 | 544 | return common->wcmPktLength; |
src/wcmTouchFilter.c
(3 / 3)
|   | |||
| 129 | 129 | secondChannel->valid.states[1] }; | |
| 130 | 130 | int direction = 0; | |
| 131 | 131 | ||
| 132 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerTapToClick \n")); | ||
| 132 | DBG(10, priv->debugLevel, "xf86WcmFingerTapToClick \n"); | ||
| 133 | 133 | ||
| 134 | 134 | /* skip initial second finger event */ | |
| 135 | 135 | if (!dsLast[1].proximity) | |
| … | … | ||
| 316 | 316 | int gesture = 0; | |
| 317 | 317 | WacomFilterState filterd; /* borrow this struct */ | |
| 318 | 318 | ||
| 319 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerScroll \n")); | ||
| 319 | DBG(10, priv->debugLevel, "xf86WcmFingerScroll \n"); | ||
| 320 | 320 | ||
| 321 | 321 | /* initialize the points so we can rotate them */ | |
| 322 | 322 | filterd.x[0] = ds[0].x; | |
| … | … | ||
| 391 | 391 | int dist = touchDistance(common->wcmGestureState[0], | |
| 392 | 392 | common->wcmGestureState[1]); | |
| 393 | 393 | ||
| 394 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerZoom \n")); | ||
| 394 | DBG(10, priv->debugLevel, "xf86WcmFingerZoom \n"); | ||
| 395 | 395 | ||
| 396 | 396 | dist = touchDistance(ds[0], ds[1]) - dist; | |
| 397 | 397 |
src/wcmUSB.c
(27 / 27)
|   | |||
| 372 | 372 | #ifdef DEBUG | |
| 373 | 373 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 374 | 374 | ||
| 375 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "usbDetect\n")); | ||
| 375 | DBG(1, priv->debugLevel, "usbDetect\n"); | ||
| 376 | 376 | #endif | |
| 377 | 377 | ||
| 378 | 378 | SYSCALL(err = ioctl(local->fd, EVIOCGVERSION, &version)); | |
| … | … | ||
| 508 | 508 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 509 | 509 | WacomCommonPtr common = priv->common; | |
| 510 | 510 | ||
| 511 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "initializing USB tablet\n")); | ||
| 511 | DBG(1, priv->debugLevel, "initializing USB tablet\n"); | ||
| 512 | 512 | *version = 0.0; | |
| 513 | 513 | ||
| 514 | 514 | /* fetch vendor, product, and model name */ | |
| … | … | ||
| 722 | 722 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 723 | 723 | WacomCommonPtr common = priv->common; | |
| 724 | 724 | ||
| 725 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "usbDetectConfig \n")); | ||
| 725 | DBG(10, common->debugLevel, "usbDetectConfig \n"); | ||
| 726 | 726 | if (IsPad (priv)) | |
| 727 | 727 | priv->nbuttons = common->npadkeys; | |
| 728 | 728 | else | |
| … | … | ||
| 813 | 813 | wcmEvent(common, i, &common->wcmChannel[i].work); | |
| 814 | 814 | } | |
| 815 | 815 | } | |
| 816 | DBG(1, common->debugLevel, xf86Msg(X_INFO, "usbParse (device with serial number: %u)" | ||
| 816 | DBG(1, common->debugLevel, "usbParse (device with serial number: %u)" | ||
| 817 | 817 | " at %d: Exceeded channel count; ignoring the events.\n", | |
| 818 | serial, (int)GetTimeInMillis())); | ||
| 818 | serial, (int)GetTimeInMillis()); | ||
| 819 | 819 | } | |
| 820 | 820 | else | |
| 821 | 821 | common->wcmLastToolSerial = serial; | |
| … | … | ||
| 830 | 830 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 831 | 831 | WacomCommonPtr common = priv->common; | |
| 832 | 832 | ||
| 833 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "usbParseEvent \n")); | ||
| 833 | DBG(10, common->debugLevel, "usbParseEvent \n"); | ||
| 834 | 834 | /* store events until we receive the MSC_SERIAL containing | |
| 835 | 835 | * the serial number; without it we cannot determine the | |
| 836 | 836 | * correct channel. */ | |
| … | … | ||
| 890 | 890 | /* ignore events without information */ | |
| 891 | 891 | if (common->wcmEventCnt <= 2) | |
| 892 | 892 | { | |
| 893 | DBG(3, common->debugLevel, xf86Msg(X_INFO, "%s - usbParse: dropping empty event" | ||
| 894 | " for serial %d\n", local->name, common->wcmLastToolSerial)); | ||
| 893 | DBG(3, common->debugLevel, "%s - usbParse: dropping empty event" | ||
| 894 | " for serial %d\n", local->name, common->wcmLastToolSerial); | ||
| 895 | 895 | goto skipEvent; | |
| 896 | 896 | } | |
| 897 | 897 | ||
| … | … | ||
| 923 | 923 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 924 | 924 | WacomCommonPtr common = priv->common; | |
| 925 | 925 | ||
| 926 | DBG(6, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel %d events received\n", common->wcmEventCnt)); | ||
| 926 | DBG(6, common->debugLevel, "usbParseChannel %d events received\n", common->wcmEventCnt); | ||
| 927 | 927 | #define MOD_BUTTONS(bit, value) do { \ | |
| 928 | 928 | shift = 1<<bit; \ | |
| 929 | 929 | ds->buttons = (((value) != 0) ? \ | |
| … | … | ||
| 931 | 931 | } while (0) | |
| 932 | 932 | ||
| 933 | 933 | if (common->wcmEventCnt == 1 && !common->wcmEvents->type) { | |
| 934 | DBG(6, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel no real events received\n")); | ||
| 934 | DBG(6, common->debugLevel, "usbParseChannel no real events received\n"); | ||
| 935 | 935 | return; | |
| 936 | 936 | } | |
| 937 | DBG(6, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel %d events received\n", common->wcmEventCnt)); | ||
| 937 | DBG(6, common->debugLevel, "usbParseChannel %d events received\n", common->wcmEventCnt); | ||
| 938 | 938 | ||
| 939 | 939 | /* all USB data operates from previous context except relative values*/ | |
| 940 | 940 | ds = &common->wcmChannel[channel].work; | |
| … | … | ||
| 945 | 945 | for (i=0; i<common->wcmEventCnt; ++i) | |
| 946 | 946 | { | |
| 947 | 947 | event = common->wcmEvents + i; | |
| 948 | DBG(11, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel " | ||
| 948 | DBG(11, common->debugLevel, "usbParseChannel " | ||
| 949 | 949 | "event[%d]->type=%d code=%d value=%d\n", | |
| 950 | i, event->type, event->code, event->value)); | ||
| 950 | i, event->type, event->code, event->value); | ||
| 951 | 951 | ||
| 952 | 952 | /* absolute events */ | |
| 953 | 953 | if (event->type == EV_ABS) | |
| … | … | ||
| 1002 | 1002 | if (common->wcmProtocolLevel == 4) | |
| 1003 | 1003 | ds->device_id = STYLUS_DEVICE_ID; | |
| 1004 | 1004 | ds->proximity = (event->value != 0); | |
| 1005 | DBG(6, common->debugLevel, xf86Msg(X_INFO, | ||
| 1005 | DBG(6, common->debugLevel, | ||
| 1006 | 1006 | "USB stylus detected %x\n", | |
| 1007 | event->code)); | ||
| 1007 | event->code); | ||
| 1008 | 1008 | } | |
| 1009 | 1009 | else if (event->code == BTN_TOOL_RUBBER) | |
| 1010 | 1010 | { | |
| … | … | ||
| 1015 | 1015 | ds->proximity = (event->value != 0); | |
| 1016 | 1016 | if (ds->proximity) | |
| 1017 | 1017 | ds->proximity = ERASER_PROX; | |
| 1018 | DBG(6, common->debugLevel, xf86Msg(X_INFO, | ||
| 1018 | DBG(6, common->debugLevel, | ||
| 1019 | 1019 | "USB eraser detected %x (value=%d)\n", | |
| 1020 | event->code, event->value)); | ||
| 1020 | event->code, event->value); | ||
| 1021 | 1021 | } | |
| 1022 | 1022 | else if ((event->code == BTN_TOOL_MOUSE) || | |
| 1023 | 1023 | (event->code == BTN_TOOL_LENS)) | |
| 1024 | 1024 | { | |
| 1025 | DBG(6, common->debugLevel, xf86Msg(X_INFO, | ||
| 1025 | DBG(6, common->debugLevel, | ||
| 1026 | 1026 | "USB mouse detected %x (value=%d)\n", | |
| 1027 | event->code, event->value)); | ||
| 1027 | event->code, event->value); | ||
| 1028 | 1028 | ds->device_type = CURSOR_ID; | |
| 1029 | 1029 | /* V5 tools use ABS_MISC to report device_id */ | |
| 1030 | 1030 | if (common->wcmProtocolLevel == 4) | |
| … | … | ||
| 1033 | 1033 | } | |
| 1034 | 1034 | else if (event->code == BTN_TOOL_FINGER) | |
| 1035 | 1035 | { | |
| 1036 | DBG(6, common->debugLevel, xf86Msg(X_INFO, | ||
| 1036 | DBG(6, common->debugLevel, | ||
| 1037 | 1037 | "USB Pad detected %x (value=%d)\n", | |
| 1038 | event->code, event->value)); | ||
| 1038 | event->code, event->value); | ||
| 1039 | 1039 | ds->device_type = PAD_ID; | |
| 1040 | 1040 | ds->device_id = PAD_DEVICE_ID; | |
| 1041 | 1041 | ds->proximity = (event->value != 0); | |
| … | … | ||
| 1044 | 1044 | { | |
| 1045 | 1045 | WacomChannelPtr pChannel = common->wcmChannel + channel; | |
| 1046 | 1046 | WacomDeviceState dslast = pChannel->valid.state; | |
| 1047 | DBG(6, common->debugLevel, xf86Msg(X_INFO, | ||
| 1047 | DBG(6, common->debugLevel, | ||
| 1048 | 1048 | "USB Touch detected %x (value=%d)\n", | |
| 1049 | event->code, event->value)); | ||
| 1049 | event->code, event->value); | ||
| 1050 | 1050 | ds->device_type = TOUCH_ID; | |
| 1051 | 1051 | ds->device_id = TOUCH_DEVICE_ID; | |
| 1052 | 1052 | ds->proximity = event->value; | |
| … | … | ||
| 1066 | 1066 | { | |
| 1067 | 1067 | WacomChannelPtr pChannel = common->wcmChannel + channel; | |
| 1068 | 1068 | WacomDeviceState dslast = pChannel->valid.state; | |
| 1069 | DBG(6, common->debugLevel, xf86Msg(X_INFO, | ||
| 1069 | DBG(6, common->debugLevel, | ||
| 1070 | 1070 | "USB Touch second finger detected %x (value=%d)\n", | |
| 1071 | event->code, event->value)); | ||
| 1071 | event->code, event->value); | ||
| 1072 | 1072 | ds->device_type = TOUCH_ID; | |
| 1073 | 1073 | ds->device_id = TOUCH_DEVICE_ID; | |
| 1074 | 1074 | ds->proximity = event->value; | |
| … | … | ||
| 1115 | 1115 | if (((common->tablet_id == 0xC0) || (common->tablet_id == 0xC2)) && | |
| 1116 | 1116 | (ds->device_type == ERASER_ID)) | |
| 1117 | 1117 | { | |
| 1118 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel " | ||
| 1119 | "DTF 720 doesn't support eraser ")); | ||
| 1118 | DBG(10, common->debugLevel, "usbParseChannel " | ||
| 1119 | "DTF 720 doesn't support eraser "); | ||
| 1120 | 1120 | return; | |
| 1121 | 1121 | } | |
| 1122 | 1122 |
src/wcmXCommand.c
(12 / 12)
|   | |||
| 50 | 50 | /* Pad is always in relative mode when it's a core device. | |
| 51 | 51 | * Always in absolute mode when it is not a core device. | |
| 52 | 52 | */ | |
| 53 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetPadCoreMode (%p)" | ||
| 53 | DBG(10, priv->debugLevel, "xf86WcmSetPadCoreMode (%p)" | ||
| 54 | 54 | " is always in %s mode when it %s core device\n", | |
| 55 | 55 | (void *)local->dev, | |
| 56 | 56 | !is_core ? "absolute" : "relative", | |
| 57 | is_core ? "is" : "isn't")); | ||
| 57 | is_core ? "is" : "isn't"); | ||
| 58 | 58 | if (is_core) | |
| 59 | 59 | priv->flags &= ~ABSOLUTE_FLAG; | |
| 60 | 60 | else | |
| … | … | ||
| 71 | 71 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 72 | 72 | int is_absolute = priv->flags & ABSOLUTE_FLAG; | |
| 73 | 73 | ||
| 74 | DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSwitchModeCall for %s to mode=%d\n", | ||
| 75 | local->name, mode)); | ||
| 74 | DBG(3, priv->debugLevel, "xf86WcmSwitchModeCall for %s to mode=%d\n", | ||
| 75 | local->name, mode); | ||
| 76 | 76 | ||
| 77 | 77 | /* Pad is always in relative mode when it's a core device. | |
| 78 | 78 | * Always in absolute mode when it is not a core device. | |
| … | … | ||
| 96 | 96 | } | |
| 97 | 97 | else if ( (mode != Absolute) && (mode != Relative)) | |
| 98 | 98 | { | |
| 99 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSwitchModeCall" | ||
| 100 | " for %s invalid mode=%d\n", local->name, mode)); | ||
| 99 | DBG(10, priv->debugLevel, "xf86WcmSwitchModeCall" | ||
| 100 | " for %s invalid mode=%d\n", local->name, mode); | ||
| 101 | 101 | return BadMatch; | |
| 102 | 102 | } | |
| 103 | 103 | ||
| … | … | ||
| 114 | 114 | #ifdef DEBUG | |
| 115 | 115 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 116 | 116 | ||
| 117 | DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSwitchMode dev=%p mode=%d\n", | ||
| 118 | (void *)dev, mode)); | ||
| 117 | DBG(3, priv->debugLevel, "xf86WcmSwitchMode dev=%p mode=%d\n", | ||
| 118 | (void *)dev, mode); | ||
| 119 | 119 | #endif | |
| 120 | 120 | /* Share this call with sendAButton in wcmCommon.c */ | |
| 121 | 121 | return xf86WcmDevSwitchModeCall(local, mode); | |
| … | … | ||
| 211 | 211 | WacomCommonPtr common = priv->common; | |
| 212 | 212 | int values[WCM_MAX_MOUSE_BUTTONS]; | |
| 213 | 213 | ||
| 214 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "InitWcmDeviceProperties for %s \n", local->name)); | ||
| 214 | DBG(10, priv->debugLevel, "InitWcmDeviceProperties for %s \n", local->name); | ||
| 215 | 215 | ||
| 216 | 216 | values[0] = priv->topX; | |
| 217 | 217 | values[1] = priv->topY; | |
| … | … | ||
| 299 | 299 | WacomDevicePtr priv = (WacomDevicePtr) local->private; | |
| 300 | 300 | WacomCommonPtr common = priv->common; | |
| 301 | 301 | ||
| 302 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetProperty for %s \n", local->name)); | ||
| 302 | DBG(10, priv->debugLevel, "xf86WcmSetProperty for %s \n", local->name); | ||
| 303 | 303 | ||
| 304 | 304 | if (property == prop_tablet_area) | |
| 305 | 305 | { | |
| … | … | ||
| 497 | 497 | { | |
| 498 | 498 | screen = -1; | |
| 499 | 499 | priv->currentScreen = 0; | |
| 500 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetProperty TwinView sets to " | ||
| 501 | "TV_NONE: can't change screen_no. \n")); | ||
| 500 | DBG(10, priv->debugLevel, "xf86WcmSetProperty TwinView sets to " | ||
| 501 | "TV_NONE: can't change screen_no. \n"); | ||
| 502 | 502 | } | |
| 503 | 503 | xf86WcmChangeScreen(local, screen); | |
| 504 | 504 | } |
src/xf86Wacom.c
(42 / 42)
|   | |||
| 148 | 148 | double screenRatio, tabletRatio; | |
| 149 | 149 | int bottomx = common->wcmMaxX, bottomy = common->wcmMaxY; | |
| 150 | 150 | ||
| 151 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitArea\n")); | ||
| 151 | DBG(10, priv->debugLevel, "xf86WcmInitArea\n"); | ||
| 152 | 152 | ||
| 153 | 153 | if (IsTouch(priv)) | |
| 154 | 154 | { | |
| … | … | ||
| 208 | 208 | tabletRatio = ((double)(bottomx - priv->topX) / | |
| 209 | 209 | (double)(bottomy - priv->topY)); | |
| 210 | 210 | ||
| 211 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, "screenRatio = %.3g, " | ||
| 212 | "tabletRatio = %.3g\n", screenRatio, tabletRatio)); | ||
| 211 | DBG(2, priv->debugLevel, "screenRatio = %.3g, " | ||
| 212 | "tabletRatio = %.3g\n", screenRatio, tabletRatio); | ||
| 213 | 213 | ||
| 214 | 214 | if (screenRatio > tabletRatio) | |
| 215 | 215 | { | |
| … | … | ||
| 296 | 296 | priv->topPadding = (int)((double)(priv->screenTopY[i] * priv->topPadding) | |
| 297 | 297 | / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5); | |
| 298 | 298 | } | |
| 299 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmVirtualTabletPadding for \"%s\" " | ||
| 300 | "x=%d y=%d \n", local->name, priv->leftPadding, priv->topPadding)); | ||
| 299 | DBG(10, priv->debugLevel, "xf86WcmVirtualTabletPadding for \"%s\" " | ||
| 300 | "x=%d y=%d \n", local->name, priv->leftPadding, priv->topPadding); | ||
| 301 | 301 | return; | |
| 302 | 302 | } | |
| 303 | 303 | ||
| … | … | ||
| 336 | 336 | priv->sizeY += (int)((double)((priv->maxHeight - priv->screenBottomY[i]) | |
| 337 | 337 | * tabletSize) / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5); | |
| 338 | 338 | } | |
| 339 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmVirtualTabletSize for \"%s\" " | ||
| 340 | "x=%d y=%d \n", local->name, priv->sizeX, priv->sizeY)); | ||
| 339 | DBG(10, priv->debugLevel, "xf86WcmVirtualTabletSize for \"%s\" " | ||
| 340 | "x=%d y=%d \n", local->name, priv->sizeX, priv->sizeY); | ||
| 341 | 341 | return; | |
| 342 | 342 | } | |
| 343 | 343 | ||
| … | … | ||
| 656 | 656 | * This is only a workaround. | |
| 657 | 657 | */ | |
| 658 | 658 | ||
| 659 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmRegisterX11Devices " | ||
| 659 | DBG(10, priv->debugLevel, "xf86WcmRegisterX11Devices " | ||
| 660 | 660 | "(%s) %d buttons, %d keys, %d axes\n", | |
| 661 | 661 | IsStylus(priv) ? "stylus" : | |
| 662 | 662 | IsCursor(priv) ? "cursor" : | |
| 663 | 663 | IsPad(priv) ? "pad" : "eraser", | |
| 664 | nbbuttons, nbkeys, nbaxes)); | ||
| 664 | nbbuttons, nbkeys, nbaxes); | ||
| 665 | 665 | ||
| 666 | 666 | for(loop=1; loop<=nbbuttons; loop++) | |
| 667 | 667 | butmap[loop] = loop; | |
| … | … | ||
| 976 | 976 | int rc; | |
| 977 | 977 | struct serial_struct ser; | |
| 978 | 978 | ||
| 979 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "opening %s\n", common->wcmDevice)); | ||
| 979 | DBG(1, priv->debugLevel, "opening %s\n", common->wcmDevice); | ||
| 980 | 980 | ||
| 981 | 981 | local->fd = xf86OpenSerial(local->options); | |
| 982 | 982 | if (local->fd < 0) | |
| … | … | ||
| 1035 | 1035 | WacomCommonPtr common = priv->common; | |
| 1036 | 1036 | struct stat st; | |
| 1037 | 1037 | ||
| 1038 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevOpen\n")); | ||
| 1038 | DBG(10, priv->debugLevel, "xf86WcmDevOpen\n"); | ||
| 1039 | 1039 | ||
| 1040 | 1040 | /* Device has been open and not autoprobed */ | |
| 1041 | 1041 | if (priv->wcmDevOpenCount) | |
| … | … | ||
| 1052 | 1052 | if ((xf86WcmOpen (local) != Success) || (local->fd < 0) || | |
| 1053 | 1053 | !common->wcmDevice) | |
| 1054 | 1054 | { | |
| 1055 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "Failed to open " | ||
| 1056 | "device (fd=%d)\n", local->fd)); | ||
| 1055 | DBG(1, priv->debugLevel, "Failed to open " | ||
| 1056 | "device (fd=%d)\n", local->fd); | ||
| 1057 | 1057 | if (local->fd >= 0) | |
| 1058 | 1058 | { | |
| 1059 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "Closing device\n")); | ||
| 1059 | DBG(1, priv->debugLevel, "Closing device\n"); | ||
| 1060 | 1060 | xf86CloseSerial(local->fd); | |
| 1061 | 1061 | } | |
| 1062 | 1062 | local->fd = -1; | |
| … | … | ||
| 1066 | 1066 | if (fstat(local->fd, &st) == -1) | |
| 1067 | 1067 | { | |
| 1068 | 1068 | /* can not access major/minor */ | |
| 1069 | DBG(1, priv->debugLevel, xf86Msg(X_ERROR, "%s: stat failed (%s). " | ||
| 1070 | "cannot check status.\n", local->name, strerror(errno))); | ||
| 1069 | DBG(1, priv->debugLevel, "%s: stat failed (%s). " | ||
| 1070 | "cannot check status.\n", local->name, strerror(errno)); | ||
| 1071 | 1071 | ||
| 1072 | 1072 | /* older systems don't support the required ioctl. | |
| 1073 | 1073 | * So, we have to let it pass */ | |
| … | … | ||
| 1098 | 1098 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1099 | 1099 | #endif | |
| 1100 | 1100 | int n = xf86WaitForInput(local->fd, 0); | |
| 1101 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmReady for %s with %d numbers of data\n", local->name, n)); | ||
| 1101 | DBG(10, priv->debugLevel, "xf86WcmReady for %s with %d numbers of data\n", local->name, n); | ||
| 1102 | 1102 | ||
| 1103 | 1103 | if (n >= 0) return n ? 1 : 0; | |
| 1104 | 1104 | xf86Msg(X_ERROR, "%s: select error: %s\n", local->name, strerror(errno)); | |
| … | … | ||
| 1130 | 1130 | ||
| 1131 | 1131 | /* report how well we're doing */ | |
| 1132 | 1132 | if (loop >= MAX_READ_LOOPS) | |
| 1133 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevReadInput: Can't keep up!!!\n")); | ||
| 1133 | DBG(1, priv->debugLevel, "xf86WcmDevReadInput: Can't keep up!!!\n"); | ||
| 1134 | 1134 | else if (loop > 0) | |
| 1135 | DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevReadInput: Read (%d)\n",loop)); | ||
| 1135 | DBG(10, priv->debugLevel, "xf86WcmDevReadInput: Read (%d)\n",loop); | ||
| 1136 | 1136 | } | |
| 1137 | 1137 | ||
| 1138 | 1138 | void wcmReadPacket(LocalDevicePtr local) | |
| … | … | ||
| 1142 | 1142 | int len, pos, cnt, remaining; | |
| 1143 | 1143 | unsigned char * data; | |
| 1144 | 1144 | ||
| 1145 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmReadPacket: device=%s" | ||
| 1146 | " fd=%d \n", common->wcmDevice, local->fd)); | ||
| 1145 | DBG(10, common->debugLevel, "wcmReadPacket: device=%s" | ||
| 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, "wcmReadPacket: pos=%d" | ||
| 1151 | " remaining=%d\n", common->bufpos, remaining)); | ||
| 1150 | DBG(1, common->debugLevel, "wcmReadPacket: pos=%d" | ||
| 1151 | " remaining=%d\n", common->bufpos, remaining); | ||
| 1152 | 1152 | ||
| 1153 | 1153 | /* fill buffer with as much data as we can handle */ | |
| 1154 | 1154 | len = xf86ReadSerial(local->fd, | |
| … | … | ||
| 1171 | 1171 | ||
| 1172 | 1172 | /* account for new data */ | |
| 1173 | 1173 | common->bufpos += len; | |
| 1174 | DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmReadPacket buffer has %d bytes\n", | ||
| 1175 | common->bufpos)); | ||
| 1174 | DBG(10, common->debugLevel, "wcmReadPacket buffer has %d bytes\n", | ||
| 1175 | common->bufpos); | ||
| 1176 | 1176 | ||
| 1177 | 1177 | pos = 0; | |
| 1178 | 1178 | ||
| … | … | ||
| 1203 | 1203 | cnt = common->wcmModel->Parse(local, common->buffer + pos); | |
| 1204 | 1204 | if (cnt <= 0) | |
| 1205 | 1205 | { | |
| 1206 | DBG(1, common->debugLevel, xf86Msg(X_INFO, "Misbehaving parser returned %d\n",cnt)); | ||
| 1206 | DBG(1, common->debugLevel, "Misbehaving parser returned %d\n",cnt); | ||
| 1207 | 1207 | break; | |
| 1208 | 1208 | } | |
| 1209 | 1209 | pos += cnt; | |
| … | … | ||
| 1214 | 1214 | /* if half a packet remains, move it down */ | |
| 1215 | 1215 | if (pos < common->bufpos) | |
| 1216 | 1216 | { | |
| 1217 | DBG(7, common->debugLevel, xf86Msg(X_INFO, "MOVE %d bytes\n", common->bufpos - pos)); | ||
| 1217 | DBG(7, common->debugLevel, "MOVE %d bytes\n", common->bufpos - pos); | ||
| 1218 | 1218 | memmove(common->buffer,common->buffer+pos, | |
| 1219 | 1219 | common->bufpos-pos); | |
| 1220 | 1220 | common->bufpos -= pos; | |
| … | … | ||
| 1232 | 1232 | { | |
| 1233 | 1233 | #ifdef DEBUG | |
| 1234 | 1234 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1235 | DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevChangeControl called\n")); | ||
| 1235 | DBG(3, priv->debugLevel, "xf86WcmDevChangeControl called\n"); | ||
| 1236 | 1236 | #endif | |
| 1237 | 1237 | return Success; | |
| 1238 | 1238 | } | |
| … | … | ||
| 1247 | 1247 | LocalDevicePtr local = (LocalDevicePtr)device->public.devicePrivate; | |
| 1248 | 1248 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1249 | 1249 | ||
| 1250 | DBG(4, priv->debugLevel, xf86Msg(X_INFO, "Wacom Dev Control Proc called\n")); | ||
| 1250 | DBG(4, priv->debugLevel, "Wacom Dev Control Proc called\n"); | ||
| 1251 | 1251 | #endif | |
| 1252 | 1252 | return; | |
| 1253 | 1253 | } | |
| … | … | ||
| 1261 | 1261 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1262 | 1262 | WacomCommonPtr common = priv->common; | |
| 1263 | 1263 | ||
| 1264 | DBG(4, priv->debugLevel, xf86Msg(X_INFO, "Wacom number of open devices = %d\n", common->fd_refs)); | ||
| 1264 | DBG(4, priv->debugLevel, "Wacom number of open devices = %d\n", common->fd_refs); | ||
| 1265 | 1265 | ||
| 1266 | 1266 | if (local->fd >= 0) | |
| 1267 | 1267 | { | |
| 1268 | 1268 | local->fd = -1; | |
| 1269 | 1269 | if (!--common->fd_refs) | |
| 1270 | 1270 | { | |
| 1271 | DBG(1, common->debugLevel, xf86Msg(X_INFO, "Closing device; uninitializing.\n")); | ||
| 1271 | DBG(1, common->debugLevel, "Closing device; uninitializing.\n"); | ||
| 1272 | 1272 | xf86CloseSerial (common->fd); | |
| 1273 | 1273 | } | |
| 1274 | 1274 | } | |
| … | … | ||
| 1284 | 1284 | LocalDevicePtr local = (LocalDevicePtr)pWcm->public.devicePrivate; | |
| 1285 | 1285 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1286 | 1286 | ||
| 1287 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, "BEGIN xf86WcmProc dev=%p priv=%p " | ||
| 1287 | DBG(2, priv->debugLevel, "BEGIN xf86WcmProc dev=%p priv=%p " | ||
| 1288 | 1288 | "type=%s(%s) flags=%d fd=%d what=%s\n", | |
| 1289 | 1289 | (void *)pWcm, (void *)priv, | |
| 1290 | 1290 | IsStylus(priv) ? "stylus" : | |
| … | … | ||
| 1294 | 1294 | (what == DEVICE_INIT) ? "INIT" : | |
| 1295 | 1295 | (what == DEVICE_OFF) ? "OFF" : | |
| 1296 | 1296 | (what == DEVICE_ON) ? "ON" : | |
| 1297 | (what == DEVICE_CLOSE) ? "CLOSE" : "???")); | ||
| 1297 | (what == DEVICE_CLOSE) ? "CLOSE" : "???"); | ||
| 1298 | 1298 | ||
| 1299 | 1299 | switch (what) | |
| 1300 | 1300 | { | |
| … | … | ||
| 1306 | 1306 | priv->wcmInitKeyClassCount = 0; | |
| 1307 | 1307 | if (!xf86WcmDevOpen(pWcm)) | |
| 1308 | 1308 | { | |
| 1309 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmProc INIT FAILED\n")); | ||
| 1309 | DBG(1, priv->debugLevel, "xf86WcmProc INIT FAILED\n"); | ||
| 1310 | 1310 | return !Success; | |
| 1311 | 1311 | } | |
| 1312 | 1312 | priv->wcmInitKeyClassCount++; | |
| … | … | ||
| 1316 | 1316 | case DEVICE_ON: | |
| 1317 | 1317 | if (!xf86WcmDevOpen(pWcm)) | |
| 1318 | 1318 | { | |
| 1319 | DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmProc ON FAILED\n")); | ||
| 1319 | DBG(1, priv->debugLevel, "xf86WcmProc ON FAILED\n"); | ||
| 1320 | 1320 | return !Success; | |
| 1321 | 1321 | } | |
| 1322 | 1322 | priv->wcmDevOpenCount++; | |
| … | … | ||
| 1341 | 1341 | break; | |
| 1342 | 1342 | } /* end switch */ | |
| 1343 | 1343 | ||
| 1344 | DBG(2, priv->debugLevel, xf86Msg(X_INFO, "END xf86WcmProc Success \n")); | ||
| 1344 | DBG(2, priv->debugLevel, "END xf86WcmProc Success \n"); | ||
| 1345 | 1345 | return Success; | |
| 1346 | 1346 | } | |
| 1347 | 1347 | ||
| … | … | ||
| 1356 | 1356 | { | |
| 1357 | 1357 | WacomDevicePtr priv = (WacomDevicePtr) local->private; | |
| 1358 | 1358 | ||
| 1359 | DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevConvert v0=%d v1=%d on screen %d \n", | ||
| 1360 | v0, v1, priv->currentScreen)); | ||
| 1359 | DBG(6, priv->debugLevel, "xf86WcmDevConvert v0=%d v1=%d on screen %d \n", | ||
| 1360 | v0, v1, priv->currentScreen); | ||
| 1361 | 1361 | ||
| 1362 | 1362 | if (first != 0 || num == 1) | |
| 1363 | 1363 | return FALSE; | |
| … | … | ||
| 1392 | 1392 | if (*y < 0) *y = 0; | |
| 1393 | 1393 | ||
| 1394 | 1394 | } | |
| 1395 | DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevConvert v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y)); | ||
| 1395 | DBG(6, priv->debugLevel, "xf86WcmDevConvert v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y); | ||
| 1396 | 1396 | return TRUE; | |
| 1397 | 1397 | } | |
| 1398 | 1398 | ||
| … | … | ||
| 1409 | 1409 | WacomDevicePtr priv = (WacomDevicePtr) local->private; | |
| 1410 | 1410 | int i = 0; | |
| 1411 | 1411 | ||
| 1412 | DBG(6, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevReverseConvert x=%d y=%d \n", x, y)); | ||
| 1412 | DBG(6, priv->debugLevel, "xf86WcmDevReverseConvert x=%d y=%d \n", x, y); | ||
| 1413 | 1413 | priv->currentSX = x; | |
| 1414 | 1414 | priv->currentSY = y; | |
| 1415 | 1415 | ||
| … | … | ||
| 1430 | 1430 | priv->devReverseCount = 0; | |
| 1431 | 1431 | } | |
| 1432 | 1432 | ||
| 1433 | DBG(6, priv->debugLevel, xf86Msg(X_INFO, "Wacom converted x=%d y=%d" | ||
| 1433 | DBG(6, priv->debugLevel, "Wacom converted x=%d y=%d" | ||
| 1434 | 1434 | " to v0=%d v1=%d v2=%d v3=%d v4=%d v5=%d\n", x, y, | |
| 1435 | 1435 | valuators[0], valuators[1], valuators[2], | |
| 1436 | valuators[3], valuators[4], valuators[5])); | ||
| 1436 | valuators[3], valuators[4], valuators[5]); | ||
| 1437 | 1437 | ||
| 1438 | 1438 | return TRUE; | |
| 1439 | 1439 | } |
src/xf86Wacom.h
(6 / 2)
|   | |||
| 74 | 74 | #endif | |
| 75 | 75 | ||
| 76 | 76 | #if DEBUG | |
| 77 | #define DBG(lvl, dLevel, f) do { if ((lvl) <= dLevel) f; } while (0) | ||
| 77 | #define DBG(lvl, dLevel, ...) \ | ||
| 78 | do { \ | ||
| 79 | if ((lvl) <= dLevel) \ | ||
| 80 | xf86Msg(X_INFO, __VA_ARGS__); \ | ||
| 81 | } while (0) | ||
| 78 | 82 | #else | |
| 79 | #define DBG(lvl, dLevel, f) | ||
| 83 | #define DBG(lvl, dLevel, ...) | ||
| 80 | 84 | #endif | |
| 81 | 85 | ||
| 82 | 86 | /***************************************************************************** |

