summaryrefslogtreecommitdiff
path: root/xserver/mi/mipointer.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-27 19:02:39 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-27 19:02:39 +0000
commit269d40cbcc43b41f621ca6d91c182952f60ec48e (patch)
tree872f2fddd3f2207e57a28595e73886713ce4a77a /xserver/mi/mipointer.c
parent917a2249b787451cad3f9697872aeccfd0da3324 (diff)
Update to xserver 1.8. Tested by many. Ok oga@, todd@.
Diffstat (limited to 'xserver/mi/mipointer.c')
-rw-r--r--xserver/mi/mipointer.c47
1 files changed, 20 insertions, 27 deletions
diff --git a/xserver/mi/mipointer.c b/xserver/mi/mipointer.c
index cf46fdfc6..e1f63be4e 100644
--- a/xserver/mi/mipointer.c
+++ b/xserver/mi/mipointer.c
@@ -27,7 +27,6 @@ in this Software without prior written authorization from The Open Group.
#include <dix-config.h>
#endif
-# define NEED_EVENTS
# include <X11/X.h>
# include <X11/Xmd.h>
# include <X11/Xproto.h>
@@ -42,7 +41,7 @@ in this Software without prior written authorization from The Open Group.
# include "inputstr.h"
static int miPointerScreenKeyIndex;
-_X_EXPORT DevPrivateKey miPointerScreenKey = &miPointerScreenKeyIndex;
+DevPrivateKey miPointerScreenKey = &miPointerScreenKeyIndex;
#define GetScreenPrivate(s) ((miPointerScreenPtr) \
dixLookupPrivate(&(s)->devPrivates, miPointerScreenKey))
@@ -52,9 +51,9 @@ static int miPointerPrivKeyIndex;
static DevPrivateKey miPointerPrivKey = &miPointerPrivKeyIndex;
#define MIPOINTER(dev) \
- ((DevHasCursor((dev)) || (!dev->isMaster && !dev->u.master)) ? \
+ ((!IsMaster(dev) && !dev->u.master) ? \
(miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \
- (miPointerPtr)dixLookupPrivate(&(dev)->u.master->devPrivates, miPointerPrivKey))
+ (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey))
static Bool miPointerRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor);
@@ -81,7 +80,7 @@ static void miPointerDeviceCleanup(DeviceIntPtr pDev,
static EventList* events; /* for WarpPointer MotionNotifies */
-_X_EXPORT Bool
+Bool
miPointerInitialize (ScreenPtr pScreen,
miPointerSpriteFuncPtr spriteFuncs,
miPointerScreenFuncPtr screenFuncs,
@@ -89,7 +88,7 @@ miPointerInitialize (ScreenPtr pScreen,
{
miPointerScreenPtr pScreenPriv;
- pScreenPriv = (miPointerScreenPtr) xalloc (sizeof (miPointerScreenRec));
+ pScreenPriv = xalloc (sizeof (miPointerScreenRec));
if (!pScreenPriv)
return FALSE;
pScreenPriv->spriteFuncs = spriteFuncs;
@@ -187,8 +186,8 @@ miPointerDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
miPointerPtr pPointer;
/* return for keyboards */
- if ((pDev->isMaster && !DevHasCursor(pDev)) ||
- (!pDev->isMaster && pDev->u.master && !DevHasCursor(pDev->u.master)))
+ if ((IsMaster(pDev) && !DevHasCursor(pDev)) ||
+ (!IsMaster(pDev) && pDev->u.master && !DevHasCursor(pDev->u.master)))
return FALSE;
pPointer = MIPOINTER(pDev);
@@ -287,7 +286,7 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
SetupScreen(pScreen);
- if (!pDev->isMaster && pDev->u.master)
+ if (!IsMaster(pDev) && pDev->u.master)
return;
(*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen);
@@ -298,13 +297,13 @@ miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
/* Once signals are ignored, the WarpCursor function can call this */
-_X_EXPORT void
+void
miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
miPointerPtr pPointer;
BOOL changedScreen = FALSE;
- SetupScreen (pScreen);
+ SetupScreen (pScreen);
pPointer = MIPOINTER(pDev);
if (pPointer->pScreen != pScreen)
@@ -368,6 +367,9 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
pPointer = MIPOINTER(pDev);
+ if (!pPointer)
+ return;
+
pScreen = pPointer->pScreen;
if (!pScreen)
return;
@@ -445,28 +447,19 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y)
pPointer->limits.y2 = pScreen->height;
}
-_X_EXPORT ScreenPtr
-miPointerCurrentScreen ()
+ScreenPtr
+miPointerCurrentScreen (void)
{
return miPointerGetScreen(inputInfo.pointer);
}
-_X_EXPORT ScreenPtr
+ScreenPtr
miPointerGetScreen(DeviceIntPtr pDev)
{
miPointerPtr pPointer = MIPOINTER(pDev);
return (pPointer) ? pPointer->pScreen : NULL;
}
-/* Move the pointer to x, y on the current screen, update the sprite, and
- * the motion history. Generates no events. Does not return changed x
- * and y if they are clipped; use miPointerSetPosition instead. */
-_X_EXPORT void
-miPointerAbsoluteCursor (int x, int y, unsigned long time)
-{
- miPointerSetPosition(inputInfo.pointer, &x, &y);
-}
-
/* Move the pointer on the current screen, and update the sprite. */
static void
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
@@ -481,7 +474,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
* VCP, as this may cause a non-HW rendered cursor to be rendered during
* SIGIO. This again leads to allocs during SIGIO which leads to SIGABRT.
*/
- if ((pDev == inputInfo.pointer || (!pDev->isMaster && pDev->u.master == inputInfo.pointer))
+ if ((pDev == inputInfo.pointer || (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer))
&& !pScreenPriv->waitForUpdate && pScreen == pPointer->pSpriteScreen)
{
pPointer->devx = x;
@@ -495,7 +488,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
pPointer->pScreen = pScreen;
}
-_X_EXPORT void
+void
miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
{
miPointerScreenPtr pScreenPriv;
@@ -548,7 +541,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
miPointerMoved(pDev, pScreen, *x, *y);
}
-_X_EXPORT void
+void
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
{
*x = MIPOINTER(pDev)->x;
@@ -591,7 +584,7 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
darwinEvents_lock();
#endif
for (i = 0; i < nevents; i++)
- mieqEnqueue(pDev, events[i].event);
+ mieqEnqueue(pDev, (InternalEvent*)events[i].event);
#ifdef XQUARTZ
darwinEvents_unlock();
#endif