Xnest: use XCB*_NONE instead of None

Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-12 14:30:45 +02:00
parent 60db30f517
commit b00f66ca53
7 changed files with 16 additions and 16 deletions

View File

@ -137,7 +137,7 @@ xnestDestroyColormap(ColormapPtr pCmap)
} }
#define SEARCH_PREDICATE \ #define SEARCH_PREDICATE \
(xnestWindow(pWin) != None && wColormap(pWin) == icws->cmapIDs[i]) (xnestWindow(pWin) != XCB_WINDOW_NONE && wColormap(pWin) == icws->cmapIDs[i])
static int static int
xnestCountInstalledColormapWindows(WindowPtr pWin, void *ptr) xnestCountInstalledColormapWindows(WindowPtr pWin, void *ptr)
@ -352,7 +352,7 @@ xnestInstallColormap(ColormapPtr pCmap)
xnestDirectUninstallColormaps(pCmap->pScreen); xnestDirectUninstallColormaps(pCmap->pScreen);
/* Uninstall pInstalledMap. Notify all interested parties. */ /* Uninstall pInstalledMap. Notify all interested parties. */
if (pOldCmap != (ColormapPtr) None) if (pOldCmap != (ColormapPtr) XCB_COLORMAP_NONE)
WalkTree(pCmap->pScreen, TellLostMap, (void *) &pOldCmap->mid); WalkTree(pCmap->pScreen, TellLostMap, (void *) &pOldCmap->mid);
SetInstalledColormap(pCmap->pScreen, pCmap); SetInstalledColormap(pCmap->pScreen, pCmap);

View File

@ -52,7 +52,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
values.plane_mask = AllPlanes; values.plane_mask = AllPlanes;
values.foreground = 1L; values.foreground = 1L;
values.background = 0L; values.background = 0L;
values.clip_mask = None; values.clip_mask = XCB_PIXMAP_NONE;
XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values); XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values);

View File

@ -141,7 +141,7 @@ xnestOpenDisplay(int argc, char *argv[])
xnestEventMask = 0L; xnestEventMask = 0L;
for (i = 0; i <= MAXDEPTH; i++) for (i = 0; i <= MAXDEPTH; i++)
xnestDefaultDrawables[i] = None; xnestDefaultDrawables[i] = XCB_WINDOW_NONE;
for (i = 0; i < xnestNumPixmapFormats; i++) for (i = 0; i < xnestNumPixmapFormats; i++)
for (j = 0; j < xnestNumDepths; j++) for (j = 0; j < xnestNumDepths; j++)

View File

@ -197,7 +197,7 @@ xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects)
switch (type) { switch (type) {
case CT_NONE: case CT_NONE:
XSetClipMask(xnestDisplay, xnestGC(pGC), None); XSetClipMask(xnestDisplay, xnestGC(pGC), XCB_PIXMAP_NONE);
pValue = NULL; pValue = NULL;
break; break;
@ -277,7 +277,7 @@ xnestDestroyClip(GCPtr pGC)
{ {
if (pGC->clientClip) { if (pGC->clientClip) {
RegionDestroy(pGC->clientClip); RegionDestroy(pGC->clientClip);
XSetClipMask(xnestDisplay, xnestGC(pGC), None); XSetClipMask(xnestDisplay, xnestGC(pGC), XCB_PIXMAP_NONE);
pGC->clientClip = NULL; pGC->clientClip = NULL;
} }
} }

View File

@ -62,5 +62,5 @@ xnestDefaultVisualColormap(Visual * visual)
if (xnestVisuals[i].visual == visual) if (xnestVisuals[i].visual == visual)
return xnestDefaultColormaps[i]; return xnestDefaultColormaps[i];
return None; return XCB_WINDOW_NONE;
} }

View File

