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 <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
This commit is contained in:
Keith Packard 2010-04-26 17:22:21 -07:00
commit faeebead7b
139 changed files with 1105 additions and 711 deletions

View file

@ -59,8 +59,8 @@ static RESTYPE CursorHideCountType;
static RESTYPE CursorWindowType;
static CursorPtr CursorCurrent[MAXDEVICES];
static int CursorScreenPrivateKeyIndex;
static DevPrivateKey CursorScreenPrivateKey = &CursorScreenPrivateKeyIndex;
static DevPrivateKeyRec CursorScreenPrivateKeyRec;
#define CursorScreenPrivateKey (&CursorScreenPrivateKeyRec)
static void deleteCursorHideCountsForScreen (ScreenPtr pScreen);
@ -1037,6 +1037,9 @@ XFixesCursorInit (void)
if (party_like_its_1989)
CursorVisible = EnableCursor;
if (!dixRegisterPrivateKey(&CursorScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
for (i = 0; i < screenInfo.numScreens; i++)
{
ScreenPtr pScreen = screenInfo.screens[i];

View file

@ -56,8 +56,8 @@ static unsigned char XFixesReqCode;
int XFixesEventBase;
int XFixesErrorBase;
static int XFixesClientPrivateKeyIndex;
static DevPrivateKey XFixesClientPrivateKey = &XFixesClientPrivateKeyIndex;
static DevPrivateKeyRec XFixesClientPrivateKeyRec;
#define XFixesClientPrivateKey (&XFixesClientPrivateKeyRec)
static int
ProcXFixesQueryVersion(ClientPtr client)
@ -241,7 +241,7 @@ XFixesExtensionInit(void)
{
ExtensionEntry *extEntry;
if (!dixRequestPrivate(XFixesClientPrivateKey, sizeof (XFixesClientRec)))
if (!dixRegisterPrivateKey(&XFixesClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (XFixesClientRec)))
return;
if (!AddCallback (&ClientStateCallback, XFixesClientCallback, 0))
return;