Unverified Commit faae65fb authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/rework_booleans_v2' into 3.6.x

parents d545afdf b44ecc0f
...@@ -97,7 +97,7 @@ void nxagentSetCoalescence(void); ...@@ -97,7 +97,7 @@ void nxagentSetCoalescence(void);
void nxagentShowVersionInfo(void); void nxagentShowVersionInfo(void);
extern int nxagentUserDefinedFontPath; extern Bool nxagentUserDefinedFontPath;
extern int nxagentRemoteMajor; extern int nxagentRemoteMajor;
......
...@@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen) ...@@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen)
* server. * server.
*/ */
nxagentChangeOption(Nested, 1); nxagentChangeOption(Nested, True);
/* /*
* Avoid the image degradation caused by * Avoid the image degradation caused by
......
...@@ -332,7 +332,7 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property) ...@@ -332,7 +332,7 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property)
* the windows updated. * the windows updated.
*/ */
nxagentChangeOption(IgnoreVisibility, 1); nxagentChangeOption(IgnoreVisibility, True);
} }
} }
} }
...@@ -373,7 +373,7 @@ static void checkIfShadowAgent(ClientPtr client) ...@@ -373,7 +373,7 @@ static void checkIfShadowAgent(ClientPtr client)
fprintf(stderr, "nxagentCheckIfShadowAgent: The last shadow nxagent has been detached.\n"); fprintf(stderr, "nxagentCheckIfShadowAgent: The last shadow nxagent has been detached.\n");
#endif #endif
nxagentChangeOption(IgnoreVisibility, 0); nxagentChangeOption(IgnoreVisibility, False);
} }
} }
} }
...@@ -457,7 +457,7 @@ void nxagentWaitWakeupBySplit(ClientPtr client) ...@@ -457,7 +457,7 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
{ {
#ifdef TEST #ifdef TEST
if (nxagentNeedWakeupBySplit(client) == 0) if (!nxagentNeedWakeupBySplit(client))
{ {
fprintf(stderr, "++++++nxagentWaitWakeupBySplit: WARNING! The client [%d] is already awake.\n", fprintf(stderr, "++++++nxagentWaitWakeupBySplit: WARNING! The client [%d] is already awake.\n",
client -> index); client -> index);
...@@ -497,12 +497,12 @@ void nxagentWaitWakeupBySplit(ClientPtr client) ...@@ -497,12 +497,12 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
#endif #endif
if (nxagentNeedWakeupBySplit(client) == 0 || if (!nxagentNeedWakeupBySplit(client) ||
NXDisplayError(nxagentDisplay) == 1) NXDisplayError(nxagentDisplay) == 1)
{ {
#ifdef TEST #ifdef TEST
if (nxagentNeedWakeupBySplit(client) == 0) if (!nxagentNeedWakeupBySplit(client))
{ {
fprintf(stderr, "++++++nxagentWaitWakeupBySplit: Client [%d] can now run.\n", fprintf(stderr, "++++++nxagentWaitWakeupBySplit: Client [%d] can now run.\n",
client -> index); client -> index);
...@@ -535,7 +535,7 @@ FIXME: Should record a serial number for the client, so that the ...@@ -535,7 +535,7 @@ FIXME: Should record a serial number for the client, so that the
*/ */
if (client -> index < MAX_CONNECTIONS) if (client -> index < MAX_CONNECTIONS)
{ {
if (nxagentNeedWakeup(client) == 0) if (!nxagentNeedWakeup(client))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "++++++nxagentSuspendBySplit: Suspending client [%d] with agent sequence [%ld].\n", fprintf(stderr, "++++++nxagentSuspendBySplit: Suspending client [%d] with agent sequence [%ld].\n",
...@@ -583,7 +583,7 @@ FIXME: Should record a serial number for the client, so that the ...@@ -583,7 +583,7 @@ FIXME: Should record a serial number for the client, so that the
{ {
nxagentClientPriv(client) -> clientState &= ~SleepingBySplit; nxagentClientPriv(client) -> clientState &= ~SleepingBySplit;
if (nxagentNeedWakeup(client) == 0) if (!nxagentNeedWakeup(client))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "++++++nxagentWakeupBySplit: Resuming client [%d] with agent sequence [%ld].\n", fprintf(stderr, "++++++nxagentWakeupBySplit: Resuming client [%d] with agent sequence [%ld].\n",
...@@ -629,7 +629,7 @@ void nxagentCheckRestartedClients(struct timeval **timeout) ...@@ -629,7 +629,7 @@ void nxagentCheckRestartedClients(struct timeval **timeout)
for (int i = 1; i < currentMaxClients; i++) for (int i = 1; i < currentMaxClients; i++)
{ {
if (clients[i] != NULL && clients[i] -> osPrivate != NULL && if (clients[i] != NULL && clients[i] -> osPrivate != NULL &&
nxagentNeedWakeup(clients[i]) == 0) !nxagentNeedWakeup(clients[i]))
{ {
int fd = ((OsCommPtr) clients[i] -> osPrivate) -> fd; int fd = ((OsCommPtr) clients[i] -> osPrivate) -> fd;
......
...@@ -225,7 +225,7 @@ const char * getXErrorString(int code) ...@@ -225,7 +225,7 @@ const char * getXErrorString(int code)
* Save the values queried from X server. * Save the values queried from X server.
*/ */
XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, 0 }; XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False };
extern Display *nxagentDisplay; extern Display *nxagentDisplay;
...@@ -1571,7 +1571,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, ...@@ -1571,7 +1571,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
* way to identify that situation during callback processing we * way to identify that situation during callback processing we
* could get rid of the Trap... * could get rid of the Trap...
*/ */
if (nxagentExternalClipboardEventTrap != 0) if (nxagentExternalClipboardEventTrap)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: Trap is set, doing nothing\n", __func__); fprintf(stderr, "%s: Trap is set, doing nothing\n", __func__);
...@@ -2234,7 +2234,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) ...@@ -2234,7 +2234,7 @@ Bool nxagentInitClipboard(WindowPtr pWin)
XFixesSelectionClientCloseNotifyMask); XFixesSelectionClientCloseNotifyMask);
} }
nxagentXFixesInfo.Initialized = 1; nxagentXFixesInfo.Initialized = True;
} }
/* /*
......
...@@ -35,7 +35,7 @@ typedef struct _XFixesAgentInfo ...@@ -35,7 +35,7 @@ typedef struct _XFixesAgentInfo
int Opcode; int Opcode;
int EventBase; int EventBase;
int ErrorBase; int ErrorBase;
int Initialized; Bool Initialized;
} XFixesAgentInfoRec; } XFixesAgentInfoRec;
extern XFixesAgentInfoRec nxagentXFixesInfo; extern XFixesAgentInfoRec nxagentXFixesInfo;
......
...@@ -57,7 +57,7 @@ void nxagentCompositeExtensionInit(void) ...@@ -57,7 +57,7 @@ void nxagentCompositeExtensionInit(void)
nxagentCompositeEnable = 0; nxagentCompositeEnable = 0;
if (nxagentOption(Composite) == 1) if (nxagentOption(Composite))
{ {
int eventBase, errorBase; int eventBase, errorBase;
...@@ -115,7 +115,7 @@ void nxagentCompositeExtensionInit(void) ...@@ -115,7 +115,7 @@ void nxagentCompositeExtensionInit(void)
void nxagentRedirectDefaultWindows(void) void nxagentRedirectDefaultWindows(void)
{ {
if (nxagentOption(Rootless) == 1 || if (nxagentOption(Rootless) ||
nxagentCompositeEnable == 0) nxagentCompositeEnable == 0)
{ {
#ifdef TEST #ifdef TEST
...@@ -154,7 +154,7 @@ void nxagentRedirectDefaultWindows(void) ...@@ -154,7 +154,7 @@ void nxagentRedirectDefaultWindows(void)
void nxagentRedirectWindow(WindowPtr pWin) void nxagentRedirectWindow(WindowPtr pWin)
{ {
if (nxagentOption(Rootless) == 0 || if (!nxagentOption(Rootless) ||
nxagentCompositeEnable == 0) nxagentCompositeEnable == 0)
{ {
#ifdef TEST #ifdef TEST
......
...@@ -127,7 +127,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -127,7 +127,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
Cursor cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None; Cursor cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None;
if (nxagentOption(Rootless) == False) if (!nxagentOption(Rootless))
{ {
XDefineCursor(nxagentDisplay, XDefineCursor(nxagentDisplay,
nxagentInputWindows[pScreen -> myNum], nxagentInputWindows[pScreen -> myNum],
......
...@@ -312,7 +312,7 @@ static void nxagentSighupHandler(int signal) ...@@ -312,7 +312,7 @@ static void nxagentSighupHandler(int signal)
} }
else if (nxagentSessionState == SESSION_UP) else if (nxagentSessionState == SESSION_UP)
{ {
if (nxagentOption(Persistent) == 1) if (nxagentOption(Persistent))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSighupHandler: Handling the signal by disconnecting the agent.\n"); fprintf(stderr, "nxagentSighupHandler: Handling the signal by disconnecting the agent.\n");
...@@ -660,7 +660,7 @@ static void nxagentDisplayBlockHandler(Display *disp, int reason) ...@@ -660,7 +660,7 @@ static void nxagentDisplayBlockHandler(Display *disp, int reason)
fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Display is blocking for [write].\n"); fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Display is blocking for [write].\n");
#endif #endif
nxagentBlocking = 1; nxagentBlocking = True;
if (!SmartScheduleSignalEnable) if (!SmartScheduleSignalEnable)
{ {
...@@ -908,7 +908,7 @@ void nxagentResetDisplayHandlers(void) ...@@ -908,7 +908,7 @@ void nxagentResetDisplayHandlers(void)
*/ */
nxagentBuffer = 0; nxagentBuffer = 0;
nxagentBlocking = 0; nxagentBlocking = False;
nxagentCongestion = 0; nxagentCongestion = 0;
/* /*
...@@ -1796,7 +1796,7 @@ void nxagentCloseDisplay(void) ...@@ -1796,7 +1796,7 @@ void nxagentCloseDisplay(void)
nxagentDoFullGeneration, (void *) nxagentDisplay); nxagentDoFullGeneration, (void *) nxagentDisplay);
#endif #endif
if (nxagentDoFullGeneration == 0 || if (!nxagentDoFullGeneration ||
nxagentDisplay == NULL) nxagentDisplay == NULL)
{ {
return; return;
...@@ -2517,7 +2517,7 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2517,7 +2517,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT, nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT,
"Couldn't open the display."); "Couldn't open the display.");
return FALSE; return False;
} }
nxagentAddXConnection(); nxagentAddXConnection();
...@@ -2535,12 +2535,12 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2535,12 +2535,12 @@ Bool nxagentReconnectDisplay(void *p0)
#endif #endif
if (nxagentCheckForDefaultDepthCompatibility() == 0) if (!nxagentCheckForDefaultDepthCompatibility())
{ {
nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT, nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT,
"Default display depth doesn't match."); "Default display depth doesn't match.");
return FALSE; return False;
} }
nxagentUseNXTrans = nxagentPostProcessArgs(nxagentDisplayName, nxagentDisplay, nxagentUseNXTrans = nxagentPostProcessArgs(nxagentDisplayName, nxagentDisplay,
...@@ -2557,12 +2557,12 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2557,12 +2557,12 @@ Bool nxagentReconnectDisplay(void *p0)
* Init and compare the visuals. * Init and compare the visuals.
*/ */
if (nxagentInitAndCheckVisuals(flexibility) == FALSE) if (!nxagentInitAndCheckVisuals(flexibility))
{ {
nxagentSetReconnectError(FAILED_RESUME_VISUALS_ALERT, nxagentSetReconnectError(FAILED_RESUME_VISUALS_ALERT,
"Couldn't restore the required visuals."); "Couldn't restore the required visuals.");
return FALSE; return False;
} }
reconnectDisplayState = GOT_VISUAL_INFO; reconnectDisplayState = GOT_VISUAL_INFO;
...@@ -2612,7 +2612,7 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2612,7 +2612,7 @@ Bool nxagentReconnectDisplay(void *p0)
reconnectDisplayState = GOT_DEPTH_LIST; reconnectDisplayState = GOT_DEPTH_LIST;
if (nxagentCheckForDepthsCompatibility() == 0) if (!nxagentCheckForDepthsCompatibility())
{ {
nxagentSetReconnectError(FAILED_RESUME_DEPTHS_ALERT, nxagentSetReconnectError(FAILED_RESUME_DEPTHS_ALERT,
"Couldn't restore all the required depths."); "Couldn't restore all the required depths.");
...@@ -2634,7 +2634,7 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2634,7 +2634,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentInitPixmapFormats(); nxagentInitPixmapFormats();
if (nxagentCheckForPixmapFormatsCompatibility() == 0) if (!nxagentCheckForPixmapFormatsCompatibility())
{ {
nxagentSetReconnectError(FAILED_RESUME_PIXMAPS_ALERT, nxagentSetReconnectError(FAILED_RESUME_PIXMAPS_ALERT,
"Couldn't restore all the required pixmap formats."); "Couldn't restore all the required pixmap formats.");
......
...@@ -38,7 +38,7 @@ typedef struct ...@@ -38,7 +38,7 @@ typedef struct
{ {
DrawablePtr pDrawable; DrawablePtr pDrawable;
int drawableType; int drawableType;
int abort; Bool abort;
int windowBitmaps; int windowBitmaps;
int pixmapBitmaps; int pixmapBitmaps;
int backgroundBitmaps; int backgroundBitmaps;
...@@ -157,7 +157,7 @@ extern int nxagentCorruptedPixmaps; ...@@ -157,7 +157,7 @@ extern int nxagentCorruptedPixmaps;
extern int nxagentCorruptedWindows; extern int nxagentCorruptedWindows;
extern int nxagentCorruptedBackgrounds; extern int nxagentCorruptedBackgrounds;
extern int nxagentForceSynchronization; extern Bool nxagentForceSynchronization;
extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
int width, int height); int width, int height);
......
...@@ -106,7 +106,7 @@ static int nxagentPrintError(Display *dpy, XErrorEvent *event, FILE *fp); ...@@ -106,7 +106,7 @@ static int nxagentPrintError(Display *dpy, XErrorEvent *event, FILE *fp);
int nxagentErrorHandler(Display *dpy, XErrorEvent *event) int nxagentErrorHandler(Display *dpy, XErrorEvent *event)
{ {
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
nxagentPrintError(dpy, event, stderr); nxagentPrintError(dpy, event, stderr);
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
extern char *nxagentClientsLogName; extern char *nxagentClientsLogName;
extern char nxagentVerbose; extern Bool nxagentVerbose;
int nxagentErrorHandler(Display *dpy, XErrorEvent *event); int nxagentErrorHandler(Display *dpy, XErrorEvent *event);
......
...@@ -209,7 +209,7 @@ extern int nxagentInputEvent; ...@@ -209,7 +209,7 @@ extern int nxagentInputEvent;
* Event-handling utilities. * Event-handling utilities.
*/ */
Bool nxagentPendingEvents(Display *dpy); int nxagentPendingEvents(Display *dpy);
#define nxagentQueuedEvents(display) \ #define nxagentQueuedEvents(display) \
XQLength((display)) XQLength((display))
......
...@@ -393,7 +393,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -393,7 +393,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
{ {
if (width == 0) if (width == 0)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
} }
...@@ -405,7 +405,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -405,7 +405,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
if (height == 0) if (height == 0)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
} }
...@@ -417,7 +417,7 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -417,7 +417,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height);
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width, XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width,
height); height);
...@@ -429,20 +429,20 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ...@@ -429,20 +429,20 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
{ {
UpdateCurrentTime(); UpdateCurrentTime();
if (nxagentOption(DesktopResize) == 1 && if (nxagentOption(DesktopResize) &&
(nxagentOption(Fullscreen) == 1 || (nxagentOption(Fullscreen) ||
width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) ||
height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))))
{ {
if (nxagentOption(ClientOs) != ClientOsWinnt if (nxagentOption(ClientOs) != ClientOsWinnt
/*&& nxagentOption(ClientOs) != ClientNXPlayer*/) /*&& nxagentOption(ClientOs) != ClientNXPlayer*/)
{ {
nxagentChangeOption(DesktopResize, 0); nxagentChangeOption(DesktopResize, False);
} }
} }
if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) &&
nxagentOption(AllScreens) == 0) !nxagentOption(AllScreens))
{ {
nxagentChangeOption(Width, width); nxagentChangeOption(Width, width);
nxagentChangeOption(Height, height); nxagentChangeOption(Height, height);
...@@ -450,8 +450,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ...@@ -450,8 +450,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True); int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True);
if (result == 1 && nxagentOption(DesktopResize) == 1 && if (result == 1 && nxagentOption(DesktopResize) &&
nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) !nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{ {
nxagentRandRSetWindowsSize(width, height); nxagentRandRSetWindowsSize(width, height);
nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height)); nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height));
......
...@@ -102,7 +102,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP ...@@ -102,7 +102,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName , FontPtr pFont); static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName , FontPtr pFont);
int nxagentFreeFont(XFontStruct *fs); int nxagentFreeFont(XFontStruct *fs);
static Bool nxagentGetFontServerPath(char * fontServerPath, int size); static Bool nxagentGetFontServerPath(char * fontServerPath, int size);
static char * nxagentMakeScalableFontName(const char *fontName, int scalableResolution); static char * nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution);
RESTYPE RT_NX_FONT; RESTYPE RT_NX_FONT;
...@@ -414,10 +414,10 @@ Bool nxagentFontLookUp(const char *name) ...@@ -414,10 +414,10 @@ Bool nxagentFontLookUp(const char *name)
if (name && strlen(name) == 0) if (name && strlen(name) == 0)
{ {
return 0; return False;
} }
int result = nxagentFontFind(name, &i); Bool result = nxagentFontFind(name, &i);
char *scalable = NULL; char *scalable = NULL;
...@@ -425,9 +425,9 @@ Bool nxagentFontLookUp(const char *name) ...@@ -425,9 +425,9 @@ Bool nxagentFontLookUp(const char *name)
* Let's try with the scalable font description. * Let's try with the scalable font description.
*/ */
if (result == 0) if (!result)
{ {
if ((scalable = nxagentMakeScalableFontName(name, 0)) != NULL) if ((scalable = nxagentMakeScalableFontName(name, False)) != NULL)
{ {
result = nxagentFontFind(scalable, &i); result = nxagentFontFind(scalable, &i);
...@@ -439,9 +439,9 @@ Bool nxagentFontLookUp(const char *name) ...@@ -439,9 +439,9 @@ Bool nxagentFontLookUp(const char *name)
* Let's try again after replacing zero to xdpi and ydpi in the pattern. * Let's try again after replacing zero to xdpi and ydpi in the pattern.
*/ */
if (result == 0) if (!result)
{ {
if ((scalable = nxagentMakeScalableFontName(name, 1)) != NULL) if ((scalable = nxagentMakeScalableFontName(name, True)) != NULL)
{ {
result = nxagentFontFind(scalable, &i); result = nxagentFontFind(scalable, &i);
...@@ -449,9 +449,9 @@ Bool nxagentFontLookUp(const char *name) ...@@ -449,9 +449,9 @@ Bool nxagentFontLookUp(const char *name)
} }
} }
if (result == 0) if (!result)
{ {
return 0; return False;
} }
else else
{ {
...@@ -612,7 +612,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) ...@@ -612,7 +612,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (nxagentFontPriv(pFont)->font_struct == NULL) if (nxagentFontPriv(pFont)->font_struct == NULL)
{ {
if (nxagentFontLookUp(name) == False) if (!nxagentFontLookUp(name))
{ {
fprintf(stderr, "Font: nxagentRealizeFont failed with font Font=%s, not in our remote list\n", fprintf(stderr, "Font: nxagentRealizeFont failed with font Font=%s, not in our remote list\n",
validateString(name)); validateString(name));
...@@ -750,7 +750,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP ...@@ -750,7 +750,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
if (numFontFields <= FIELDS) if (numFontFields <= FIELDS)
{ {
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Font name in non standard format.\n"); fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Font name in non standard format.\n");
} }
...@@ -817,7 +817,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP ...@@ -817,7 +817,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
} }
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Failed to load font '%s'. Replacing with '%s'.\n", fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Failed to load font '%s'. Replacing with '%s'.\n",
fontName, substFontBuf); fontName, substFontBuf);
...@@ -1532,7 +1532,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo ...@@ -1532,7 +1532,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf(stderr, "nxagentLoadQueryFont: Looking for font '%s'.\n", name); fprintf(stderr, "nxagentLoadQueryFont: Looking for font '%s'.\n", name);
#endif #endif
if (nxagentFontLookUp(name) == 0) if (!nxagentFontLookUp(name))
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name); fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name);
...@@ -1630,7 +1630,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) ...@@ -1630,7 +1630,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
char *current = string; char *current = string;
int i = 0; int i = 0;
int last = 0; Bool last = False;
for (;;) for (;;)
{ {
...@@ -1644,7 +1644,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) ...@@ -1644,7 +1644,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
if (next == NULL) if (next == NULL)
{ {
next = string + len; next = string + len;
last = 1; last = True;
} }
int fieldlen = next - current; int fieldlen = next - current;
...@@ -1662,7 +1662,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) ...@@ -1662,7 +1662,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
i++; i++;
if (last == 1) if (last)
{ {
break; break;
} }
...@@ -1671,7 +1671,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) ...@@ -1671,7 +1671,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
return i; return i;
} }
char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) char *nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution)
{ {
char *scalableFontName; char *scalableFontName;
...@@ -1710,7 +1710,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) ...@@ -1710,7 +1710,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
strcat(scalableFontName, "-0"); strcat(scalableFontName, "-0");
} }
else if (scalableResolution == 1 && (field == 8 || field == 9)) else if (scalableResolution && (field == 8 || field == 9))
{ {
/* /*
* RESOLUTION_X || RESOLUTION_Y * RESOLUTION_X || RESOLUTION_Y
......
...@@ -86,7 +86,7 @@ GCPtr nxagentCreateGraphicContext(int depth); ...@@ -86,7 +86,7 @@ GCPtr nxagentCreateGraphicContext(int depth);
static void nxagentReconnectGC(void*, XID, void*); static void nxagentReconnectGC(void*, XID, void*);
static void nxagentReconnectClip(GCPtr, int, void *, int); static void nxagentReconnectClip(GCPtr, int, void *, int);
static int nxagentCompareRegions(RegionPtr, RegionPtr); static Bool nxagentCompareRegions(RegionPtr, RegionPtr);
struct nxagentGCRec struct nxagentGCRec
{ {
...@@ -317,7 +317,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -317,7 +317,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
else else
{ {
if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized && if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized &&
nxagentGCTrap == 0) !nxagentGCTrap)
{ {
/* /*
* If the tile is corrupted and is not too large, it can be * If the tile is corrupted and is not too large, it can be
...@@ -367,7 +367,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -367,7 +367,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
if (mask & GCStipple) if (mask & GCStipple)
{ {
if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized && if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized &&
nxagentGCTrap == 0) !nxagentGCTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n", fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n",
...@@ -425,7 +425,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -425,7 +425,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
{ {
mask &= ~GCDashList; mask &= ~GCDashList;
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetDashes(nxagentDisplay, nxagentGC(pGC), XSetDashes(nxagentDisplay, nxagentGC(pGC),
pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList); pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList);
...@@ -434,7 +434,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) ...@@ -434,7 +434,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
CHECKGCVAL(GCArcMode, arc_mode, pGC->arcMode); CHECKGCVAL(GCArcMode, arc_mode, pGC->arcMode);
if (nxagentGCTrap == 1) if (nxagentGCTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n", fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n",
...@@ -497,7 +497,7 @@ void nxagentDestroyGC(GCPtr pGC) ...@@ -497,7 +497,7 @@ void nxagentDestroyGC(GCPtr pGC)
void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{ {
int clipsMatch = 0; Bool clipsMatch = False;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentChangeClip: Going to change clip on GC [%p]\n", fprintf(stderr, "nxagentChangeClip: Going to change clip on GC [%p]\n",
...@@ -528,7 +528,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -528,7 +528,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
default: default:
{ {
clipsMatch = 0; clipsMatch = False;
break; break;
} }
} }
...@@ -544,7 +544,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -544,7 +544,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{ {
case CT_NONE: case CT_NONE:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
} }
...@@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_REGION: case CT_REGION:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XRectangle *pRects; XRectangle *pRects;
nRects = RegionNumRects((RegionPtr)pValue); nRects = RegionNumRects((RegionPtr)pValue);
...@@ -576,7 +576,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -576,7 +576,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_PIXMAP: case CT_PIXMAP:
{ {
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), XSetClipMask(nxagentDisplay, nxagentGC(pGC),
nxagentPixmap((PixmapPtr)pValue)); nxagentPixmap((PixmapPtr)pValue));
...@@ -594,7 +594,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -594,7 +594,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_UNSORTED: case CT_UNSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -604,7 +604,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -604,7 +604,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YSORTED: case CT_YSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -614,7 +614,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -614,7 +614,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YXSORTED: case CT_YXSORTED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -624,7 +624,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -624,7 +624,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
} }
case CT_YXBANDED: case CT_YXBANDED:
{ {
if (clipsMatch == 0 && nxagentGCTrap == 0) if (!clipsMatch && !nxagentGCTrap)
{ {
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y, pGC->clipOrg.x, pGC->clipOrg.y,
...@@ -679,7 +679,7 @@ void nxagentDestroyClip(GCPtr pGC) ...@@ -679,7 +679,7 @@ void nxagentDestroyClip(GCPtr pGC)
nxagentDestroyClipHelper(pGC); nxagentDestroyClipHelper(pGC);
if (nxagentGCTrap == 0) if (!nxagentGCTrap)
{ {
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
} }
...@@ -1209,29 +1209,29 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) ...@@ -1209,29 +1209,29 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
nxagentGCPriv(pGC)->nClipRects = nRects; nxagentGCPriv(pGC)->nClipRects = nRects;
} }
static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) static Bool nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
{ {
/* /*
* It returns 1 if regions are equal, 0 otherwise * It returns True if regions are equal, False otherwise
*/ */
if (r1 == NULL && r2 == NULL) if (r1 == NULL && r2 == NULL)
{ {
return 1; return True;
} }
if ((r1 == NULL) || (r2 == NULL)) if ((r1 == NULL) || (r2 == NULL))
{ {
return 0; return False;
} }
if (RegionNumRects(r1) != RegionNumRects(r2)) if (RegionNumRects(r1) != RegionNumRects(r2))
{ {
return 0; return False;
} }
else if (RegionNumRects(r1) == 0) else if (RegionNumRects(r1) == 0)
{ {
return 1; return True;
} }
else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0; else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0;
else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0; else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0;
...@@ -1247,7 +1247,7 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) ...@@ -1247,7 +1247,7 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0; else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0;
} }
} }
return 1; return True;
} }
/* /*
......
...@@ -114,15 +114,15 @@ extern void nxagentDumpInputDevicesState(void); ...@@ -114,15 +114,15 @@ extern void nxagentDumpInputDevicesState(void);
* Used in the handling of the X desktop manager protocol. * Used in the handling of the X desktop manager protocol.
*/ */
int nxagentXdmcpUp = 0; Bool nxagentXdmcpUp = False;
int nxagentXdmcpAlertUp = 0; Bool nxagentXdmcpAlertUp = False;
/* /*
* Also used in the block, wakeup and sync handlers. * Also used in the block, wakeup and sync handlers.
*/ */
int nxagentBuffer; int nxagentBuffer;
int nxagentBlocking; Bool nxagentBlocking;
int nxagentCongestion; int nxagentCongestion;
double nxagentBytesIn; double nxagentBytesIn;
...@@ -153,7 +153,7 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 }; ...@@ -153,7 +153,7 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 };
* server. * server.
*/ */
extern int nxagentSkipImage; extern Bool nxagentSkipImage;
void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
{ {
...@@ -179,7 +179,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -179,7 +179,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* Set if we need to synchronize any drawable. * Set if we need to synchronize any drawable.
*/ */
static int synchronize; static Bool synchronize;
#ifdef BLOCKS #ifdef BLOCKS
fprintf(stderr, "[Begin block]\n"); fprintf(stderr, "[Begin block]\n");
...@@ -199,7 +199,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -199,7 +199,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#endif #endif
if (nxagentNeedConnectionChange() == 1) if (nxagentNeedConnectionChange())
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Calling nxagentHandleConnectionChanges " fprintf(stderr, "nxagentBlockHandler: Calling nxagentHandleConnectionChanges "
...@@ -222,7 +222,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -222,7 +222,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#ifdef TEST #ifdef TEST
if (nxagentLastWindowDestroyed == 1) if (nxagentLastWindowDestroyed)
{ {
fprintf(stderr, "nxagentBlockHandler: Elapsed time [%lu].\n", fprintf(stderr, "nxagentBlockHandler: Elapsed time [%lu].\n",
now - nxagentLastWindowDestroyedTime); now - nxagentLastWindowDestroyedTime);
...@@ -302,7 +302,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -302,7 +302,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* are synchronized. * are synchronized.
*/ */
if (synchronize == 1) if (synchronize)
{ {
/* /*
* We should not enter the synchronization loop if there is any * We should not enter the synchronization loop if there is any
...@@ -310,7 +310,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -310,7 +310,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* operation. * operation.
*/ */
if (nxagentForceSynchronization == 1) if (nxagentForceSynchronization)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Going to force a synchronization at %s.\n", fprintf(stderr, "nxagentBlockHandler: Going to force a synchronization at %s.\n",
...@@ -319,10 +319,10 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -319,10 +319,10 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
nxagentSynchronizationLoop(NEVER_BREAK); nxagentSynchronizationLoop(NEVER_BREAK);
nxagentForceSynchronization = 0; nxagentForceSynchronization = False;
} }
else if (nxagentUserInput(NULL) == 0 && else if (nxagentUserInput(NULL) == 0 &&
nxagentBlocking == 0 && !nxagentBlocking &&
nxagentCongestion <= 4) nxagentCongestion <= 4)
{ {
#ifdef TEST #ifdef TEST
...@@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
nxagentCorruptedBackgrounds > 0 || nxagentCorruptedBackgrounds > 0 ||
nxagentCorruptedPixmaps > 0)); nxagentCorruptedPixmaps > 0));
if (nxagentSkipImage == 0 && synchronize == 1) if (!nxagentSkipImage && synchronize)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and " fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and "
...@@ -391,7 +391,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) ...@@ -391,7 +391,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#ifdef DYNAMIC_DISPLAY_BUFFER #ifdef DYNAMIC_DISPLAY_BUFFER
if (nxagentBlocking == 1 && if (nxagentBlocking &&
nxagentBuffer > MINIMUM_DISPLAY_BUFFER) nxagentBuffer > MINIMUM_DISPLAY_BUFFER)
{ {
nxagentBuffer >>= 1; nxagentBuffer >>= 1;
...@@ -587,7 +587,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -587,7 +587,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
* Can become true during the dispatch loop. * Can become true during the dispatch loop.
*/ */
nxagentBlocking = 0; nxagentBlocking = False;
/* /*
* Check if we got new events. * Check if we got new events.
...@@ -648,7 +648,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -648,7 +648,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
* the session. * the session.
*/ */
if (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0) if (nxagentOption(Xdmcp) && !nxagentXdmcpUp)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState); fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState);
...@@ -656,10 +656,10 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -656,10 +656,10 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
if (XdmcpState == XDM_RUN_SESSION) if (XdmcpState == XDM_RUN_SESSION)
{ {
nxagentXdmcpUp = 1; nxagentXdmcpUp = True;
} }
if (nxagentXdmcpUp == 0) if (!nxagentXdmcpUp)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentWakeupHandler: XdmcpTime [%lu].\n", fprintf(stderr, "nxagentWakeupHandler: XdmcpTime [%lu].\n",
...@@ -671,7 +671,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -671,7 +671,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
XdmcpTimeOutRtx); XdmcpTimeOutRtx);
#endif #endif
if (nxagentXdmcpAlertUp == 0 && if (!nxagentXdmcpAlertUp &&
GetTimeInMillis() - XdmcpStartTime >= XDM_TIMEOUT) GetTimeInMillis() - XdmcpStartTime >= XDM_TIMEOUT)
{ {
#ifdef WARNING #ifdef WARNING
...@@ -681,7 +681,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) ...@@ -681,7 +681,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
NXTransAlert(FAILED_XDMCP_CONNECTION_ALERT, NX_ALERT_REMOTE); NXTransAlert(FAILED_XDMCP_CONNECTION_ALERT, NX_ALERT_REMOTE);
nxagentXdmcpAlertUp = 1; nxagentXdmcpAlertUp = True;
} }
} }
} }
...@@ -703,7 +703,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas ...@@ -703,7 +703,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
fprintf(stderr, "[Begin block]\n"); fprintf(stderr, "[Begin block]\n");
#endif #endif
if (nxagentNeedConnectionChange() == 1) if (nxagentNeedConnectionChange())
{ {
nxagentHandleConnectionChanges(); nxagentHandleConnectionChanges();
} }
...@@ -732,9 +732,9 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas ...@@ -732,9 +732,9 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
nxagentDispatchEvents(NULL); nxagentDispatchEvents(NULL);
} }
if (nxagentShadowResize == 1) if (nxagentShadowResize)
{ {
nxagentShadowResize = 0; nxagentShadowResize = False;
nxagentShadowAdaptToRatio(); nxagentShadowAdaptToRatio();
} }
...@@ -759,7 +759,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas ...@@ -759,7 +759,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
nxagentShadowSendUpdates(&suspended); nxagentShadowSendUpdates(&suspended);
if (nxagentBlocking == 0) if (!nxagentBlocking)
{ {
nxagentSynchronizeDrawable((DrawablePtr) nxagentShadowPixmapPtr, DONT_WAIT, nxagentSynchronizeDrawable((DrawablePtr) nxagentShadowPixmapPtr, DONT_WAIT,
ALWAYS_BREAK, nxagentShadowWindowPtr); ALWAYS_BREAK, nxagentShadowWindowPtr);
...@@ -830,7 +830,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) ...@@ -830,7 +830,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
* Can become true during the dispatch loop. * Can become true during the dispatch loop.
*/ */
nxagentBlocking = 0; nxagentBlocking = False;
/* /*
* Check if we got new events. * Check if we got new events.
...@@ -1200,7 +1200,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) ...@@ -1200,7 +1200,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
nxagentDispatchEvents(NULL); nxagentDispatchEvents(NULL);
nxagentBlocking = 1; nxagentBlocking = True;
} }
/* /*
......
...@@ -37,7 +37,7 @@ extern int nxagentBuffer; ...@@ -37,7 +37,7 @@ extern int nxagentBuffer;
* the display to become writable. * the display to become writable.
*/ */
extern int nxagentBlocking; extern Bool nxagentBlocking;
/* /*
* Current congestion level based on * Current congestion level based on
......
...@@ -171,7 +171,7 @@ int nxagentSaveUnder; ...@@ -171,7 +171,7 @@ int nxagentSaveUnder;
* nxagentOpenScreen * nxagentOpenScreen
* InitInput * InitInput
*/ */
int nxagentDoFullGeneration = 1; Bool nxagentDoFullGeneration = True;
/* /*
* True if agent is running as X2goAgent * True if agent is running as X2goAgent
...@@ -251,7 +251,7 @@ void InitOutput(ScreenInfo *scrInfo, int argc, char *argv[]) ...@@ -251,7 +251,7 @@ void InitOutput(ScreenInfo *scrInfo, int argc, char *argv[])
AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL); AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL);
} }
if (nxagentUserDefinedFontPath == 0) if (!nxagentUserDefinedFontPath)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "InitOutput: Calling nxagentVerifyDefaultFontPath.\n"); fprintf(stderr, "InitOutput: Calling nxagentVerifyDefaultFontPath.\n");
...@@ -518,7 +518,7 @@ FIXME: Do we need to check the key grab if the ...@@ -518,7 +518,7 @@ FIXME: Do we need to check the key grab if the
fprintf(stderr, "Info: Auto-terminating session with no client running.\n"); fprintf(stderr, "Info: Auto-terminating session with no client running.\n");
raise(SIGTERM); raise(SIGTERM);
} }
else if (nxagentOption(Persistent) == 0) else if (!nxagentOption(Persistent))
{ {
fprintf(stderr, "Info: Auto-terminating session with persistence not allowed.\n"); fprintf(stderr, "Info: Auto-terminating session with persistence not allowed.\n");
raise(SIGTERM); raise(SIGTERM);
......
...@@ -161,7 +161,7 @@ XkbAgentInfoRec nxagentXkbInfo = { -1, -1, -1, -1, -1 }; ...@@ -161,7 +161,7 @@ XkbAgentInfoRec nxagentXkbInfo = { -1, -1, -1, -1, -1 };
* Keyboard status, updated through XKB events. * Keyboard status, updated through XKB events.
*/ */
XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, 0 }; XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, False };
/* /*
* Info for disabling/enabling Xkb extension. * Info for disabling/enabling Xkb extension.
...@@ -776,7 +776,7 @@ XkbError: ...@@ -776,7 +776,7 @@ XkbError:
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
} }
if (nxagentOption(Shadow) == 1 && pDev && pDev->key) if (nxagentOption(Shadow) && pDev && pDev->key)
{ {
NXShadowInitKeymap(&(pDev->key->curKeySyms)); NXShadowInitKeymap(&(pDev->key->curKeySyms));
} }
...@@ -974,7 +974,7 @@ int nxagentResetKeyboard(void) ...@@ -974,7 +974,7 @@ int nxagentResetKeyboard(void)
if (dev->key) if (dev->key)
{ {
#ifdef XKB #ifdef XKB
if (noXkbExtension == 0 && dev->key->xkbInfo) if (!noXkbExtension && dev->key->xkbInfo)
{ {
oldMinKeycode = dev->key->xkbInfo -> desc -> min_key_code; oldMinKeycode = dev->key->xkbInfo -> desc -> min_key_code;
oldMaxKeycode = dev->key->xkbInfo -> desc -> max_key_code; oldMaxKeycode = dev->key->xkbInfo -> desc -> max_key_code;
...@@ -1132,7 +1132,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) ...@@ -1132,7 +1132,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
if (dev->key) if (dev->key)
{ {
#ifdef XKB #ifdef XKB
if (noXkbExtension == 0 && dev->key->xkbInfo) if (!noXkbExtension && dev->key->xkbInfo)
{ {
XkbFreeInfo(dev->key->xkbInfo); XkbFreeInfo(dev->key->xkbInfo);
dev->key->xkbInfo = NULL; dev->key->xkbInfo = NULL;
......
...@@ -68,8 +68,7 @@ typedef struct _XkbAgentState ...@@ -68,8 +68,7 @@ typedef struct _XkbAgentState
int Caps; int Caps;
int Num; int Num;
int Focus; int Focus;
int Initialized; Bool Initialized;
} XkbAgentStateRec; } XkbAgentStateRec;
extern XkbAgentStateRec nxagentXkbState; extern XkbAgentStateRec nxagentXkbState;
......
...@@ -624,7 +624,7 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) ...@@ -624,7 +624,7 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
return True; return True;
break; break;
case KEYSTROKE_FORCE_SYNCHRONIZATION: case KEYSTROKE_FORCE_SYNCHRONIZATION:
nxagentForceSynchronization = 1; nxagentForceSynchronization = True;
break; break;
#ifdef DUMP #ifdef DUMP
case KEYSTROKE_REGIONS_ON_SCREEN: case KEYSTROKE_REGIONS_ON_SCREEN:
......
...@@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
clientReady[0] = 0; clientReady[0] = 0;
if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) && !nxagentXdmcpUp))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n",
...@@ -343,7 +343,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -343,7 +343,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if (serverGeneration > nxagentMaxAllowedResets && if (serverGeneration > nxagentMaxAllowedResets &&
nxagentSessionState == SESSION_STARTING && nxagentSessionState == SESSION_STARTING &&
(nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) (!nxagentOption(Xdmcp) || nxagentXdmcpUp))
{ {
#ifdef NX_DEBUG_INPUT #ifdef NX_DEBUG_INPUT
fprintf(stderr, "Session: Session started at '%s' timestamp [%u].\n", fprintf(stderr, "Session: Session started at '%s' timestamp [%u].\n",
...@@ -575,7 +575,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -575,7 +575,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString()); fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString());
} }
if (nxagentOption(Shadow) == 1) if (nxagentOption(Shadow))
{ {
NXShadowDestroy(); NXShadowDestroy();
} }
......
...@@ -189,7 +189,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, ...@@ -189,7 +189,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
* } * }
*/ */
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
/* /*
* from nxagent-1.5.0-20 changelog: * from nxagent-1.5.0-20 changelog:
...@@ -238,7 +238,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse) ...@@ -238,7 +238,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse)
* by the agent (for example if the focus had left the window), so * by the agent (for example if the focus had left the window), so
* that agent could be unable to update the mouse button state. * that agent could be unable to update the mouse button state.
*/ */
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
XUngrabPointer(nxagentDisplay, CurrentTime); XUngrabPointer(nxagentDisplay, CurrentTime);
......
...@@ -193,7 +193,7 @@ ProcChangeProperty(ClientPtr client) ...@@ -193,7 +193,7 @@ ProcChangeProperty(ClientPtr client)
return err; return err;
else else
{ {
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format, nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format,
(int) mode, len, (void *) &stuff[1]); (int) mode, len, (void *) &stuff[1]);
......
...@@ -551,8 +551,8 @@ int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst) ...@@ -551,8 +551,8 @@ int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst)
fprintf(stderr, "nxagentCompositePredicate: Case 1.\n"); fprintf(stderr, "nxagentCompositePredicate: Case 1.\n");
#endif #endif
if (nxagentPixmapIsVirtual(pPixmap1) == 1 && if (nxagentPixmapIsVirtual(pPixmap1) &&
nxagentPixmapIsVirtual(pPixmap2) == 1) nxagentPixmapIsVirtual(pPixmap2))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCompositePredicate: Case 2.\n"); fprintf(stderr, "nxagentCompositePredicate: Case 2.\n");
......
...@@ -96,7 +96,7 @@ ShmExtensionInit(void) ...@@ -96,7 +96,7 @@ ShmExtensionInit(void)
#endif #endif
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
if (nxagentOption(SharedMemory) == False) if (!nxagentOption(SharedMemory))
{ {
return; return;
} }
......
...@@ -392,7 +392,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP ...@@ -392,7 +392,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) && if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) &&
pWin -> overrideRedirect == 0 && pWin -> overrideRedirect == 0 &&
nxagentScreenTrap == 0) !nxagentScreenTrap)
{ {
nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask); nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask);
......
...@@ -59,10 +59,12 @@ void nxagentInitOptions(void) ...@@ -59,10 +59,12 @@ void nxagentInitOptions(void)
{ {
nxagentOptions.LinkType = UNDEFINED; nxagentOptions.LinkType = UNDEFINED;
nxagentOptions.Desktop = UNDEFINED; nxagentOptions.Desktop = True;
nxagentOptions.Persistent = 1; nxagentOptions.Persistent = True;
nxagentOptions.Rootless = UNDEFINED; nxagentOptions.Rootless = False;
nxagentOptions.Fullscreen = UNDEFINED; nxagentOptions.Shadow = False;
nxagentOptions.Fullscreen = False;
nxagentOptions.AllScreens = False;
nxagentOptions.NoRootlessExit = False; nxagentOptions.NoRootlessExit = False;
nxagentOptions.X = 0; nxagentOptions.X = 0;
...@@ -81,23 +83,23 @@ void nxagentInitOptions(void) ...@@ -81,23 +83,23 @@ void nxagentInitOptions(void)
nxagentOptions.Timeout = 0; nxagentOptions.Timeout = 0;
nxagentOptions.Nested = 0; nxagentOptions.Nested = False;
nxagentOptions.BackingStore = BackingStoreUndefined; nxagentOptions.BackingStore = BackingStoreUndefined;
nxagentOptions.Clipboard = ClipboardBoth; nxagentOptions.Clipboard = ClipboardBoth;
nxagentOptions.SharedMemory = 1; nxagentOptions.SharedMemory = True;
nxagentOptions.SharedPixmaps = 1; nxagentOptions.SharedPixmaps = True;
nxagentOptions.DeviceControl = 0; nxagentOptions.DeviceControl = False;
nxagentOptions.DeviceControlUserDefined = 0; nxagentOptions.DeviceControlUserDefined = False;
nxagentOptions.ResetKeyboardAtResume = 1; nxagentOptions.ResetKeyboardAtResume = True;
nxagentOptions.Reset = 0; nxagentOptions.Reset = False;
nxagentOptions.RootX = 0; nxagentOptions.RootX = 0;
nxagentOptions.RootY = 0; nxagentOptions.RootY = 0;
...@@ -107,7 +109,7 @@ void nxagentInitOptions(void) ...@@ -107,7 +109,7 @@ void nxagentInitOptions(void)
nxagentOptions.ViewportXSpan = 0; nxagentOptions.ViewportXSpan = 0;
nxagentOptions.ViewportYSpan = 0; nxagentOptions.ViewportYSpan = 0;
nxagentOptions.DesktopResize = 1; nxagentOptions.DesktopResize = True;
nxagentOptions.Ratio = DONT_SCALE; nxagentOptions.Ratio = DONT_SCALE;
nxagentOptions.XRatio = DONT_SCALE; nxagentOptions.XRatio = DONT_SCALE;
...@@ -117,25 +119,25 @@ void nxagentInitOptions(void) ...@@ -117,25 +119,25 @@ void nxagentInitOptions(void)
nxagentOptions.FloatXRatio = 1.0; nxagentOptions.FloatXRatio = 1.0;
nxagentOptions.FloatYRatio = 1.0; nxagentOptions.FloatYRatio = 1.0;
nxagentOptions.UseDamage = 1; nxagentOptions.UseDamage = True;
nxagentOptions.Binder = UNDEFINED; nxagentOptions.Binder = False;
nxagentOptions.BinderOptions = NULL; nxagentOptions.BinderOptions = NULL;
nxagentOptions.Xdmcp = 0; nxagentOptions.Xdmcp = False;
nxagentOptions.DisplayBuffer = UNDEFINED; nxagentOptions.DisplayBuffer = UNDEFINED;
nxagentOptions.DisplayCoalescence = 0; nxagentOptions.DisplayCoalescence = 0;
nxagentOptions.Composite = 1; nxagentOptions.Composite = True;
nxagentOptions.IgnoreVisibility = 0; nxagentOptions.IgnoreVisibility = False;
nxagentOptions.ViewOnly = 0; nxagentOptions.ViewOnly = False;
nxagentOptions.Adaptive = 0; nxagentOptions.Adaptive = False;
nxagentOptions.Streaming = 0; nxagentOptions.Streaming = False;
nxagentOptions.DeferLevel = UNDEFINED; nxagentOptions.DeferLevel = UNDEFINED;
nxagentOptions.DeferTimeout = 200; nxagentOptions.DeferTimeout = 200;
...@@ -143,19 +145,19 @@ void nxagentInitOptions(void) ...@@ -143,19 +145,19 @@ void nxagentInitOptions(void)
nxagentOptions.TileWidth = UNDEFINED; nxagentOptions.TileWidth = UNDEFINED;
nxagentOptions.TileHeight = UNDEFINED; nxagentOptions.TileHeight = UNDEFINED;
nxagentOptions.Menu = 1; nxagentOptions.Menu = True;
nxagentOptions.MagicPixel = 1; nxagentOptions.MagicPixel = True;
nxagentOptions.ClientOs = UNDEFINED; nxagentOptions.ClientOs = UNDEFINED;
nxagentOptions.InhibitXkb = 1; nxagentOptions.InhibitXkb = True;
nxagentOptions.CopyBufferSize = COPY_UNLIMITED; nxagentOptions.CopyBufferSize = COPY_UNLIMITED;
nxagentOptions.ImageRateLimit = 0; nxagentOptions.ImageRateLimit = 0;
nxagentOptions.Xinerama = 1; nxagentOptions.Xinerama = True;
nxagentOptions.SleepTimeMillis = DEFAULT_SLEEP_TIME_MILLIS; nxagentOptions.SleepTimeMillis = DEFAULT_SLEEP_TIME_MILLIS;
......
...@@ -26,6 +26,12 @@ ...@@ -26,6 +26,12 @@
#ifndef __Options_H__ #ifndef __Options_H__
#define __Options_H__ #define __Options_H__
/* Bool is defined in Xlib.h but we do not want to include that here, so let's
clone the definition */
#ifndef Bool
#define Bool int
#endif
#ifndef True #ifndef True
#define True 1 #define True 1
#endif #endif
...@@ -122,33 +128,33 @@ typedef struct _AgentOptions ...@@ -122,33 +128,33 @@ typedef struct _AgentOptions
/* /*
* Is agent running in desktop mode? This is presently the default. * Is agent running in desktop mode? This is presently the default.
*/ */
int Desktop; Bool Desktop;
/* /*
* True if user activated rootless mode. * True if user activated rootless mode.
*/ */
int Rootless; Bool Rootless;
/* /*
* True for shadow mode. * True for shadow mode.
*/ */
int Shadow; Bool Shadow;
/* /*
* True if user activated persistent mode. * True if user activated persistent mode.
*/ */
int Persistent; Bool Persistent;
/* /*
* True if user activated fullscreen mode. * True if user activated fullscreen mode.
*/ */
int Fullscreen; Bool Fullscreen;
/* /*
* True if the fullscreen NX session will extend on all available * True if the fullscreen NX session will extend on all available
* screens. * screens.
*/ */
int AllScreens; Bool AllScreens;
/* /*
* Set to the auto-disconnect timeout, if the user activated this * Set to the auto-disconnect timeout, if the user activated this
...@@ -176,7 +182,7 @@ typedef struct _AgentOptions ...@@ -176,7 +182,7 @@ typedef struct _AgentOptions
/* /*
* Set if agent is running nested in another agent X server. * Set if agent is running nested in another agent X server.
*/ */
int Nested; Bool Nested;
/* /*
* Selected backing-store mode. * Selected backing-store mode.
...@@ -192,12 +198,12 @@ typedef struct _AgentOptions ...@@ -192,12 +198,12 @@ typedef struct _AgentOptions
* Enable agent to use the MITSHM extension in path from remote * Enable agent to use the MITSHM extension in path from remote
* proxy to the real X server. * proxy to the real X server.
*/ */
int SharedMemory; Bool SharedMemory;
/* /*
* Enable agent to use shared Pixmaps * Enable agent to use shared Pixmaps
*/ */
int SharedPixmaps; Bool SharedPixmaps;
/* /*
* Enable agent to propagate keyboard and pointer device * Enable agent to propagate keyboard and pointer device
...@@ -214,12 +220,12 @@ typedef struct _AgentOptions ...@@ -214,12 +220,12 @@ typedef struct _AgentOptions
* Resuming keyboard device corrects keymap if session migrates * Resuming keyboard device corrects keymap if session migrates
* across platforms with different keycode layout. * across platforms with different keycode layout.
*/ */
int ResetKeyboardAtResume; Bool ResetKeyboardAtResume;
/* /*
* Reset server when the last client disconnects. * Reset server when the last client disconnects.
*/ */
int Reset; Bool Reset;
/* /*
* Geometry of the agent root window, relative to the agent default * Geometry of the agent root window, relative to the agent default
...@@ -236,7 +242,7 @@ typedef struct _AgentOptions ...@@ -236,7 +242,7 @@ typedef struct _AgentOptions
* True if the user can resize the desktop by dragging the window * True if the user can resize the desktop by dragging the window
* border. * border.
*/ */
int DesktopResize; Bool DesktopResize;
/* /*
* The scaling ratio of the shadow agent. * The scaling ratio of the shadow agent.
...@@ -248,19 +254,19 @@ typedef struct _AgentOptions ...@@ -248,19 +254,19 @@ typedef struct _AgentOptions
/* /*
* The shadow agent uses the Damage extension. * The shadow agent uses the Damage extension.
*/ */
int UseDamage; Bool UseDamage;
/* /*
* Was the agent run with the -B option? * Was the agent run with the -B option?
*/ */
int Binder; Bool Binder;
char *BinderOptions; char *BinderOptions;
/* /*
* Set if the agent has to connect to a desktop manager to start the * Set if the agent has to connect to a desktop manager to start the
* session. * session.
*/ */
int Xdmcp; Bool Xdmcp;
/* /*
* Size of the Xlib display buffer. The default is set according to * Size of the Xlib display buffer. The default is set according to
...@@ -276,31 +282,31 @@ typedef struct _AgentOptions ...@@ -276,31 +282,31 @@ typedef struct _AgentOptions
/* /*
* Use the composite extension when available on the remote display. * Use the composite extension when available on the remote display.
*/ */
int Composite; Bool Composite;
/* /*
* If set, don't skip internal operations when the agent window is * If set, don't skip internal operations when the agent window is
* not fully visible. * not fully visible.
*/ */
int IgnoreVisibility; Bool IgnoreVisibility;
/* /*
* If set, prevent the shadow session to interact with master * If set, prevent the shadow session to interact with master
* display. * display.
*/ */
int ViewOnly; Bool ViewOnly;
/* /*
* If true select a lossy or lossless compression method based on * If true select a lossy or lossless compression method based on
* the characteristics of the image. * the characteristics of the image.
*/ */
int Adaptive; Bool Adaptive;
/* /*
* Stream the images and update the display when the image has been * Stream the images and update the display when the image has been
* completely transerred. * completely transerred.
*/ */
int Streaming; Bool Streaming;
/* /*
* Use a lazy approach in updating the remote display. This means * Use a lazy approach in updating the remote display. This means
...@@ -323,12 +329,12 @@ typedef struct _AgentOptions ...@@ -323,12 +329,12 @@ typedef struct _AgentOptions
/* /*
* Enabling/disabling the pulldown menu. * Enabling/disabling the pulldown menu.
*/ */
int Menu; Bool Menu;
/* /*
* Enabling/disabling the magic pixel. * Enabling/disabling the magic pixel.
*/ */
int MagicPixel; Bool MagicPixel;
/* /*
* Specify the Operative System of the client. * Specify the Operative System of the client.
...@@ -338,7 +344,7 @@ typedef struct _AgentOptions ...@@ -338,7 +344,7 @@ typedef struct _AgentOptions
/* /*
* Inhibit some XKEYBOARD requests. * Inhibit some XKEYBOARD requests.
*/ */
int InhibitXkb; Bool InhibitXkb;
/* /*
* Maximum number of bytes that can be pasted from an NX session * Maximum number of bytes that can be pasted from an NX session
...@@ -355,7 +361,7 @@ typedef struct _AgentOptions ...@@ -355,7 +361,7 @@ typedef struct _AgentOptions
* True if agent should not exit if there are no clients in rootless * True if agent should not exit if there are no clients in rootless
* mode * mode
*/ */
int NoRootlessExit; Bool NoRootlessExit;
/* /*
* Store if the user wants Xinerama. There are variables called * Store if the user wants Xinerama. There are variables called
...@@ -365,7 +371,7 @@ typedef struct _AgentOptions ...@@ -365,7 +371,7 @@ typedef struct _AgentOptions
* the user preference provided by the -/+(rr)xinerama parameter(s) * the user preference provided by the -/+(rr)xinerama parameter(s)
* before initializing those extensions. * before initializing those extensions.
*/ */
int Xinerama; Bool Xinerama;
/* /*
* Sleep delay in milliseconds. * Sleep delay in milliseconds.
...@@ -386,7 +392,7 @@ typedef struct _AgentOptions ...@@ -386,7 +392,7 @@ typedef struct _AgentOptions
* True if agent should grab the input in windowed mode whenever the * True if agent should grab the input in windowed mode whenever the
* agent window gets the focus * agent window gets the focus
*/ */
int AutoGrab; /* Should be Bool but I do not want to include Xlib.h here */ Bool AutoGrab;
} AgentOptionsRec; } AgentOptionsRec;
......
...@@ -77,7 +77,7 @@ while (0) ...@@ -77,7 +77,7 @@ while (0)
#define breakOnBlocking(mask) \ #define breakOnBlocking(mask) \
(((mask) != NEVER_BREAK) && ((mask) & BLOCKING_BREAK) && \ (((mask) != NEVER_BREAK) && ((mask) & BLOCKING_BREAK) && \
nxagentBlocking == 1) nxagentBlocking)
#define breakOnCongestion(mask) \ #define breakOnCongestion(mask) \
(((mask) != NEVER_BREAK) && ((mask) & CONGESTION_BREAK) && \ (((mask) != NEVER_BREAK) && ((mask) & CONGESTION_BREAK) && \
...@@ -97,7 +97,7 @@ while (0) ...@@ -97,7 +97,7 @@ while (0)
nxagentUserInput(NULL) == 1) nxagentUserInput(NULL) == 1)
#define canBreakOnTimeout(mask) \ #define canBreakOnTimeout(mask) \
(((mask) != NEVER_BREAK) && nxagentOption(Shadow) == 0) (((mask) != NEVER_BREAK) && !nxagentOption(Shadow))
/* /*
* Macros defining the conditions to * Macros defining the conditions to
...@@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE ...@@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
(nxagentSplitTrap == 0 && \ (!nxagentSplitTrap && \
nxagentOption(DeferLevel) > 0) nxagentOption(DeferLevel) > 0)
/* /*
...@@ -164,7 +164,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE ...@@ -164,7 +164,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
#define NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask) \ #define NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask) \
((nxagentCorruptedWindows == 0 && nxagentCorruptedPixmaps > 0 && \ ((nxagentCorruptedWindows == 0 && nxagentCorruptedPixmaps > 0 && \
nxagentCongestion == 0 && nxagentBlocking == 0) || \ nxagentCongestion == 0 && !nxagentBlocking) || \
mask == NEVER_BREAK) mask == NEVER_BREAK)
/* /*
...@@ -173,8 +173,8 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE ...@@ -173,8 +173,8 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
*/ */
#define NXAGENT_SHOULD_SYNCHRONIZE_WINDOW(pDrawable) \ #define NXAGENT_SHOULD_SYNCHRONIZE_WINDOW(pDrawable) \
(nxagentWindowIsVisible((WindowPtr) pDrawable) == 1 && \ (nxagentWindowIsVisible((WindowPtr) pDrawable) && \
(nxagentDefaultWindowIsVisible() == 1 || nxagentCompositeEnable == 1)) (nxagentDefaultWindowIsVisible() || nxagentCompositeEnable == 1))
#define MINIMUM_PIXMAP_USAGE_COUNTER 2 #define MINIMUM_PIXMAP_USAGE_COUNTER 2
......
...@@ -200,7 +200,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -200,7 +200,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
* checksum. * checksum.
*/ */
if (width != 0 && height != 0 && nxagentGCTrap == 0) if (width != 0 && height != 0 && !nxagentGCTrap)
{ {
pPixmapPriv -> id = XCreatePixmap(nxagentDisplay, pPixmapPriv -> id = XCreatePixmap(nxagentDisplay,
nxagentDefaultWindows[pScreen -> myNum], nxagentDefaultWindows[pScreen -> myNum],
...@@ -1064,7 +1064,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, ...@@ -1064,7 +1064,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
int wPict, int hPict) int wPict, int hPict)
{ {
if (pDrawable -> type == DRAWABLE_PIXMAP && if (pDrawable -> type == DRAWABLE_PIXMAP &&
nxagentIsShmPixmap((PixmapPtr) pDrawable) == 1) nxagentIsShmPixmap((PixmapPtr) pDrawable))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentSynchronizeShmPixmap: WARNING! Synchronizing shared pixmap at [%p].\n", fprintf(stderr, "nxagentSynchronizeShmPixmap: WARNING! Synchronizing shared pixmap at [%p].\n",
......
...@@ -84,7 +84,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) ...@@ -84,7 +84,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
* leaves the agent's window. * leaves the agent's window.
*/ */
if (nxagentOption(DeviceControl) == True) if (nxagentOption(DeviceControl))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "%s: WARNING! Propagating changes to pointer settings.\n", __func__); fprintf(stderr, "%s: WARNING! Propagating changes to pointer settings.\n", __func__);
......
...@@ -220,7 +220,7 @@ int nxagentHandleConnectionStates(void) ...@@ -220,7 +220,7 @@ int nxagentHandleConnectionStates(void)
} }
} }
if (nxagentNeedConnectionChange() == 1) if (nxagentNeedConnectionChange())
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentHandleConnectionStates: Calling nxagentHandleConnectionChanges " fprintf(stderr, "nxagentHandleConnectionStates: Calling nxagentHandleConnectionChanges "
...@@ -240,7 +240,7 @@ TODO: This should be reset only when the state became SESSION_DOWN. ...@@ -240,7 +240,7 @@ TODO: This should be reset only when the state became SESSION_DOWN.
*/ */
nxagentException.ioError = 0; nxagentException.ioError = 0;
if (nxagentOption(Persistent) == 1 && nxagentSessionState != SESSION_STARTING) if (nxagentOption(Persistent) && nxagentSessionState != SESSION_STARTING)
{ {
if (nxagentSessionState == SESSION_UP) if (nxagentSessionState == SESSION_UP)
{ {
...@@ -458,7 +458,7 @@ Bool nxagentReconnectSession(void) ...@@ -458,7 +458,7 @@ Bool nxagentReconnectSession(void)
nxagentProcessOptions(nxagentOptionsFilenameOrString); nxagentProcessOptions(nxagentOptionsFilenameOrString);
if (nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]) == 0) if (!nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentReconnectSession: WARNING! Failed display reconnection.\n"); fprintf(stderr, "nxagentReconnectSession: WARNING! Failed display reconnection.\n");
...@@ -468,7 +468,7 @@ Bool nxagentReconnectSession(void) ...@@ -468,7 +468,7 @@ Bool nxagentReconnectSession(void)
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP]) == 0) if (!nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP]))
{ {
failedStep = SCREEN_STEP; failedStep = SCREEN_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
...@@ -478,9 +478,9 @@ Bool nxagentReconnectSession(void) ...@@ -478,9 +478,9 @@ Bool nxagentReconnectSession(void)
nxagentListRemoteFonts("*", nxagentMaxFontNames); nxagentListRemoteFonts("*", nxagentMaxFontNames);
if (nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP]) == 0) if (!nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP]))
{ {
if (nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP]) == 0) if (!nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP]))
{ {
failedStep = FONT_STEP; failedStep = FONT_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
...@@ -515,26 +515,26 @@ Bool nxagentReconnectSession(void) ...@@ -515,26 +515,26 @@ Bool nxagentReconnectSession(void)
nxagentEmptyBSPixmapList(); nxagentEmptyBSPixmapList();
/* FIXME: nxagentReconnectAllPixmaps will always return 1 */ /* FIXME: nxagentReconnectAllPixmaps will always return 1 */
if (nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP]) == 0) if (!nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP]))
{ {
failedStep = PIXMAP_STEP; failedStep = PIXMAP_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP]) == 0) if (!nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP]))
{ {
failedStep = GC_STEP; failedStep = GC_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP]) == 0) if (!nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP]))
{ {
failedStep = COLORMAP_STEP; failedStep = COLORMAP_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP]) == 0) if (!nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP]))
{ {
failedStep = WINDOW_STEP; failedStep = WINDOW_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
...@@ -542,32 +542,32 @@ Bool nxagentReconnectSession(void) ...@@ -542,32 +542,32 @@ Bool nxagentReconnectSession(void)
if (nxagentRenderEnable) if (nxagentRenderEnable)
{ {
if (nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP]) == 0) if (!nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP]))
{ {
failedStep = GLYPHSET_STEP; failedStep = GLYPHSET_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP]) == 0) if (!nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP]))
{ {
failedStep = PICTFORMAT_STEP; failedStep = PICTFORMAT_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP]) == 0) if (!nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP]))
{ {
failedStep = PICTURE_STEP; failedStep = PICTURE_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
} }
if (nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP]) == 0) if (!nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP]))
{ {
failedStep = CURSOR_STEP; failedStep = CURSOR_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
} }
if (nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP]) == 0) if (!nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP]))
{ {
failedStep = WINDOW_STEP; failedStep = WINDOW_STEP;
goto nxagentReconnectError; goto nxagentReconnectError;
...@@ -588,7 +588,7 @@ Bool nxagentReconnectSession(void) ...@@ -588,7 +588,7 @@ Bool nxagentReconnectSession(void)
} }
/* Reset the keyboard only if we detect any changes. */ /* Reset the keyboard only if we detect any changes. */
if (nxagentOption(ResetKeyboardAtResume) == 1) if (nxagentOption(ResetKeyboardAtResume))
{ {
if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 ||
...@@ -598,7 +598,7 @@ Bool nxagentReconnectSession(void) ...@@ -598,7 +598,7 @@ Bool nxagentReconnectSession(void)
if (nxagentResetKeyboard() == 0) if (nxagentResetKeyboard() == 0)
{ {
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "%s: Failed to reset keyboard device.\n", __func__); fprintf(stderr, "%s: Failed to reset keyboard device.\n", __func__);
} }
...@@ -616,7 +616,7 @@ Bool nxagentReconnectSession(void) ...@@ -616,7 +616,7 @@ Bool nxagentReconnectSession(void)
} }
} }
nxagentXkbState.Initialized = 0; nxagentXkbState.Initialized = False;
SAFE_free(nxagentOldKeyboard); SAFE_free(nxagentOldKeyboard);
...@@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void) ...@@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void)
nxagentRedirectDefaultWindows(); nxagentRedirectDefaultWindows();
if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True) if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama))
{ {
nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True); nxagentOption(RootHeight), True);
...@@ -699,7 +699,7 @@ nxagentReconnectError: ...@@ -699,7 +699,7 @@ nxagentReconnectError:
if (*nxagentGetReconnectError() == '\0') if (*nxagentGetReconnectError() == '\0')
{ {
#ifdef WARNING #ifdef WARNING
if (nxagentVerbose == 1) if (nxagentVerbose)
{ {
fprintf(stderr, "nxagentReconnectSession: WARNING! The reconnect error message is not set. Failed step is [%d].\n", fprintf(stderr, "nxagentReconnectSession: WARNING! The reconnect error message is not set. Failed step is [%d].\n",
failedStep); failedStep);
......
...@@ -925,7 +925,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -925,7 +925,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPRepeat) if (mask & CPRepeat)
{ {
attributes.repeat = (Bool)pPicture -> repeat; attributes.repeat = (Bool)pPicture -> repeat;
if (nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat))
{ {
valuemask |= CPRepeat; valuemask |= CPRepeat;
nxagentSetPictureRemoteValue(pPicture, repeat, attributes.repeat); nxagentSetPictureRemoteValue(pPicture, repeat, attributes.repeat);
...@@ -935,7 +935,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -935,7 +935,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaMap) if (mask & CPAlphaMap)
{ {
attributes.alpha_map = nxagentPicturePriv(pPicture -> alphaMap) -> picture; attributes.alpha_map = nxagentPicturePriv(pPicture -> alphaMap) -> picture;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map))
{ {
valuemask |= CPAlphaMap; valuemask |= CPAlphaMap;
nxagentSetPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map); nxagentSetPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map);
...@@ -945,7 +945,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -945,7 +945,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaXOrigin) if (mask & CPAlphaXOrigin)
{ {
attributes.alpha_x_origin = pPicture -> alphaOrigin.x; attributes.alpha_x_origin = pPicture -> alphaOrigin.x;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin))
{ {
valuemask |= CPAlphaXOrigin; valuemask |= CPAlphaXOrigin;
nxagentSetPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin); nxagentSetPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin);
...@@ -955,7 +955,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -955,7 +955,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaYOrigin) if (mask & CPAlphaYOrigin)
{ {
attributes.alpha_y_origin = pPicture -> alphaOrigin.y; attributes.alpha_y_origin = pPicture -> alphaOrigin.y;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin))
{ {
valuemask |= CPAlphaYOrigin; valuemask |= CPAlphaYOrigin;
nxagentSetPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin); nxagentSetPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin);
...@@ -965,7 +965,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -965,7 +965,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPClipXOrigin) if (mask & CPClipXOrigin)
{ {
attributes.clip_x_origin = pPicture -> clipOrigin.x; attributes.clip_x_origin = pPicture -> clipOrigin.x;
if (nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin))
{ {
valuemask |= CPClipXOrigin; valuemask |= CPClipXOrigin;
nxagentSetPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin); nxagentSetPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin);
...@@ -975,7 +975,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -975,7 +975,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPClipYOrigin) if (mask & CPClipYOrigin)
{ {
attributes.clip_y_origin = pPicture -> clipOrigin.y; attributes.clip_y_origin = pPicture -> clipOrigin.y;
if (nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin))
{ {
valuemask |= CPClipYOrigin; valuemask |= CPClipYOrigin;
nxagentSetPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin); nxagentSetPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin);
...@@ -985,7 +985,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -985,7 +985,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPGraphicsExposure) if (mask & CPGraphicsExposure)
{ {
attributes.graphics_exposures = (Bool)pPicture -> graphicsExposures; attributes.graphics_exposures = (Bool)pPicture -> graphicsExposures;
if (nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures))
{ {
valuemask |= CPGraphicsExposure; valuemask |= CPGraphicsExposure;
nxagentSetPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures); nxagentSetPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures);
...@@ -995,7 +995,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -995,7 +995,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPSubwindowMode) if (mask & CPSubwindowMode)
{ {
attributes.subwindow_mode = pPicture -> subWindowMode; attributes.subwindow_mode = pPicture -> subWindowMode;
if (nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode))
{ {
valuemask |= CPSubwindowMode; valuemask |= CPSubwindowMode;
nxagentSetPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode); nxagentSetPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode);
...@@ -1021,7 +1021,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -1021,7 +1021,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPPolyEdge) if (mask & CPPolyEdge)
{ {
attributes.poly_edge = pPicture -> polyEdge; attributes.poly_edge = pPicture -> polyEdge;
if (nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge))
{ {
valuemask |= CPPolyEdge; valuemask |= CPPolyEdge;
nxagentSetPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge); nxagentSetPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge);
...@@ -1031,7 +1031,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -1031,7 +1031,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPPolyMode) if (mask & CPPolyMode)
{ {
attributes.poly_mode = pPicture -> polyMode; attributes.poly_mode = pPicture -> polyMode;
if (nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode))
{ {
valuemask |= CPPolyMode; valuemask |= CPPolyMode;
nxagentSetPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode); nxagentSetPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode);
...@@ -1041,7 +1041,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -1041,7 +1041,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPDither) if (mask & CPDither)
{ {
attributes.dither = pPicture -> dither; attributes.dither = pPicture -> dither;
if (nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither))
{ {
valuemask |= CPDither; valuemask |= CPDither;
nxagentSetPictureRemoteValue(pPicture, dither, attributes.dither); nxagentSetPictureRemoteValue(pPicture, dither, attributes.dither);
...@@ -1051,7 +1051,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -1051,7 +1051,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPComponentAlpha) if (mask & CPComponentAlpha)
{ {
attributes.component_alpha = pPicture -> componentAlpha; attributes.component_alpha = pPicture -> componentAlpha;
if (nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha) == 0) if (!nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha))
{ {
valuemask |= CPComponentAlpha; valuemask |= CPComponentAlpha;
nxagentSetPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha); nxagentSetPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha);
...@@ -1314,7 +1314,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1314,7 +1314,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
RegionPtr pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1, RegionPtr pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1,
glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1); glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1);
if (RegionNil(pRegion) == 1) if (RegionNil(pRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n", fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n",
...@@ -2252,7 +2252,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2) ...@@ -2252,7 +2252,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2)
{ {
GlyphSetPtr pGly = (GlyphSetPtr) p0; GlyphSetPtr pGly = (GlyphSetPtr) p0;
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
int i; int i;
XRenderPictFormat *pForm = NULL; XRenderPictFormat *pForm = NULL;
......
...@@ -176,7 +176,7 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix); ...@@ -176,7 +176,7 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix);
* These variables are for shadowing feature. * These variables are for shadowing feature.
*/ */
int nxagentShadowResize = 0; Bool nxagentShadowResize = False;
WindowPtr nxagentShadowWindowPtr = NULL; WindowPtr nxagentShadowWindowPtr = NULL;
...@@ -800,6 +800,9 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix) ...@@ -800,6 +800,9 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix)
fprintf(stderr, "%s | Fullscreen is %s.\n", prefix, fprintf(stderr, "%s | Fullscreen is %s.\n", prefix,
nxagentOption(Fullscreen) ? "ON" : "OFF"); nxagentOption(Fullscreen) ? "ON" : "OFF");
fprintf(stderr, "%s | AllScreens is %s.\n", prefix,
nxagentOption(AllScreens) ? "ON" : "OFF");
fprintf(stderr, "%s | Desktop resize mode is %s.\n", prefix, fprintf(stderr, "%s | Desktop resize mode is %s.\n", prefix,
nxagentOption(DesktopResize) ? "ON" : "OFF"); nxagentOption(DesktopResize) ? "ON" : "OFF");
...@@ -846,7 +849,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -846,7 +849,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
pScreen->myNum); pScreen->myNum);
#endif #endif
if (nxagentRenderEnable && nxagentReconnectTrap == False) if (nxagentRenderEnable && !nxagentReconnectTrap)
{ {
PictureScreenPrivateIndex = -1; PictureScreenPrivateIndex = -1;
} }
...@@ -901,7 +904,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -901,7 +904,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* user geometry then. * user geometry then.
*/ */
if (nxagentReconnectTrap == False && !nxagentOption(Rootless)) if (!nxagentReconnectTrap && !nxagentOption(Rootless))
{ {
if (nxagentUserGeometry.flag & XValue) if (nxagentUserGeometry.flag & XValue)
{ {
...@@ -945,7 +948,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -945,7 +948,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* the screen if we are either in rootless or in fullscreen mode. * the screen if we are either in rootless or in fullscreen mode.
*/ */
if (nxagentOption(Rootless) == False && !nxagentWMIsRunning) if (!nxagentOption(Rootless) && !nxagentWMIsRunning)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n"); fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n");
...@@ -954,7 +957,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -954,7 +957,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(Fullscreen, True); nxagentChangeOption(Fullscreen, True);
if (nxagentOption(ClientOs) == ClientOsWinnt && if (nxagentOption(ClientOs) == ClientOsWinnt &&
(nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup))
{ {
NXSetExposeParameters(nxagentDisplay, 0, 0, 0); NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
} }
...@@ -963,7 +966,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -963,7 +966,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
if (nxagentOption(Fullscreen) && if (nxagentOption(Fullscreen) &&
nxagentWMIsRunning && nxagentWMIsRunning &&
nxagentReconnectTrap && nxagentReconnectTrap &&
nxagentResizeDesktopAtStartup == False && !nxagentResizeDesktopAtStartup &&
nxagentXServerGeometryChanged()) nxagentXServerGeometryChanged())
{ {
#ifdef TEST #ifdef TEST
...@@ -993,7 +996,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -993,7 +996,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(Height, h); nxagentChangeOption(Height, h);
/* first time screen initialization or resize during reconnect */ /* first time screen initialization or resize during reconnect */
if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup) if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)
{ {
if (nxagentOption(RootWidth) >= w) if (nxagentOption(RootWidth) >= w)
{ {
...@@ -1046,7 +1049,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -1046,7 +1049,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* screen is initialized for the first time. * screen is initialized for the first time.
*/ */
if (nxagentReconnectTrap == False) if (!nxagentReconnectTrap)
{ {
nxagentChangeOption(RootX, 0); nxagentChangeOption(RootX, 0);
nxagentChangeOption(RootY, 0); nxagentChangeOption(RootY, 0);
...@@ -1085,7 +1088,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -1085,7 +1088,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* the root window isn't bigger than the X server root window.. * the root window isn't bigger than the X server root window..
*/ */
if (nxagentReconnectTrap == False) if (!nxagentReconnectTrap)
{ {
if ((nxagentOption(RootWidth) < w) && if ((nxagentOption(RootWidth) < w) &&
!(nxagentUserGeometry.flag & WidthValue)) !(nxagentUserGeometry.flag & WidthValue))
...@@ -1117,7 +1120,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) ...@@ -1117,7 +1120,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth));
nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight));
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
if (nxagentOption(Persistent)) if (nxagentOption(Persistent))
{ {
...@@ -1654,8 +1657,8 @@ N/A ...@@ -1654,8 +1657,8 @@ N/A
nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:"); nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:");
#endif #endif
if (nxagentDoFullGeneration == 1 || if (nxagentDoFullGeneration ||
nxagentReconnectTrap == 1) nxagentReconnectTrap)
{ {
unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap; unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap;
XSetWindowAttributes attributes = { XSetWindowAttributes attributes = {
...@@ -1664,13 +1667,13 @@ N/A ...@@ -1664,13 +1667,13 @@ N/A
.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)) .colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen))
}; };
if (nxagentOption(AllScreens) == 1) if (nxagentOption(AllScreens))
{ {
valuemask |= CWOverrideRedirect; valuemask |= CWOverrideRedirect;
attributes.override_redirect = True; attributes.override_redirect = True;
} }
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
if (nxagentReconnectTrap) if (nxagentReconnectTrap)
{ {
...@@ -1729,7 +1732,7 @@ N/A ...@@ -1729,7 +1732,7 @@ N/A
pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]); pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]);
#endif #endif
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask}; XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask};
...@@ -1833,7 +1836,7 @@ N/A ...@@ -1833,7 +1836,7 @@ N/A
sizeHints->width = nxagentOption(RootWidth); sizeHints->width = nxagentOption(RootWidth);
sizeHints->height = nxagentOption(RootHeight); sizeHints->height = nxagentOption(RootHeight);
if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen))
{ {
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
...@@ -1950,7 +1953,7 @@ N/A ...@@ -1950,7 +1953,7 @@ N/A
/* FIXME: This doing the same thing in both cases. The /* FIXME: This doing the same thing in both cases. The
comments do not seem accurate (anymore?) */ comments do not seem accurate (anymore?) */
if (nxagentOption(Rootless) == False) if (!nxagentOption(Rootless))
{ {
/* /*
* Set the WM_DELETE_WINDOW protocol for the main agent * Set the WM_DELETE_WINDOW protocol for the main agent
...@@ -1998,7 +2001,7 @@ N/A ...@@ -1998,7 +2001,7 @@ N/A
* change the real X server's keyboard and pointer settings. * change the real X server's keyboard and pointer settings.
*/ */
if (nxagentOption(DeviceControl) == False) if (!nxagentOption(DeviceControl))
{ {
fprintf(stderr, "Info: Not using local device configuration changes.\n"); fprintf(stderr, "Info: Not using local device configuration changes.\n");
} }
...@@ -2362,7 +2365,7 @@ FIXME: We should try to restore the previously ...@@ -2362,7 +2365,7 @@ FIXME: We should try to restore the previously
* Change agent window size and size hints. * Change agent window size and size hints.
*/ */
if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)) if (!(nxagentOption(Fullscreen) || nxagentOption(AllScreens)))
{ {
nxagentSetWMNormalHints(pScreen->myNum, width, height); nxagentSetWMNormalHints(pScreen->myNum, width, height);
...@@ -2374,7 +2377,7 @@ FIXME: We should try to restore the previously ...@@ -2374,7 +2377,7 @@ FIXME: We should try to restore the previously
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height);
} }
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height); fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height);
...@@ -2529,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2529,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
NXShadowSetDisplayUid(nxagentShadowUid); NXShadowSetDisplayUid(nxagentShadowUid);
} }
if (nxagentOption(UseDamage) == 0) if (nxagentOption(UseDamage))
{ {
NXShadowDisableDamage(); NXShadowDisableDamage();
} }
...@@ -2566,7 +2569,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) ...@@ -2566,7 +2569,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
return -1; return -1;
} }
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth, nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth,
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight); HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight);
...@@ -2900,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended) ...@@ -2900,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended)
{ {
*suspended = 0; *suspended = 0;
if (RegionNil(&nxagentShadowUpdateRegion) == 1) if (RegionNil(&nxagentShadowUpdateRegion))
{ {
return 0; return 0;
} }
...@@ -4396,7 +4399,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height) ...@@ -4396,7 +4399,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
sizeHints->width = width; sizeHints->width = width;
sizeHints->height = height; sizeHints->height = height;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
......
...@@ -67,7 +67,7 @@ extern RegionRec nxagentShadowUpdateRegion; ...@@ -67,7 +67,7 @@ extern RegionRec nxagentShadowUpdateRegion;
extern WindowPtr nxagentShadowWindowPtr; extern WindowPtr nxagentShadowWindowPtr;
extern int nxagentShadowResize; extern Bool nxagentShadowResize;
extern short nxagentShadowUid; extern short nxagentShadowUid;
......
...@@ -612,7 +612,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -612,7 +612,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion)
RegionIntersect(&tmpRegion, pResource -> region, pRegion); RegionIntersect(&tmpRegion, pResource -> region, pRegion);
if (RegionNil(&tmpRegion) == 0) if (!RegionNil(&tmpRegion))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid " fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid "
...@@ -829,11 +829,11 @@ static Bool nxagentWaitSplitPredicate(Display *disp, XEvent *event, XPointer ptr ...@@ -829,11 +829,11 @@ static Bool nxagentWaitSplitPredicate(Display *disp, XEvent *event, XPointer ptr
event -> xclient.format == 32); event -> xclient.format == 32);
} }
int nxagentWaitSplitEvent(int resource) Bool nxagentWaitSplitEvent(int resource)
{ {
XEvent event; XEvent event;
int split = 0; Bool split = 0;
/* /*
* Don't flush the link. We only want to query the NX transport to * Don't flush the link. We only want to query the NX transport to
...@@ -890,7 +890,7 @@ int nxagentWaitSplitEvent(int resource) ...@@ -890,7 +890,7 @@ int nxagentWaitSplitEvent(int resource)
{ {
nxagentHandleStartSplitEvent(resource); nxagentHandleStartSplitEvent(resource);
split = 1; split = True;
break; break;
} }
...@@ -1074,7 +1074,7 @@ void nxagentHandleEndSplitEvent(int resource) ...@@ -1074,7 +1074,7 @@ void nxagentHandleEndSplitEvent(int resource)
if (pResource -> drawable != NULL && if (pResource -> drawable != NULL &&
pResource -> region != NullRegion) pResource -> region != NullRegion)
{ {
if (RegionNil(pResource -> region) == 0) if (!RegionNil(pResource -> region))
{ {
RegionSubtract( RegionSubtract(
nxagentCorruptedRegion(pResource -> drawable), nxagentCorruptedRegion(pResource -> drawable),
......
...@@ -378,7 +378,7 @@ Bool nxagentCreateWindow(WindowPtr pWin) ...@@ -378,7 +378,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
nxagentWindowPriv(pWin) -> corruptedTimestamp = 0; nxagentWindowPriv(pWin) -> corruptedTimestamp = 0;
nxagentWindowPriv(pWin) -> splitResource = NULL; nxagentWindowPriv(pWin) -> splitResource = NULL;
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
nxagentWindowPriv(pWin) -> isMapped = 0; nxagentWindowPriv(pWin) -> isMapped = 0;
...@@ -548,7 +548,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -548,7 +548,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
{ {
nxagentPrivWindowPtr pWindowPriv; nxagentPrivWindowPtr pWindowPriv;
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return 1; return 1;
} }
...@@ -643,7 +643,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -643,7 +643,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
} }
if (nxagentOption(Rootless) && nxagentRootlessDialogPid == 0 && if (nxagentOption(Rootless) && nxagentRootlessDialogPid == 0 &&
nxagentLastWindowDestroyed == False && nxagentSomeWindowsAreMapped() == False) !nxagentLastWindowDestroyed && nxagentSomeWindowsAreMapped() == False)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDestroyWindow: Last mapped window as been destroyed.\n"); fprintf(stderr, "nxagentDestroyWindow: Last mapped window as been destroyed.\n");
...@@ -672,7 +672,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -672,7 +672,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
*/ */
Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return True; return True;
} }
...@@ -690,7 +690,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) ...@@ -690,7 +690,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return; return;
} }
...@@ -700,7 +700,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) ...@@ -700,7 +700,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
{ {
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless))
{ {
return; return;
} }
...@@ -901,9 +901,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -901,9 +901,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e);
nxagentFullscreenWindow = w; nxagentFullscreenWindow = w;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True); HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True);
...@@ -952,12 +952,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -952,12 +952,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentIconWindow = nxagentFullscreenWindow = None; nxagentIconWindow = nxagentFullscreenWindow = None;
if (nxagentOption(DesktopResize) == 1) if (nxagentOption(DesktopResize))
{ {
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
if (nxagentOption(Shadow) == 0) if (!nxagentOption(Shadow))
{ {
nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True); nxagentOption(RootHeight), True);
...@@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) ...@@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption(Width, nxagentOption(SavedWidth)); nxagentChangeOption(Width, nxagentOption(SavedWidth));
nxagentChangeOption(Height, nxagentOption(SavedHeight)); nxagentChangeOption(Height, nxagentOption(SavedHeight));
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1) if (nxagentOption(Shadow) && nxagentOption(DesktopResize))
{ {
nxagentShadowAdaptToRatio(); nxagentShadowAdaptToRatio();
} }
...@@ -1250,7 +1250,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1250,7 +1250,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x; int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x;
int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y; int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y;
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n"); fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n");
...@@ -1259,8 +1259,8 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1259,8 +1259,8 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
return; return;
} }
if (nxagentOption(Rootless) == 1 && if (nxagentOption(Rootless) &&
nxagentWindowTopLevel(pWin) == 1) nxagentWindowTopLevel(pWin))
{ {
mask &= ~(CWSibling | CWStackMode); mask &= ~(CWSibling | CWStackMode);
} }
...@@ -1877,7 +1877,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired) ...@@ -1877,7 +1877,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired)
-+ */ -+ */
Bool nxagentRealizeWindow(WindowPtr pWin) Bool nxagentRealizeWindow(WindowPtr pWin)
{ {
if (nxagentScreenTrap == 1) if (nxagentScreenTrap)
{ {
return True; return True;
} }
...@@ -2146,7 +2146,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo ...@@ -2146,7 +2146,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
if (nxagentSessionState != SESSION_DOWN) if (nxagentSessionState != SESSION_DOWN)
{ {
if (nxagentExposeArrayIsInitialized == 0) if (!nxagentExposeArrayIsInitialized)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentWindowExposures: Initializing expose queue.\n"); fprintf(stderr, "nxagentWindowExposures: Initializing expose queue.\n");
...@@ -2171,7 +2171,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo ...@@ -2171,7 +2171,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
nxagentInitRemoteExposeRegion(); nxagentInitRemoteExposeRegion();
nxagentExposeArrayIsInitialized = 1; nxagentExposeArrayIsInitialized = True;
} }
RegionRec temp; RegionRec temp;
...@@ -2195,7 +2195,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo ...@@ -2195,7 +2195,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
RegionUnion(&temp, &temp, other_exposed); RegionUnion(&temp, &temp, other_exposed);
} }
if (RegionNil(&temp) == 0) if (!RegionNil(&temp))
{ {
RegionTranslate(&temp, RegionTranslate(&temp,
-(pWin -> drawable.x), -(pWin -> drawable.y)); -(pWin -> drawable.x), -(pWin -> drawable.y));
...@@ -2500,7 +2500,7 @@ void nxagentRefreshWindows(WindowPtr pWin) ...@@ -2500,7 +2500,7 @@ void nxagentRefreshWindows(WindowPtr pWin)
void nxagentUnmapWindows(void) void nxagentUnmapWindows(void)
{ {
if (nxagentOption(Fullscreen) == 1) if (nxagentOption(Fullscreen))
{ {
for (int i = 0; i < screenInfo.numScreens; i++) for (int i = 0; i < screenInfo.numScreens; i++)
{ {
...@@ -2527,7 +2527,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2527,7 +2527,7 @@ void nxagentMapDefaultWindows(void)
*/ */
MapWindow(pWin, serverClient); MapWindow(pWin, serverClient);
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
/* /*
* Show the NX splash screen. * Show the NX splash screen.
...@@ -2547,7 +2547,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2547,7 +2547,7 @@ void nxagentMapDefaultWindows(void)
* Windows client. * Windows client.
*/ */
if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning) if (!nxagentOption(Shadow) || !nxagentWMIsRunning)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n", fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n",
...@@ -2556,7 +2556,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2556,7 +2556,7 @@ void nxagentMapDefaultWindows(void)
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning) if (nxagentOption(Fullscreen) && nxagentWMIsRunning)
{ {
nxagentMaximizeToFullScreen(pScreen); nxagentMaximizeToFullScreen(pScreen);
} }
...@@ -2573,7 +2573,7 @@ void nxagentMapDefaultWindows(void) ...@@ -2573,7 +2573,7 @@ void nxagentMapDefaultWindows(void)
* nxagentReconnectAllWindows, after the Root Window is mapped. * nxagentReconnectAllWindows, after the Root Window is mapped.
*/ */
if (nxagentReconnectTrap == 0) if (!nxagentReconnectTrap)
{ {
XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]); XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]);
} }
...@@ -2760,7 +2760,7 @@ Bool nxagentReconnectAllWindows(void *p0) ...@@ -2760,7 +2760,7 @@ Bool nxagentReconnectAllWindows(void *p0)
* raised. * raised.
*/ */
if (nxagentOption(Rootless) == 0) if (!nxagentOption(Rootless))
{ {
for (int i = 0; i < screenInfo.numScreens; i++) for (int i = 0; i < screenInfo.numScreens; i++)
{ {
...@@ -3274,7 +3274,7 @@ XXX: This would break Motif menus. ...@@ -3274,7 +3274,7 @@ XXX: This would break Motif menus.
XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum); XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum);
} }
} }
else if (nxagentOption(Rootless) == 0) else if (!nxagentOption(Rootless))
{ {
/* /*
* Map the root window. * Map the root window.
......
...@@ -36,6 +36,6 @@ ...@@ -36,6 +36,6 @@
extern xdmcp_states XdmcpState; extern xdmcp_states XdmcpState;
extern int XdmcpTimeOutRtx; extern int XdmcpTimeOutRtx;
extern int XdmcpStartTime; extern int XdmcpStartTime;
extern int nxagentXdmcpUp; extern Bool nxagentXdmcpUp;
#endif /* __Xdmcp_H__ */ #endif /* __Xdmcp_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment