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 /cfb/cfbscrinit.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 'cfb/cfbscrinit.c')
-rw-r--r-- | cfb/cfbscrinit.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/cfb/cfbscrinit.c b/cfb/cfbscrinit.c index 83f5cf0a2..48e363971 100644 --- a/cfb/cfbscrinit.c +++ b/cfb/cfbscrinit.c @@ -59,7 +59,7 @@ cfbCloseScreen (index, pScreen) xfree (depths); xfree (pScreen->visuals); #ifdef CFB_NEED_SCREEN_PRIVATE - xfree (pScreen->devPrivates[cfbScreenPrivateIndex].ptr); + xfree (dixLookupPrivate(&pScreen->devPrivates, cfbScreenPrivateKey)); #else xfree (pScreen->devPrivate); #endif @@ -88,7 +88,7 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - if (!cfbAllocatePrivates(pScreen, (int *) 0, (int *) 0)) + if (!cfbAllocatePrivates(pScreen, NULL, NULL)) return FALSE; pScreen->defColormap = FakeClientID(0); /* let CreateDefColormap do whatever it wants for pixels */ @@ -132,9 +132,11 @@ cfbCreateScreenResources(pScreen) Bool retval; pointer oldDevPrivate = pScreen->devPrivate; - pScreen->devPrivate = pScreen->devPrivates[cfbScreenPrivateIndex].ptr; + pScreen->devPrivate = dixLookupPrivate(&pScreen->devPrivates, + cfbScreenPrivateKey); retval = miCreateScreenResources(pScreen); - pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate; + dixSetPrivate(&pScreen->devPrivates, cfbScreenPrivateKey, + pScreen->devPrivate); pScreen->devPrivate = oldDevPrivate; return retval; } @@ -173,7 +175,8 @@ cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->CloseScreen = cfbCloseScreen; #ifdef CFB_NEED_SCREEN_PRIVATE pScreen->CreateScreenResources = cfbCreateScreenResources; - pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate; + dixSetPrivate(&pScreen->devPrivates, cfbScreenPrivateKey, + pScreen->devPrivate); pScreen->devPrivate = oldDevPrivate; #endif pScreen->GetScreenPixmap = cfbGetScreenPixmap; @@ -200,7 +203,8 @@ cfbGetScreenPixmap(pScreen) ScreenPtr pScreen; { #ifdef CFB_NEED_SCREEN_PRIVATE - return (PixmapPtr)pScreen->devPrivates[cfbScreenPrivateIndex].ptr; + return (PixmapPtr)dixLookupPrivate(&pScreen->devPrivates, + cfbScreenPrivateKey); #else return (PixmapPtr)pScreen->devPrivate; #endif @@ -212,8 +216,8 @@ cfbSetScreenPixmap(pPix) { #ifdef CFB_NEED_SCREEN_PRIVATE if (pPix) - pPix->drawable.pScreen->devPrivates[cfbScreenPrivateIndex].ptr = - (pointer)pPix; + dixSetPrivate(&pPix->drawable.pScreen->devPrivates, + cfbScreenPrivateKey, pPix); #else if (pPix) pPix->drawable.pScreen->devPrivate = (pointer)pPix; |