summaryrefslogtreecommitdiff
path: root/afb/afb.h
diff options
context:
space:
mode:
Diffstat (limited to 'afb/afb.h')
-rw-r--r--afb/afb.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/afb/afb.h b/afb/afb.h
index 769e4502f..6731d9557 100644
--- a/afb/afb.h
+++ b/afb/afb.h
@@ -55,11 +55,11 @@ SOFTWARE.
#include "gc.h"
#include "colormap.h"
#include "regionstr.h"
+#include "privates.h"
#include "mibstore.h"
#include "mfb.h"
extern int afbInverseAlu[];
-extern int afbScreenPrivateIndex;
/* warning: PixelType definition duplicated in maskbits.h */
#ifndef PixelType
#define PixelType CARD32
@@ -731,20 +731,21 @@ typedef struct {
} afbPrivGC;
typedef afbPrivGC *afbPrivGCPtr;
-extern int afbGCPrivateIndex; /* index into GC private array */
-extern int afbWindowPrivateIndex; /* index into Window private array */
+extern DevPrivateKey afbScreenPrivateKey;
+extern DevPrivateKey afbGCPrivateKey;
+extern DevPrivateKey afbWindowPrivateKey;
#ifdef PIXMAP_PER_WINDOW
-extern int frameWindowPrivateIndex; /* index into Window private array */
+extern DevPrivateKey frameWindowPrivateKey;
#endif
#define afbGetGCPrivate(pGC) \
- ((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr))
+ ((afbPrivGC *)dixLookupPrivate(&(pGC)->devPrivates, afbGCPrivateKey))
/* Common macros for extracting drawing information */
#define afbGetTypedWidth(pDrawable,wtype)( \
(((pDrawable)->type == DRAWABLE_WINDOW) ? \
- (int)(((PixmapPtr)((pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr))->devKind) : \
+ (int)(((PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey)->devKind) : \
(int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
@@ -754,7 +755,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
PixmapPtr _pPix; \
if ((pDrawable)->type == DRAWABLE_WINDOW) \
- _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
+ _pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
else \
_pPix = (PixmapPtr)(pDrawable); \
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
@@ -764,7 +765,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
PixmapPtr _pPix; \
if ((pDrawable)->type == DRAWABLE_WINDOW) \
- _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
+ _pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
else \
_pPix = (PixmapPtr)(pDrawable); \
(pointer) = (PixelType *)_pPix->devPrivate.ptr; \
@@ -780,7 +781,7 @@ extern int frameWindowPrivateIndex; /* index into Window private array */
afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix = (PixmapPtr)(pWin)->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
+ PixmapPtr _pPix = (PixmapPtr)dixLookupPrivate(&(pWin)->drawable.pScreen->devPrivates, afbScreenPrivateKey); \
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
(width) = ((int) _pPix->devKind) / sizeof (wtype); \
}