summaryrefslogtreecommitdiff
path: root/dbe/dbestruct.h
diff options
context:
space:
mode:
Diffstat (limited to 'dbe/dbestruct.h')
-rw-r--r--dbe/dbestruct.h37
1 files changed, 9 insertions, 28 deletions
diff --git a/dbe/dbestruct.h b/dbe/dbestruct.h
index 90f13428a..7d5a115ad 100644
--- a/dbe/dbestruct.h
+++ b/dbe/dbestruct.h
@@ -39,14 +39,13 @@
#define NEED_DBE_PROTOCOL
#include <X11/extensions/Xdbeproto.h>
#include "windowstr.h"
+#include "privates.h"
/* DEFINES */
-#define DBE_SCREEN_PRIV(pScreen) \
- ((dbeScreenPrivIndex < 0) ? \
- NULL : \
- ((DbeScreenPrivPtr)((pScreen)->devPrivates[dbeScreenPrivIndex].ptr)))
+#define DBE_SCREEN_PRIV(pScreen) ((DbeScreenPrivPtr) \
+ dixLookupPrivate(&(pScreen)->devPrivates, dbeScreenPrivKey))
#define DBE_SCREEN_PRIV_FROM_DRAWABLE(pDrawable) \
DBE_SCREEN_PRIV((pDrawable)->pScreen)
@@ -63,10 +62,8 @@
#define DBE_SCREEN_PRIV_FROM_GC(pGC)\
DBE_SCREEN_PRIV((pGC)->pScreen)
-#define DBE_WINDOW_PRIV(pWindow)\
- ((dbeWindowPrivIndex < 0) ? \
- NULL : \
- ((DbeWindowPrivPtr)(pWindow->devPrivates[dbeWindowPrivIndex].ptr)))
+#define DBE_WINDOW_PRIV(pWin) ((DbeWindowPrivPtr) \
+ dixLookupPrivate(&(pWin)->devPrivates, dbeWindowPrivKey))
/* Initial size of the buffer ID array in the window priv. */
#define DBE_INIT_MAX_IDS 2
@@ -142,7 +139,7 @@ typedef struct _DbeWindowPrivRec
/* Device-specific private information.
*/
- DevUnion *devPrivates;
+ PrivateRec *devPrivates;
} DbeWindowPrivRec, *DbeWindowPrivPtr;
@@ -155,18 +152,13 @@ typedef struct _DbeWindowPrivRec
typedef struct _DbeScreenPrivRec
{
- /* Info for creating window privs */
- int winPrivPrivLen; /* Length of privs in DbeWindowPrivRec */
- unsigned int *winPrivPrivSizes; /* Array of private record sizes */
- unsigned int totalWinPrivSize; /* PrivRec + size of all priv priv ptrs */
-
/* Resources created by DIX to be used by DDX */
RESTYPE dbeDrawableResType;
RESTYPE dbeWindowPrivResType;
/* Private indices created by DIX to be used by DDX */
- int dbeScreenPrivIndex;
- int dbeWindowPrivIndex;
+ DevPrivateKey dbeScreenPrivKey;
+ DevPrivateKey dbeWindowPrivKey;
/* Wrapped functions
* It is the responsibilty of the DDX layer to wrap PositionWindow().
@@ -180,17 +172,6 @@ typedef struct _DbeScreenPrivRec
WindowPtr /*pWin*/,
GCPtr /*pGC*/
);
- DbeWindowPrivPtr (*AllocWinPriv)(
- ScreenPtr /*pScreen*/
-);
- int (*AllocWinPrivPrivIndex)(
- void
-);
- Bool (*AllocWinPrivPriv)(
- ScreenPtr /*pScreen*/,
- int /*index*/,
- unsigned /*amount*/
-);
/* Per-screen DDX routines */
Bool (*GetVisualInfo)(
@@ -223,7 +204,7 @@ typedef struct _DbeScreenPrivRec
/* Device-specific private information.
*/
- DevUnion *devPrivates;
+ PrivateRec *devPrivates;
} DbeScreenPrivRec, *DbeScreenPrivPtr;