@ -132,7 +132,7 @@ xnestCreateWindow(WindowPtr pWin)
xnestWindowPriv(pWin)->width = pWin->drawable.width; xnestWindowPriv(pWin)->width = pWin->drawable.width;
xnestWindowPriv(pWin)->height = pWin->drawable.height; xnestWindowPriv(pWin)->height = pWin->drawable.height;
xnestWindowPriv(pWin)->border_width = pWin->borderWidth; xnestWindowPriv(pWin)->border_width = pWin->borderWidth;
xnestWindowPriv(pWin)->sibling_above = None; xnestWindowPriv(pWin)->sibling_above = XCB_WINDOW_NONE;
if (pWin->nextSib) if (pWin->nextSib)
xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin); xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin);
xnestWindowPriv(pWin)->bounding_shape = RegionCreate(NULL, 1); xnestWindowPriv(pWin)->bounding_shape = RegionCreate(NULL, 1);
@ -153,7 +153,7 @@ xnestDestroyWindow(WindowPtr pWin)
RegionDestroy(xnestWindowPriv(pWin)->bounding_shape); RegionDestroy(xnestWindowPriv(pWin)->bounding_shape);
RegionDestroy(xnestWindowPriv(pWin)->clip_shape); RegionDestroy(xnestWindowPriv(pWin)->clip_shape);
XDestroyWindow(xnestDisplay, xnestWindow(pWin)); XDestroyWindow(xnestDisplay, xnestWindow(pWin));
xnestWindowPriv(pWin)->window = None; xnestWindowPriv(pWin)->window = XCB_WINDOW_NONE;
if (pWin->optional && pWin->optional->colormap && pWin->parent) if (pWin->optional && pWin->optional->colormap && pWin->parent)
xnestSetInstalledColormapWindows(pWin->drawable.pScreen); xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
@ -190,7 +190,7 @@ xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin); xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin);
xnestWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin); xnestWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin);
xnestWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin); xnestWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin);
xnestWindowPriv(pWin)->sibling_above = None; xnestWindowPriv(pWin)->sibling_above = XCB_WINDOW_NONE;
if (pWin->nextSib) if (pWin->nextSib)
xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin); xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin);
} }
@ -243,7 +243,7 @@ xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
valuemask = XCB_CONFIG_WINDOW_STACK_MODE; valuemask = XCB_CONFIG_WINDOW_STACK_MODE;
values.stack_mode = Above; values.stack_mode = Above;
XConfigureWindow(xnestDisplay, xnestWindow(pSib), valuemask, &values); XConfigureWindow(xnestDisplay, xnestWindow(pSib), valuemask, &values);
xnestWindowPriv(pSib)->sibling_above = None; xnestWindowPriv(pSib)->sibling_above = XCB_WINDOW_NONE;
/* the rest of siblings */ /* the rest of siblings */
for (pSib = pSib->nextSib; pSib != NullWindow; pSib = pSib->nextSib) { for (pSib = pSib->nextSib; pSib != NullWindow; pSib = pSib->nextSib) {
@ -266,7 +266,7 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
if (mask & XCB_CW_BACK_PIXMAP) if (mask & XCB_CW_BACK_PIXMAP)
switch (pWin->backgroundState) { switch (pWin->backgroundState) {
case XCB_BACK_PIXMAP_NONE: case XCB_BACK_PIXMAP_NONE:
attributes.background_pixmap = None; attributes.background_pixmap = XCB_PIXMAP_NONE;
break; break;
case XCB_BACK_PIXMAP_PARENT_RELATIVE: case XCB_BACK_PIXMAP_PARENT_RELATIVE:
@ -486,7 +486,7 @@ xnestShapeWindow(WindowPtr pWin)
RegionEmpty(xnestWindowPriv(pWin)->bounding_shape); RegionEmpty(xnestWindowPriv(pWin)->bounding_shape);
XShapeCombineMask(xnestDisplay, xnestWindow(pWin), XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
ShapeBounding, 0, 0, None, ShapeSet); ShapeBounding, 0, 0, XCB_PIXMAP_NONE, ShapeSet);
} }
} }
@ -513,7 +513,7 @@ xnestShapeWindow(WindowPtr pWin)
RegionEmpty(xnestWindowPriv(pWin)->clip_shape); RegionEmpty(xnestWindowPriv(pWin)->clip_shape);
XShapeCombineMask(xnestDisplay, xnestWindow(pWin), XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
ShapeClip, 0, 0, None, ShapeSet); ShapeClip, 0, 0, XCB_PIXMAP_NONE, ShapeSet);
} }
} }
} }

View File

@ -50,10 +50,10 @@ extern DevPrivateKeyRec xnestWindowPrivateKeyRec;
xnestDefaultWindows[pWin->drawable.pScreen->myNum]) xnestDefaultWindows[pWin->drawable.pScreen->myNum])
#define xnestWindowSiblingAbove(pWin) \ #define xnestWindowSiblingAbove(pWin) \
((pWin)->prevSib ? xnestWindow((pWin)->prevSib) : None) ((pWin)->prevSib ? xnestWindow((pWin)->prevSib) : XCB_WINDOW_NONE)
#define xnestWindowSiblingBelow(pWin) \ #define xnestWindowSiblingBelow(pWin) \
((pWin)->nextSib ? xnestWindow((pWin)->nextSib) : None) ((pWin)->nextSib ? xnestWindow((pWin)->nextSib) : XCB_WINDOW_NONE)
WindowPtr xnestWindowPtr(Window window); WindowPtr xnestWindowPtr(Window window);
Bool xnestCreateWindow(WindowPtr pWin); Bool xnestCreateWindow(WindowPtr pWin);