diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-11-02 15:26:35 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-11-02 15:26:35 +0000 |
commit | dbca69c8a4f3e2d1ccb4f89152213b2861b33af6 (patch) | |
tree | f8963ef73903a7b4374adc2354dffbaa905112ac /xserver/Xext/xcalibrate.c | |
parent | 33b2029f322f3c238b7ba528083195ad8dde33e1 (diff) |
xserver 1.5.2. tested by ckuethe@, oga@, and others.
Diffstat (limited to 'xserver/Xext/xcalibrate.c')
-rw-r--r-- | xserver/Xext/xcalibrate.c | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/xserver/Xext/xcalibrate.c b/xserver/Xext/xcalibrate.c index 6cc682b4e..3fe2bdc5c 100644 --- a/xserver/Xext/xcalibrate.c +++ b/xserver/Xext/xcalibrate.c @@ -1,6 +1,4 @@ /* - * $Id: xcalibrate.c,v 1.1 2006/11/26 18:14:51 matthieu Exp $ - * * Copyright © 2003 Philip Blundell * * Permission to use, copy, modify, distribute, and sell this software and its @@ -166,7 +164,6 @@ ProcXCalibrateSetRawMode (ClientPtr client) return (client->noClientException); } - static int SProcXCalibrateSetRawMode (ClientPtr client) { @@ -180,6 +177,47 @@ SProcXCalibrateSetRawMode (ClientPtr client) return ProcXCalibrateSetRawMode(client); } +static int +ProcXCalibrateScreenToCoord (ClientPtr client) +{ + REQUEST(xXCalibrateScreenToCoordReq); + xXCalibrateScreenToCoordReply rep; + + REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq); + + memset (&rep, 0, sizeof (rep)); + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.x = stuff->x; + rep.y = stuff->y; + + KdScreenToPointerCoords(&rep.x, &rep.y); + + if (client->swapped) + { + int n; + + swaps (&rep.x, n); + swaps (&rep.y, n); + } + WriteToClient(client, sizeof (rep), (char *) &rep); + return (client->noClientException); +} + +static int +SProcXCalibrateScreenToCoord (ClientPtr client) +{ + REQUEST(xXCalibrateScreenToCoordReq); + int n; + + REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq); + + swaps(&stuff->x, n); + swaps(&stuff->y, n); + + return ProcXCalibrateScreenToCoord(client); +} + static void XCalibrateResetProc (ExtensionEntry *extEntry) { @@ -194,6 +232,9 @@ ProcXCalibrateDispatch (ClientPtr client) return ProcXCalibrateQueryVersion(client); case X_XCalibrateRawMode: return ProcXCalibrateSetRawMode(client); + case X_XCalibrateScreenToCoord: + return ProcXCalibrateScreenToCoord(client); + default: break; } @@ -213,6 +254,8 @@ SProcXCalibrateDispatch (ClientPtr client) return SProcXCalibrateQueryVersion(client); case X_XCalibrateRawMode: return SProcXCalibrateSetRawMode(client); + case X_XCalibrateScreenToCoord: + return SProcXCalibrateScreenToCoord(client); default: break; } |