Commit 0501b9977050dbec74c72dbd8c78f2b72df43ab9

  • avatar
  • Peter Hutterer <peter.hutterer @wh…t.net>
  • Thu Dec 24 00:00:22 CET 2009
Merge the xf86Msg into the DBG macro.

All DBG macros call this function, there's no need to have it inside the
macro, we might as well leverage __VA_ARGS__.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  
5757{
5858 WacomDevicePtr priv = (WacomDevicePtr) local->private;
5959
60 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmMappingFactor \n"));
60 DBG(10, priv->debugLevel, "xf86WcmMappingFactor \n");
6161
6262 xf86WcmVirtualTabletSize(local);
6363
8181 if (priv->currentScreen == -1) /* tool on the tablet */
8282 priv->currentScreen = 0;
8383
84 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmMappingFactor"
84 DBG(10, priv->debugLevel, "xf86WcmMappingFactor"
8585 " Active tablet area x=%d y=%d (virtual tablet area x=%d y=%d) map"
8686 " to maxWidth =%d maxHeight =%d\n",
8787 priv->bottomX, priv->bottomY, priv->sizeX, priv->sizeY,
88 priv->maxWidth, priv->maxHeight));
88 priv->maxWidth, priv->maxHeight);
8989
9090 priv->factorX = (double)priv->maxWidth / (double)priv->sizeX;
9191 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);
9494}
9595
9696/*****************************************************************************
106106 WacomDevicePtr priv = (WacomDevicePtr) local->private;
107107 int screenToSet = -1, i, j, x, y, tabletSize = 0;
108108
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);
111111
112112 if (priv->screen_no != -1 && priv->screen_no >= priv->numScreen)
113113 {
152152 if (v0 > priv->topY && v0 <= priv->topY + priv->tvoffsetY)
153153 priv->currentScreen = 1;
154154 }
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);
157157 }
158158
159159 xf86WcmMappingFactor(local);
194194
195195 if (screenToSet == -1)
196196 {
197 DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetScreen Error: "
197 DBG(3, priv->debugLevel, "xf86WcmSetScreen Error: "
198198 "Can not find valid screen (currentScreen=%d)\n",
199 priv->currentScreen));
199 priv->currentScreen);
200200 return;
201201 }
202202
210210 y = screenInfo.screens[screenToSet]->height - 1;
211211
212212 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);
215215 priv->currentScreen = screenToSet;
216216}
217217
227227 int button, mask;
228228 WacomDevicePtr priv = (WacomDevicePtr) local->private;
229229 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);
232232
233233 /* Tablet PC buttons only apply to penabled devices */
234234 if (common->wcmTPCButton && (priv->flags & STYLUS_ID))
461461 if (!priv->button[button]) /* ignore this button event */
462462 return;
463463
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 "
466465 "code=%08x, for %s coreEvent=%s \n",
467466 common->wcmTPCButton ? "on" : "off",
468467 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");
470469
471470 if (!priv->keys[button][0])
472471 {
578578 unsigned *keyP = 0;
579579 int is_absolute = priv->flags & ABSOLUTE_FLAG;
580580
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);
582582
583583 /* emulate events for relative wheel */
584584 if ( ds->relwheel )
668668
669669 if (!fakeButton) return;
670670
671 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "sendWheelStripEvents "
671 DBG(10, priv->debugLevel, "sendWheelStripEvents "
672672 "send fakeButton %x with value = %d \n",
673 fakeButton, value));
673 fakeButton, value);
674674
675675 switch (fakeButton & AC_TYPE)
676676 {
747747
748748 if (priv->serial && serial != priv->serial)
749749 {
750 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "[%s] serial number"
750 DBG(10, priv->debugLevel, "[%s] serial number"
751751 " is %u but your system configured %u",
752 local->name, serial, (int)priv->serial));
752 local->name, serial, (int)priv->serial);
753753 return;
754754 }
755755
767767 ty = ds->stripy;
768768 }
769769
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 "
771771 "b=%s b=%d tx=%d ty=%d wl=%d rot=%d th=%d\n",
772772 (type == STYLUS_ID) ? "stylus" :
773773 (type == CURSOR_ID) ? "cursor" :
775775 (type == TOUCH_ID) ? "touch" : "pad",
776776 priv->oldProximity ? "true" : "false",
777777 x, y, z, is_button ? "true" : "false", buttons,
778 tx, ty, wheel, rot, throttle));
778 tx, ty, wheel, rot, throttle);
779779
780780 /* rotation mixes x and y up a bit */
781781 if (common->wcmRotate == ROTATE_CW)
822822 }
823823 v5 = wheel;
824824
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"
826826 "\ty=%d\tz=%d\tv3=%d\tv4=%d\tv5=%d\tid=%d"
827827 "\tserial=%u\tbutton=%s\tbuttons=%d\n",
828828 local->name,
829829 is_absolute ? "abs" : "rel",
830830 is_proximity,
831831 x, y, z, v3, v4, v5, id, serial,
832 is_button ? "true" : "false", buttons));
832 is_button ? "true" : "false", buttons);
833833
834834 priv->currentX = x;
835835 priv->currentY = y;
10681068 dsNew->y = dsOrig->y;
10691069 }
10701070
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);
10731073 return returnV;
10741074}
10751075
11031103 pChannel = common->wcmChannel + channel;
11041104 pLast = &pChannel->valid.state;
11051105
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);
11071107
11081108 /* sanity check the channel */
11091109 if (channel >= MAX_CHANNELS)
11151115
11161116 /* timestamp the state for velocity and acceleration analysis */
11171117 ds.sample = (int)GetTimeInMillis();
1118 DBG(10, common->debugLevel, xf86Msg(X_INFO, "wcmEvent: "
1118 DBG(10, common->debugLevel, "wcmEvent: "
11191119 "c=%d i=%d t=%d s=%u x=%d y=%d b=%d "
11201120 "p=%d rz=%d tx=%d ty=%d aw=%d rw=%d "
11211121 "t=%d df=%d px=%d st=%d cs=%d \n",
11271127 ds.pressure, ds.rotation, ds.tiltx,
11281128 ds.tilty, ds.abswheel, ds.relwheel, ds.throttle,
11291129 ds.discard_first, ds.proximity, ds.sample,
1130 pChannel->nSamples));
1130 pChannel->nSamples);
11311131
11321132 /* Discard the first 2 USB packages due to events delay */
11331133 if ( (pChannel->nSamples < 2) && (common->wcmDevCls == &gWacomUSBDevice) &&
11341134 ds.device_type != PAD_ID && (ds.device_type != TOUCH_ID) )
11351135 {
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);
11391139 ++pChannel->nSamples;
11401140 return; /* discard */
11411141 }
11491149 fs = &pChannel->rawFilter;
11501150 if (!fs->npoints && ds.proximity)
11511151 {
1152 DBG(11, common->debugLevel, xf86Msg(X_INFO, "initialize Channel data.\n"));
1152 DBG(11, common->debugLevel, "initialize Channel data.\n");
11531153 /* store channel device state for later use */
11541154 for (i=common->wcmRawSample - 1; i>=0; i--)
11551155 {
11821182 {
11831183 if (common->wcmModel->FilterRaw(common,pChannel,&ds))
11841184 {
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");
11871187 resetSampleCounter(pChannel);
11881188 return; /* discard */
11891189 }
13371337 }
13381338 }
13391339
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);
13411341 /* Find the device the current events are meant for */
13421342 /* 1: Find the tool (the one with correct serial or in second
13431343 * hand, the one with serial set to 0 if no match with the
14001400 LocalDevicePtr oDev = outprox->device;
14011401 WacomDeviceState out = { 0 };
14021402 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);
14051405 xf86WcmSendEvents(oDev, &out);
14061406 }
14071407 else
14121412 if(tool->current)
14131413 {
14141414 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);
14171417 }
14181418 }
14191419 /* X: InputDevice selection done! */
14701470 /* Send soft prox-out for touch first */
14711471 WacomDeviceState out = { 0 };
14721472 out.device_type = DEVICE_ID(temppriv->flags);
1473 DBG(2, common->debugLevel, xf86Msg(X_INFO,
1473 DBG(2, common->debugLevel,
14741474 "Send soft prox-out for %s first\n",
1475 localDevices->name));
1475 localDevices->name);
14761476 xf86WcmSendEvents(localDevices, &out);
14771477 }
14781478 }
15431543 }
15441544 else /* no other events to send */
15451545 {
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");
15481547 return;
15491548 }
15501549 }
15721572 if (common->wcmMaxCursorDist < filtered.distance)
15731573 common->wcmMaxCursorDist = filtered.distance;
15741574 }
1575 DBG(10, common->debugLevel, xf86Msg(X_INFO, "Distance over"
1575 DBG(10, common->debugLevel, "Distance over"
15761576 " the tablet: %d, ProxoutDist: %d current"
15771577 " min/max %d hard prox: %d\n",
15781578 filtered.distance,
15791579 common->wcmCursorProxoutDist,
15801580 common->wcmMaxCursorDist,
1581 ds->proximity));
1581 ds->proximity);
15821582
15831583 if (priv->oldProximity)
15841584 {
16061606 /* otherwise, if no device matched... */
16071607 else
16081608 {
1609 DBG(11, common->debugLevel, xf86Msg(X_INFO, "no device matches with"
1609 DBG(11, common->debugLevel, "no device matches with"
16101610 " id=%d, serial=%u\n",
1611 ds->device_type, ds->serial_num));
1611 ds->device_type, ds->serial_num);
16121612 }
16131613}
16141614
18041804 priv->screenBottomY[1] = priv->tvResolution[1];
18051805 }
18061806
1807 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialTVScreens for \"%s\" "
1807 DBG(10, priv->debugLevel, "xf86WcmInitialTVScreens for \"%s\" "
18081808 "topX0=%d topY0=%d bottomX0=%d bottomY0=%d "
18091809 "topX1=%d topY1=%d bottomX1=%d bottomY1=%d \n",
18101810 local->name, priv->screenTopX[0], priv->screenTopY[0],
18111811 priv->screenBottomX[0], priv->screenBottomY[0],
18121812 priv->screenTopX[1], priv->screenTopY[1],
1813 priv->screenBottomX[1], priv->screenBottomY[1]));
1813 priv->screenBottomX[1], priv->screenBottomY[1]);
18141814}
18151815
18161816/*****************************************************************************
18221822 WacomDevicePtr priv = (WacomDevicePtr)local->private;
18231823 int i;
18241824
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);
18271827 priv->tvoffsetX = 0;
18281828 priv->tvoffsetY = 0;
18291829 if (priv->twinview != TV_NONE)
18471847 priv->screenBottomX[i] = dixScreenOrigins[i].x;
18481848 priv->screenBottomY[i] = dixScreenOrigins[i].y;
18491849
1850 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialScreens from dix for \"%s\" "
1850 DBG(10, priv->debugLevel, "xf86WcmInitialScreens from dix for \"%s\" "
18511851 "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]);
18531854 }
18541855
18551856 priv->screenBottomX[i] += screenInfo.screens[i]->width;
18561857 priv->screenBottomY[i] += screenInfo.screens[i]->height;
18571858
1858 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitialScreens for \"%s\" "
1859 DBG(10, priv->debugLevel, "xf86WcmInitialScreens for \"%s\" "
18591860 "topX[%d]=%d topY[%d]=%d bottomX[%d]=%d bottomY[%d]=%d \n",
18601861 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]);
18621863 }
18631864}
18641865
18731873 WacomToolAreaPtr area = priv->toolarea;
18741874 int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
18751875
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);
18771877
18781878 if (!IsTouch(priv))
18791879 {
19501950 int oldRotation;
19511951 int tmpTopX, tmpTopY, tmpBottomX, tmpBottomY, oldMaxX, oldMaxY;
19521952
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);
19541954
19551955 if (common->wcmRotate == value) /* initialization */
19561956 {
  
229229 WacomDevicePtr dev;
230230 WacomDevicePtr *prev;
231231
232 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmUninit\n"));
232 DBG(1, priv->debugLevel, "xf86WcmUninit\n");
233233
234234 if (priv->isParent)
235235 {
289289 strstr(pMatch->drv->driverName, "wacom") &&
290290 !strcmp(privMatch->common->wcmDevice, common->wcmDevice))
291291 {
292 DBG(2, priv->debugLevel, xf86Msg(X_INFO,
292 DBG(2, priv->debugLevel,
293293 "xf86WcmInit wacom port share between"
294 " %s and %s\n", pLocal->name, pMatch->name));
294 " %s and %s\n", pLocal->name, pMatch->name);
295295 type = xf86FindOptionValue(pMatch->options, "Type");
296296 if ( type && (strstr(type, "eraser")) )
297297 privMatch->common->wcmEraserID=pMatch->name;
  
248248 WacomDeviceState *pLast;
249249 int *x, *y, i;
250250
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);
253253 x = pChannel->rawFilter.x;
254254 y = pChannel->rawFilter.y;
255255
  
123123 WacomDevicePtr priv = (WacomDevicePtr)local->private;
124124 WacomCommonPtr common = priv->common;
125125
126 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "initializing ISDV4 tablet\n"));
126 DBG(1, priv->debugLevel, "initializing ISDV4 tablet\n");
127127
128128 /* Initial baudrate is 38400 */
129129 if (xf86SetSerialSpeed(local->fd, common->wcmISDV4Speed) < 0)
150150 WacomDevicePtr priv = (WacomDevicePtr)local->private;
151151 WacomCommonPtr common = priv->common;
152152
153 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "Querying ISDV4 tablet\n"));
153 DBG(1, priv->debugLevel, "Querying ISDV4 tablet\n");
154154
155155 /* Send stop command to the tablet */
156156 err = xf86WriteSerial(local->fd, WC_ISDV4_STOP, strlen(WC_ISDV4_STOP));
256256 WacomCommonPtr common = priv->common;
257257 int ret = Success;
258258
259 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "getting ISDV4 Ranges\n"));
259 DBG(2, priv->debugLevel, "getting ISDV4 Ranges\n");
260260
261261 /* Send query command to the tablet */
262262 ret = isdv4Query(local, WC_ISDV4_QUERY, data);
281281 if (!common->wcmMaxX || !common->wcmMaxY)
282282 common->tablet_id = 0xE2;
283283
284 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "isdv4GetRanges Pen speed=%d "
284 DBG(2, priv->debugLevel, "isdv4GetRanges Pen speed=%d "
285285 "maxX=%d maxY=%d maxZ=%d resX=%d resY=%d \n",
286286 common->wcmISDV4Speed, common->wcmMaxX, common->wcmMaxY,
287 common->wcmMaxZ, common->wcmResolX, common->wcmResolY));
287 common->wcmMaxZ, common->wcmResolX, common->wcmResolY);
288288 }
289289
290290 /* Touch might be supported. Send a touch query command */
367367 common->wcmVersion = ( data[10] | (data[9] << 7) );
368368 ret = Success;
369369
370 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "isdv4GetRanges touch speed=%d "
370 DBG(2, priv->debugLevel, "isdv4GetRanges touch speed=%d "
371371 "maxTouchX=%d maxTouchY=%d TouchresX=%d TouchresY=%d \n",
372372 common->wcmISDV4Speed, common->wcmMaxTouchX,
373373 common->wcmMaxTouchY, common->wcmTouchResolX,
374 common->wcmTouchResolY));
374 common->wcmTouchResolY);
375375 }
376376 return ret;
377377}
401401 WacomDeviceState* ds;
402402 int n, cur_type, channel = 0;
403403
404 DBG(10, common->debugLevel, xf86Msg(X_INFO, "isdv4Parse \n"));
404 DBG(10, common->debugLevel, "isdv4Parse \n");
405405
406406 /* determine the type of message (touch or stylus) */
407407 if (data[0] & 0x10) /* a touch data */
484484 }
485485 }
486486
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");
489489 }
490490 else
491491 {
536536 ds->device_id = ERASER_DEVICE_ID;
537537 }
538538
539 DBG(8, priv->debugLevel, xf86Msg(X_INFO, "isdv4Parse %s\n",
539 DBG(8, priv->debugLevel, "isdv4Parse %s\n",
540540 ds->device_type == ERASER_ID ? "ERASER " :
541 ds->device_type == STYLUS_ID ? "STYLUS" : "NONE"));
541 ds->device_type == STYLUS_ID ? "STYLUS" : "NONE");
542542 }
543543 wcmEvent(common, channel, ds);
544544 return common->wcmPktLength;
  
