Revision: 4221
http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4221&view=rev
Author: atkac
Date: 2010-12-08 16:05:48 +0000 (Wed, 08 Dec 2010)
Log Message:
-----------
[Development] Add support for X.Org 1.10
Modified Paths:
--------------
trunk/unix/xserver/hw/vnc/Input.cc
trunk/unix/xserver/hw/vnc/vncHooks.cc
trunk/unix/xserver/hw/vnc/xorg-version.h
trunk/unix/xserver/hw/vnc/xvnc.cc
Modified: trunk/unix/xserver/hw/vnc/Input.cc
===================================================================
--- trunk/unix/xserver/hw/vnc/Input.cc 2010-12-08 14:43:55 UTC (rev 4220)
+++ trunk/unix/xserver/hw/vnc/Input.cc 2010-12-08 16:05:48 UTC (rev 4221)
@@ -30,6 +30,9 @@
#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
@@ -140,6 +143,9 @@
void InputDevice::PointerButtonAction(int buttonMask)
{
int i, n;
+#if XORG >= 110
+ ValuatorMask mask;
+#endif
initInputDevice();
@@ -147,8 +153,14 @@
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);
}
@@ -160,6 +172,9 @@
void InputDevice::PointerMove(const rfb::Point &pos)
{
int n, valuators[2];
+#if XORG >= 110
+ ValuatorMask mask;
+#endif
if (pos.equals(cursorPos))
return;
@@ -168,8 +183,14 @@
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;
Modified: trunk/unix/xserver/hw/vnc/vncHooks.cc
===================================================================
--- trunk/unix/xserver/hw/vnc/vncHooks.cc 2010-12-08 14:43:55 UTC (rev
4220)
+++ trunk/unix/xserver/hw/vnc/vncHooks.cc 2010-12-08 16:05:48 UTC (rev
4221)
@@ -72,7 +72,9 @@
CreateGCProcPtr CreateGC;
CopyWindowProcPtr CopyWindow;
ClearToBackgroundProcPtr ClearToBackground;
+#if XORG < 110
RestoreAreasProcPtr RestoreAreas;
+#endif
InstallColormapProcPtr InstallColormap;
StoreColorsProcPtr StoreColors;
DisplayCursorProcPtr DisplayCursor;
@@ -120,7 +122,9 @@
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);
@@ -260,7 +264,9 @@
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;
@@ -284,7 +290,9 @@
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;
@@ -334,7 +342,9 @@
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;
@@ -428,6 +438,7 @@
SCREEN_REWRAP(ClearToBackground);
}
+#if XORG < 110
// RestoreAreas - changed region is the given region
static RegionPtr vncHooksRestoreAreas(WindowPtr pWin, RegionPtr pRegion)
@@ -444,6 +455,7 @@
return result;
}
+#endif
// InstallColormap - get the new colormap
Modified: trunk/unix/xserver/hw/vnc/xorg-version.h
===================================================================
--- trunk/unix/xserver/hw/vnc/xorg-version.h 2010-12-08 14:43:55 UTC (rev
4220)
+++ trunk/unix/xserver/hw/vnc/xorg-version.h 2010-12-08 16:05:48 UTC (rev
4221)
@@ -34,8 +34,10 @@
#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
Modified: trunk/unix/xserver/hw/vnc/xvnc.cc
===================================================================
--- trunk/unix/xserver/hw/vnc/xvnc.cc 2010-12-08 14:43:55 UTC (rev 4220)
+++ trunk/unix/xserver/hw/vnc/xvnc.cc 2010-12-08 16:05:48 UTC (rev 4221)
@@ -890,10 +890,12 @@
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;
@@ -951,11 +953,13 @@
if (WasViewable)
{
+#if XORG < 110
if (pWin->backStorage)
{
pOldClip = REGION_CREATE(pScreen, NullBox, 1);
REGION_COPY(pScreen, pOldClip, &pWin->clipList);
}
+#endif
if (pWin->firstChild)
{
@@ -969,7 +973,7 @@
anyMarked = TRUE;
}
-#ifdef DO_SAVE_UNDERS
+#if XORG < 110 && defined(DO_SAVE_UNDERS)
if (DO_SAVE_UNDERS(pWin))
{
dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
@@ -980,6 +984,7 @@
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
}
+#if XORG < 110
if (pWin->backStorage &&
((pWin->backingStore == Always) || WasViewable))
{
@@ -1002,11 +1007,13 @@
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 */
@@ -1184,7 +1191,9 @@
if (!ret) return FALSE;
+#if XORG < 110
miInitializeBackingStore(pScreen);
+#endif
/*
* Circumvent the backing store that was just initialised. This amounts
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:
WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits