summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-10-08 17:44:37 +0300
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2006-10-08 17:44:37 +0300
commitef68273f5bdb27a492ec0b69548ec4fbede46c08 (patch)
tree189d232327ba5d59f0732390603df93797e0914b
parent6eab4c55890660089067da0e944256b1ed3a8c67 (diff)
mi/mipointer: deprecate functions which don't take a device
Deprecate all mi pointer functions which don't take a device argument, and replace them with versions which do, in preparation for MPX.
-rw-r--r--mi/mieq.c6
-rw-r--r--mi/mipointer.c39
-rw-r--r--mi/mipointer.h33
3 files changed, 56 insertions, 22 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index 63b900c85..856aa25c4 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -104,9 +104,9 @@ mieqEnqueue (xEvent *e)
&laste->event[0];
if (e->u.u.type == MotionNotify) {
- miPointerAbsoluteCursor(e->u.keyButtonPointer.rootX,
- e->u.keyButtonPointer.rootY,
- e->u.keyButtonPointer.time);
+ miPointerSetPosition(pDev, e->u.keyButtonPointer.rootX,
+ e->u.keyButtonPointer.rootY,
+ e->u.keyButtonPointer.time);
pDev = inputInfo.pointer;
isMotion = inputInfo.pointer->id & DEVICE_BITS;
}
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 206a3fc5c..c9b80bfe1 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -44,6 +44,7 @@ in this Software without prior written authorization from The Open Group.
# include "mipointrst.h"
# include "cursorstr.h"
# include "dixstruct.h"
+# include "inputstr.h"
_X_EXPORT int miPointerScreenIndex;
static unsigned long miPointerGeneration = 0;
@@ -178,7 +179,7 @@ miPointerDisplayCursor (pScreen, pCursor)
{
miPointer.pCursor = pCursor;
miPointer.pScreen = pScreen;
- miPointerUpdate ();
+ miPointerUpdateSprite(inputInfo.pointer);
return TRUE;
}
@@ -225,7 +226,7 @@ miPointerSetCursorPosition(pScreen, x, y, generateEvent)
/* device dependent - must pend signal and call miPointerWarpCursor */
(*pScreenPriv->screenFuncs->WarpCursor) (pScreen, x, y);
if (!generateEvent)
- miPointerUpdate();
+ miPointerUpdateSprite(inputInfo.pointer);
return TRUE;
}
@@ -308,6 +309,12 @@ miPointerGetMotionEvents (pPtr, coords, start, stop, pScreen)
void
miPointerUpdate ()
{
+ miPointerUpdateSprite(inputInfo.pointer);
+}
+
+void
+miPointerUpdateSprite (DeviceIntPtr pDev)
+{
ScreenPtr pScreen;
miPointerScreenPtr pScreenPriv;
CursorPtr pCursor;
@@ -376,11 +383,10 @@ miPointerUpdate ()
*/
void
-miPointerDeltaCursor (dx, dy, time)
- int dx, dy;
- unsigned long time;
+miPointerDeltaCursor (int dx, int dy, unsigned long time)
{
- miPointerAbsoluteCursor (miPointer.x + dx, miPointer.y + dy, time);
+ miPointerSetPosition(inputInfo.pointer, miPointer.x + dx,
+ miPointer.y + dy, time);
}
void
@@ -408,9 +414,13 @@ miPointerCurrentScreen ()
*/
_X_EXPORT void
-miPointerAbsoluteCursor (x, y, time)
- int x, y;
- unsigned long time;
+miPointerAbsoluteCursor (int x, int y, unsigned long time)
+{
+ miPointerSetPosition(inputInfo.pointer, x, y, time);
+}
+
+_X_EXPORT void
+miPointerSetPosition(DeviceIntPtr pDev, int x, int y, unsigned long time)
{
miPointerScreenPtr pScreenPriv;
ScreenPtr pScreen;
@@ -419,6 +429,7 @@ miPointerAbsoluteCursor (x, y, time)
pScreen = miPointer.pScreen;
if (!pScreen)
return; /* called before ready */
+
if (x < 0 || x >= pScreen->width || y < 0 || y >= pScreen->height)
{
pScreenPriv = GetScreenPrivate (pScreen);
@@ -455,8 +466,13 @@ miPointerAbsoluteCursor (x, y, time)
}
_X_EXPORT void
-miPointerPosition (x, y)
- int *x, *y;
+miPointerPosition (int *x, int *y)
+{
+ miPointerGetPosition(inputInfo.pointer, x, y);
+}
+
+_X_EXPORT void
+miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
{
*x = miPointer.x;
*y = miPointer.y;
@@ -473,7 +489,6 @@ miPointerMove (pScreen, x, y, time)
unsigned long time;
{
SetupScreen(pScreen);
- xEvent xE;
miHistoryPtr history;
int prev, end, start;
diff --git a/mi/mipointer.h b/mi/mipointer.h
index b4e74ea53..a910de61e 100644
--- a/mi/mipointer.h
+++ b/mi/mipointer.h
@@ -111,40 +111,59 @@ extern int miPointerGetMotionEvents(
ScreenPtr /*pScreen*/
);
+/* Deprecated in favour of miPointerUpdateSprite. */
extern void miPointerUpdate(
void
) _X_DEPRECATED;
+/* Deprecated in favour of miSetPointerPosition. */
extern void miPointerDeltaCursor(
int /*dx*/,
int /*dy*/,
unsigned long /*time*/
) _X_DEPRECATED;
-
extern void miPointerAbsoluteCursor(
int /*x*/,
int /*y*/,
unsigned long /*time*/
) _X_DEPRECATED;
+/* Deprecated in favour of miGetPointerPosition. */
extern void miPointerPosition(
int * /*x*/,
int * /*y*/
) _X_DEPRECATED;
+/* Deprecated in favour of miPointerSetScreen. */
extern void miPointerSetNewScreen(
int, /*screen_no*/
- int, /*x*/
- int /*y*/
+ int, /*x*/
+ int /*y*/
) _X_DEPRECATED;
+
+/* Deprecated in favour of miPointerGetScreen. */
extern ScreenPtr miPointerCurrentScreen(
void
) _X_DEPRECATED;
-extern void miRegisterPointerDevice(
- ScreenPtr /*pScreen*/,
- DeviceIntPtr /*pDevice*/
-);
+extern ScreenPtr miPointerGetScreen(
+ DeviceIntPtr pDev);
+extern void miPointerSetScreen(
+ DeviceIntPtr pDev);
+
+extern void miPointerGetPosition(
+ DeviceIntPtr pDev,
+ int *x,
+ int *y);
+
+extern void miPointerSetPosition(
+ DeviceIntPtr pDev,
+ int x,
+ int y,
+ unsigned long time);
+
+extern void miPointerUpdateSprite(
+ DeviceIntPtr pDev);
extern int miPointerScreenIndex;