diff options
-rw-r--r-- | src/XChgDCtl.c | 59 | ||||
-rw-r--r-- | src/XGetDCtl.c | 52 |
2 files changed, 85 insertions, 26 deletions
diff --git a/src/XChgDCtl.c b/src/XChgDCtl.c index 49e3a52..e70db73 100644 --- a/src/XChgDCtl.c +++ b/src/XChgDCtl.c @@ -107,21 +107,50 @@ XChangeDeviceControl(dpy, dev, control, d) } else return (rep.status); } - case DEVICE_TOUCHSCREEN: + case DEVICE_ABS_CALIB: { - XDeviceTSControl *T = (XDeviceTSControl *) d; - xDeviceTSCtl t; - - 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; - - req->length += (sizeof(t) + 3) >> 2; - Data(dpy, (char *) &t, sizeof(t)); + XDeviceAbsCalibControl *C = (XDeviceAbsCalibControl *) d; + xDeviceAbsCalibCtl c; + + c.control = DEVICE_ABS_CALIB; + c.length = sizeof(c); + c.min_x = C->min_x; + c.max_x = C->max_x; + c.min_y = C->min_y; + c.max_y = C->max_y; + c.flip_x = C->flip_x; + c.flip_y = C->flip_y; + c.rotation = C->rotation; + c.button_threshold = C->button_threshold; + + req->length += (sizeof(c) + 3) >> 2; + Data(dpy, (char *) &c, sizeof(c)); + + if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay(dpy); + SyncHandle(); + return NoSuchExtension; + } + else { + return rep.status; + } + } + case DEVICE_ABS_AREA: + { + XDeviceAbsAreaControl *A = (XDeviceAbsAreaControl *) d; + xDeviceAbsAreaCtl a; + + a.control = DEVICE_ABS_AREA; + a.length = sizeof(a); + a.offset_x = A->offset_x; + a.offset_y = A->offset_y; + a.width = A->width; + a.height = A->height; + a.screen = A->screen; + a.following = A->following; + + req->length += (sizeof(a) + 3) >> 2; + Data(dpy, (char *) &a, sizeof(a)); if (!_XReply(dpy, (xReply *) &rep, 0, xTrue)) { UnlockDisplay(dpy); @@ -153,6 +182,7 @@ XChangeDeviceControl(dpy, dev, control, d) return rep.status; } } +#if 0 case DEVICE_ENABLE: { XDeviceEnableControl *E = (XDeviceEnableControl *) d; @@ -174,6 +204,7 @@ XChangeDeviceControl(dpy, dev, control, d) return rep.status; } } +#endif default: { xDeviceCtl u; diff --git a/src/XGetDCtl.c b/src/XGetDCtl.c index 42f1be6..3fa709f 100644 --- a/src/XGetDCtl.c +++ b/src/XGetDCtl.c @@ -114,9 +114,14 @@ XGetDeviceControl(dpy, dev, control) (3 * sizeof(int) * r->num_valuators); break; } - case DEVICE_TOUCHSCREEN: + case DEVICE_ABS_CALIB: { - size += sizeof(xDeviceTSState); + size += sizeof(xDeviceAbsCalibState); + break; + } + case DEVICE_ABS_AREA: + { + size += sizeof(xDeviceAbsAreaState); break; } case DEVICE_CORE: @@ -159,18 +164,37 @@ XGetDeviceControl(dpy, dev, control) *iptr++ = *iptr2++; break; } - case DEVICE_TOUCHSCREEN: + case DEVICE_ABS_CALIB: { - xDeviceTSState *t = (xDeviceTSState *) d; - XDeviceTSState *T = (XDeviceTSState *) Device; + xDeviceAbsCalibState *c = (xDeviceAbsCalibState *) d; + XDeviceAbsCalibState *C = (XDeviceAbsCalibState *) Device; + + C->control = DEVICE_ABS_CALIB; + C->length = sizeof(C); + C->min_x = c->min_x; + C->max_x = c->max_x; + C->min_y = c->min_y; + C->max_y = c->max_y; + C->flip_x = c->flip_x; + C->flip_y = c->flip_y; + C->rotation = c->rotation; + C->button_threshold = c->button_threshold; - 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_ABS_AREA: + { + xDeviceAbsAreaState *a = (xDeviceAbsAreaState *) d; + XDeviceAbsAreaState *A = (XDeviceAbsAreaState *) Device; + + A->control = DEVICE_ABS_AREA; + A->length = sizeof(A); + A->offset_x = a->offset_x; + A->offset_y = a->offset_y; + A->width = a->width; + A->height = a->height; + A->screen = a->screen; + A->following = a->following; break; } @@ -182,10 +206,13 @@ XGetDeviceControl(dpy, dev, control) C->control = DEVICE_CORE; C->length = sizeof(C); C->status = c->status; +#if 0 C->iscore = c->iscore; +#endif break; } +#if 0 case DEVICE_ENABLE: { xDeviceEnableState *e = (xDeviceEnableState *) d; @@ -197,6 +224,7 @@ XGetDeviceControl(dpy, dev, control) break; } +#endif default: break; } |