diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-07-18 11:43:24 -0400 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-07-18 11:43:24 -0400 |
commit | 878d9e76764d27f5af861817b46b2caf2d89d7c4 (patch) | |
tree | 4563424795d2208844a44276c4bb9b1f1ea5a5f7 /src/XGetDCtl.c | |
parent | 8f0d3c6d1f64fdc3b20d0beb831fa457214d5188 (diff) |
add sensible DEVICE_TOUCHSCREEN and DEVICE_CORE controls
Add a more sensible DEVICE_TOUCHSCREEN control, which allows you to
clip the x and y values.
Add a DEVICE_CORE control, which toggles the sending of core events
by extended devices.
Diffstat (limited to 'src/XGetDCtl.c')
-rw-r--r-- | src/XGetDCtl.c | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/src/XGetDCtl.c b/src/XGetDCtl.c index 9862dcc..139f7e7 100644 --- a/src/XGetDCtl.c +++ b/src/XGetDCtl.c @@ -61,13 +61,11 @@ SOFTWARE. #include <X11/extensions/extutil.h> #include "XIint.h" -XDeviceControl * XGetDeviceControl(dpy, dev, control) - register Display * - dpy; - XDevice * - dev; - int - control; +XDeviceControl * +XGetDeviceControl(dpy, dev, control) + register Display *dpy; + XDevice *dev; + int control; { int size = 0; int nbytes, i; @@ -116,6 +114,15 @@ XDeviceControl * XGetDeviceControl(dpy, dev, control) (3 * sizeof(int) * r->num_valuators); break; } + case DEVICE_TOUCHSCREEN: + { + size += sizeof(xDeviceTSState); + break; + } + case DEVICE_CORE: + { + size += sizeof(xDeviceCoreState); + } default: size += d->length; break; @@ -152,6 +159,32 @@ XDeviceControl * XGetDeviceControl(dpy, dev, control) *iptr++ = *iptr2++; break; } + case DEVICE_TOUCHSCREEN: + { + xDeviceTSState *t = (xDeviceTSState *) d; + XDeviceTSState *T = (XDeviceTSState *) Device; + + T->control = DEVICE_TOUCHSCREEN; + T->length = sizeof(T); + T->min_x = t->min_x; + T->max_x = t->max_x; + T->min_y = t->min_y; + T->max_y = t->max_y; + T->button_threshold = t->button_threshold; + + break; + } + case DEVICE_CORE: + { + xDeviceCoreState *c = (xDeviceCoreState *) d; + XDeviceCoreState *C = (XDeviceCoreState *) Device; + + C->control = DEVICE_CORE; + C->length = sizeof(C); + C->status = c->status; + + break; + } default: break; } |