diff options
author | Simon Thum <simon.thum@gmx.de> | 2011-03-09 20:48:22 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-03-24 09:52:51 +1000 |
commit | 633b81e8ba09cc6a1ea8b43f323874fda2cf0bde (patch) | |
tree | 57915afb61443a6f7596b4dc0d86c49dcf1b04c2 /Xi | |
parent | 2103d61909c7e6bd345622962df7784a19df72c5 (diff) |
xserver: remove AbsoluteClassRec keeping the ABI
This removes the struct, but keeps InitAbsoluteClassDeviceStruct as
a no-op and preserves related struct layout.
Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/chgdctl.c | 72 | ||||
-rw-r--r-- | Xi/exevents.c | 24 | ||||
-rw-r--r-- | Xi/getdctl.c | 75 |
3 files changed, 4 insertions, 167 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 901a0e419..4c4aebac6 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -76,8 +76,6 @@ SProcXChangeDeviceControl(ClientPtr client) { char n; xDeviceCtl *ctl; - xDeviceAbsCalibCtl *calib; - xDeviceAbsAreaCtl *area; REQUEST(xChangeDeviceControlReq); swaps(&stuff->length, n); @@ -88,26 +86,7 @@ SProcXChangeDeviceControl(ClientPtr client) swaps(&ctl->length, n); switch(stuff->control) { case DEVICE_ABS_CALIB: - calib = (xDeviceAbsCalibCtl*)ctl; - 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); - break; case DEVICE_ABS_AREA: - area = (xDeviceAbsAreaCtl*)ctl; - 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); - break; case DEVICE_CORE: case DEVICE_ENABLE: case DEVICE_RESOLUTION: @@ -134,8 +113,6 @@ ProcXChangeDeviceControl(ClientPtr client) xChangeDeviceControlReply rep; AxisInfoPtr a; CARD32 *resolution; - xDeviceAbsCalibCtl *calib; - xDeviceAbsAreaCtl *area; xDeviceEnableCtl *e; devicePresenceNotify dpn; @@ -193,53 +170,10 @@ ProcXChangeDeviceControl(ClientPtr client) } break; case DEVICE_ABS_CALIB: - calib = (xDeviceAbsCalibCtl *)&stuff[1]; - - if (calib->button_threshold < 0 || calib->button_threshold > 255) { - ret = BadValue; - goto out; - } - - status = ChangeDeviceControl(client, dev, (xDeviceCtl *) calib); - - if (status == Success) { - dev->absolute->min_x = calib->min_x; - dev->absolute->max_x = calib->max_x; - dev->absolute->min_y = calib->min_y; - dev->absolute->max_y = calib->max_y; - dev->absolute->flip_x = calib->flip_x; - dev->absolute->flip_y = calib->flip_y; - dev->absolute->rotation = calib->rotation; - dev->absolute->button_threshold = calib->button_threshold; - ret = Success; - } else if (status == DeviceBusy || status == BadValue) { - rep.status = status; - ret = Success; - } else { - ret = BadMatch; - } - - break; case DEVICE_ABS_AREA: - area = (xDeviceAbsAreaCtl *)&stuff[1]; - - status = ChangeDeviceControl(client, dev, (xDeviceCtl *) area); - - if (status == Success) { - dev->absolute->offset_x = area->offset_x; - dev->absolute->offset_y = area->offset_y; - dev->absolute->width = area->width; - dev->absolute->height = area->height; - dev->absolute->screen = area->screen; - dev->absolute->following = area->following; - ret = Success; - } else if (status == DeviceBusy || status == BadValue) { - rep.status = status; - ret = Success; - } else { - ret = Success; - } - + /* Calibration is now done through properties, and never had any effect + * on anything (in the open-source world). Thus, be honest. */ + ret = BadMatch; break; case DEVICE_CORE: /* Sorry, no device core switching no more. If you want a device to diff --git a/Xi/exevents.c b/Xi/exevents.c index c7089bb69..5b207bc4b 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -626,30 +626,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) classes->proximity = to->proximity; to->proximity = NULL; } - - if (from->absolute) - { - if (!to->absolute) - { - classes = to->unused_classes; - to->absolute = classes->absolute; - if (!to->absolute) - { - to->absolute = calloc(1, sizeof(AbsoluteClassRec)); - if (!to->absolute) - FatalError("[Xi] no memory for class shift.\n"); - } else - classes->absolute = NULL; - } - memcpy(to->absolute, from->absolute, sizeof(AbsoluteClassRec)); - to->absolute->sourceid = from->id; - } else if (to->absolute) - { - ClassesPtr classes; - classes = to->unused_classes; - classes->absolute = to->absolute; - to->absolute = NULL; - } } /** diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 3e81e9479..4e04b8b06 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -118,64 +118,6 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf, } } -static void CopySwapDeviceAbsCalib (ClientPtr client, AbsoluteClassPtr dts, - char *buf) -{ - char n; - xDeviceAbsCalibState *calib = (xDeviceAbsCalibState *) buf; - - calib->control = DEVICE_ABS_CALIB; - calib->length = sizeof(xDeviceAbsCalibState); - 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); - } -} - -static void CopySwapDeviceAbsArea (ClientPtr client, AbsoluteClassPtr dts, - char *buf) -{ - char n; - xDeviceAbsAreaState *area = (xDeviceAbsAreaState *) buf; - - area->control = DEVICE_ABS_AREA; - area->length = sizeof(xDeviceAbsAreaState); - 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(&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); - } -} - static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf) { char n; @@ -260,17 +202,8 @@ ProcXGetDeviceControl(ClientPtr client) (3 * sizeof(int) * dev->valuator->numAxes); break; case DEVICE_ABS_CALIB: - if (!dev->absolute) - return BadMatch; - - total_length = sizeof(xDeviceAbsCalibState); - break; case DEVICE_ABS_AREA: - if (!dev->absolute) - return BadMatch; - - total_length = sizeof(xDeviceAbsAreaState); - break; + return BadMatch; case DEVICE_CORE: total_length = sizeof(xDeviceCoreState); break; @@ -290,12 +223,6 @@ ProcXGetDeviceControl(ClientPtr client) case DEVICE_RESOLUTION: CopySwapDeviceResolution(client, dev->valuator, buf, total_length); break; - 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); break; |