diff options
author | Daniel Stone <daniel.stone@nokia.com> | 2006-07-19 12:15:18 -0400 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-07-21 15:19:50 -0400 |
commit | b308dbf273f8c26361b0fee7aca64aec3245f60b (patch) | |
tree | d81b973c4ff1149f08d876f7ae4d95060d8b6d1c /Xi/chgdctl.c | |
parent | c9a3d9baa81ceb940032ffe529d9eadf2d202ab2 (diff) |
add DEVICE_TOUCHSCREEN and DEVICE_CORE Xi controls (DeviceIntRec ABI break)
Add DEVICE_TOUCHSCREEN and DEVICE_CORE controls to the Xi code, and the
TouchscreenClassRec and a coreEvents flag, to toggle propagation of core
events.
Diffstat (limited to 'Xi/chgdctl.c')
-rw-r--r-- | Xi/chgdctl.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index d507513a9..ebe086548 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -104,6 +104,8 @@ ProcXChangeDeviceControl(ClientPtr client) xChangeDeviceControlReply rep; AxisInfoPtr a; CARD32 *resolution; + xDeviceTSCtl *ts; + xDeviceCoreCtl *c; REQUEST(xChangeDeviceControlReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq); @@ -168,6 +170,54 @@ ProcXChangeDeviceControl(ClientPtr client) return Success; } break; + case DEVICE_TOUCHSCREEN: + ts = (xDeviceTSCtl *)&stuff[1]; + + if (ts->button_threshold < 0 || ts->button_threshold > 255) { + SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, + BadValue); + return Success; + } + + status = ChangeDeviceControl(client, dev, (xDeviceCtl *) ts); + + if (status == Success) { + dev->touchscreen->min_x = ts->min_x; + dev->touchscreen->max_x = ts->max_x; + dev->touchscreen->min_y = ts->min_y; + dev->touchscreen->max_y = ts->max_y; + dev->touchscreen->button_threshold = ts->button_threshold; + } else if (status == DeviceBusy) { + rep.status = DeviceBusy; + WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), + &rep); + return Success; + } else { + SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, + BadMatch); + return Success; + } + + break; + case DEVICE_CORE: + c = (xDeviceCoreCtl *)&stuff[1]; + + status = ChangeDeviceControl(client, dev, (xDeviceCtl *) c); + + if (status == Success) { + dev->coreEvents = c->status; + } else if (status == DeviceBusy) { + rep.status = DeviceBusy; + WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), + &rep); + return Success; + } else { + SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, + BadMatch); + return Success; + } + + break; default: SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, BadValue); return Success; |