aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Drawable.c20
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c36
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GC.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GCOps.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglxext.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXrender.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXshm.c16
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixmap.c18
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Reconnect.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Render.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Rootless.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Trap.c70
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Trap.h8
14 files changed, 100 insertions, 102 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
index 266ea86da..ba6d48fa5 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
@@ -160,15 +160,15 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre
* so that the image will be transferred in a single operation.
*/
- nxagentFBTrap = 1;
+ nxagentFBTrap = True;
- nxagentSplitTrap = 1;
+ nxagentSplitTrap = True;
int result = nxagentSynchronizeDrawableData(pDrawable, breakMask, owner);
- nxagentSplitTrap = 0;
+ nxagentSplitTrap = False;
- nxagentFBTrap = 0;
+ nxagentFBTrap = False;
if (wait == DO_WAIT && nxagentSplitResource(pDrawable) != NULL)
{
@@ -495,11 +495,11 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
int saveTrap = nxagentGCTrap;
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
- nxagentFBTrap = 1;
+ nxagentFBTrap = True;
- nxagentSplitTrap = 1;
+ nxagentSplitTrap = True;
pGC = nxagentGetGraphicContext(pDrawable);
@@ -839,9 +839,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
nxagentSynchronizeRegionStop:
- nxagentSplitTrap = 0;
+ nxagentSplitTrap = False;
- nxagentFBTrap = 0;
+ nxagentFBTrap = False;
nxagentGCTrap = saveTrap;
@@ -2412,7 +2412,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
int saveTrap = nxagentGCTrap;
- nxagentGCTrap = 1;
+ nxagentGCTrap = True;
if (nxagentDrawableStatus(pDrawable) == Synchronized)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index e0acf354f..73c5d7c36 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -1142,17 +1142,17 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
{
if (X.xkey.keycode == nxagentCapsLockKeycode)
{
- nxagentXkbCapsTrap = 1;
+ nxagentXkbCapsTrap = True;
}
else if (X.xkey.keycode == nxagentNumLockKeycode)
{
- nxagentXkbNumTrap = 1;
+ nxagentXkbNumTrap = True;
}
nxagentInitXkbKeyboardState();
- nxagentXkbCapsTrap = 0;
- nxagentXkbNumTrap = 0;
+ nxagentXkbCapsTrap = False;
+ nxagentXkbNumTrap = False;
}
/* Calculate the time elapsed between this and the last event
@@ -1712,11 +1712,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
Mask mask = CWX | CWY;
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
ConfigureWindow(pWin, mask, (XID *) values, wClient(pWin));
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
}
if (nxagentOption(Fullscreen) == 1 &&
@@ -2006,11 +2006,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL &&
nxagentWindowTopLevel(pWin) == 1))
{
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
UnmapWindow(pWin, False);
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
}
}
@@ -2037,11 +2037,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
((pWin = nxagentWindowPtr(X.xmap.window)) != NULL &&
nxagentWindowTopLevel(pWin) == 1))
{
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
MapWindow(pWin, wClient(pWin));
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
}
if (pWin != NULL)
@@ -2262,17 +2262,17 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
{
if (X -> xkey.keycode == nxagentCapsLockKeycode)
{
- nxagentXkbCapsTrap = 1;
+ nxagentXkbCapsTrap = True;
}
else if (X -> xkey.keycode == nxagentNumLockKeycode)
{
- nxagentXkbNumTrap = 1;
+ nxagentXkbNumTrap = True;
}
nxagentInitXkbKeyboardState();
- nxagentXkbCapsTrap = 0;
- nxagentXkbNumTrap = 0;
+ nxagentXkbCapsTrap = False;
+ nxagentXkbNumTrap = False;
}
if (nxagentCheckSpecialKeystroke(&X -> xkey, result))
@@ -2900,9 +2900,9 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X)
* identify that situation during Callback processing we could
* get rid of the Trap...
*/
- nxagentExternalClipboardEventTrap = 1;
+ nxagentExternalClipboardEventTrap = True;
CallCallbacks(&SelectionCallback, &info);
- nxagentExternalClipboardEventTrap = 0;
+ nxagentExternalClipboardEventTrap = False;
}
}
return 1;
@@ -3199,11 +3199,11 @@ int nxagentHandleConfigureNotify(XEvent* X)
* nxagentWindowPriv(pWinWindow)->height = X -> xconfigure.height;
*/
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
ConfigureWindow(pWinWindow, mask, (XID *) values, wClient(pWinWindow));
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
nxagentCheckWindowConfiguration((XConfigureEvent*)X);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c
index 1feb62a4d..21e888b8a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/GC.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c
@@ -1264,7 +1264,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen)
int nxagentSaveGCTrap = nxagentGCTrap;
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
GCPtr pGC = GetScratchGC(depth, pScreen);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
index 9bce4af0d..5cc29234a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
@@ -80,7 +80,7 @@ static int nxagentSaveGCTrap;
{ \
nxagentSaveGCTrap = nxagentGCTrap;\
\
- nxagentGCTrap = 1; \
+ nxagentGCTrap = True; \
}
#define RESET_GC_TRAP() \
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
index 7af295eac..6149ad27d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
@@ -64,7 +64,7 @@ static int __glXDispatch(ClientPtr client)
* dispatching a GLX operation.
*/
- nxagentGlxTrap = 1;
+ nxagentGlxTrap = True;
#ifdef TEST
fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n",
@@ -73,7 +73,7 @@ static int __glXDispatch(ClientPtr client)
retval = xorg__glXDispatch(client);
- nxagentGlxTrap = 0;
+ nxagentGlxTrap = False;
#ifdef TEST
fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
index cc5f08227..bcb64edcd 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
@@ -1766,11 +1766,11 @@ ProcRenderDispatch (ClientPtr client)
* operation to avoid reentrancy in GCOps.c.
*/
- nxagentGCTrap = 1;
+ nxagentGCTrap = True;
int result = xorg_ProcRenderDispatch(client);
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
return result;
}
@@ -1793,11 +1793,11 @@ SProcRenderDispatch (ClientPtr client)
* operation to avoid reentrancy in GCOps.c.
*/
- nxagentGCTrap = 1;
+ nxagentGCTrap = True;
int result = xorg_SProcRenderDispatch(client);
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
return result;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
index 33f093ba2..a38baac6a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
@@ -171,11 +171,11 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
{
/* Careful! This wrapper DEACTIVATES the trap! */
- nxagentShmTrap = 0;
+ nxagentShmTrap = False;
xorg_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data);
- nxagentShmTrap = 1;
+ nxagentShmTrap = True;
return;
}
@@ -439,11 +439,11 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
{
PixmapPtr result;
- nxagentShmPixmapTrap = 1;
+ nxagentShmPixmapTrap = True;
result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr);
- nxagentShmPixmapTrap = 0;
+ nxagentShmPixmapTrap = False;
return result;
}
@@ -465,11 +465,11 @@ ProcShmDispatch (register ClientPtr client)
}
#endif
- nxagentShmTrap = 1;
+ nxagentShmTrap = True;
result = xorg_ProcShmDispatch(client);
- nxagentShmTrap = 0;
+ nxagentShmTrap = False;
return result;
}
@@ -488,11 +488,11 @@ SProcShmDispatch (register ClientPtr client)
}
#endif
- nxagentShmTrap = 1;
+ nxagentShmTrap = True;
result = xorg_SProcShmDispatch(client);
- nxagentShmTrap = 0;
+ nxagentShmTrap = False;
return result;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
index 545d9255c..8d7af08c0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
@@ -79,11 +79,11 @@ ProcXvDispatch(ClientPtr client)
stuff->data, client -> index);
#endif
- nxagentXvTrap = 1;
+ nxagentXvTrap = True;
result = xorg_ProcXvDispatch(client);
- nxagentXvTrap = 0;
+ nxagentXvTrap = False;
#ifdef TEST
fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n",
@@ -108,11 +108,11 @@ SProcXvDispatch(ClientPtr client)
stuff->data, client -> index);
#endif
- nxagentXvTrap = 1;
+ nxagentXvTrap = True;
result = xorg_SProcXvDispatch(client);
- nxagentXvTrap = 0;
+ nxagentXvTrap = False;
#ifdef TEST
fprintf(stderr, "SProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n",
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
index 565394c65..c1ca9bc2f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
@@ -157,7 +157,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
* synchronized with the remote X Server.
*/
- if (pPixmapPriv -> isShared == 1)
+ if (pPixmapPriv -> isShared)
{
BoxRec box = { .x1 = 0, .y1 = 0, .x2 = width, .y2 = height };
@@ -773,11 +773,11 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2)
return;
}
- nxagentSplitTrap = 1;
+ nxagentSplitTrap = True;
*pBool = nxagentSynchronizeDrawableData((DrawablePtr) pPixmap, NEVER_BREAK, NULL);
- nxagentSplitTrap = 0;
+ nxagentSplitTrap = False;
if (!*pBool)
{
@@ -1095,13 +1095,13 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
int length = nxagentImageLength(width, height, format, 0, depth);
- int saveTrap = nxagentGCTrap;
+ Bool saveTrap = nxagentGCTrap;
- nxagentGCTrap = 0;
+ nxagentGCTrap = False;
- nxagentSplitTrap = 1;
+ nxagentSplitTrap = True;
- nxagentFBTrap = 1;
+ nxagentFBTrap = True;
char *data = malloc(length);
@@ -1124,9 +1124,9 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
nxagentGCTrap = saveTrap;
- nxagentSplitTrap = 0;
+ nxagentSplitTrap = False;
- nxagentFBTrap = 0;
+ nxagentFBTrap = False;
nxagentFreeScratchGC(pGC);
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
index 98db9ca92..515ffefa0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
@@ -340,7 +340,7 @@ void nxagentInitializeRecLossyLevel(void)
void nxagentInitReconnector(void)
{
- nxagentReconnectTrap = 0;
+ nxagentReconnectTrap = False;
reconnectLossyLevel[DISPLAY_STEP] = malloc(sizeof(int));
reconnectLossyLevel[SCREEN_STEP] = malloc(sizeof(int));
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c
index 597392bf1..f38319858 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c
@@ -532,11 +532,11 @@ void nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
* if the cursor was already encoded with the best quality.
*/
- nxagentLosslessTrap = 1;
+ nxagentLosslessTrap = True;
nxagentSynchronizeDrawable(pPicture -> pDrawable, DO_WAIT, NEVER_BREAK, NULL);
- nxagentLosslessTrap = 0;
+ nxagentLosslessTrap = False;
nxagentCursor(pCursor, pScreen) = XRenderCreateCursor(nxagentDisplay, nxagentPicture(pPicture), x, y);
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
index 77843b851..da386d845 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
@@ -341,9 +341,9 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
Mask mask = CWSibling | CWStackMode;
values[0] = pWin -> drawable.id;
ClientPtr pClient = wClient(toplevel[i]);
- nxagentScreenTrap = 1;
+ nxagentScreenTrap = True;
ConfigureWindow(toplevel[i], mask, values, pClient);
- nxagentScreenTrap = 0;
+ nxagentScreenTrap = False;
#ifdef TEST
fprintf(stderr, "%s: Restacked window [%p].\n", __func__, (void*) toplevel[i]);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.c b/nx-X11/programs/Xserver/hw/nxagent/Trap.c
index 4fe12bede..6eade2073 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Trap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.c
@@ -25,94 +25,84 @@
#include "Trap.h"
+#include <nx-X11/Xdefs.h>
+
/*
- * Set if we are dispatching a render
- * extension request. Used to avoid
+ * Set if we are dispatching a render extension request. Used to avoid
* reentrancy in GC operations.
*/
-int nxagentGCTrap = 0;
+Bool nxagentGCTrap = False;
/*
- * Set if we are enqueing an internal
- * operation, CreateWindow and Reparent-
- * Window. Used to remove any screen operation.
+ * Set if we are enqueing an internal operation, CreateWindow and
+ * Reparent- Window. Used to remove any screen operation.
*/
-int nxagentScreenTrap = 0;
+Bool nxagentScreenTrap = False;
/*
- * Set if we are executing a GC operation
- * only on the X side. Used to avoid
- * reentrancy in FB layer.
+ * Set if we are executing a GC operation only on the X side. Used to
+ * avoid reentrancy in FB layer.
*/
-int nxagentFBTrap = 0;
+Bool nxagentFBTrap = False;
/*
- * Set if we are dispatching a shared
- * memory extension request.
+ * Set if we are dispatching a shared memory extension request.
*/
-int nxagentShmTrap = 0;
+Bool nxagentShmTrap = False;
/*
- * Set if a shared pixmap operation is
- * requested by the client.
+ * Set if a shared pixmap operation is requested by the client.
*/
-int nxagentShmPixmapTrap = 0;
+Bool nxagentShmPixmapTrap = False;
/*
- * Set if we are dispatching a XVideo
- * extension request.
+ * Set if we are dispatching a XVideo extension request.
*/
-int nxagentXvTrap = 0;
+Bool nxagentXvTrap = False;
/*
- * Set if we are dispatching a GLX
- * extension request.
+ * Set if we are dispatching a GLX extension request.
*/
-int nxagentGlxTrap = 0;
+Bool nxagentGlxTrap = False;
/*
* Set while we are resuming the session.
*/
-int nxagentReconnectTrap = 0;
+Bool nxagentReconnectTrap = False;
/*
- * Set if we need to realize a drawable
- * by using a lossless encoding.
+ * Set if we need to realize a drawable by using a lossless encoding.
*/
-int nxagentLosslessTrap = 0;
+Bool nxagentLosslessTrap = False;
/*
- * Set to force the synchronization of
- * a drawable.
+ * Set to force the synchronization of a drawable.
*/
-int nxagentSplitTrap = 0;
+Bool nxagentSplitTrap = False;
/*
- * Set to avoid CapsLock synchronization
- * problems when CapsLock is the first
- * key to be pressed in the session.
+ * Set to avoid CapsLock synchronization problems when CapsLock is the
+ * first key to be pressed in the session.
*/
-int nxagentXkbCapsTrap = 0;
+Bool nxagentXkbCapsTrap = False;
/*
- * Set to avoid NumLock synchronization
- * problems when NumLock is the first
- * key to be pressed in the session.
+ * Set to avoid NumLock synchronization problems when NumLock is the
+ * first key to be pressed in the session.
*/
-int nxagentXkbNumTrap = 0;
-
+Bool nxagentXkbNumTrap = False;
/*
* Set to indicate we are processing a clipboard event triggered by
@@ -120,4 +110,4 @@ int nxagentXkbNumTrap = 0;
* would trigger another event by the real X server
*/
-int nxagentExternalClipboardEventTrap = 0;
+Bool nxagentExternalClipboardEventTrap = False;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.h b/nx-X11/programs/Xserver/hw/nxagent/Trap.h
index cd1e79ff7..4203d2b13 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Trap.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.h
@@ -26,6 +26,14 @@
#ifndef __Traps_H__
#define __Traps_H__
+#ifndef False
+#define False 0
+#endif
+
+#ifndef True
+#define True 1
+#endif
+
/*
* Set if we are dispatching a render extension request. Used to avoid
* reentrancy in GC operations.