diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-08-28 09:28:25 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-08-28 09:28:25 -0400 |
commit | 4017d3190234e189a0bbd33193a148d4d3c7556b (patch) | |
tree | 2ab228113d410386afde50c893f137d95974b8f3 /mi/midispcur.c | |
parent | 85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (diff) |
devPrivates rework: since API is already broken, switch everything
over to new system.
Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
Diffstat (limited to 'mi/midispcur.c')
-rw-r--r-- | mi/midispcur.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/mi/midispcur.c b/mi/midispcur.c index feb6c2f98..8b782925a 100644 --- a/mi/midispcur.c +++ b/mi/midispcur.c @@ -54,8 +54,7 @@ in this Software without prior written authorization from The Open Group. /* per-screen private data */ -static int miDCScreenIndex; -static unsigned long miDCGeneration = 0; +static DevPrivateKey miDCScreenKey = &miDCScreenKey; static Bool miDCCloseScreen(int index, ScreenPtr pScreen); @@ -117,13 +116,6 @@ miDCInitialize (pScreen, screenFuncs) { miDCScreenPtr pScreenPriv; - if (miDCGeneration != serverGeneration) - { - miDCScreenIndex = AllocateScreenPrivateIndex (); - if (miDCScreenIndex < 0) - return FALSE; - miDCGeneration = serverGeneration; - } pScreenPriv = (miDCScreenPtr) xalloc (sizeof (miDCScreenRec)); if (!pScreenPriv) return FALSE; @@ -149,7 +141,7 @@ miDCInitialize (pScreen, screenFuncs) pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = miDCCloseScreen; - pScreen->devPrivates[miDCScreenIndex].ptr = (pointer) pScreenPriv; + dixSetPrivate(&pScreen->devPrivates, miDCScreenKey, pScreenPriv); if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs)) { @@ -170,7 +162,8 @@ miDCCloseScreen (index, pScreen) { miDCScreenPtr pScreenPriv; - pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; + pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + miDCScreenKey); pScreen->CloseScreen = pScreenPriv->CloseScreen; tossGC (pScreenPriv->pSourceGC); tossGC (pScreenPriv->pMaskGC); @@ -475,7 +468,8 @@ miDCPutUpCursor (pScreen, pCursor, x, y, source, mask) if (!pPriv) return FALSE; } - pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; + pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + miDCScreenKey); pWin = WindowTable[pScreen->myNum]; #ifdef ARGB_CURSOR if (pPriv->pPicture) @@ -520,7 +514,8 @@ miDCSaveUnderCursor (pScreen, x, y, w, h) WindowPtr pWin; GCPtr pGC; - pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; + pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + miDCScreenKey); pSave = pScreenPriv->pSave; pWin = WindowTable[pScreen->myNum]; if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h) @@ -552,7 +547,8 @@ miDCRestoreUnderCursor (pScreen, x, y, w, h) WindowPtr pWin; GCPtr pGC; - pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; + pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + miDCScreenKey); pSave = pScreenPriv->pSave; pWin = WindowTable[pScreen->myNum]; if (!pSave) @@ -578,7 +574,8 @@ miDCChangeSave (pScreen, x, y, w, h, dx, dy) GCPtr pGC; int sourcex, sourcey, destx, desty, copyw, copyh; - pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; + pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + miDCScreenKey); pSave = pScreenPriv->pSave; pWin = WindowTable[pScreen->myNum]; /* @@ -721,7 +718,8 @@ miDCMoveCursor (pScreen, pCursor, x, y, w, h, dx, dy, source, mask) if (!pPriv) return FALSE; } - pScreenPriv = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr; + pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates, + miDCScreenKey); pWin = WindowTable[pScreen->myNum]; pTemp = pScreenPriv->pTemp; if (!pTemp || |