summaryrefslogtreecommitdiff
path: root/packages/xorg-lib/libxcalibrate/coords.patch
blob: 19cf1639f65f53ded3fd9cc38610cecc47598c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
 xcalibrate.c |   26 ++++++++++++++++++++++++++
 xcalibrate.h |    2 ++
 2 files changed, 28 insertions(+)

Index: XCalibrate/xcalibrate.c
===================================================================
--- XCalibrate.orig/xcalibrate.c	2007-06-30 14:12:22.000000000 +0100
+++ XCalibrate/xcalibrate.c	2007-06-30 14:18:10.000000000 +0100
@@ -227,3 +227,29 @@ XCalibrateSetRawMode (Display *dpy, Bool
   SyncHandle ();
   return 0;
 }
+
+Status 
+XCalibrateScreenToCoord (Display *dpy, int *x, int *y)
+{
+  XExtDisplayInfo		*info = XCalibrateFindDisplay (dpy);
+  xXCalibrateScreenToCoordReq *req;
+  xXCalibrateScreenToCoordReply	rep;
+  LockDisplay (dpy);
+  GetReq (XCalibrateScreenToCoord, req);
+  req->reqType = info->codes->major_opcode;
+  req->xCalibrateReqType = X_XCalibrateScreenToCoord;
+  req->x = *x;
+  req->y = *y;
+  if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) 
+    {
+      UnlockDisplay (dpy);
+      SyncHandle ();
+      return 1;
+    }
+  *x = rep.x;
+  *y = rep.y;
+  UnlockDisplay (dpy);
+  SyncHandle ();
+  return 0;
+}
+
Index: XCalibrate/xcalibrate.h
===================================================================
--- XCalibrate.orig/xcalibrate.h	2007-06-30 14:16:16.000000000 +0100
+++ XCalibrate/xcalibrate.h	2007-06-30 14:16:38.000000000 +0100
@@ -43,4 +43,6 @@ Status XCalibrateQueryVersion (Display *
 
 Status XCalibrateSetRawMode (Display *dpy, Bool enable);
 
+Status XCalibrateScreenToCoord (Display *dpy, int *x, int *y);
+
 #endif