(submit/xnest-bool) Xnest: use Xorg's TRUE/FALSE instead of Xlib's True/False

Use Xserver's defines instead of Xlib's ones. The values are the same.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-21 16:53:50 +02:00
parent 54860920e1
commit 4a4fb2817a
12 changed files with 66 additions and 66 deletions

View File

@ -34,23 +34,23 @@ is" without express or implied warranty.
#include "Args.h" #include "Args.h"
char *xnestDisplayName = NULL; char *xnestDisplayName = NULL;
Bool xnestSynchronize = False; Bool xnestSynchronize = FALSE;
Bool xnestFullGeneration = False; Bool xnestFullGeneration = FALSE;
int xnestDefaultClass; int xnestDefaultClass;
Bool xnestUserDefaultClass = False; Bool xnestUserDefaultClass = FALSE;
int xnestDefaultDepth; int xnestDefaultDepth;
Bool xnestUserDefaultDepth = False; Bool xnestUserDefaultDepth = FALSE;
Bool xnestSoftwareScreenSaver = False; Bool xnestSoftwareScreenSaver = FALSE;
int xnestX; int xnestX;
int xnestY; int xnestY;
unsigned int xnestWidth; unsigned int xnestWidth;
unsigned int xnestHeight; unsigned int xnestHeight;
int xnestUserGeometry = 0; int xnestUserGeometry = 0;
int xnestBorderWidth; int xnestBorderWidth;
Bool xnestUserBorderWidth = False; Bool xnestUserBorderWidth = FALSE;
char *xnestWindowName = NULL; char *xnestWindowName = NULL;
int xnestNumScreens = 0; int xnestNumScreens = 0;
Bool xnestDoDirectColormaps = False; Bool xnestDoDirectColormaps = FALSE;
Window xnestParentWindow = 0; Window xnestParentWindow = 0;
int int
@ -64,43 +64,43 @@ ddxProcessArgument(int argc, char *argv[], int i)
return 0; return 0;
} }
if (!strcmp(argv[i], "-sync")) { if (!strcmp(argv[i], "-sync")) {
xnestSynchronize = True; xnestSynchronize = TRUE;
return 1; return 1;
} }
if (!strcmp(argv[i], "-full")) { if (!strcmp(argv[i], "-full")) {
xnestFullGeneration = True; xnestFullGeneration = TRUE;
return 1; return 1;
} }
if (!strcmp(argv[i], "-class")) { if (!strcmp(argv[i], "-class")) {
if (++i < argc) { if (++i < argc) {
if (!strcmp(argv[i], "StaticGray")) { if (!strcmp(argv[i], "StaticGray")) {
xnestDefaultClass = StaticGray; xnestDefaultClass = StaticGray;
xnestUserDefaultClass = True; xnestUserDefaultClass = TRUE;
return 2; return 2;
} }
else if (!strcmp(argv[i], "GrayScale")) { else if (!strcmp(argv[i], "GrayScale")) {
xnestDefaultClass = GrayScale; xnestDefaultClass = GrayScale;
xnestUserDefaultClass = True; xnestUserDefaultClass = TRUE;
return 2; return 2;
} }
else if (!strcmp(argv[i], "StaticColor")) { else if (!strcmp(argv[i], "StaticColor")) {
xnestDefaultClass = StaticColor; xnestDefaultClass = StaticColor;
xnestUserDefaultClass = True; xnestUserDefaultClass = TRUE;
return 2; return 2;
} }
else if (!strcmp(argv[i], "PseudoColor")) { else if (!strcmp(argv[i], "PseudoColor")) {
xnestDefaultClass = PseudoColor; xnestDefaultClass = PseudoColor;
xnestUserDefaultClass = True; xnestUserDefaultClass = TRUE;
return 2; return 2;
} }
else if (!strcmp(argv[i], "TrueColor")) { else if (!strcmp(argv[i], "TrueColor")) {
xnestDefaultClass = TrueColor; xnestDefaultClass = TrueColor;
xnestUserDefaultClass = True; xnestUserDefaultClass = TRUE;
return 2; return 2;
} }
else if (!strcmp(argv[i], "DirectColor")) { else if (!strcmp(argv[i], "DirectColor")) {
xnestDefaultClass = DirectColor; xnestDefaultClass = DirectColor;
xnestUserDefaultClass = True; xnestUserDefaultClass = TRUE;
return 2; return 2;
} }
} }
@ -109,7 +109,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-cc")) { if (!strcmp(argv[i], "-cc")) {
if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultClass) == 1) { if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultClass) == 1) {
if (xnestDefaultClass >= 0 && xnestDefaultClass <= 5) { if (xnestDefaultClass >= 0 && xnestDefaultClass <= 5) {
xnestUserDefaultClass = True; xnestUserDefaultClass = TRUE;
/* lex the OS layer process it as well, so return 0 */ /* lex the OS layer process it as well, so return 0 */
} }
} }
@ -118,14 +118,14 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-depth")) { if (!strcmp(argv[i], "-depth")) {
if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultDepth) == 1) { if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultDepth) == 1) {
if (xnestDefaultDepth > 0) { if (xnestDefaultDepth > 0) {
xnestUserDefaultDepth = True; xnestUserDefaultDepth = TRUE;
return 2; return 2;
} }
} }
return 0; return 0;
} }
if (!strcmp(argv[i], "-sss")) { if (!strcmp(argv[i], "-sss")) {
xnestSoftwareScreenSaver = True; xnestSoftwareScreenSaver = TRUE;
return 1; return 1;
} }
if (!strcmp(argv[i], "-geometry")) { if (!strcmp(argv[i], "-geometry")) {
@ -141,7 +141,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-bw")) { if (!strcmp(argv[i], "-bw")) {
if (++i < argc && sscanf(argv[i], "%i", &xnestBorderWidth) == 1) { if (++i < argc && sscanf(argv[i], "%i", &xnestBorderWidth) == 1) {
if (xnestBorderWidth >= 0) { if (xnestBorderWidth >= 0) {
xnestUserBorderWidth = True; xnestUserBorderWidth = TRUE;
return 2; return 2;
} }
} }
@ -167,7 +167,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
return 0; return 0;
} }
if (!strcmp(argv[i], "-install")) { if (!strcmp(argv[i], "-install")) {
xnestDoDirectColormaps = True; xnestDoDirectColormaps = TRUE;
return 1; return 1;
} }
if (!strcmp(argv[i], "-parent")) { if (!strcmp(argv[i], "-parent")) {

View File

@ -126,7 +126,7 @@ xnestCreateColormap(ColormapPtr pCmap)
break; break;
} }
return True; return TRUE;
} }
void void
@ -175,19 +175,19 @@ static Bool
xnestSameInstalledColormapWindows(Window *windows, int numWindows) xnestSameInstalledColormapWindows(Window *windows, int numWindows)
{ {
if (xnestNumOldInstalledColormapWindows != numWindows) if (xnestNumOldInstalledColormapWindows != numWindows)
return False; return FALSE;
if (xnestOldInstalledColormapWindows == windows) if (xnestOldInstalledColormapWindows == windows)
return True; return TRUE;
if (xnestOldInstalledColormapWindows == NULL || windows == NULL) if (xnestOldInstalledColormapWindows == NULL || windows == NULL)
return False; return FALSE;
if (memcmp(xnestOldInstalledColormapWindows, windows, if (memcmp(xnestOldInstalledColormapWindows, windows,
numWindows * sizeof(Window))) numWindows * sizeof(Window)))
return False; return FALSE;
return True; return TRUE;
} }
void void
@ -372,7 +372,7 @@ xnestUninstallColormap(ColormapPtr pCmap)
} }
} }
static Bool xnestInstalledDefaultColormap = False; static Bool xnestInstalledDefaultColormap = FALSE;
int int
xnestListInstalledColormaps(ScreenPtr pScreen, Colormap * pCmapIDs) xnestListInstalledColormaps(ScreenPtr pScreen, Colormap * pCmapIDs)
@ -474,7 +474,7 @@ xnestCreateDefaultColormap(ScreenPtr pScreen)
(pVisual->class & DynamicClass) ? AllocNone : AllocAll, (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
0) 0)
!= Success) != Success)
return False; return FALSE;
wp = pScreen->whitePixel; wp = pScreen->whitePixel;
bp = pScreen->blackPixel; bp = pScreen->blackPixel;
@ -486,7 +486,7 @@ xnestCreateDefaultColormap(ScreenPtr pScreen)
pScreen->blackPixel = bp; pScreen->blackPixel = bp;
(*pScreen->InstallColormap) (pCmap); (*pScreen->InstallColormap) (pCmap);
xnestInstalledDefaultColormap = True; xnestInstalledDefaultColormap = TRUE;
return True; return TRUE;
} }

