Commit faeebead authored by Keith Packard's avatar Keith Packard
Browse files

Change the devPrivates API to require dixRegisterPrivateKey



This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
Tested-by: default avatarTiago Vignatti <tiago.vignatti@nokia.com>
parent c865a244
......@@ -36,12 +36,10 @@
#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
static int GEClientPrivateKeyIndex;
DevPrivateKey GEClientPrivateKey = &GEClientPrivateKeyIndex;
DevPrivateKeyRec GEClientPrivateKeyRec;
int RT_GECLIENT = 0;
GEExtension GEExtensions[MAXEXTENSIONS];
/* Major available requests */
......@@ -209,7 +207,7 @@ GEExtensionInit(void)
{
ExtensionEntry *extEntry;
if (!dixRequestPrivate(GEClientPrivateKey, sizeof(GEClientInfoRec)))
if (!dixRegisterPrivateKey(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
FatalError("GEExtensionInit: GE private request failed.\n");
if(!AddCallback(&ClientStateCallback, GEClientCallback, 0))
......
......@@ -37,7 +37,8 @@
#include "extnsionst.h"
#include <X11/extensions/geproto.h>
extern _X_EXPORT DevPrivateKey GEClientPrivateKey;
extern _X_EXPORT DevPrivateKeyRec GEClientPrivateKeyRec;
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
typedef struct _GEClientInfo {
CARD32 major_version;
......
......@@ -103,10 +103,10 @@ static void PanoramiXResetProc(ExtensionEntry*);
int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
static int PanoramiXGCKeyIndex;
static DevPrivateKey PanoramiXGCKey = &PanoramiXGCKeyIndex;
static int PanoramiXScreenKeyIndex;
static DevPrivateKey PanoramiXScreenKey = &PanoramiXScreenKeyIndex;
static DevPrivateKeyRec PanoramiXGCKeyRec;
#define PanoramiXGCKey (&PanoramiXGCKeyRec)
static DevPrivateKeyRec PanoramiXScreenKeyRec;
#define PanoramiXScreenKey (&PanoramiXScreenKeyRec)
typedef struct {
DDXPointRec clipOrg;
......@@ -443,6 +443,16 @@ void PanoramiXExtensionInit(int argc, char *argv[])
if (noPanoramiXExtension)
return;
if (!dixRegisterPrivateKey(&PanoramiXScreenKeyRec, PRIVATE_SCREEN, 0)) {
noPanoramiXExtension = TRUE;
return;
}
if (!dixRegisterPrivateKey(&PanoramiXGCKeyRec, PRIVATE_GC, sizeof(PanoramiXGCRec))) {
noPanoramiXExtension = TRUE;
return;
}
PanoramiXNumScreens = screenInfo.numScreens;
if (PanoramiXNumScreens == 1) { /* Only 1 screen */
noPanoramiXExtension = TRUE;
......@@ -462,11 +472,6 @@ void PanoramiXExtensionInit(int argc, char *argv[])
* run in non-PanoramiXeen mode.
*/
if (!dixRequestPrivate(PanoramiXGCKey, sizeof(PanoramiXGCRec))) {
noPanoramiXExtension = TRUE;
return;
}
for (i = 0; i < PanoramiXNumScreens; i++) {
pScreen = screenInfo.screens[i];
pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
......
......@@ -226,8 +226,8 @@ MakeScreenPrivate (
ScreenPtr /* pScreen */
);
static int ScreenPrivateKeyIndex;
static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKeyIndex;
static DevPrivateKeyRec ScreenPrivateKeyRec;
#define ScreenPrivateKey (&ScreenPrivateKeyRec)
#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
......@@ -252,6 +252,9 @@ ScreenSaverExtensionInit(INITARGS)
int i;
ScreenPtr pScreen;
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
return;
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
"SaverEvent");
......
......@@ -51,8 +51,8 @@ static RESTYPE RTEventClient;
static CallbackListPtr SecurityValidateGroupCallback = NULL;
/* Private state record */
static int stateKeyIndex;
static DevPrivateKey stateKey = &stateKeyIndex;
static DevPrivateKeyRec stateKeyRec;
#define stateKey (&stateKeyRec)
/* This is what we store as client security state */
typedef struct {
......@@ -1108,7 +1108,7 @@ SecurityExtensionInit(INITARGS)
RTEventClient |= RC_NEVERRETAIN;
/* Allocate the private storage */
if (!dixRequestPrivate(stateKey, sizeof(SecurityStateRec)))
if (!dixRegisterPrivateKey(stateKey, PRIVATE_CLIENT, sizeof(SecurityStateRec)))
FatalError("SecurityExtensionSetup: Can't allocate client private.\n");
/* Register callbacks */
......
......@@ -141,10 +141,10 @@ int BadShmSegCode;
RESTYPE ShmSegType;
static ShmDescPtr Shmsegs;
static Bool sharedPixmaps;
static int shmScrPrivateKeyIndex;
static DevPrivateKey shmScrPrivateKey = &shmScrPrivateKeyIndex;
static int shmPixmapPrivateIndex;
static DevPrivateKey shmPixmapPrivate = &shmPixmapPrivateIndex;
static DevPrivateKeyRec shmScrPrivateKeyRec;
#define shmScrPrivateKey (&shmScrPrivateKeyRec)
static DevPrivateKeyRec shmPixmapPrivateKeyRec;
#define shmPixmapPrivateKey (&shmPixmapPrivateKeyRec)
static ShmFuncs miFuncs = {NULL, NULL};
static ShmFuncs fbFuncs = {fbShmCreatePixmap, NULL};
......@@ -244,6 +244,16 @@ ShmInitScreenPriv(ScreenPtr pScreen)
return screen_priv;
}
static Bool
ShmRegisterPrivates(void)
{
if (!dixRegisterPrivateKey(&shmScrPrivateKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
if (!dixRegisterPrivateKey(&shmPixmapPrivateKeyRec, PRIVATE_PIXMAP, 0))
return FALSE;
return TRUE;
}
void
ShmExtensionInit(INITARGS)
{
......@@ -258,6 +268,9 @@ ShmExtensionInit(INITARGS)
}
#endif
if (!ShmRegisterPrivates())
return;
sharedPixmaps = xFalse;
{
sharedPixmaps = xTrue;
......@@ -303,6 +316,8 @@ ShmResetProc(ExtensionEntry *extEntry)
void
ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs)
{
if (!ShmRegisterPrivates())
return;
ShmInitScreenPriv(pScreen)->shmFuncs = funcs;
}
......@@ -316,7 +331,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap)
{
ShmDescPtr shmdesc;
shmdesc = (ShmDescPtr)dixLookupPrivate(&pPixmap->devPrivates,
shmPixmapPrivate);
shmPixmapPrivateKey);
if (shmdesc)
ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id);
}
......@@ -817,7 +832,7 @@ CreatePmap:
shmdesc->addr + stuff->offset);
if (pMap) {
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivate, shmdesc);
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
shmdesc->refcnt++;
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pMap->drawable.id = newPix->info[j].id;
......@@ -1156,7 +1171,7 @@ CreatePmap:
pDraw->pScreen->DestroyPixmap(pMap);
return rc;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivate, shmdesc);
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
shmdesc->refcnt++;
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pMap->drawable.id = stuff->pid;
......
......@@ -59,12 +59,9 @@ typedef struct {
} SELinuxAuditRec;
/* private state keys */
static int subjectKeyIndex;
DevPrivateKey subjectKey = &subjectKeyIndex;
static int objectKeyIndex;
DevPrivateKey objectKey = &objectKeyIndex;
static int dataKeyIndex;
DevPrivateKey dataKey = &dataKeyIndex;
DevPrivateKeyRec subjectKeyRec;
DevPrivateKeyRec objectKeyRec;
DevPrivateKeyRec dataKeyRec;
/* audit file descriptor */
static int audit_fd;
......@@ -896,9 +893,9 @@ SELinuxFlaskInit(void)
FatalError("SELinux: Failed to open the system audit log\n");
/* Allocate private storage */
if (!dixRequestPrivate(subjectKey, sizeof(SELinuxSubjectRec)) ||
!dixRequestPrivate(objectKey, sizeof(SELinuxObjectRec)) ||
!dixRequestPrivate(dataKey, sizeof(SELinuxObjectRec)))
if (!dixRegisterPrivateKey(subjectKey, PRIVATE_XSELINUX, sizeof(SELinuxSubjectRec)) ||
!dixRegisterPrivateKey(objectKey, PRIVATE_XSELINUX, sizeof(SELinuxObjectRec)) ||
!dixRegisterPrivateKey(dataKey, PRIVATE_XSELINUX, sizeof(SELinuxObjectRec)))
FatalError("SELinux: Failed to allocate private storage.\n");
/* Create atoms for doing window labeling */
......
......@@ -62,9 +62,12 @@ typedef struct {
* Globals
*/
extern DevPrivateKey subjectKey;
extern DevPrivateKey objectKey;
extern DevPrivateKey dataKey;
extern DevPrivateKeyRec subjectKeyRec;
#define subjectKey (&subjectKeyRec)
extern DevPrivateKeyRec objectKeyRec;
#define objectKey (&objectKeyRec)
extern DevPrivateKeyRec dataKeyRec;
#define dataKey (&dataKeyRec)
/*
* Label functions
......
......@@ -63,8 +63,8 @@ extern int DeviceValuator;
static EventListPtr xtest_evlist;
/* Used to store if a device is an XTest Virtual device */
static int XTestDevicePrivateKeyIndex;
DevPrivateKey XTestDevicePrivateKey = &XTestDevicePrivateKeyIndex;
static DevPrivateKeyRec XTestDevicePrivateKeyRec;
#define XTestDevicePrivateKey (&XTestDevicePrivateKeyRec)
/**
* xtestpointer
......@@ -102,6 +102,9 @@ static DISPATCH_PROC(SProcXTestGrabControl);
void
XTestExtensionInit(INITARGS)
{
if (!dixRegisterPrivateKey(&XTestDevicePrivateKeyRec, PRIVATE_DEVICE, 0))
return;
AddExtension(XTestExtensionName, 0, 0,
ProcXTestDispatch, SProcXTestDispatch,
NULL, StandardMinorOpcode);
......
......@@ -105,8 +105,8 @@ SOFTWARE.
#endif
#include "xvdisp.h"
static int XvScreenKeyIndex;
static DevPrivateKey XvScreenKey = &XvScreenKeyIndex;
static DevPrivateKeyRec XvScreenKeyRec;
#define XvScreenKey (&XvScreenKeyRec)
unsigned long XvExtensionGeneration = 0;
unsigned long XvScreenGeneration = 0;
unsigned long XvResourceGeneration = 0;
......@@ -156,6 +156,9 @@ XvExtensionInit(void)
{
ExtensionEntry *extEntry;
if (!dixRegisterPrivateKey(&XvScreenKeyRec, PRIVATE_SCREEN, 0))
return;
/* LOOK TO SEE IF ANY SCREENS WERE INITIALIZED; IF NOT THEN
INIT GLOBAL VARIABLES SO THE EXTENSION CAN FUNCTION */
if (XvScreenGeneration != serverGeneration)
......@@ -269,6 +272,9 @@ XvScreenInit(ScreenPtr pScreen)
XvScreenGeneration = serverGeneration;
}
if (!dixRegisterPrivateKey(&XvScreenKeyRec, PRIVATE_SCREEN, 0))
return BadAlloc;
if (dixLookupPrivate(&pScreen->devPrivates, XvScreenKey))
{
ErrorF("XvScreenInit: screen devPrivates ptr non-NULL before init\n");
......@@ -284,7 +290,6 @@ XvScreenInit(ScreenPtr pScreen)
}
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs);
pxvs->DestroyPixmap = pScreen->DestroyPixmap;
pxvs->DestroyWindow = pScreen->DestroyWindow;
......
......@@ -33,8 +33,9 @@
#define DR_CLIENT_DRIVER_NAME_SIZE 48
#define DR_BUSID_SIZE 48
static int XvMCScreenKeyIndex;
static DevPrivateKey XvMCScreenKey;
static DevPrivateKeyRec XvMCScreenKeyRec;
#define XvMCScreenKey (&XvMCScreenKeyRec)
static Bool XvMCInUse;
unsigned long XvMCGeneration = 0;
......@@ -138,7 +139,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
if(XvMCScreenKey) { /* any adaptors at all */
if(XvMCInUse) { /* any adaptors at all */
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
......@@ -193,7 +194,7 @@ ProcXvMCCreateContext(ClientPtr client)
pScreen = pPort->pAdaptor->pScreen;
if(XvMCScreenKey == NULL) /* no XvMC adaptors */
if(!XvMCInUse) /* no XvMC adaptors */
return BadMatch;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
......@@ -716,7 +717,8 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
{
XvMCScreenPtr pScreenPriv;
XvMCScreenKey = &XvMCScreenKeyIndex;
if (!dixRegisterPrivateKey(&XvMCScreenKeyRec, PRIVATE_SCREEN, 0))
return BadAlloc;
if(!(pScreenPriv = malloc(sizeof(XvMCScreenRec))))
return BadAlloc;
......@@ -734,6 +736,8 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
pScreenPriv->minor = 0;
pScreenPriv->patchLevel = 0;
XvMCInUse = TRUE;
return Success;
}
......
......@@ -78,5 +78,7 @@ extern int DevicePropertyNotify;
extern int RT_INPUTCLIENT;
extern DevPrivateKey XIClientPrivateKey;
extern DevPrivateKeyRec XIClientPrivateKeyRec;
#define XIClientPrivateKey (&XIClientPrivateKeyRec)
#endif /* EXGLOBALS_H */
......@@ -377,9 +377,7 @@ Mask PropagateMask[MAXDEVICES];
*
*/
static int XIClientPrivateKeyIndex;
DevPrivateKey XIClientPrivateKey = &XIClientPrivateKeyIndex;
DevPrivateKeyRec XIClientPrivateKeyRec;
/*****************************************************************
*
......@@ -1256,7 +1254,7 @@ XInputExtensionInit(void)
SERVER_XI_MINOR_VERSION,
};
if (!dixRequestPrivate(XIClientPrivateKey, sizeof(XIClientRec)))
if (!dixRegisterPrivateKey(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec)))
FatalError("Cannot request private for XI.\n");
if (!AddCallback(&ClientStateCallback, XIClientCallback, 0))
......
......@@ -50,8 +50,8 @@
#include "protocol-versions.h"
static CARD8 CompositeReqCode;
static int CompositeClientPrivateKeyIndex;
static DevPrivateKey CompositeClientPrivateKey = &CompositeClientPrivateKeyIndex;
static DevPrivateKeyRec CompositeClientPrivateKeyRec;
#define CompositeClientPrivateKey (&CompositeClientPrivateKeyRec)
RESTYPE CompositeClientWindowType;
RESTYPE CompositeClientSubwindowsType;
RESTYPE CompositeClientOverlayType;
......@@ -558,8 +558,8 @@ CompositeExtensionInit (void)
if (!CompositeClientOverlayType)
return;
if (!dixRequestPrivate(CompositeClientPrivateKey,
sizeof(CompositeClientRec)))
if (!dixRegisterPrivateKey(&CompositeClientPrivateKeyRec, PRIVATE_CLIENT,
sizeof(CompositeClientRec)))
return;
if (!AddCallback (&ClientStateCallback, CompositeClientCallback, 0))
......
......@@ -48,13 +48,9 @@
#include "compint.h"
#include "compositeext.h"
static int CompScreenPrivateKeyIndex;
DevPrivateKey CompScreenPrivateKey = &CompScreenPrivateKeyIndex;
static int CompWindowPrivateKeyIndex;
DevPrivateKey CompWindowPrivateKey = &CompWindowPrivateKeyIndex;
static int CompSubwindowsPrivateKeyIndex;
DevPrivateKey CompSubwindowsPrivateKey = &CompSubwindowsPrivateKeyIndex;
DevPrivateKeyRec CompScreenPrivateKeyRec;
DevPrivateKeyRec CompWindowPrivateKeyRec;
DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
static Bool
compCloseScreen (int index, ScreenPtr pScreen)
......@@ -319,6 +315,13 @@ compScreenInit (ScreenPtr pScreen)
{
CompScreenPtr cs;
if (!dixRegisterPrivateKey(&CompScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
if (!dixRegisterPrivateKey(&CompWindowPrivateKeyRec, PRIVATE_WINDOW, 0))
return FALSE;
if (!dixRegisterPrivateKey(&CompSubwindowsPrivateKeyRec, PRIVATE_WINDOW, 0))
return FALSE;
if (GetCompScreen (pScreen))
return TRUE;
cs = (CompScreenPtr) malloc(sizeof (CompScreenRec));
......
......@@ -157,9 +157,14 @@ typedef struct _CompScreen {
} CompScreenRec, *CompScreenPtr;
extern DevPrivateKey CompScreenPrivateKey;
extern DevPrivateKey CompWindowPrivateKey;
extern DevPrivateKey CompSubwindowsPrivateKey;
extern DevPrivateKeyRec CompScreenPrivateKeyRec;
#define CompScreenPrivateKey (&CompScreenPrivateKeyRec)
extern DevPrivateKeyRec CompWindowPrivateKeyRec;
#define CompWindowPrivateKey (&CompWindowPrivateKeyRec)
extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
#define CompSubwindowsPrivateKey (&CompSubwindowsPrivateKeyRec)
#define GetCompScreen(s) ((CompScreenPtr) \
dixLookupPrivate(&(s)->devPrivates, CompScreenPrivateKey))
......
......@@ -32,8 +32,8 @@ static int DamageEventBase;
static RESTYPE DamageExtType;
static RESTYPE DamageExtWinType;
static int DamageClientPrivateKeyIndex;
static DevPrivateKey DamageClientPrivateKey = &DamageClientPrivateKeyIndex;
static DevPrivateKeyRec DamageClientPrivateKeyRec;
#define DamageClientPrivateKey (&DamageClientPrivateKeyRec)
#define prScreen screenInfo.screens[0]
......@@ -502,8 +502,9 @@ DamageExtensionInit(void)
if (!DamageExtWinType)
return;
if (!dixRequestPrivate(DamageClientPrivateKey, sizeof (DamageClientRec)))
if (!dixRegisterPrivateKey(&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (DamageClientRec)))
return;
if (!AddCallback (&ClientStateCallback, DamageClientCallback, 0))
return;
......
......@@ -57,15 +57,13 @@
/* GLOBALS */
/* These are static globals copied to DBE's screen private for use by DDX */
static int dbeScreenPrivKeyIndex;
static DevPrivateKey dbeScreenPrivKey = &dbeScreenPrivKeyIndex;
static int dbeWindowPrivKeyIndex;
static DevPrivateKey dbeWindowPrivKey = &dbeWindowPrivKeyIndex;
/* These are globals for use by DDX */
DevPrivateKeyRec dbeScreenPrivKeyRec;
DevPrivateKeyRec dbeWindowPrivKeyRec;
/* These are static globals copied to DBE's screen private for use by DDX */
static RESTYPE dbeDrawableResType;
static RESTYPE dbeWindowPrivResType;
/* These are globals for use by DDX */
RESTYPE dbeDrawableResType;
RESTYPE dbeWindowPrivResType;
/* Used to generate DBE's BadBuffer error. */
static int dbeErrorBase;
......@@ -254,7 +252,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
* Allocate a window priv.
*/
pDbeWindowPriv = calloc(1, sizeof(DbeWindowPrivRec));
pDbeWindowPriv = dixAllocateObjectWithPrivates(DbeWindowPrivRec, PRIVATE_DBE_WINDOW);
if (!pDbeWindowPriv)
return(BadAlloc);
......@@ -1410,8 +1408,7 @@ DbeWindowPrivDelete(pointer pDbeWinPriv, XID id)
NULL);
/* We are done with the window priv. */
dixFreePrivates(pDbeWindowPriv->devPrivates);
free(pDbeWindowPriv);
dixFreeObjectWithPrivates(pDbeWindowPriv, PRIVATE_DBE_WINDOW);
}
return(Success);
......@@ -1576,6 +1573,12 @@ DbeExtensionInit(void)
if (!dbeWindowPrivResType)
return;
if (!dixRegisterPrivateKey(&dbeScreenPrivKeyRec, PRIVATE_SCREEN, 0))
return;
if (!dixRegisterPrivateKey(&dbeWindowPrivKeyRec, PRIVATE_WINDOW, 0))
return;
for (i = 0; i < screenInfo.numScreens; i++)
{
/* For each screen, set up DBE screen privates and init DIX and DDX
......@@ -1602,14 +1605,6 @@ DbeExtensionInit(void)
dixSetPrivate(&pScreen->devPrivates, dbeScreenPrivKey, pDbeScreenPriv);
/* Copy the resource types */
pDbeScreenPriv->dbeDrawableResType = dbeDrawableResType;
pDbeScreenPriv->dbeWindowPrivResType = dbeWindowPrivResType;
/* Copy the private indices */
pDbeScreenPriv->dbeScreenPrivKey = dbeScreenPrivKey;
pDbeScreenPriv->dbeWindowPrivKey = dbeWindowPrivKey;
{
/* We don't have DDX support for DBE anymore */
......
......@@ -167,14 +167,6 @@ typedef struct _DbeWindowPrivRec
typedef struct _DbeScreenPrivRec
{
/* Resources created by DIX to be used by DDX */
RESTYPE dbeDrawableResType;
RESTYPE dbeWindowPrivResType;
/* Private indices created by DIX to be used by DDX */
DevPrivateKey dbeScreenPrivKey;
DevPrivateKey dbeWindowPrivKey;
/* Wrapped functions
* It is the responsibilty of the DDX layer to wrap PositionWindow().
* DbeExtensionInit wraps DestroyWindow().
......
......@@ -58,14 +58,8 @@
#include <stdio.h>
static int miDbeWindowPrivPrivKeyIndex;
static DevPrivateKey miDbeWindowPrivPrivKey = &miDbeWindowPrivPrivKeyIndex;
static RESTYPE dbeDrawableResType;
static RESTYPE dbeWindowPrivResType;
static int dbeScreenPrivKeyIndex;
static DevPrivateKey dbeScreenPrivKey = &dbeScreenPrivKeyIndex;
static int dbeWindowPrivKeyIndex;
static DevPrivateKey dbeWindowPrivKey = &dbeWindowPrivKeyIndex;
static DevPrivateKeyRec miDbeWindowPrivPrivKeyRec;
#define miDbeWindowPrivPrivKey (&miDbeWindowPrivPrivKeyRec)
/******************************************************************************
......@@ -787,16 +781,8 @@ miDbeResetProc(ScreenPtr pScreen)
Bool
miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
{
/* Copy resource types created by DIX */
dbeDrawableResType = pDbeScreenPriv->dbeDrawableResType;
dbeWindowPrivResType = pDbeScreenPriv->dbeWindowPrivResType;
/* Copy private indices created by DIX */
dbeScreenPrivKey = pDbeScreenPriv->dbeScreenPrivKey;
dbeWindowPrivKey = pDbeScreenPriv->dbeWindowPrivKey;
if (!dixRequestPrivate(miDbeWindowPrivPrivKey,
sizeof(MiDbeWindowPrivPrivRec)))
if (!dixRegisterPrivateKey(&miDbeWindowPrivPrivKeyRec, PRIVATE_DBE_WINDOW,
sizeof(MiDbeWindowPrivPrivRec)))
return(FALSE);
/* Wrap functions. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment