diff options
author | marha <marha@users.sourceforge.net> | 2010-09-24 10:10:29 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-09-24 10:10:29 +0000 |
commit | 84b35d18d0b84909f7216fc6a7487ffa72bd3f18 (patch) | |
tree | a6a1cf67169f65d2b680c6d3f548d45901284aff /xorg-server/mi | |
parent | 6a14682c40a85bbfdb5023a3330e95a3a3c0ad03 (diff) | |
download | vcxsrv-84b35d18d0b84909f7216fc6a7487ffa72bd3f18.tar.gz vcxsrv-84b35d18d0b84909f7216fc6a7487ffa72bd3f18.tar.bz2 vcxsrv-84b35d18d0b84909f7216fc6a7487ffa72bd3f18.zip |
xserver xkbcomp libxcb pixman git update 24/9/2010
Diffstat (limited to 'xorg-server/mi')
-rw-r--r-- | xorg-server/mi/midispcur.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/xorg-server/mi/midispcur.c b/xorg-server/mi/midispcur.c index 7d79042f4..ef5c4e29e 100644 --- a/xorg-server/mi/midispcur.c +++ b/xorg-server/mi/midispcur.c @@ -56,6 +56,10 @@ in this Software without prior written authorization from The Open Group. /* per-screen private data */
static DevPrivateKeyRec miDCScreenKeyRec;
#define miDCScreenKey (&miDCScreenKeyRec)
+static DevScreenPrivateKeyRec miDCCursorBitsKeyRec;
+#define miDCCursorBitsKey (&miDCCursorBitsKeyRec)
+static DevScreenPrivateKeyRec miDCDeviceKeyRec;
+#define miDCDeviceKey (&miDCDeviceKeyRec)
static Bool miDCCloseScreen(int index, ScreenPtr pScreen);
@@ -71,8 +75,8 @@ typedef struct { #define miGetDCDevice(dev, screen) \
((DevHasCursor(dev)) ? \
- (miDCBufferPtr)dixLookupPrivate(&dev->devPrivates, miDCDeviceKey(screen)) : \
- (miDCBufferPtr)dixLookupPrivate(&dev->u.master->devPrivates, miDCDeviceKey(screen)))
+ (miDCBufferPtr)dixLookupScreenPrivate(&dev->devPrivates, miDCDeviceKey, screen) : \
+ (miDCBufferPtr)dixLookupScreenPrivate(&dev->u.master->devPrivates, miDCDeviceKey, screen))
/*
* The core pointer buffer will point to the index of the virtual core pointer
@@ -80,13 +84,9 @@ typedef struct { */
typedef struct {
CloseScreenProcPtr CloseScreen;
- DevPrivateKey device_key;
- DevPrivateKey cursor_bits_key;
} miDCScreenRec, *miDCScreenPtr;
#define miGetDCScreen(s) ((miDCScreenPtr)(dixLookupPrivate(&(s)->devPrivates, miDCScreenKey)))
-#define miDCDeviceKey(s) (miGetDCScreen(s)->device_key)
-#define miDCCursorBitsKey(s) (miGetDCScreen(s)->cursor_bits_key)
/* per-cursor per-screen private data */
typedef struct {
@@ -102,19 +102,15 @@ miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) {
miDCScreenPtr pScreenPriv;
- if (!dixRegisterPrivateKey(&miDCScreenKeyRec, PRIVATE_SCREEN, 0))
+ if (!dixRegisterPrivateKey(&miDCScreenKeyRec, PRIVATE_SCREEN, 0) ||
+ !dixRegisterScreenPrivateKey(&miDCCursorBitsKeyRec, pScreen, PRIVATE_CURSOR_BITS, 0) ||
+ !dixRegisterScreenPrivateKey(&miDCDeviceKeyRec, pScreen, PRIVATE_DEVICE, 0))
return FALSE;
pScreenPriv = malloc(sizeof (miDCScreenRec));
if (!pScreenPriv)
return FALSE;
- pScreenPriv->cursor_bits_key = dixCreatePrivateKey(PRIVATE_CURSOR_BITS, 0);
- pScreenPriv->device_key = dixCreatePrivateKey(PRIVATE_DEVICE, 0);
- if (!pScreenPriv->cursor_bits_key || !pScreenPriv->device_key) {
- free(pScreenPriv);
- return FALSE;
- }
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = miDCCloseScreen;
@@ -144,7 +140,7 @@ Bool miDCRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
{
if (pCursor->bits->refcnt <= 1)
- dixSetPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey(pScreen), NULL);
+ dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, pScreen, NULL);
return TRUE;
}
@@ -243,7 +239,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) free((pointer) pPriv);
return NULL;
}
- dixSetPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey(pScreen), pPriv);
+ dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, pScreen, pPriv);
return pPriv;
}
pPriv->pPicture = 0;
@@ -261,7 +257,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor) free((pointer) pPriv);
return NULL;
}
- dixSetPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey(pScreen), pPriv);
+ dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, pScreen, pPriv);
/* create the two sets of bits, clipping as appropriate */
@@ -305,8 +301,8 @@ miDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) {
miDCCursorPtr pPriv;
- pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
- miDCCursorBitsKey(pScreen));
+ pPriv = (miDCCursorPtr)dixLookupScreenPrivate(&pCursor->bits->devPrivates,
+ miDCCursorBitsKey, pScreen);
if (pPriv && (pCursor->bits->refcnt <= 1))
{
if (pPriv->sourceBits)
@@ -318,7 +314,7 @@ miDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) FreePicture (pPriv->pPicture, 0);
#endif
free((pointer) pPriv);
- dixSetPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey(pScreen), NULL);
+ dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, pScreen, NULL);
}
return TRUE;
}
@@ -406,8 +402,8 @@ miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, miDCBufferPtr pBuffer;
WindowPtr pWin;
- pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
- miDCCursorBitsKey(pScreen));
+ pPriv = (miDCCursorPtr)dixLookupScreenPrivate(&pCursor->bits->devPrivates,
+ miDCCursorBitsKey, pScreen);
if (!pPriv)
{
pPriv = miDCRealize(pScreen, pCursor);
@@ -523,7 +519,7 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) if (!pBuffer)
goto failure;
- dixSetPrivate(&pDev->devPrivates, miDCDeviceKey(pScreen), pBuffer);
+ dixSetScreenPrivate(&pDev->devPrivates, miDCDeviceKey, pScreen, pBuffer);
pWin = pScreen->root;
pBuffer->pSourceGC = miDCMakeGC(pWin);
@@ -589,7 +585,7 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) if (pBuffer->pSave) (*pScreen->DestroyPixmap)(pBuffer->pSave);
free(pBuffer);
- dixSetPrivate(&pDev->devPrivates, miDCDeviceKey(pScreen), NULL);
+ dixSetScreenPrivate(&pDev->devPrivates, miDCDeviceKey, pScreen, NULL);
}
}
}
|