View File

@ -107,7 +107,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
XFreePixmap(xnestDisplay, source); XFreePixmap(xnestDisplay, source);
XFreePixmap(xnestDisplay, mask); XFreePixmap(xnestDisplay, mask);
return True; return TRUE;
} }
Bool Bool
@ -115,7 +115,7 @@ xnestUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{ {
XFreeCursor(xnestDisplay, xnestCursor(pCursor, pScreen)); XFreeCursor(xnestDisplay, xnestCursor(pCursor, pScreen));
free(xnestGetCursorPriv(pCursor, pScreen)); free(xnestGetCursorPriv(pCursor, pScreen));
return True; return TRUE;
} }
void void

View File

@ -86,7 +86,7 @@ xnestOpenDisplay(int argc, char *argv[])
XDisplayName(xnestDisplayName)); XDisplayName(xnestDisplayName));
if (xnestSynchronize) if (xnestSynchronize)
XSynchronize(xnestDisplay, True); XSynchronize(xnestDisplay, TRUE);
mask = VisualScreenMask; mask = VisualScreenMask;
vi.screen = DefaultScreen(xnestDisplay); vi.screen = DefaultScreen(xnestDisplay);

View File

@ -47,7 +47,7 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL); xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL);
name_atom = MakeAtom("FONT", 4, True); name_atom = MakeAtom("FONT", 4, TRUE);
value_atom = 0L; value_atom = 0L;
nprops = pFont->info.nprops; nprops = pFont->info.nprops;
@ -60,12 +60,12 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
} }
if (!value_atom) if (!value_atom)
return False; return FALSE;
name = NameForAtom(value_atom); name = NameForAtom(value_atom);
if (!name) if (!name)
return False; return FALSE;
priv = (void *) malloc(sizeof(xnestPrivFont)); priv = (void *) malloc(sizeof(xnestPrivFont));
xfont2_font_set_private(pFont, xnestFontPrivateIndex, priv); xfont2_font_set_private(pFont, xnestFontPrivateIndex, priv);
@ -73,9 +73,9 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name); xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name);
if (!xnestFontStruct(pFont)) if (!xnestFontStruct(pFont))
return False; return FALSE;
return True; return TRUE;
} }
Bool Bool
@ -87,5 +87,5 @@ xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
free(xnestFontPriv(pFont)); free(xnestFontPriv(pFont));
xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL); xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL);
} }
return True; return TRUE;
} }

