summaryrefslogtreecommitdiff
path: root/fb/fballpriv.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-28 09:28:25 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-28 09:28:25 -0400
commit4017d3190234e189a0bbd33193a148d4d3c7556b (patch)
tree2ab228113d410386afde50c893f137d95974b8f3 /fb/fballpriv.c
parent85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (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 'fb/fballpriv.c')
-rw-r--r--fb/fballpriv.c48
1 files changed, 15 insertions, 33 deletions
diff --git a/fb/fballpriv.c b/fb/fballpriv.c
index 8efb8fa99..68cb2e4c0 100644
--- a/fb/fballpriv.c
+++ b/fb/fballpriv.c
@@ -27,51 +27,33 @@
#include "fb.h"
#ifdef FB_SCREEN_PRIVATE
-int fbScreenPrivateIndex;
-int fbGetScreenPrivateIndex(void)
+static DevPrivateKey fbScreenPrivateKey = &fbScreenPrivateKey;
+DevPrivateKey fbGetScreenPrivateKey(void)
{
- return fbScreenPrivateIndex;
+ return fbScreenPrivateKey;
}
#endif
-int fbGCPrivateIndex;
-int fbGetGCPrivateIndex(void)
+static DevPrivateKey fbGCPrivateKey = &fbGCPrivateKey;
+DevPrivateKey fbGetGCPrivateKey(void)
{
- return fbGCPrivateIndex;
+ return fbGCPrivateKey;
}
#ifndef FB_NO_WINDOW_PIXMAPS
-int fbWinPrivateIndex;
-int fbGetWinPrivateIndex(void)
+static DevPrivateKey fbWinPrivateKey = &fbWinPrivateKey;
+DevPrivateKey fbGetWinPrivateKey(void)
{
- return fbWinPrivateIndex;
+ return fbWinPrivateKey;
}
#endif
-int fbGeneration;
Bool
-fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
+fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey)
{
- if (fbGeneration != serverGeneration)
- {
- fbGCPrivateIndex = miAllocateGCPrivateIndex ();
-#ifndef FB_NO_WINDOW_PIXMAPS
- fbWinPrivateIndex = AllocateWindowPrivateIndex();
-#endif
-#ifdef FB_SCREEN_PRIVATE
- fbScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (fbScreenPrivateIndex == -1)
- return FALSE;
-#endif
-
- fbGeneration = serverGeneration;
- }
- if (pGCIndex)
- *pGCIndex = fbGCPrivateIndex;
- if (!AllocateGCPrivate(pScreen, fbGCPrivateIndex, sizeof(FbGCPrivRec)))
+ if (pGCKey)
+ *pGCKey = fbGCPrivateKey;
+
+ if (!dixRequestPrivate(fbGCPrivateKey, sizeof(FbGCPrivRec)))
return FALSE;
-#ifndef FB_NO_WINDOW_PIXMAPS
- if (!AllocateWindowPrivate(pScreen, fbWinPrivateIndex, 0))
- return FALSE;
-#endif
#ifdef FB_SCREEN_PRIVATE
{
FbScreenPrivPtr pScreenPriv;
@@ -79,7 +61,7 @@ fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
pScreenPriv = (FbScreenPrivPtr) xalloc (sizeof (FbScreenPrivRec));
if (!pScreenPriv)
return FALSE;
- pScreen->devPrivates[fbScreenPrivateIndex].ptr = (pointer) pScreenPriv;
+ dixSetPrivate(&pScreen->devPrivates, fbScreenPrivateKey, pScreenPriv);
}
#endif
return TRUE;