#define public c_public
#define class c_class
#include "inputstr.h"
+#if XORG >= 110
+#include "inpututils.h"
+#endif
#include "mi.h"
#ifndef XKB_IN_SERVER
#define XKB_IN_SERVER
void InputDevice::PointerButtonAction(int buttonMask)
{
int i, n;
+#if XORG >= 110
+ ValuatorMask mask;
+#endif
initInputDevice();
if ((buttonMask ^ oldButtonMask) & (1 << i)) {
int action = (buttonMask & (1<<i)) ?
ButtonPress : ButtonRelease;
+#if XORG < 110
n = GetPointerEvents(eventq, pointerDev, action, i + 1,
POINTER_RELATIVE, 0, 0, NULL);
+#else
+ valuator_mask_set_range(&mask, 0, 0, NULL);
+ n = GetPointerEvents(eventq, pointerDev, action, i + 1,
+ POINTER_RELATIVE, &mask);
+#endif
enqueueEvents(pointerDev, n);
}
void InputDevice::PointerMove(const rfb::Point &pos)
{
int n, valuators[2];
+#if XORG >= 110
+ ValuatorMask mask;
+#endif
if (pos.equals(cursorPos))
return;
valuators[0] = pos.x;
valuators[1] = pos.y;
+#if XORG < 110
n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE, 0,
2, valuators);
+#else
+ valuator_mask_set_range(&mask, 0, 2, valuators);
+ n = GetPointerEvents(eventq, pointerDev, MotionNotify, 0, POINTER_ABSOLUTE,
+ &mask);
+#endif
enqueueEvents(pointerDev, n);
cursorPos = pos;
CreateGCProcPtr CreateGC;
CopyWindowProcPtr CopyWindow;
ClearToBackgroundProcPtr ClearToBackground;
+#if XORG < 110
RestoreAreasProcPtr RestoreAreas;
+#endif
InstallColormapProcPtr InstallColormap;
StoreColorsProcPtr StoreColors;
DisplayCursorProcPtr DisplayCursor;
RegionPtr pOldRegion);
static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w,
int h, Bool generateExposures);
+#if XORG < 110
static RegionPtr vncHooksRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed);
+#endif
static void vncHooksInstallColormap(ColormapPtr pColormap);
static void vncHooksStoreColors(ColormapPtr pColormap, int ndef,
xColorItem* pdef);
vncHooksScreen->CreateGC = pScreen->CreateGC;
vncHooksScreen->CopyWindow = pScreen->CopyWindow;
vncHooksScreen->ClearToBackground = pScreen->ClearToBackground;
+#if XORG < 110
vncHooksScreen->RestoreAreas = pScreen->RestoreAreas;
+#endif
vncHooksScreen->InstallColormap = pScreen->InstallColormap;
vncHooksScreen->StoreColors = pScreen->StoreColors;
vncHooksScreen->DisplayCursor = pScreen->DisplayCursor;
pScreen->CreateGC = vncHooksCreateGC;
pScreen->CopyWindow = vncHooksCopyWindow;
pScreen->ClearToBackground = vncHooksClearToBackground;
+#if XORG < 110
pScreen->RestoreAreas = vncHooksRestoreAreas;
+#endif
pScreen->InstallColormap = vncHooksInstallColormap;
pScreen->StoreColors = vncHooksStoreColors;
pScreen->DisplayCursor = vncHooksDisplayCursor;
pScreen->CreateGC = vncHooksScreen->CreateGC;
pScreen->CopyWindow = vncHooksScreen->CopyWindow;
pScreen->ClearToBackground = vncHooksScreen->ClearToBackground;
+#if XORG < 110
pScreen->RestoreAreas = vncHooksScreen->RestoreAreas;
+#endif
pScreen->InstallColormap = vncHooksScreen->InstallColormap;
pScreen->StoreColors = vncHooksScreen->StoreColors;
pScreen->DisplayCursor = vncHooksScreen->DisplayCursor;
SCREEN_REWRAP(ClearToBackground);
}
+#if XORG < 110
// RestoreAreas - changed region is the given region
static RegionPtr vncHooksRestoreAreas(WindowPtr pWin, RegionPtr pRegion)
return result;
}
+#endif
// InstallColormap - get the new colormap
#define XORG 18
#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (9 * 100000) + (99 * 1000))
#define XORG 19
+#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (10 * 100000) + (99 * 1000))
+#define XORG 110
#else
-#error "X.Org newer than 1.9 is not supported"
+#error "X.Org newer than 1.10 is not supported"
#endif
#endif
WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable);
Bool anyMarked = FALSE;
+#if XORG < 110
RegionPtr pOldClip = NULL, bsExposed;
#ifdef DO_SAVE_UNDERS
Bool dosave = FALSE;
+#endif
#endif
WindowPtr pLayerWin;
BoxRec box;
if (WasViewable)
{
+#if XORG < 110
if (pWin->backStorage)
{
pOldClip = REGION_CREATE(pScreen, NullBox, 1);
REGION_COPY(pScreen, pOldClip, &pWin->clipList);
}
+#endif
if (pWin->firstChild)
{
anyMarked = TRUE;
}
-#ifdef DO_SAVE_UNDERS
+#if XORG < 110 && defined(DO_SAVE_UNDERS)
if (DO_SAVE_UNDERS(pWin))
{
dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
}
+#if XORG < 110
if (pWin->backStorage &&
((pWin->backingStore == Always) || WasViewable))
{
REGION_DESTROY(pScreen, bsExposed);
}
}
+#endif
if (WasViewable)
{
if (anyMarked)
(*pScreen->HandleExposures)(pWin);
-#ifdef DO_SAVE_UNDERS
+
+#if XORG < 110 && defined(DO_SAVE_UNDERS)
if (dosave)
(*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
#endif /* DO_SAVE_UNDERS */
if (!ret) return FALSE;
+#if XORG < 110
miInitializeBackingStore(pScreen);
+#endif
/*
* Circumvent the backing store that was just initialised. This amounts