diff options
author | Richard Purdie <richard@openedhand.com> | 2007-06-30 15:27:45 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-06-30 15:27:45 +0000 |
commit | a863497347198c0c6968ff02148ac766085d6d12 (patch) | |
tree | d19660610a8aff5d0b9cf65c58df46884647bbcb /meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0 | |
parent | d5ba636e35b3f8ef200dae9c1450146f00699ebe (diff) | |
download | poky-a863497347198c0c6968ff02148ac766085d6d12.tar.gz |
X calibration changes. Add functionality to the xcalibrate protocol (and X) to convert screen coordinates to mouse coordinates. xtscal can then be massively simplified removing a stack of bugs. Also remove stale cvs versions of xcalibrate.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2067 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0')
-rw-r--r-- | meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch new file mode 100644 index 0000000000..e0cca5428b --- /dev/null +++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch | |||
@@ -0,0 +1,122 @@ | |||
1 | --- | ||
2 | Xext/xcalibrate.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- | ||
3 | hw/kdrive/src/kdrive.h | 3 +++ | ||
4 | hw/kdrive/src/kinput.c | 12 ++++++++++++ | ||
5 | 3 files changed, 61 insertions(+), 1 deletion(-) | ||
6 | |||
7 | Index: xorg-server-1.3.0.0/Xext/xcalibrate.c | ||
8 | =================================================================== | ||
9 | --- xorg-server-1.3.0.0.orig/Xext/xcalibrate.c 2007-06-29 17:30:03.000000000 +0100 | ||
10 | +++ xorg-server-1.3.0.0/Xext/xcalibrate.c 2007-06-30 14:04:40.000000000 +0100 | ||
11 | @@ -166,7 +166,6 @@ ProcXCalibrateSetRawMode (ClientPtr clie | ||
12 | return (client->noClientException); | ||
13 | } | ||
14 | |||
15 | - | ||
16 | static int | ||
17 | SProcXCalibrateSetRawMode (ClientPtr client) | ||
18 | { | ||
19 | @@ -180,6 +179,47 @@ SProcXCalibrateSetRawMode (ClientPtr cli | ||
20 | return ProcXCalibrateSetRawMode(client); | ||
21 | } | ||
22 | |||
23 | +static int | ||
24 | +ProcXCalibrateScreenToCoord (ClientPtr client) | ||
25 | +{ | ||
26 | + REQUEST(xXCalibrateScreenToCoordReq); | ||
27 | + xXCalibrateScreenToCoordReply rep; | ||
28 | + | ||
29 | + REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq); | ||
30 | + | ||
31 | + memset (&rep, 0, sizeof (rep)); | ||
32 | + rep.type = X_Reply; | ||
33 | + rep.sequenceNumber = client->sequence; | ||
34 | + rep.x = stuff->x; | ||
35 | + rep.y = stuff->y; | ||
36 | + | ||
37 | + KdScreenToMouseCoords(&rep.x, &rep.y); | ||
38 | + | ||
39 | + if (client->swapped) | ||
40 | + { | ||
41 | + int n; | ||
42 | + | ||
43 | + swaps (&rep.x, n); | ||
44 | + swaps (&rep.y, n); | ||
45 | + } | ||
46 | + WriteToClient(client, sizeof (rep), (char *) &rep); | ||
47 | + return (client->noClientException); | ||
48 | +} | ||
49 | + | ||
50 | +static int | ||
51 | +SProcXCalibrateScreenToCoord (ClientPtr client) | ||
52 | +{ | ||
53 | + REQUEST(xXCalibrateScreenToCoordReq); | ||
54 | + int n; | ||
55 | + | ||
56 | + REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq); | ||
57 | + | ||
58 | + swaps(&stuff->x, n); | ||
59 | + swaps(&stuff->y, n); | ||
60 | + | ||
61 | + return ProcXCalibrateScreenToCoord(client); | ||
62 | +} | ||
63 | + | ||
64 | static void | ||
65 | XCalibrateResetProc (ExtensionEntry *extEntry) | ||
66 | { | ||
67 | @@ -194,6 +234,9 @@ ProcXCalibrateDispatch (ClientPtr client | ||
68 | return ProcXCalibrateQueryVersion(client); | ||
69 | case X_XCalibrateRawMode: | ||
70 | return ProcXCalibrateSetRawMode(client); | ||
71 | + case X_XCalibrateScreenToCoord: | ||
72 | + return ProcXCalibrateScreenToCoord(client); | ||
73 | + | ||
74 | default: break; | ||
75 | } | ||
76 | |||
77 | @@ -213,6 +256,8 @@ SProcXCalibrateDispatch (ClientPtr clien | ||
78 | return SProcXCalibrateQueryVersion(client); | ||
79 | case X_XCalibrateRawMode: | ||
80 | return SProcXCalibrateSetRawMode(client); | ||
81 | + case X_XCalibrateScreenToCoord: | ||
82 | + return SProcXCalibrateScreenToCoord(client); | ||
83 | |||
84 | default: break; | ||
85 | } | ||
86 | Index: xorg-server-1.3.0.0/hw/kdrive/src/kdrive.h | ||
87 | =================================================================== | ||
88 | --- xorg-server-1.3.0.0.orig/hw/kdrive/src/kdrive.h 2007-06-30 13:43:45.000000000 +0100 | ||
89 | +++ xorg-server-1.3.0.0/hw/kdrive/src/kdrive.h 2007-06-30 13:45:03.000000000 +0100 | ||
90 | @@ -746,6 +746,9 @@ void | ||
91 | KdSetMouseMatrix (KdMouseMatrix *matrix); | ||
92 | |||
93 | void | ||
94 | +KdScreenToMouseCoords (int *x, int *y); | ||
95 | + | ||
96 | +void | ||
97 | KdComputeMouseMatrix (KdMouseMatrix *matrix, Rotation randr, int width, int height); | ||
98 | |||
99 | void | ||
100 | Index: xorg-server-1.3.0.0/hw/kdrive/src/kinput.c | ||
101 | =================================================================== | ||
102 | --- xorg-server-1.3.0.0.orig/hw/kdrive/src/kinput.c 2007-06-29 17:30:16.000000000 +0100 | ||
103 | +++ xorg-server-1.3.0.0/hw/kdrive/src/kinput.c 2007-06-30 15:52:16.000000000 +0100 | ||
104 | @@ -381,6 +381,18 @@ KdSetMouseMatrix (KdMouseMatrix *matrix) | ||
105 | } | ||
106 | |||
107 | void | ||
108 | +KdScreenToMouseCoords (int *x, int *y) | ||
109 | +{ | ||
110 | + int (*m)[3] = kdMouseMatrix.matrix; | ||
111 | + int div = m[0][1] * m[1][0] - m[1][1] * m[0][0]; | ||
112 | + int sx = *x; | ||
113 | + int sy = *y; | ||
114 | + | ||
115 | + *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div; | ||
116 | + *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div; | ||
117 | +} | ||
118 | + | ||
119 | +void | ||
120 | KdComputeMouseMatrix (KdMouseMatrix *m, Rotation randr, int width, int height) | ||
121 | { | ||
122 | int x_dir = 1, y_dir = 1; | ||