LOG_DEBUG("%s %d %s", msg, kc, down ? "down" : "up");
action = down ? KeyPress : KeyRelease;
-#if XORG < 118
+#if XORG_OLDER_THAN(1, 18, 0)
QueueKeyboardEvents(dev, action, kc, NULL);
#else
QueueKeyboardEvents(dev, action, kc);
#define KEYBOARD_OR_FLOAT MASTER_KEYBOARD
#endif
-#if XORG < 118
+#if XORG_OLDER_THAN(1, 18, 0)
#define GetMaster(dev, type) ((dev)->master)
#endif
#include "vncBlockHandler.h"
#include "xorg-version.h"
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
static void vncBlockHandler(void* data, void* timeout);
static void vncSocketNotify(int fd, int xevents, void *data);
#else
void vncRegisterBlockHandlers(void)
{
if (!RegisterBlockAndWakeupHandlers(vncBlockHandler,
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
(ServerWakeupHandlerProcPtr)NoopDDA,
#else
vncWakeupHandler,
void vncSetNotifyFd(int fd, int scrIdx, int read, int write)
{
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
int mask = (read ? X_NOTIFY_READ : 0) | (write ? X_NOTIFY_WRITE : 0);
SetNotifyFd(fd, vncSocketNotify, mask, (void*)(intptr_t)scrIdx);
#else
void vncRemoveNotifyFd(int fd)
{
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
RemoveNotifyFd(fd);
#else
struct vncFdEntry** prev;
#endif
}
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
static void vncSocketNotify(int fd, int xevents, void *data)
{
int scrIdx;
}
#endif
-#if XORG < 119
+#if XORG_OLDER_THAN(1, 19, 0)
static void vncWriteBlockHandlerFallback(OSTimePtr timeout);
static void vncWriteWakeupHandlerFallback(void);
void vncWriteBlockHandler(fd_set *fds);
// descriptors that we want read events on.
//
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
static void vncBlockHandler(void* data, void* timeout)
#else
static void vncBlockHandler(void * data, OSTimePtr t, void * readmask)
#endif
{
-#if XORG < 119
+#if XORG_OLDER_THAN(1, 19, 0)
int _timeout;
int* timeout = &_timeout;
static struct timeval tv;
vncCallBlockHandlers(timeout);
-#if XORG < 119
+#if XORG_OLDER_THAN(1, 19, 0)
if (_timeout != -1) {
tv.tv_sec= _timeout / 1000;
tv.tv_usec = (_timeout % 1000) * 1000;
#endif
}
-#if XORG < 119
+#if XORG_OLDER_THAN(1, 19, 0)
static void vncWakeupHandler(void * data, int nfds, void * readmask)
{
fd_set* fds = (fd_set*)readmask;
// modified Xorg and might therefore not be called.
//
-#if XORG < 119
+#if XORG_OLDER_THAN(1, 19, 0)
static Bool needFallback = TRUE;
static fd_set fallbackFds;
static struct timeval tw;
CopyWindowProcPtr CopyWindow;
ClearToBackgroundProcPtr ClearToBackground;
DisplayCursorProcPtr DisplayCursor;
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
CursorWarpedToProcPtr CursorWarpedTo;
#endif
ScreenBlockHandlerProcPtr BlockHandler;
int h, Bool generateExposures);
static Bool vncHooksDisplayCursor(DeviceIntPtr pDev,
ScreenPtr pScreen, CursorPtr cursor);
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
static void vncHooksCursorWarpedTo(DeviceIntPtr pDev,
ScreenPtr pScreen_, ClientPtr pClient,
WindowPtr pWindow, SpritePtr pSprite,
int x, int y);
#endif
-#if XORG <= 118
+#if XORG_AT_LEAST(1, 19, 0)
+static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout);
+#else
static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout,
void * pReadmask);
-#else
-static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout);
#endif
static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask,
wrap(vncHooksScreen, pScreen, CopyWindow, vncHooksCopyWindow);
wrap(vncHooksScreen, pScreen, ClearToBackground, vncHooksClearToBackground);
wrap(vncHooksScreen, pScreen, DisplayCursor, vncHooksDisplayCursor);
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
wrap(vncHooksScreen, pScreen, CursorWarpedTo, vncHooksCursorWarpedTo);
#endif
wrap(vncHooksScreen, pScreen, BlockHandler, vncHooksBlockHandler);
// CursorWarpedTo - notify that the cursor was warped
-#if XORG >= 119
+#if XORG_AT_LEAST(1, 19, 0)
static void vncHooksCursorWarpedTo(DeviceIntPtr pDev,
ScreenPtr pScreen_, ClientPtr pClient,
WindowPtr pWindow, SpritePtr pSprite,
// BlockHandler - ignore any changes during the block handler - it's likely
// these are just drawing the cursor.
-#if XORG <= 118
+#if XORG_AT_LEAST(1, 19, 0)
+static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout)
+#else
static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout,
void * pReadmask)
-#else
-static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout)
#endif
{
SCREEN_PROLOGUE(pScreen_, BlockHandler);
vncHooksScreen->ignoreHooks++;
-#if XORG <= 118
- (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
-#else
+#if XORG_AT_LEAST(1, 19, 0)
(*pScreen->BlockHandler) (pScreen, pTimeout);
+#else
+ (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
#endif
vncHooksScreen->ignoreHooks--;
#include <dix-config.h>
#endif
-#if XORG_VERSION_CURRENT < ((1 * 10000000) + (15 * 100000) + (99 * 1000))
+#define XORG_AT_LEAST(major, minor, patch) \
+ (XORG_VERSION_CURRENT >= ((major * 10000000) + (minor * 100000) + (patch * 1000)))
+#define XORG_OLDER_THAN(major, minor, patch) \
+ (XORG_VERSION_CURRENT < ((major * 10000000) + (minor * 100000) + (patch * 1000)))
+
+#if XORG_OLDER_THAN(1, 16, 0)
#error "X.Org older than 1.16 is not supported"
-#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (16 * 100000) + (99 * 1000))
-#define XORG 116
-#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (17 * 100000) + (99 * 1000))
-#define XORG 117
-#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (18 * 100000) + (99 * 1000))
-#define XORG 118
-#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (19 * 100000) + (99 * 1000))
-#define XORG 119
-#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (20 * 100000) + (99 * 1000))
-#define XORG 120
-#else
+#endif
+
+#if XORG_AT_LEAST(1, 21, 0)
#error "X.Org newer than 1.20 is not supported"
#endif
static void vfbFreeFramebufferMemory(vfbFramebufferInfoPtr pfb);
#ifdef DPMSExtension
-#if XORG < 120
+#if XORG_OLDER_THAN(1, 20, 0)
/* Why support DPMS? Because stupid modern desktop environments
such as Unity 2D on Ubuntu 11.10 crashes if DPMS is not
available. (DPMSSet is called by dpms.c, but the return value
#endif
#if INPUTTHREAD
+#if XORG_AT_LEAST(1, 20, 7)
/** This function is called in Xserver/os/inputthread.c when starting
the input thread. */
void
{
}
#endif
+#endif
void
ddxUseMsg(void)
}
#ifdef GLXEXT
+#if XORG_OLDER_THAN(1, 20, 0)
extern void GlxExtensionInit(void);
static ExtensionModule glxExt = {
&noGlxExtension
};
#endif
+#endif
void
InitOutput(ScreenInfo * scrInfo, int argc, char **argv)
vncPrintBanner();
-#if XORG >= 120
+#if XORG_AT_LEAST(1, 20, 0)
xorgGlxCreateVendor();
#else