View File

@ -84,7 +84,7 @@ xnestCreateGC(GCPtr pGC)
xnestDefaultDrawables[pGC->depth], xnestDefaultDrawables[pGC->depth],
0L, NULL); 0L, NULL);
return True; return TRUE;
} }
void void

View File

@ -100,7 +100,7 @@ static int
xnestIgnoreErrorHandler (Display *dpy, xnestIgnoreErrorHandler (Display *dpy,
XErrorEvent *event) XErrorEvent *event)
{ {
return False; /* return value is ignored */ return FALSE; /* return value is ignored */
} }
void void
@ -112,7 +112,7 @@ xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
int (*old_handler)(Display*, XErrorEvent*); int (*old_handler)(Display*, XErrorEvent*);
/* we may get BadMatch error when xnest window is minimized */ /* we may get BadMatch error when xnest window is minimized */
XSync(xnestDisplay, False); XSync(xnestDisplay, FALSE);
old_handler = XSetErrorHandler (xnestIgnoreErrorHandler); old_handler = XSetErrorHandler (xnestIgnoreErrorHandler);
ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable), ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
@ -150,13 +150,13 @@ xnestBitBlitHelper(GCPtr pGC)
if (!pReg || !pTmpReg) if (!pReg || !pTmpReg)
return NullRegion; return NullRegion;
pending = True; pending = TRUE;
while (pending) { while (pending) {
XIfEvent(xnestDisplay, &event, xnestBitBlitPredicate, NULL); XIfEvent(xnestDisplay, &event, xnestBitBlitPredicate, NULL);
switch (event.type) { switch (event.type) {
case NoExpose: case NoExpose:
pending = False; pending = FALSE;
break; break;
case GraphicsExpose: case GraphicsExpose:

View File

@ -51,7 +51,7 @@ is" without express or implied warranty.
#include "dpmsproc.h" #include "dpmsproc.h"
#endif #endif
Bool xnestDoFullGeneration = True; Bool xnestDoFullGeneration = TRUE;
#ifdef GLXEXT #ifdef GLXEXT
void void
@ -135,7 +135,7 @@ CloseInput(void)
void void
ddxGiveUp(enum ExitCode error) ddxGiveUp(enum ExitCode error)
{ {
xnestDoFullGeneration = True; xnestDoFullGeneration = TRUE;
xnestCloseDisplay(); xnestCloseDisplay();
} }

View File

@ -190,7 +190,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
modmap, serverClient); modmap, serverClient);
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
XkbFreeKeyboard(xkb, 0, False); XkbFreeKeyboard(xkb, 0, FALSE);
free(keymap); free(keymap);
break; break;
case DEVICE_ON: case DEVICE_ON:

View File

@ -41,7 +41,7 @@ DeviceIntPtr xnestPointerDevice = NULL;
void void
xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl * ctrl) xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl * ctrl)
{ {
XChangePointerControl(xnestDisplay, True, True, XChangePointerControl(xnestDisplay, TRUE, TRUE,
ctrl->num, ctrl->den, ctrl->threshold); ctrl->num, ctrl->den, ctrl->threshold);
} }

