diff options
author | Zephaniah E. Hull <warp@agamemnon.b5> | 2006-10-21 04:24:49 -0400 |
---|---|---|
committer | Zephaniah E. Hull <warp@agamemnon.b5> | 2006-10-21 04:24:49 -0400 |
commit | 736b0d5078597abbda80444deef852879260af90 (patch) | |
tree | ecaa01bbd879d151c1390658ad79be9b84bc45c5 /Xi/getdctl.c | |
parent | 1b1698af41b9038d9f9dbf521737d0baab5a2237 (diff) |
DEVICE_TOUCHSCREEN becomes DEVICE_ABS_CALIB.
Update the DEVICE_ABS_CALIB stuff to include the new elements.
New DEVICE_ABS_AREA support.
dev->touchscreen becomes dev->absolute, with _CALIB and _AREA stuff in it.
Update xfree86 to compile with this, kdrive needs an update too.
Diffstat (limited to 'Xi/getdctl.c')
-rw-r--r-- | Xi/getdctl.c | 87 |
1 files changed, 66 insertions, 21 deletions
diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 66342b340..61798f274 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -124,14 +124,23 @@ ProcXGetDeviceControl(ClientPtr client) total_length = sizeof(xDeviceResolutionState) + (3 * sizeof(int) * dev->valuator->numAxes); break; - case DEVICE_TOUCHSCREEN: - if (!dev->touchscreen) { + case DEVICE_ABS_CALIB: + if (!dev->absolute) { SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadMatch); return Success; } - total_length = sizeof(xDeviceTSCtl); + total_length = sizeof(xDeviceAbsCalibCtl); + break; + case DEVICE_ABS_AREA: + if (!dev->absolute) { + SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, + BadMatch); + return Success; + } + + total_length = sizeof(xDeviceAbsAreaCtl); break; case DEVICE_CORE: total_length = sizeof(xDeviceCoreCtl); @@ -152,8 +161,11 @@ ProcXGetDeviceControl(ClientPtr client) case DEVICE_RESOLUTION: CopySwapDeviceResolution(client, dev->valuator, buf, total_length); break; - case DEVICE_TOUCHSCREEN: - CopySwapDeviceTouchscreen(client, dev->touchscreen, buf); + case DEVICE_ABS_CALIB: + CopySwapDeviceAbsCalib(client, dev->absolute, buf); + break; + case DEVICE_ABS_AREA: + CopySwapDeviceAbsArea(client, dev->absolute, buf); break; case DEVICE_CORE: CopySwapDeviceCore(client, dev, buf); @@ -206,28 +218,61 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf, } } -void CopySwapDeviceTouchscreen (ClientPtr client, TouchscreenClassPtr dts, +void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts, + char *buf) +{ + register char n; + xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf; + + calib->control = DEVICE_ABS_CALIB; + calib->length = sizeof(calib); + calib->min_x = dts->min_x; + calib->max_x = dts->max_x; + calib->min_y = dts->min_y; + calib->max_y = dts->max_y; + calib->flip_x = dts->flip_x; + calib->flip_y = dts->flip_y; + calib->rotation = dts->rotation; + calib->button_threshold = dts->button_threshold; + + if (client->swapped) { + swaps(&calib->control, n); + swaps(&calib->length, n); + swapl(&calib->min_x, n); + swapl(&calib->max_x, n); + swapl(&calib->min_y, n); + swapl(&calib->max_y, n); + swapl(&calib->flip_x, n); + swapl(&calib->flip_y, n); + swapl(&calib->rotation, n); + swapl(&calib->button_threshold, n); + } +} + +void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts, char *buf) { register char n; - xDeviceTSState *ts = (xDeviceTSState *) buf; + xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf; - ts->control = DEVICE_TOUCHSCREEN; - ts->length = sizeof(ts); - ts->min_x = dts->min_x; - ts->max_x = dts->max_x; - ts->min_y = dts->min_y; - ts->max_y = dts->max_y; - ts->button_threshold = dts->button_threshold; + area->control = DEVICE_ABS_AREA; + area->length = sizeof(area); + area->offset_x = dts->offset_x; + area->offset_y = dts->offset_y; + area->width = dts->width; + area->height = dts->height; + area->screen = dts->screen; + area->following = dts->following; if (client->swapped) { - swaps(&ts->control, n); - swaps(&ts->length, n); - swapl(&ts->min_x, n); - swapl(&ts->max_x, n); - swapl(&ts->min_y, n); - swapl(&ts->max_y, n); - swapl(&ts->button_threshold, n); + swaps(&area->control, n); + swaps(&area->length, n); + swapl(&area->offset_x, n); + swapl(&area->offset_y, n); + swapl(&area->width, n); + swapl(&area->height, n); + swapl(&area->screen, n); + swapl(&area->following, n); } } |