#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "fb.h"
#ifdef FB_SCREEN_PRIVATE
int fbScreenPrivateIndex;
int fbGetScreenPrivateIndex(void)
{
return fbScreenPrivateIndex;
}
#endif
int fbGCPrivateIndex;
int fbGetGCPrivateIndex(void)
{
return fbGCPrivateIndex;
}
#ifndef FB_NO_WINDOW_PIXMAPS
int fbWinPrivateIndex;
int fbGetWinPrivateIndex(void)
{
return fbWinPrivateIndex;
}
#endif
int fbGeneration;
Bool
fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
{
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)))
return FALSE;
#ifndef FB_NO_WINDOW_PIXMAPS
if (!AllocateWindowPrivate(pScreen, fbWinPrivateIndex, 0))
return FALSE;
#endif
#ifdef FB_SCREEN_PRIVATE
{
FbScreenPrivPtr pScreenPriv;
pScreenPriv = (FbScreenPrivPtr) xalloc (sizeof (FbScreenPrivRec));
if (!pScreenPriv)
return FALSE;
pScreen->devPrivates[fbScreenPrivateIndex].ptr = (pointer) pScreenPriv;
}
#endif
return TRUE;
}
#ifdef FB_ACCESS_WRAPPER
ReadMemoryProcPtr wfbReadMemory;
WriteMemoryProcPtr wfbWriteMemory;
#endif