View File

@ -78,7 +78,7 @@ static Bool
xnestSaveScreen(ScreenPtr pScreen, int what) xnestSaveScreen(ScreenPtr pScreen, int what)
{ {
if (xnestSoftwareScreenSaver) if (xnestSoftwareScreenSaver)
return False; return FALSE;
else { else {
switch (what) { switch (what) {
case SCREEN_SAVER_ON: case SCREEN_SAVER_ON:
@ -102,7 +102,7 @@ xnestSaveScreen(ScreenPtr pScreen, int what)
xnestSetInstalledColormapWindows(pScreen); xnestSetInstalledColormapWindows(pScreen);
break; break;
} }
return True; return TRUE;
} }
} }
@ -406,9 +406,9 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
} }
if (!xnestCreateDefaultColormap(pScreen)) if (!xnestCreateDefaultColormap(pScreen))
return False; return FALSE;
return True; return TRUE;
} }
Bool Bool
@ -427,5 +427,5 @@ xnestCloseScreen(ScreenPtr pScreen)
the display connection. There is no need to generate extra protocol. the display connection. There is no need to generate extra protocol.
*/ */
return True; return TRUE;
} }

View File

@ -145,7 +145,7 @@ xnestCreateWindow(WindowPtr pWin)
if (!pWin->parent) /* only the root window will have the right colormap */ if (!pWin->parent) /* only the root window will have the right colormap */
xnestSetInstalledColormapWindows(pWin->drawable.pScreen); xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
return True; return TRUE;
} }
Bool Bool
@ -162,7 +162,7 @@ xnestDestroyWindow(WindowPtr pWin)
if (pWin->optional && pWin->optional->colormap && pWin->parent) if (pWin->optional && pWin->optional->colormap && pWin->parent)
xnestSetInstalledColormapWindows(pWin->drawable.pScreen); xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
return True; return TRUE;
} }
Bool Bool
@ -172,7 +172,7 @@ xnestPositionWindow(WindowPtr pWin, int x, int y)
CWParent | CWParent |
CWX | CWY | CWWidth | CWHeight | CWBorderWidth); CWX | CWY | CWWidth | CWHeight | CWBorderWidth);
return True; return TRUE;
} }
void void
@ -348,7 +348,7 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
XChangeWindowAttributes(xnestDisplay, xnestWindow(pWin), XChangeWindowAttributes(xnestDisplay, xnestWindow(pWin),
mask, &attributes); mask, &attributes);
return True; return TRUE;
} }
Bool Bool
@ -358,7 +358,7 @@ xnestRealizeWindow(WindowPtr pWin)
xnestShapeWindow(pWin); xnestShapeWindow(pWin);
XMapWindow(xnestDisplay, xnestWindow(pWin)); XMapWindow(xnestDisplay, xnestWindow(pWin));
return True; return TRUE;
} }
Bool Bool
@ -366,7 +366,7 @@ xnestUnrealizeWindow(WindowPtr pWin)
{ {
XUnmapWindow(xnestDisplay, xnestWindow(pWin)); XUnmapWindow(xnestDisplay, xnestWindow(pWin));
return True; return TRUE;
} }
void void
@ -394,7 +394,7 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn)
Window window; Window window;
BoxRec Box; BoxRec Box;
XSync(xnestDisplay, False); XSync(xnestDisplay, FALSE);
window = xnestWindow(pWin); window = xnestWindow(pWin);
@ -429,10 +429,10 @@ xnestRegionEqual(RegionPtr pReg1, RegionPtr pReg2)
unsigned int n1, n2; unsigned int n1, n2;
if (pReg1 == pReg2) if (pReg1 == pReg2)
return True; return TRUE;
if (pReg1 == NullRegion || pReg2 == NullRegion) if (pReg1 == NullRegion || pReg2 == NullRegion)
return False; return FALSE;
pBox1 = RegionRects(pReg1); pBox1 = RegionRects(pReg1);
n1 = RegionNumRects(pReg1); n1 = RegionNumRects(pReg1);
@ -441,15 +441,15 @@ xnestRegionEqual(RegionPtr pReg1, RegionPtr pReg2)
n2 = RegionNumRects(pReg2); n2 = RegionNumRects(pReg2);
if (n1 != n2) if (n1 != n2)
return False; return FALSE;
if (pBox1 == pBox2) if (pBox1 == pBox2)
return True; return TRUE;
if (memcmp(pBox1, pBox2, n1 * sizeof(BoxRec))) if (memcmp(pBox1, pBox2, n1 * sizeof(BoxRec)))
return False; return FALSE;
return True; return TRUE;
} }
void void