diff options
author | Keith Packard <keithp@keithp.com> | 2010-04-26 17:22:21 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-06-05 19:23:03 -0700 |
commit | faeebead7bfcc78535757ca7acc1faf7554c03b7 (patch) | |
tree | 1a8f13a3b1ae968011efb9679bc3ed79a29020be /randr | |
parent | c865a24401f06bcf1347d8b41f736a066ab25693 (diff) |
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>
Diffstat (limited to 'randr')
-rw-r--r-- | randr/randr.c | 15 | ||||
-rw-r--r-- | randr/randrstr.h | 6 |
2 files changed, 12 insertions, 9 deletions
diff --git a/randr/randr.c b/randr/randr.c index ffb34d6a9..f52a46ac8 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -54,11 +54,9 @@ static int SProcRRDispatch (ClientPtr pClient); int RREventBase; int RRErrorBase; RESTYPE RRClientType, RREventType; /* resource types for event masks */ -static int RRClientPrivateKeyIndex; -DevPrivateKey RRClientPrivateKey = &RRClientPrivateKeyIndex; +DevPrivateKeyRec RRClientPrivateKeyRec; -static int rrPrivKeyIndex; -DevPrivateKey rrPrivKey = &rrPrivKeyIndex; +DevPrivateKeyRec rrPrivKeyRec; static void RRClientCallback (CallbackListPtr *list, @@ -215,6 +213,9 @@ Bool RRInit (void) return FALSE; RRGeneration = serverGeneration; } + if (!dixRegisterPrivateKey(&rrPrivKeyRec, PRIVATE_SCREEN, 0)) + return FALSE; + return TRUE; } @@ -329,9 +330,9 @@ RRExtensionInit (void) if (RRNScreens == 0) return; - if (!dixRequestPrivate(RRClientPrivateKey, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) + if (!dixRegisterPrivateKey(&RRClientPrivateKeyRec, PRIVATE_CLIENT, + sizeof (RRClientRec) + + screenInfo.numScreens * sizeof (RRTimesRec))) return; if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) return; diff --git a/randr/randrstr.h b/randr/randrstr.h index a18c834e9..aad126f80 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -299,7 +299,8 @@ typedef struct _rrScrPriv { #endif } rrScrPrivRec, *rrScrPrivPtr; -extern _X_EXPORT DevPrivateKey rrPrivKey; +extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec; +#define rrPrivKey (&rrPrivKeyRec) #define rrGetScrPriv(pScr) ((rrScrPrivPtr)dixLookupPrivate(&(pScr)->devPrivates, rrPrivKey)) #define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr) @@ -335,7 +336,8 @@ typedef struct _RRClient { } RRClientRec, *RRClientPtr; extern _X_EXPORT RESTYPE RRClientType, RREventType; /* resource types for event masks */ -extern _X_EXPORT DevPrivateKey RRClientPrivateKey; +extern _X_EXPORT DevPrivateKeyRec RRClientPrivateKeyRec; +#define RRClientPrivateKey (&RRClientPrivateKeyRec) extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType; #define VERIFY_RR_OUTPUT(id, ptr, a)\ |