summaryrefslogtreecommitdiff
path: root/miext/cw/cw.h
diff options
context:
space:
mode:
Diffstat (limited to 'miext/cw/cw.h')
-rw-r--r--miext/cw/cw.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/miext/cw/cw.h b/miext/cw/cw.h
index 0d57b9b9d..45247d670 100644
--- a/miext/cw/cw.h
+++ b/miext/cw/cw.h
@@ -26,6 +26,7 @@
#include "gcstruct.h"
#include "picturestr.h"
+#include "privates.h"
/*
* One of these structures is allocated per GC that gets used with a window with
@@ -43,10 +44,10 @@ typedef struct {
GCFuncs *wrapFuncs; /* wrapped funcs */
} cwGCRec, *cwGCPtr;
-extern int cwGCIndex;
+extern DevPrivateKey cwGCKey;
-#define getCwGC(pGC) ((cwGCPtr)(pGC)->devPrivates[cwGCIndex].ptr)
-#define setCwGC(pGC,p) ((pGC)->devPrivates[cwGCIndex].ptr = (pointer) (p))
+#define getCwGC(pGC) ((cwGCPtr)dixLookupPrivate(&(pGC)->devPrivates, cwGCKey))
+#define setCwGC(pGC,p) dixSetPrivate(&(pGC)->devPrivates, cwGCKey, p)
/*
* One of these structures is allocated per Picture that gets used with a
@@ -59,17 +60,17 @@ typedef struct {
unsigned long stateChanges;
} cwPictureRec, *cwPicturePtr;
-#define getCwPicture(pPicture) \
- (pPicture->pDrawable ? (cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr : 0)
-#define setCwPicture(pPicture,p) ((pPicture)->devPrivates[cwPictureIndex].ptr = (pointer) (p))
+#define getCwPicture(pPicture) (pPicture->pDrawable ? \
+ (cwPicturePtr)dixLookupPrivate(&(pPicture)->devPrivates, cwPictureKey) : 0)
+#define setCwPicture(pPicture,p) dixSetPrivate(&(pPicture)->devPrivates, cwPictureKey, p)
-extern int cwPictureIndex;
+extern DevPrivateKey cwPictureKey;
+extern DevPrivateKey cwWindowKey;
-extern int cwWindowIndex;
-
-#define cwWindowPrivate(pWindow) ((pWindow)->devPrivates[cwWindowIndex].ptr)
+#define cwWindowPrivate(pWin) dixLookupPrivate(&(pWin)->devPrivates, cwWindowKey)
#define getCwPixmap(pWindow) ((PixmapPtr) cwWindowPrivate(pWindow))
-#define setCwPixmap(pWindow,pPixmap) (cwWindowPrivate(pWindow) = (pointer) (pPixmap))
+#define setCwPixmap(pWindow,pPixmap) \
+ dixSetPrivate(&(pWindow)->devPrivates, cwWindowKey, pPixmap)
#define cwDrawableIsRedirWindow(pDraw) \
((pDraw)->type == DRAWABLE_WINDOW && \
@@ -112,10 +113,10 @@ typedef struct {
#endif
} cwScreenRec, *cwScreenPtr;
-extern int cwScreenIndex;
+extern DevPrivateKey cwScreenKey;
-#define getCwScreen(pScreen) ((cwScreenPtr)(pScreen)->devPrivates[cwScreenIndex].ptr)
-#define setCwScreen(pScreen,p) ((cwScreenPtr)(pScreen)->devPrivates[cwScreenIndex].ptr = (p))
+#define getCwScreen(pScreen) ((cwScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, cwScreenKey))
+#define setCwScreen(pScreen,p) dixSetPrivate(&(pScreen)->devPrivates, cwScreenKey, p)
#define CW_OFFSET_XYPOINTS(ppt, npt) do { \
DDXPointPtr _ppt = (DDXPointPtr)(ppt); \