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 /dbe/midbe.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 'dbe/midbe.c')
-rw-r--r-- | dbe/midbe.c | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/dbe/midbe.c b/dbe/midbe.c index 014e365ce..f26a09c6d 100644 --- a/dbe/midbe.c +++ b/dbe/midbe.c @@ -59,12 +59,11 @@ #include <stdio.h> -static int miDbePrivPrivGeneration = 0; -static int miDbeWindowPrivPrivIndex = -1; +static DevPrivateKey miDbeWindowPrivPrivKey = &miDbeWindowPrivPrivKey; static RESTYPE dbeDrawableResType; static RESTYPE dbeWindowPrivResType; -static int dbeScreenPrivIndex = -1; -static int dbeWindowPrivIndex = -1; +static DevPrivateKey dbeScreenPrivKey = &dbeScreenPrivKey; +static DevPrivateKey dbeWindowPrivKey = &dbeWindowPrivKey; /****************************************************************************** @@ -204,8 +203,8 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) /* Attach the priv priv to the priv. */ - pDbeWindowPriv->devPrivates[miDbeWindowPrivPrivIndex].ptr = - (pointer)pDbeWindowPrivPriv; + dixSetPrivate(&pDbeWindowPriv->devPrivates, miDbeWindowPrivPrivKey, + pDbeWindowPrivPriv); /* Clear the back buffer. */ @@ -778,30 +777,12 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv) dbeWindowPrivResType = pDbeScreenPriv->dbeWindowPrivResType; /* Copy private indices created by DIX */ - dbeScreenPrivIndex = pDbeScreenPriv->dbeScreenPrivIndex; - dbeWindowPrivIndex = pDbeScreenPriv->dbeWindowPrivIndex; + dbeScreenPrivKey = pDbeScreenPriv->dbeScreenPrivKey; + dbeWindowPrivKey = pDbeScreenPriv->dbeWindowPrivKey; - /* Reset the window priv privs if generations do not match. */ - if (miDbePrivPrivGeneration != serverGeneration) - { - /* - ********************************************************************** - ** Allocate the window priv priv. - ********************************************************************** - */ - - miDbeWindowPrivPrivIndex = (*pDbeScreenPriv->AllocWinPrivPrivIndex)(); - - /* Make sure we only do this code once. */ - miDbePrivPrivGeneration = serverGeneration; - - } /* if -- Reset priv privs. */ - - if (!(*pDbeScreenPriv->AllocWinPrivPriv)(pScreen, - miDbeWindowPrivPrivIndex, sizeof(MiDbeWindowPrivPrivRec))) - { + if (!dixRequestPrivate(miDbeWindowPrivPrivKey, + sizeof(MiDbeWindowPrivPrivRec))) return(FALSE); - } /* Wrap functions. */ pDbeScreenPriv->PositionWindow = pScreen->PositionWindow; |