xnest: Replace use of Colormap->devPriv with standard devPrivates.
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
This commit is contained in:
parent
34d6492436
commit
2e8069dd36
@ -34,6 +34,8 @@ is" without express or implied warranty.
|
|||||||
#include "XNWindow.h"
|
#include "XNWindow.h"
|
||||||
#include "Args.h"
|
#include "Args.h"
|
||||||
|
|
||||||
|
DevPrivateKeyRec xnestColormapPrivateKeyRec;
|
||||||
|
|
||||||
static DevPrivateKeyRec cmapScrPrivateKeyRec;
|
static DevPrivateKeyRec cmapScrPrivateKeyRec;
|
||||||
#define cmapScrPrivateKey (&cmapScrPrivateKeyRec)
|
#define cmapScrPrivateKey (&cmapScrPrivateKeyRec)
|
||||||
|
|
||||||
@ -52,8 +54,6 @@ xnestCreateColormap(ColormapPtr pCmap)
|
|||||||
pVisual = pCmap->pVisual;
|
pVisual = pCmap->pVisual;
|
||||||
ncolors = pVisual->ColormapEntries;
|
ncolors = pVisual->ColormapEntries;
|
||||||
|
|
||||||
pCmap->devPriv = (pointer)malloc(sizeof(xnestPrivColormap));
|
|
||||||
|
|
||||||
xnestColormapPriv(pCmap)->colormap =
|
xnestColormapPriv(pCmap)->colormap =
|
||||||
XCreateColormap(xnestDisplay,
|
XCreateColormap(xnestDisplay,
|
||||||
xnestDefaultWindows[pCmap->pScreen->myNum],
|
xnestDefaultWindows[pCmap->pScreen->myNum],
|
||||||
@ -130,7 +130,6 @@ void
|
|||||||
xnestDestroyColormap(ColormapPtr pCmap)
|
xnestDestroyColormap(ColormapPtr pCmap)
|
||||||
{
|
{
|
||||||
XFreeColormap(xnestDisplay, xnestColormap(pCmap));
|
XFreeColormap(xnestDisplay, xnestColormap(pCmap));
|
||||||
free(pCmap->devPriv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SEARCH_PREDICATE \
|
#define SEARCH_PREDICATE \
|
||||||
|
@ -32,8 +32,9 @@ typedef struct {
|
|||||||
int index;
|
int index;
|
||||||
} xnestInstalledColormapWindows;
|
} xnestInstalledColormapWindows;
|
||||||
|
|
||||||
|
extern DevPrivateKeyRec xnestColormapPrivateKeyRec;
|
||||||
#define xnestColormapPriv(pCmap) \
|
#define xnestColormapPriv(pCmap) \
|
||||||
((xnestPrivColormap *)((pCmap)->devPriv))
|
((xnestPrivColormap *) dixLookupPrivate(&(pCmap)->devPrivates, &xnestColormapPrivateKeyRec))
|
||||||
|
|
||||||
#define xnestColormap(pCmap) (xnestColormapPriv(pCmap)->colormap)
|
#define xnestColormap(pCmap) (xnestColormapPriv(pCmap)->colormap)
|
||||||
|
|
||||||
|
@ -151,6 +151,8 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
if (!dixRegisterPrivateKey(&xnestPixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof (xnestPrivPixmap)))
|
if (!dixRegisterPrivateKey(&xnestPixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof (xnestPrivPixmap)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
if (!dixRegisterPrivateKey(&xnestColormapPrivateKeyRec, PRIVATE_COLORMAP, sizeof (xnestPrivColormap)))
|
||||||
|
return FALSE;
|
||||||
if (!dixRegisterPrivateKey(&xnestCursorScreenKeyRec, PRIVATE_SCREEN, 0))
|
if (!dixRegisterPrivateKey(&xnestCursorScreenKeyRec, PRIVATE_SCREEN, 0))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user