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 /composite | |
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 'composite')
-rw-r--r-- | composite/compext.c | 8 | ||||
-rw-r--r-- | composite/compinit.c | 17 | ||||
-rw-r--r-- | composite/compint.h | 11 |
3 files changed, 22 insertions, 14 deletions
diff --git a/composite/compext.c b/composite/compext.c index d37d52a18..30d9dc2b6 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -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)) diff --git a/composite/compinit.c b/composite/compinit.c index b4deaf5e8..1b2cd8ff6 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -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)); diff --git a/composite/compint.h b/composite/compint.h index 93da4dfa2..9c1ffd501 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -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)) |