129129 secondChannel->valid.states[1] };
130130 int direction = 0;
131131
132 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerTapToClick \n"));
132 DBG(10, priv->debugLevel, "xf86WcmFingerTapToClick \n");
133133
134134 /* skip initial second finger event */
135135 if (!dsLast[1].proximity)
316316 int gesture = 0;
317317 WacomFilterState filterd; /* borrow this struct */
318318
319 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerScroll \n"));
319 DBG(10, priv->debugLevel, "xf86WcmFingerScroll \n");
320320
321321 /* initialize the points so we can rotate them */
322322 filterd.x[0] = ds[0].x;
391391 int dist = touchDistance(common->wcmGestureState[0],
392392 common->wcmGestureState[1]);
393393
394 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmFingerZoom \n"));
394 DBG(10, priv->debugLevel, "xf86WcmFingerZoom \n");
395395
396396 dist = touchDistance(ds[0], ds[1]) - dist;
397397
src/wcmUSB.c
(27 / 27)
  
372372#ifdef DEBUG
373373 WacomDevicePtr priv = (WacomDevicePtr)local->private;
374374
375 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "usbDetect\n"));
375 DBG(1, priv->debugLevel, "usbDetect\n");
376376#endif
377377
378378 SYSCALL(err = ioctl(local->fd, EVIOCGVERSION, &version));
508508 WacomDevicePtr priv = (WacomDevicePtr)local->private;
509509 WacomCommonPtr common = priv->common;
510510
511 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "initializing USB tablet\n"));
511 DBG(1, priv->debugLevel, "initializing USB tablet\n");
512512 *version = 0.0;
513513
514514 /* fetch vendor, product, and model name */
722722 WacomDevicePtr priv = (WacomDevicePtr)local->private;
723723 WacomCommonPtr common = priv->common;
724724
725 DBG(10, common->debugLevel, xf86Msg(X_INFO, "usbDetectConfig \n"));
725 DBG(10, common->debugLevel, "usbDetectConfig \n");
726726 if (IsPad (priv))
727727 priv->nbuttons = common->npadkeys;
728728 else
813813 wcmEvent(common, i, &common->wcmChannel[i].work);
814814 }
815815 }
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)"
817817 " at %d: Exceeded channel count; ignoring the events.\n",
818 serial, (int)GetTimeInMillis()));
818 serial, (int)GetTimeInMillis());
819819 }
820820 else
821821 common->wcmLastToolSerial = serial;
830830 WacomDevicePtr priv = (WacomDevicePtr)local->private;
831831 WacomCommonPtr common = priv->common;
832832
833 DBG(10, common->debugLevel, xf86Msg(X_INFO, "usbParseEvent \n"));
833 DBG(10, common->debugLevel, "usbParseEvent \n");
834834 /* store events until we receive the MSC_SERIAL containing
835835 * the serial number; without it we cannot determine the
836836 * correct channel. */
890890 /* ignore events without information */
891891 if (common->wcmEventCnt <= 2)
892892 {
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);
895895 goto skipEvent;
896896 }
897897
923923 WacomDevicePtr priv = (WacomDevicePtr)local->private;
924924 WacomCommonPtr common = priv->common;
925925
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);
927927 #define MOD_BUTTONS(bit, value) do { \
928928 shift = 1<<bit; \
929929 ds->buttons = (((value) != 0) ? \
931931 } while (0)
932932
933933 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");
935935 return;
936936 }
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);
938938
939939 /* all USB data operates from previous context except relative values*/
940940 ds = &common->wcmChannel[channel].work;
945945 for (i=0; i<common->wcmEventCnt; ++i)
946946 {
947947 event = common->wcmEvents + i;
948 DBG(11, common->debugLevel, xf86Msg(X_INFO, "usbParseChannel "
948 DBG(11, common->debugLevel, "usbParseChannel "
949949 "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);
951951
952952 /* absolute events */
953953 if (event->type == EV_ABS)
10021002 if (common->wcmProtocolLevel == 4)
10031003 ds->device_id = STYLUS_DEVICE_ID;
10041004 ds->proximity = (event->value != 0);
1005 DBG(6, common->debugLevel, xf86Msg(X_INFO,
1005 DBG(6, common->debugLevel,
10061006 "USB stylus detected %x\n",
1007 event->code));
1007 event->code);
10081008 }
10091009 else if (event->code == BTN_TOOL_RUBBER)
10101010 {
10151015 ds->proximity = (event->value != 0);
10161016 if (ds->proximity)
10171017 ds->proximity = ERASER_PROX;
1018 DBG(6, common->debugLevel, xf86Msg(X_INFO,
1018 DBG(6, common->debugLevel,
10191019 "USB eraser detected %x (value=%d)\n",
1020 event->code, event->value));
1020 event->code, event->value);
10211021 }
10221022 else if ((event->code == BTN_TOOL_MOUSE) ||
10231023 (event->code == BTN_TOOL_LENS))
10241024 {
1025 DBG(6, common->debugLevel, xf86Msg(X_INFO,
1025 DBG(6, common->debugLevel,
10261026 "USB mouse detected %x (value=%d)\n",
1027 event->code, event->value));
1027 event->code, event->value);
10281028 ds->device_type = CURSOR_ID;
10291029 /* V5 tools use ABS_MISC to report device_id */
10301030 if (common->wcmProtocolLevel == 4)
10331033 }
10341034 else if (event->code == BTN_TOOL_FINGER)
10351035 {
1036 DBG(6, common->debugLevel, xf86Msg(X_INFO,
1036 DBG(6, common->debugLevel,
10371037 "USB Pad detected %x (value=%d)\n",
1038 event->code, event->value));
1038 event->code, event->value);
10391039 ds->device_type = PAD_ID;
10401040 ds->device_id = PAD_DEVICE_ID;
10411041 ds->proximity = (event->value != 0);
10441044 {
10451045 WacomChannelPtr pChannel = common->wcmChannel + channel;
10461046 WacomDeviceState dslast = pChannel->valid.state;
1047 DBG(6, common->debugLevel, xf86Msg(X_INFO,
1047 DBG(6, common->debugLevel,
10481048 "USB Touch detected %x (value=%d)\n",
1049 event->code, event->value));
1049 event->code, event->value);
10501050 ds->device_type = TOUCH_ID;
10511051 ds->device_id = TOUCH_DEVICE_ID;
10521052 ds->proximity = event->value;
10661066 {
10671067 WacomChannelPtr pChannel = common->wcmChannel + channel;
10681068 WacomDeviceState dslast = pChannel->valid.state;
1069 DBG(6, common->debugLevel, xf86Msg(X_INFO,
1069 DBG(6, common->debugLevel,
10701070 "USB Touch second finger detected %x (value=%d)\n",
1071 event->code, event->value));
1071 event->code, event->value);
10721072 ds->device_type = TOUCH_ID;
10731073 ds->device_id = TOUCH_DEVICE_ID;
10741074 ds->proximity = event->value;
11151115 if (((common->tablet_id == 0xC0) || (common->tablet_id == 0xC2)) &&
11161116 (ds->device_type == ERASER_ID))
11171117 {
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 ");
11201120 return;
11211121 }
11221122
  
5050 /* Pad is always in relative mode when it's a core device.
5151 * Always in absolute mode when it is not a core device.
5252 */
53 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmSetPadCoreMode (%p)"
53 DBG(10, priv->debugLevel, "xf86WcmSetPadCoreMode (%p)"
5454 " is always in %s mode when it %s core device\n",
5555 (void *)local->dev,
5656 !is_core ? "absolute" : "relative",
57 is_core ? "is" : "isn't"));
57 is_core ? "is" : "isn't");
5858 if (is_core)
5959 priv->flags &= ~ABSOLUTE_FLAG;
6060 else
7171 WacomDevicePtr priv = (WacomDevicePtr)local->private;
7272 int is_absolute = priv->flags & ABSOLUTE_FLAG;
7373
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);
7676
7777 /* Pad is always in relative mode when it's a core device.
7878 * Always in absolute mode when it is not a core device.
9696 }
9797 else if ( (mode != Absolute) && (mode != Relative))
9898 {
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);
101101 return BadMatch;
102102 }
103103
114114#ifdef DEBUG
115115 WacomDevicePtr priv = (WacomDevicePtr)local->private;
116116
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);
119119#endif
120120 /* Share this call with sendAButton in wcmCommon.c */
121121 return xf86WcmDevSwitchModeCall(local, mode);
211211 WacomCommonPtr common = priv->common;
212212 int values[WCM_MAX_MOUSE_BUTTONS];
213213
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);
215215
216216 values[0] = priv->topX;
217217 values[1] = priv->topY;
299299 WacomDevicePtr priv = (WacomDevicePtr) local->private;
300300 WacomCommonPtr common = priv->common;
301301
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);
303303
304304 if (property == prop_tablet_area)
305305 {
497497 {
498498 screen = -1;
499499 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");
502502 }
503503 xf86WcmChangeScreen(local, screen);
504504 }
  
148148 double screenRatio, tabletRatio;
149149 int bottomx = common->wcmMaxX, bottomy = common->wcmMaxY;
150150
151 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmInitArea\n"));
151 DBG(10, priv->debugLevel, "xf86WcmInitArea\n");
152152
153153 if (IsTouch(priv))
154154 {
208208 tabletRatio = ((double)(bottomx - priv->topX) /
209209 (double)(bottomy - priv->topY));
210210
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);
213213
214214 if (screenRatio > tabletRatio)
215215 {
296296 priv->topPadding = (int)((double)(priv->screenTopY[i] * priv->topPadding)
297297 / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5);
298298 }
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);
301301 return;
302302}
303303
336336 priv->sizeY += (int)((double)((priv->maxHeight - priv->screenBottomY[i])
337337 * tabletSize) / ((double)(priv->screenBottomY[i] - priv->screenTopY[i])) + 0.5);
338338 }
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);
341341 return;
342342}
343343
656656 * This is only a workaround.
657657 */
658658
659 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmRegisterX11Devices "
659 DBG(10, priv->debugLevel, "xf86WcmRegisterX11Devices "
660660 "(%s) %d buttons, %d keys, %d axes\n",
661661 IsStylus(priv) ? "stylus" :
662662 IsCursor(priv) ? "cursor" :
663663 IsPad(priv) ? "pad" : "eraser",
664 nbbuttons, nbkeys, nbaxes));
664 nbbuttons, nbkeys, nbaxes);
665665
666666 for(loop=1; loop<=nbbuttons; loop++)
667667 butmap[loop] = loop;
976976 int rc;
977977 struct serial_struct ser;
978978
979 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "opening %s\n", common->wcmDevice));
979 DBG(1, priv->debugLevel, "opening %s\n", common->wcmDevice);
980980
981981 local->fd = xf86OpenSerial(local->options);
982982 if (local->fd < 0)
10351035 WacomCommonPtr common = priv->common;
10361036 struct stat st;
10371037
1038 DBG(10, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevOpen\n"));
1038 DBG(10, priv->debugLevel, "xf86WcmDevOpen\n");
10391039
10401040 /* Device has been open and not autoprobed */
10411041 if (priv->wcmDevOpenCount)
10521052 if ((xf86WcmOpen (local) != Success) || (local->fd < 0) ||
10531053 !common->wcmDevice)
10541054 {
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);
10571057 if (local->fd >= 0)
10581058 {
1059 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "Closing device\n"));
1059 DBG(1, priv->debugLevel, "Closing device\n");
10601060 xf86CloseSerial(local->fd);
10611061 }
10621062 local->fd = -1;
10661066 if (fstat(local->fd, &st) == -1)
10671067 {
10681068 /* 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));
10711071
10721072 /* older systems don't support the required ioctl.
10731073 * So, we have to let it pass */
10981098 WacomDevicePtr priv = (WacomDevicePtr)local->private;
10991099#endif
11001100 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);
11021102
11031103 if (n >= 0) return n ? 1 : 0;
11041104 xf86Msg(X_ERROR, "%s: select error: %s\n", local->name, strerror(errno));
11301130
11311131 /* report how well we're doing */
11321132 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");
11341134 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);
11361136}
11371137
11381138void wcmReadPacket(LocalDevicePtr local)
11421142 int len, pos, cnt, remaining;
11431143 unsigned char * data;
11441144
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);
11471147
11481148 remaining = sizeof(common->buffer) - common->bufpos;
11491149
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);
11521152
11531153 /* fill buffer with as much data as we can handle */
11541154 len = xf86ReadSerial(local->fd,
11711171
11721172 /* account for new data */
11731173 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);
11761176
11771177 pos = 0;
11781178
12031203 cnt = common->wcmModel->Parse(local, common->buffer + pos);
12041204 if (cnt <= 0)
12051205 {
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);
12071207 break;
12081208 }
12091209 pos += cnt;
12141214 /* if half a packet remains, move it down */
12151215 if (pos < common->bufpos)
12161216 {
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);
12181218 memmove(common->buffer,common->buffer+pos,
12191219 common->bufpos-pos);
12201220 common->bufpos -= pos;
12321232{
12331233#ifdef DEBUG
12341234 WacomDevicePtr priv = (WacomDevicePtr)local->private;
1235 DBG(3, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmDevChangeControl called\n"));
1235 DBG(3, priv->debugLevel, "xf86WcmDevChangeControl called\n");
12361236#endif
12371237 return Success;
12381238}
12471247 LocalDevicePtr local = (LocalDevicePtr)device->public.devicePrivate;
12481248 WacomDevicePtr priv = (WacomDevicePtr)local->private;
12491249
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");
12511251#endif
12521252 return;
12531253}
12611261 WacomDevicePtr priv = (WacomDevicePtr)local->private;
12621262 WacomCommonPtr common = priv->common;
12631263
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);
12651265
12661266 if (local->fd >= 0)
12671267 {
12681268 local->fd = -1;
12691269 if (!--common->fd_refs)
12701270 {
1271 DBG(1, common->debugLevel, xf86Msg(X_INFO, "Closing device; uninitializing.\n"));
1271 DBG(1, common->debugLevel, "Closing device; uninitializing.\n");
12721272 xf86CloseSerial (common->fd);
12731273 }
12741274 }
12841284 LocalDevicePtr local = (LocalDevicePtr)pWcm->public.devicePrivate;
12851285 WacomDevicePtr priv = (WacomDevicePtr)local->private;
12861286
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 "
12881288 "type=%s(%s) flags=%d fd=%d what=%s\n",
12891289 (void *)pWcm, (void *)priv,
12901290 IsStylus(priv) ? "stylus" :
12941294 (what == DEVICE_INIT) ? "INIT" :
12951295 (what == DEVICE_OFF) ? "OFF" :
12961296 (what == DEVICE_ON) ? "ON" :
1297 (what == DEVICE_CLOSE) ? "CLOSE" : "???"));
1297 (what == DEVICE_CLOSE) ? "CLOSE" : "???");
12981298
12991299 switch (what)
13001300 {
13061306 priv->wcmInitKeyClassCount = 0;
13071307 if (!xf86WcmDevOpen(pWcm))
13081308 {
1309 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmProc INIT FAILED\n"));
1309 DBG(1, priv->debugLevel, "xf86WcmProc INIT FAILED\n");
13101310 return !Success;
13111311 }
13121312 priv->wcmInitKeyClassCount++;
13161316 case DEVICE_ON:
13171317 if (!xf86WcmDevOpen(pWcm))
13181318 {
1319 DBG(1, priv->debugLevel, xf86Msg(X_INFO, "xf86WcmProc ON FAILED\n"));
1319 DBG(1, priv->debugLevel, "xf86WcmProc ON FAILED\n");
13201320 return !Success;
13211321 }
13221322 priv->wcmDevOpenCount++;
13411341 break;
13421342 } /* end switch */
13431343
1344 DBG(2, priv->debugLevel, xf86Msg(X_INFO, "END xf86WcmProc Success \n"));
1344 DBG(2, priv->debugLevel, "END xf86WcmProc Success \n");
13451345 return Success;
13461346}
13471347
13561356{
13571357 WacomDevicePtr priv = (WacomDevicePtr) local->private;
13581358
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);
13611361
13621362 if (first != 0 || num == 1)
13631363 return FALSE;
13921392 if (*y < 0) *y = 0;
13931393
13941394 }
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);
13961396 return TRUE;
13971397}
13981398
14091409 WacomDevicePtr priv = (WacomDevicePtr) local->private;
14101410 int i = 0;
14111411
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);
14131413 priv->currentSX = x;
14141414 priv->currentSY = y;
14151415
14301430 priv->devReverseCount = 0;
14311431 }
14321432
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"
14341434 " to v0=%d v1=%d v2=%d v3=%d v4=%d v5=%d\n", x, y,
14351435 valuators[0], valuators[1], valuators[2],
1436 valuators[3], valuators[4], valuators[5]));
1436 valuators[3], valuators[4], valuators[5]);
14371437
14381438 return TRUE;
14391439}
  
7474#endif
7575
7676#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)
7882#else
79#define DBG(lvl, dLevel, f)
83#define DBG(lvl, dLevel, ...)
8084#endif
8185
8286/*****************************************************************************