Commit ea0591783f7c32dc9c650bc1b1f12a7c62379991
- Diff rendering mode:
- inline
- side by side
src/wcmCommon.c
(23 / 25)
|   | |||
| 56 | 56 | void xf86WcmMappingFactor(LocalDevicePtr local) | |
| 57 | 57 | { | |
| 58 | 58 | WacomDevicePtr priv = (WacomDevicePtr) local->private; | |
| 59 | |||
| 60 | DBG(10, priv->debugLevel, "xf86WcmMappingFactor \n"); | ||
| 61 | 59 | ||
| 60 | DBG(10, priv->debugLevel, "\n"); /* just prints function name */ | ||
| 61 | |||
| 62 | 62 | xf86WcmVirtualTabletSize(local); | |
| 63 | 63 | ||
| 64 | 64 | if (!(priv->flags & ABSOLUTE_FLAG) || !priv->wcmMMonitor) | |
| … | … | ||
| 81 | 81 | if (priv->currentScreen == -1) /* tool on the tablet */ | |
| 82 | 82 | priv->currentScreen = 0; | |
| 83 | 83 | ||
| 84 | DBG(10, priv->debugLevel, "xf86WcmMappingFactor" | ||
| 85 | " Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d) map" | ||
| 86 | " to maxWidth =%d maxHeight =%d\n", | ||
| 84 | DBG(10, priv->debugLevel, | ||
| 85 | "Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d) map" | ||
| 86 | " to maxWidth =%d maxHeight =%d\n", | ||
| 87 | 87 | priv->bottomX, priv->bottomY, priv->sizeX, priv->sizeY, | |
| 88 | 88 | priv->maxWidth, priv->maxHeight); | |
| 89 | 89 | ||
| … | … | ||
| 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, "xf86WcmSetScreen v0=%d v1=%d " | ||
| 109 | DBG(6, priv->debugLevel, "v0=%d v1=%d " | ||
| 110 | 110 | "currentScreen=%d\n", v0, v1, priv->currentScreen); | |
| 111 | 111 | ||
| 112 | 112 | if (priv->screen_no != -1 && priv->screen_no >= priv->numScreen) | |
| … | … | ||
| 152 | 152 | if (v0 > priv->topY && v0 <= priv->topY + priv->tvoffsetY) | |
| 153 | 153 | priv->currentScreen = 1; | |
| 154 | 154 | } | |
| 155 | DBG(10, priv->debugLevel, "xf86WcmSetScreen TwinView setup screenToSet=%d\n", | ||
| 155 | DBG(10, priv->debugLevel, "TwinView setup screenToSet=%d\n", | ||
| 156 | 156 | priv->currentScreen); | |
| 157 | 157 | } | |
| 158 | 158 | ||
| … | … | ||
| 194 | 194 | ||
| 195 | 195 | if (screenToSet == -1) | |
| 196 | 196 | { | |
| 197 | DBG(3, priv->debugLevel, "xf86WcmSetScreen Error: " | ||
| 197 | DBG(3, priv->debugLevel, "Error: " | ||
| 198 | 198 | "Can not find valid screen (currentScreen=%d)\n", | |
| 199 | 199 | priv->currentScreen); | |
| 200 | 200 | return; | |
| … | … | ||
| 210 | 210 | y = screenInfo.screens[screenToSet]->height - 1; | |
| 211 | 211 | ||
| 212 | 212 | xf86XInputSetScreen(local, screenToSet, x, y); | |
| 213 | DBG(10, priv->debugLevel, "xf86WcmSetScreen current=%d ToSet=%d\n", | ||
| 213 | DBG(10, priv->debugLevel, "current=%d ToSet=%d\n", | ||
| 214 | 214 | priv->currentScreen, screenToSet); | |
| 215 | 215 | priv->currentScreen = screenToSet; | |
| 216 | 216 | } | |
| … | … | ||
| 227 | 227 | int button, mask; | |
| 228 | 228 | WacomDevicePtr priv = (WacomDevicePtr) local->private; | |
| 229 | 229 | WacomCommonPtr common = priv->common; | |
| 230 | DBG(6, priv->debugLevel, "xf86WcmSendButtons " | ||
| 231 | "buttons=%d for %s\n", buttons, local->name); | ||
| 230 | DBG(6, priv->debugLevel, "buttons=%d for %s\n", buttons, local->name); | ||
| 232 | 231 | ||
| 233 | 232 | /* Tablet PC buttons only apply to penabled devices */ | |
| 234 | 233 | if (common->wcmTPCButton && (priv->flags & STYLUS_ID)) | |
| … | … | ||
| 460 | 460 | if (!priv->button[button]) /* ignore this button event */ | |
| 461 | 461 | return; | |
| 462 | 462 | ||
| 463 | DBG(4, priv->debugLevel, "sendAButton TPCButton(%s) button=%d state=%d " | ||
| 463 | DBG(4, priv->debugLevel, "TPCButton(%s) button=%d state=%d " | ||
| 464 | 464 | "code=%08x, for %s coreEvent=%s \n", | |
| 465 | 465 | common->wcmTPCButton ? "on" : "off", | |
| 466 | 466 | button, mask, priv->button[button], | |
| … | … | ||
| 577 | 577 | unsigned *keyP = 0; | |
| 578 | 578 | int is_absolute = priv->flags & ABSOLUTE_FLAG; | |
| 579 | 579 | ||
| 580 | DBG(10, priv->debugLevel, "sendWheelStripEvents for %s \n", local->name); | ||
| 580 | DBG(10, priv->debugLevel, "strip events for %s \n", local->name); | ||
| 581 | 581 | ||
| 582 | 582 | /* emulate events for relative wheel */ | |
| 583 | 583 | if ( ds->relwheel ) | |
| … | … | ||
| 667 | 667 | ||
| 668 | 668 | if (!fakeButton) return; | |
| 669 | 669 | ||
| 670 | DBG(10, priv->debugLevel, "sendWheelStripEvents " | ||
| 671 | "send fakeButton %x with value = %d \n", | ||
| 670 | DBG(10, priv->debugLevel, "send fakeButton %x with value = %d \n", | ||
| 672 | 671 | fakeButton, value); | |
| 673 | 672 | ||
| 674 | 673 | switch (fakeButton & AC_TYPE) | |
| … | … | ||
| 1066 | 1066 | dsNew->y = dsOrig->y; | |
| 1067 | 1067 | } | |
| 1068 | 1068 | ||
| 1069 | DBG(10, common->debugLevel, "xf86WcmSuppress at level = %d" | ||
| 1069 | DBG(10, common->debugLevel, "level = %d" | ||
| 1070 | 1070 | " return value = %d\n", suppress, returnV); | |
| 1071 | 1071 | return returnV; | |
| 1072 | 1072 | } | |
| … | … | ||
| 1101 | 1101 | pChannel = common->wcmChannel + channel; | |
| 1102 | 1102 | pLast = &pChannel->valid.state; | |
| 1103 | 1103 | ||
| 1104 | DBG(10, common->debugLevel, "wcmEvent at channel = %d\n", channel); | ||
| 1104 | DBG(10, common->debugLevel, "channel = %d\n", channel); | ||
| 1105 | 1105 | ||
| 1106 | 1106 | /* sanity check the channel */ | |
| 1107 | 1107 | if (channel >= MAX_CHANNELS) | |
| … | … | ||
| 1113 | 1113 | ||
| 1114 | 1114 | /* timestamp the state for velocity and acceleration analysis */ | |
| 1115 | 1115 | ds.sample = (int)GetTimeInMillis(); | |
| 1116 | DBG(10, common->debugLevel, "wcmEvent: " | ||
| 1116 | DBG(10, common->debugLevel, | ||
| 1117 | 1117 | "c=%d i=%d t=%d s=%u x=%d y=%d b=%d " | |
| 1118 | 1118 | "p=%d rz=%d tx=%d ty=%d aw=%d rw=%d " | |
| 1119 | 1119 | "t=%d df=%d px=%d st=%d cs=%d \n", | |
| … | … | ||
| 1335 | 1335 | } | |
| 1336 | 1336 | } | |
| 1337 | 1337 | ||
| 1338 | DBG(10, common->debugLevel, "commonDispatchDevice device type = %d\n", ds->device_type); | ||
| 1338 | DBG(10, common->debugLevel, "device type = %d\n", ds->device_type); | ||
| 1339 | 1339 | /* Find the device the current events are meant for */ | |
| 1340 | 1340 | /* 1: Find the tool (the one with correct serial or in second | |
| 1341 | 1341 | * hand, the one with serial set to 0 if no match with the | |
| … | … | ||
| 1802 | 1802 | priv->screenBottomY[1] = priv->tvResolution[1]; | |
| 1803 | 1803 | } | |
| 1804 | 1804 | ||
| 1805 | DBG(10, priv->debugLevel, "xf86WcmInitialTVScreens for \"%s\" " | ||
| 1805 | DBG(10, priv->debugLevel, "\"%s\":" | ||
| 1806 | 1806 | "topX0=%d topY0=%d bottomX0=%d bottomY0=%d " | |
| 1807 | 1807 | "topX1=%d topY1=%d bottomX1=%d bottomY1=%d \n", | |
| 1808 | 1808 | local->name, priv->screenTopX[0], priv->screenTopY[0], | |
| … | … | ||
| 1820 | 1820 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1821 | 1821 | int i; | |
| 1822 | 1822 | ||
| 1823 | DBG(2, priv->debugLevel, "xf86WcmInitialScreens for \"%s\" " | ||
| 1823 | DBG(2, priv->debugLevel, "\"%s\":" | ||
| 1824 | 1824 | "number of screen=%d \n", local->name, screenInfo.numScreens); | |
| 1825 | 1825 | priv->tvoffsetX = 0; | |
| 1826 | 1826 | priv->tvoffsetY = 0; | |
| … | … | ||
| 1845 | 1845 | priv->screenBottomX[i] = dixScreenOrigins[i].x; | |
| 1846 | 1846 | priv->screenBottomY[i] = dixScreenOrigins[i].y; | |
| 1847 | 1847 | ||
| 1848 | DBG(10, priv->debugLevel, "xf86WcmInitialScreens from dix for \"%s\" " | ||
| 1848 | DBG(10, priv->debugLevel, "from dix for \"%s\" " | ||
| 1849 | 1849 | "ScreenOrigins[%d].x=%d ScreenOrigins[%d].y=%d \n", | |
| 1850 | 1850 | local->name, i, priv->screenTopX[i], i, | |
| 1851 | 1851 | priv->screenTopY[i]); | |
| … | … | ||
| 1854 | 1854 | priv->screenBottomX[i] += screenInfo.screens[i]->width; | |
| 1855 | 1855 | priv->screenBottomY[i] += screenInfo.screens[i]->height; | |
| 1856 | 1856 | ||
| 1857 | DBG(10, priv->debugLevel, "xf86WcmInitialScreens for \"%s\" " | ||
| 1857 | DBG(10, priv->debugLevel, "\"%s\":" | ||
| 1858 | 1858 | "topX[%d]=%d topY[%d]=%d bottomX[%d]=%d bottomY[%d]=%d \n", | |
| 1859 | 1859 | local->name, i, priv->screenTopX[i], i, priv->screenTopY[i], | |
| 1860 | 1860 | i, priv->screenBottomX[i], i, priv->screenBottomY[i]); | |
| … | … | ||
| 1871 | 1871 | WacomToolAreaPtr area = priv->toolarea; | |
| 1872 | 1872 | int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY; | |
| 1873 | 1873 | ||
| 1874 | DBG(10, priv->debugLevel, "rotateOneTool for \"%s\" \n", priv->local->name); | ||
| 1874 | DBG(10, priv->debugLevel, "\"%s\"", priv->local->name); | ||
| 1875 | 1875 | ||
| 1876 | 1876 | if (!IsTouch(priv)) | |
| 1877 | 1877 | { | |
| … | … | ||
| 1948 | 1948 | int oldRotation; | |
| 1949 | 1949 | int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY; | |
| 1950 | 1950 | ||
| 1951 | DBG(10, priv->debugLevel, "xf86WcmRotateTablet for \"%s\" \n", local->name); | ||
| 1951 | DBG(10, priv->debugLevel, "\"%s\":\n", local->name); | ||
| 1952 | 1952 | ||
| 1953 | 1953 | if (common->wcmRotate == value) /* initialization */ | |
| 1954 | 1954 | { |
src/wcmConfig.c
(2 / 2)
|   | |||
| 229 | 229 | WacomDevicePtr dev; | |
| 230 | 230 | WacomDevicePtr *prev; | |
| 231 | 231 | ||
| 232 | DBG(1, priv->debugLevel, "xf86WcmUninit\n"); | ||
| 232 | DBG(1, priv->debugLevel, "\n"); | ||
| 233 | 233 | ||
| 234 | 234 | if (priv->isParent) | |
| 235 | 235 | { | |
| … | … | ||
| 290 | 290 | !strcmp(privMatch->common->wcmDevice, common->wcmDevice)) | |
| 291 | 291 | { | |
| 292 | 292 | DBG(2, priv->debugLevel, | |
| 293 | "xf86WcmInit wacom port share between" | ||
| 293 | "port share between" | ||
| 294 | 294 | " %s and %s\n", pLocal->name, pMatch->name); | |
| 295 | 295 | type = xf86FindOptionValue(pMatch->options, "Type"); | |
| 296 | 296 | if ( type && (strstr(type, "eraser")) ) |
src/wcmFilter.c
(1 / 1)
|   | |||
| 248 | 248 | WacomDeviceState *pLast; | |
| 249 | 249 | int *x, *y, i; | |
| 250 | 250 | ||
| 251 | DBG(10, common->debugLevel, "wcmFilterCoord with " | ||
| 251 | DBG(10, common->debugLevel, | ||
| 252 | 252 | "common->wcmRawSample = %d \n", common->wcmRawSample); | |
| 253 | 253 | x = pChannel->rawFilter.x; | |
| 254 | 254 | y = pChannel->rawFilter.y; |
src/wcmISDV4.c
(5 / 5)
|   | |||
| 281 | 281 | if (!common->wcmMaxX || !common->wcmMaxY) | |
| 282 | 282 | common->tablet_id = 0xE2; | |
| 283 | 283 | ||
| 284 | DBG(2, priv->debugLevel, "isdv4GetRanges Pen speed=%d " | ||
| 284 | DBG(2, priv->debugLevel, "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 | 287 | common->wcmMaxZ, common->wcmResolX, common->wcmResolY); | |
| … | … | ||
| 367 | 367 | common->wcmVersion = ( data[10] | (data[9] << 7) ); | |
| 368 | 368 | ret = Success; | |
| 369 | 369 | ||
| 370 | DBG(2, priv->debugLevel, "isdv4GetRanges touch speed=%d " | ||
| 370 | DBG(2, priv->debugLevel, "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, | |
| … | … | ||
| 401 | 401 | WacomDeviceState* ds; | |
| 402 | 402 | int n, cur_type, channel = 0; | |
| 403 | 403 | ||
| 404 | DBG(10, common->debugLevel, "isdv4Parse \n"); | ||
| 404 | DBG(10, common->debugLevel, "\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, "isdv4Parse MultiTouch " | ||
| 487 | DBG(8, priv->debugLevel, "MultiTouch " | ||
| 488 | 488 | "%s proximity \n", ds->proximity ? "in" : "out of"); | |
| 489 | 489 | } | |
| 490 | 490 | else | |
| … | … | ||
| 536 | 536 | ds->device_id = ERASER_DEVICE_ID; | |
| 537 | 537 | } | |
| 538 | 538 | ||
| 539 | DBG(8, priv->debugLevel, "isdv4Parse %s\n", | ||
| 539 | DBG(8, priv->debugLevel, "%s\n", | ||
| 540 | 540 | ds->device_type == ERASER_ID ? "ERASER " : | |
| 541 | 541 | ds->device_type == STYLUS_ID ? "STYLUS" : "NONE"); | |
| 542 | 542 | } |
src/wcmTouchFilter.c
(3 / 3)
|   | |||
| 129 | 129 | secondChannel->valid.states[1] }; | |
| 130 | 130 | int direction = 0; | |
| 131 | 131 | ||
| 132 | DBG(10, priv->debugLevel, "xf86WcmFingerTapToClick \n"); | ||
| 132 | DBG(10, priv->debugLevel, "\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, "xf86WcmFingerScroll \n"); | ||
| 319 | DBG(10, priv->debugLevel, "\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, "xf86WcmFingerZoom \n"); | ||
| 394 | DBG(10, priv->debugLevel, "\n"); | ||
| 395 | 395 | ||
| 396 | 396 | dist = touchDistance(ds[0], ds[1]) - dist; | |
| 397 | 397 |
src/wcmUSB.c
(10 / 10)
|   | |||
| 372 | 372 | #ifdef DEBUG | |
| 373 | 373 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 374 | 374 | ||
| 375 | DBG(1, priv->debugLevel, "usbDetect\n"); | ||
| 375 | DBG(1, priv->debugLevel, "\n"); | ||
| 376 | 376 | #endif | |
| 377 | 377 | ||
| 378 | 378 | SYSCALL(err = ioctl(local->fd, EVIOCGVERSION, &version)); | |
| … | … | ||
| 722 | 722 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 723 | 723 | WacomCommonPtr common = priv->common; | |
| 724 | 724 | ||
| 725 | DBG(10, common->debugLevel, "usbDetectConfig \n"); | ||
| 725 | DBG(10, common->debugLevel, "\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, "usbParse (device with serial number: %u)" | ||
| 816 | DBG(1, common->debugLevel, "device with serial number: %u" | ||
| 817 | 817 | " at %d: Exceeded channel count; ignoring the events.\n", | |
| 818 | 818 | serial, (int)GetTimeInMillis()); | |
| 819 | 819 | } | |
| … | … | ||
| 830 | 830 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 831 | 831 | WacomCommonPtr common = priv->common; | |
| 832 | 832 | ||
| 833 | DBG(10, common->debugLevel, "usbParseEvent \n"); | ||
| 833 | DBG(10, common->debugLevel, "\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, "%s - usbParse: dropping empty event" | ||
| 893 | DBG(3, common->debugLevel, "%s: dropping empty event" | ||
| 894 | 894 | " for serial %d\n", local->name, common->wcmLastToolSerial); | |
| 895 | 895 | goto skipEvent; | |
| 896 | 896 | } | |
| … | … | ||
| 923 | 923 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 924 | 924 | WacomCommonPtr common = priv->common; | |
| 925 | 925 | ||
| 926 | DBG(6, common->debugLevel, "usbParseChannel %d events received\n", common->wcmEventCnt); | ||
| 926 | DBG(6, common->debugLevel, "%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, "usbParseChannel no real events received\n"); | ||
| 934 | DBG(6, common->debugLevel, "no real events received\n"); | ||
| 935 | 935 | return; | |
| 936 | 936 | } | |
| 937 | DBG(6, common->debugLevel, "usbParseChannel %d events received\n", common->wcmEventCnt); | ||
| 937 | DBG(6, common->debugLevel, "%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, "usbParseChannel " | ||
| 948 | DBG(11, common->debugLevel, | ||
| 949 | 949 | "event[%d]->type=%d code=%d value=%d\n", | |
| 950 | 950 | i, event->type, event->code, event->value); | |
| 951 | 951 | ||
| … | … | ||
| 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, "usbParseChannel " | ||
| 1118 | DBG(10, common->debugLevel, | ||
| 1119 | 1119 | "DTF 720 doesn't support eraser "); | |
| 1120 | 1120 | return; | |
| 1121 | 1121 | } |
src/wcmXCommand.c
(8 / 8)
|   | |||
| 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, "xf86WcmSetPadCoreMode (%p)" | ||
| 53 | DBG(10, priv->debugLevel, "%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", | |
| … | … | ||
| 71 | 71 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 72 | 72 | int is_absolute = priv->flags & ABSOLUTE_FLAG; | |
| 73 | 73 | ||
| 74 | DBG(3, priv->debugLevel, "xf86WcmSwitchModeCall for %s to mode=%d\n", | ||
| 74 | DBG(3, priv->debugLevel, "%s to mode=%d\n", | ||
| 75 | 75 | local->name, mode); | |
| 76 | 76 | ||
| 77 | 77 | /* Pad is always in relative mode when it's a core device. | |
| … | … | ||
| 96 | 96 | } | |
| 97 | 97 | else if ( (mode != Absolute) && (mode != Relative)) | |
| 98 | 98 | { | |
| 99 | DBG(10, priv->debugLevel, "xf86WcmSwitchModeCall" | ||
| 100 | " for %s invalid mode=%d\n", local->name, mode); | ||
| 99 | DBG(10, priv->debugLevel, | ||
| 100 | "%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, "xf86WcmSwitchMode dev=%p mode=%d\n", | ||
| 117 | DBG(3, priv->debugLevel, "dev=%p mode=%d\n", | ||
| 118 | 118 | (void *)dev, mode); | |
| 119 | 119 | #endif | |
| 120 | 120 | /* Share this call with sendAButton in wcmCommon.c */ | |
| … | … | ||
| 211 | 211 | WacomCommonPtr common = priv->common; | |
| 212 | 212 | int values[WCM_MAX_MOUSE_BUTTONS]; | |
| 213 | 213 | ||
| 214 | DBG(10, priv->debugLevel, "InitWcmDeviceProperties for %s \n", local->name); | ||
| 214 | DBG(10, priv->debugLevel, "%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, "xf86WcmSetProperty for %s \n", local->name); | ||
| 302 | DBG(10, priv->debugLevel, "%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, "xf86WcmSetProperty TwinView sets to " | ||
| 500 | DBG(10, priv->debugLevel, "TwinView sets to " | ||
| 501 | 501 | "TV_NONE: can't change screen_no. \n"); | |
| 502 | 502 | } | |
| 503 | 503 | xf86WcmChangeScreen(local, screen); |
src/xf86Wacom.c
(20 / 20)
|   | |||
| 148 | 148 | double screenRatio, tabletRatio; | |
| 149 | 149 | int bottomx = common->wcmMaxX, bottomy = common->wcmMaxY; | |
| 150 | 150 | ||
| 151 | DBG(10, priv->debugLevel, "xf86WcmInitArea\n"); | ||
| 151 | DBG(10, priv->debugLevel, "\n"); | ||
| 152 | 152 | ||
| 153 | 153 | if (IsTouch(priv)) | |
| 154 | 154 | { | |
| … | … | ||
| 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, "xf86WcmVirtualTabletPadding for \"%s\" " | ||
| 299 | DBG(10, priv->debugLevel, "\"%s\" " | ||
| 300 | 300 | "x=%d y=%d \n", local->name, priv->leftPadding, priv->topPadding); | |
| 301 | 301 | return; | |
| 302 | 302 | } | |
| … | … | ||
| 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, "xf86WcmVirtualTabletSize for \"%s\" " | ||
| 339 | DBG(10, priv->debugLevel, "\"%s\" " | ||
| 340 | 340 | "x=%d y=%d \n", local->name, priv->sizeX, priv->sizeY); | |
| 341 | 341 | return; | |
| 342 | 342 | } | |
| … | … | ||
| 656 | 656 | * This is only a workaround. | |
| 657 | 657 | */ | |
| 658 | 658 | ||
| 659 | DBG(10, priv->debugLevel, "xf86WcmRegisterX11Devices " | ||
| 659 | DBG(10, priv->debugLevel, | ||
| 660 | 660 | "(%s) %d buttons, %d keys, %d axes\n", | |
| 661 | 661 | IsStylus(priv) ? "stylus" : | |
| 662 | 662 | IsCursor(priv) ? "cursor" : | |
| … | … | ||
| 1035 | 1035 | WacomCommonPtr common = priv->common; | |
| 1036 | 1036 | struct stat st; | |
| 1037 | 1037 | ||
| 1038 | DBG(10, priv->debugLevel, "xf86WcmDevOpen\n"); | ||
| 1038 | DBG(10, priv->debugLevel, "\n"); | ||
| 1039 | 1039 | ||
| 1040 | 1040 | /* Device has been open and not autoprobed */ | |
| 1041 | 1041 | if (priv->wcmDevOpenCount) | |
| … | … | ||
| 1098 | 1098 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1099 | 1099 | #endif | |
| 1100 | 1100 | int n = xf86WaitForInput(local->fd, 0); | |
| 1101 | DBG(10, priv->debugLevel, "xf86WcmReady for %s with %d numbers of data\n", local->name, n); | ||
| 1101 | DBG(10, priv->debugLevel, "%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, "xf86WcmDevReadInput: Can't keep up!!!\n"); | ||
| 1133 | DBG(1, priv->debugLevel, "Can't keep up!!!\n"); | ||
| 1134 | 1134 | else if (loop > 0) | |
| 1135 | DBG(10, priv->debugLevel, "xf86WcmDevReadInput: Read (%d)\n",loop); | ||
| 1135 | DBG(10, priv->debugLevel, "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, "wcmReadPacket: device=%s" | ||
| 1145 | DBG(10, common->debugLevel, "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, "wcmReadPacket: pos=%d" | ||
| 1150 | DBG(1, common->debugLevel, "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, "wcmReadPacket buffer has %d bytes\n", | ||
| 1174 | DBG(10, common->debugLevel, "buffer has %d bytes\n", | ||
| 1175 | 1175 | common->bufpos); | |
| 1176 | 1176 | ||
| 1177 | 1177 | pos = 0; | |
| … | … | ||
| 1232 | 1232 | { | |
| 1233 | 1233 | #ifdef DEBUG | |
| 1234 | 1234 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1235 | DBG(3, priv->debugLevel, "xf86WcmDevChangeControl called\n"); | ||
| 1235 | DBG(3, priv->debugLevel, "\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, "Wacom Dev Control Proc called\n"); | ||
| 1250 | DBG(4, priv->debugLevel, "called\n"); | ||
| 1251 | 1251 | #endif | |
| 1252 | 1252 | return; | |
| 1253 | 1253 | } | |
| … | … | ||
| 1284 | 1284 | LocalDevicePtr local = (LocalDevicePtr)pWcm->public.devicePrivate; | |
| 1285 | 1285 | WacomDevicePtr priv = (WacomDevicePtr)local->private; | |
| 1286 | 1286 | ||
| 1287 | DBG(2, priv->debugLevel, "BEGIN xf86WcmProc dev=%p priv=%p " | ||
| 1287 | DBG(2, priv->debugLevel, "BEGIN 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" : | |
| … | … | ||
| 1306 | 1306 | priv->wcmInitKeyClassCount = 0; | |
| 1307 | 1307 | if (!xf86WcmDevOpen(pWcm)) | |
| 1308 | 1308 | { | |
| 1309 | DBG(1, priv->debugLevel, "xf86WcmProc INIT FAILED\n"); | ||
| 1309 | DBG(1, priv->debugLevel, "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, "xf86WcmProc ON FAILED\n"); | ||
| 1319 | DBG(1, priv->debugLevel, "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, "END xf86WcmProc Success \n"); | ||
| 1344 | DBG(2, priv->debugLevel, "END 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, "xf86WcmDevConvert v0=%d v1=%d on screen %d \n", | ||
| 1359 | DBG(6, priv->debugLevel, "v0=%d v1=%d on screen %d \n", | ||
| 1360 | 1360 | v0, v1, priv->currentScreen); | |
| 1361 | 1361 | ||
| 1362 | 1362 | if (first != 0 || num == 1) | |
| … | … | ||
| 1392 | 1392 | if (*y < 0) *y = 0; | |
| 1393 | 1393 | ||
| 1394 | 1394 | } | |
| 1395 | DBG(6, priv->debugLevel, "xf86WcmDevConvert v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y); | ||
| 1395 | DBG(6, priv->debugLevel, "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, "xf86WcmDevReverseConvert x=%d y=%d \n", x, y); | ||
| 1412 | DBG(6, priv->debugLevel, "x=%d y=%d \n", x, y); | ||
| 1413 | 1413 | priv->currentSX = x; | |
| 1414 | 1414 | priv->currentSY = y; | |
| 1415 | 1415 |
src/xf86Wacom.h
(4 / 2)
|   | |||
| 76 | 76 | #if DEBUG | |
| 77 | 77 | #define DBG(lvl, dLevel, ...) \ | |
| 78 | 78 | do { \ | |
| 79 | if ((lvl) <= dLevel) \ | ||
| 80 | xf86Msg(X_INFO, __VA_ARGS__); \ | ||
| 79 | if ((lvl) <= dLevel) { \ | ||
| 80 | xf86Msg(X_INFO, "%s: ", __func__); \ | ||
| 81 | xf86Msg(X_NONE, __VA_ARGS__); \ | ||
| 82 | } \ | ||
| 81 | 83 | } while (0) | |
| 82 | 84 | #else | |
| 83 | 85 | #define DBG(lvl, dLevel, ...) |

