summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@openedhand.com>2008-01-08 12:12:06 +0100
committerDodji Seketeli <dodji@openedhand.com>2008-01-08 12:31:47 +0100
commitc31aead0fe9fe424120ce221cd9f76cb6d29a5b5 (patch)
treed5ad9bdf02e5de7f8d1f5e5b3ea155645962bd93 /Xext
parent30375cd6d1439a3390b41714fe116aecc94743ca (diff)
[Kdrive] make XCalibrate 'orientation aware'
Diffstat (limited to 'Xext')
-rw-r--r--Xext/xcalibrate.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/Xext/xcalibrate.c b/Xext/xcalibrate.c
index 97ef3dc38..3fe2bdc5c 100644
--- a/Xext/xcalibrate.c
+++ b/Xext/xcalibrate.c
@@ -164,7 +164,6 @@ ProcXCalibrateSetRawMode (ClientPtr client)
return (client->noClientException);
}
-
static int
SProcXCalibrateSetRawMode (ClientPtr client)
{
@@ -178,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)
{
@@ -192,6 +232,9 @@ ProcXCalibrateDispatch (ClientPtr client)
return ProcXCalibrateQueryVersion(client);
case X_XCalibrateRawMode:
return ProcXCalibrateSetRawMode(client);
+ case X_XCalibrateScreenToCoord:
+ return ProcXCalibrateScreenToCoord(client);
+
default: break;
}
@@ -211,6 +254,8 @@ SProcXCalibrateDispatch (ClientPtr client)
return SProcXCalibrateQueryVersion(client);
case X_XCalibrateRawMode:
return SProcXCalibrateSetRawMode(client);
+ case X_XCalibrateScreenToCoord:
+ return SProcXCalibrateScreenToCoord(client);
default: break;
}