summaryrefslogtreecommitdiff
path: root/mi/mioverlay.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-28 09:28:25 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-28 09:28:25 -0400
commit4017d3190234e189a0bbd33193a148d4d3c7556b (patch)
tree2ab228113d410386afde50c893f137d95974b8f3 /mi/mioverlay.c
parent85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (diff)
devPrivates rework: since API is already broken, switch everything
over to new system. Need to update documentation and address some remaining vestiges of old system such as CursorRec structure, fb "offman" structure, and FontRec privates.
Diffstat (limited to 'mi/mioverlay.c')
-rw-r--r--mi/mioverlay.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 1dbb85da5..a1f32ad60 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -10,6 +10,7 @@
#include "mi.h"
#include "gcstruct.h"
#include "regionstr.h"
+#include "privates.h"
#include "mivalidate.h"
#include "mioverlay.h"
#include "migc.h"
@@ -53,9 +54,8 @@ typedef struct {
Bool copyUnderlay;
} miOverlayScreenRec, *miOverlayScreenPtr;
-static unsigned long miOverlayGeneration = 0;
-static int miOverlayWindowIndex = -1;
-static int miOverlayScreenIndex = -1;
+static DevPrivateKey miOverlayWindowKey = &miOverlayWindowKey;
+static DevPrivateKey miOverlayScreenKey = &miOverlayScreenKey;
static void RebuildTree(WindowPtr);
static Bool HasUnderlayChildren(WindowPtr);
@@ -85,10 +85,10 @@ static void miOverlaySetShape(WindowPtr);
#endif
static void miOverlayChangeBorderWidth(WindowPtr, unsigned int);
-#define MIOVERLAY_GET_SCREEN_PRIVATE(pScreen) \
- ((miOverlayScreenPtr)((pScreen)->devPrivates[miOverlayScreenIndex].ptr))
-#define MIOVERLAY_GET_WINDOW_PRIVATE(pWin) \
- ((miOverlayWindowPtr)((pWin)->devPrivates[miOverlayWindowIndex].ptr))
+#define MIOVERLAY_GET_SCREEN_PRIVATE(pScreen) ((miOverlayScreenPtr) \
+ dixLookupPrivate(&(pScreen)->devPrivates, miOverlayScreenKey))
+#define MIOVERLAY_GET_WINDOW_PRIVATE(pWin) ((miOverlayWindowPtr) \
+ dixLookupPrivate(&(pWin)->devPrivates, miOverlayWindowKey))
#define MIOVERLAY_GET_WINDOW_TREE(pWin) \
(MIOVERLAY_GET_WINDOW_PRIVATE(pWin)->tree)
@@ -112,22 +112,13 @@ miInitOverlay(
if(!inOverlayFunc || !transFunc) return FALSE;
- if(miOverlayGeneration != serverGeneration) {
- if(((miOverlayScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
- ((miOverlayWindowIndex = AllocateWindowPrivateIndex()) < 0))
- return FALSE;
-
- miOverlayGeneration = serverGeneration;
- }
-
- if(!AllocateWindowPrivate(pScreen, miOverlayWindowIndex,
- sizeof(miOverlayWindowRec)))
+ if(!dixRequestPrivate(miOverlayWindowKey, sizeof(miOverlayWindowRec)))
return FALSE;
if(!(pScreenPriv = xalloc(sizeof(miOverlayScreenRec))))
return FALSE;
- pScreen->devPrivates[miOverlayScreenIndex].ptr = (pointer)pScreenPriv;
+ dixSetPrivate(&pScreen->devPrivates, miOverlayScreenKey, pScreenPriv);
pScreenPriv->InOverlay = inOverlayFunc;
pScreenPriv->MakeTransparent = transFunc;