aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi/mipointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/mi/mipointer.c')
-rw-r--r--xorg-server/mi/mipointer.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c
index 85cc70de0..55bb4664e 100644
--- a/xorg-server/mi/mipointer.c
+++ b/xorg-server/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);
@@ -286,7 +285,8 @@ static void
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);
@@ -297,7 +297,7 @@ 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;
@@ -367,6 +367,9 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
pPointer = MIPOINTER(pDev);
+ if (!pPointer)
+ return;
+
pScreen = pPointer->pScreen;
if (!pScreen)
return;
@@ -444,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,
@@ -480,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;
@@ -494,7 +488,7 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
pPointer->pScreen = pScreen;
}
-_X_EXPORT void
+void
miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
{
miPointerScreenPtr pScreenPriv;
@@ -547,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;
@@ -590,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