--- a/open-src/xserver/xvnc/upstream-xorg-version.patch Mon May 09 10:12:33 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,455 +0,0 @@
-From 7830b1117f289c0adcc14d60318f1b950ff5fd1a Mon Sep 17 00:00:00 2001
-From: atkac <atkac@3789f03b-4d11-0410-bbf8-ca57d06f2519>
-Date: Fri, 28 Aug 2009 12:00:32 +0000
-Subject: [PATCH] Use "XORG <version>" macro instead of "XORG_<version>" to distinguish between X.Org branches.
-
-git-svn-id: https://tigervnc.svn.sourceforge.net/svnroot/tigervnc/trunk@3883 3789f03b-4d11-0410-bbf8-ca57d06f2519
----
- unix/xserver/hw/vnc/XserverDesktop.cc | 38 ++++++++++++++++----------------
- unix/xserver/hw/vnc/XserverDesktop.h | 4 +-
- unix/xserver/hw/vnc/vncHooks.cc | 12 +++++-----
- unix/xserver/hw/vnc/xvnc.cc | 14 ++++++------
- 4 files changed, 34 insertions(+), 34 deletions(-)
-
-diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
-index 9a5fb40..a36e769 100644
---- a/unix/xserver/hw/vnc/XserverDesktop.cc
-+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
-@@ -63,7 +63,7 @@ extern char *display;
- #ifdef XKB
- #include <xkbsrv.h>
- #endif
--#ifdef XORG_16
-+#if XORG >= 16
- #include "exevents.h"
- extern void
- CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
-@@ -77,7 +77,7 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
-
- static DeviceIntPtr vncKeyboardDevice = NULL;
- static DeviceIntPtr vncPointerDevice = NULL;
--#ifdef XORG_15
-+#if XORG == 15
- static xEvent *eventq = NULL;
- #else
- static EventList *eventq = NULL;
-@@ -194,7 +194,7 @@ XserverDesktop::XserverDesktop(ScreenPtr pScreen_,
- if (httpListener)
- httpServer = new FileHTTPServer(this);
-
--#ifdef XORG_15
-+#if XORG == 15
- /*
- * XXX eventq is never free()-ed because it has to exist during server life
- * */
-@@ -211,7 +211,7 @@ XserverDesktop::XserverDesktop(ScreenPtr pScreen_,
- */
- if (vncKeyboardDevice == NULL) {
- vncKeyboardDevice = AddInputDevice(
--#ifdef XORG_16
-+#if XORG >= 16
- serverClient,
- #endif
- vfbKeybdProc, TRUE);
-@@ -220,7 +220,7 @@ XserverDesktop::XserverDesktop(ScreenPtr pScreen_,
-
- if (vncPointerDevice == NULL) {
- vncPointerDevice = AddInputDevice(
--#ifdef XORG_16
-+#if XORG >= 16
- serverClient,
- #endif
- vfbMouseProc, TRUE);
-@@ -557,7 +557,7 @@ void XserverDesktop::positionCursor()
- if (!cursorPos.equals(oldCursorPos)) {
- oldCursorPos = cursorPos;
- (*pScreen->SetCursorPosition) (
--#ifdef XORG_16
-+#if XORG >= 16
- vncPointerDevice,
- #endif
- pScreen, cursorPos.x, cursorPos.y, FALSE);
-@@ -569,7 +569,7 @@ void XserverDesktop::positionCursor()
- void XserverDesktop::blockHandler(fd_set* fds)
- {
- try {
--#ifdef XORG_15
-+#if XORG == 15
- ScreenPtr screenWithCursor = GetCurrentRootWindow()->drawable.pScreen;
- #else
- ScreenPtr screenWithCursor =
-@@ -578,7 +578,7 @@ void XserverDesktop::blockHandler(fd_set* fds)
- if (screenWithCursor == pScreen) {
- int x, y;
- GetSpritePosition(
--#ifdef XORG_16
-+#if XORG >= 16
- vncPointerDevice,
- #endif
- &x, &y);
-@@ -742,7 +742,7 @@ void XserverDesktop::pointerEvent(const Point& pos, int buttonMask)
- //(*pScreen->SetCursorPosition) (pScreen, pos.x, pos.y, FALSE);
-
- NewCurrentScreen(
--#ifdef XORG_16
-+#if XORG >= 16
- vncPointerDevice,
- #endif
- pScreen, pos.x, pos.y);
-@@ -751,7 +751,7 @@ void XserverDesktop::pointerEvent(const Point& pos, int buttonMask)
- valuators[0] = pos.x;
- valuators[1] = pos.y;
-
--#ifdef XORG_16
-+#if XORG >= 16
- GetEventList(&eventq);
- #endif
- n = GetPointerEvents (eventq, vncPointerDevice, MotionNotify, 0,
-@@ -759,7 +759,7 @@ void XserverDesktop::pointerEvent(const Point& pos, int buttonMask)
-
- for (i = 0; i < n; i++) {
- mieqEnqueue (vncPointerDevice,
--#ifdef XORG_15
-+#if XORG == 15
- eventq + i
- #else
- (eventq + i)->event
-@@ -779,7 +779,7 @@ void XserverDesktop::pointerEvent(const Point& pos, int buttonMask)
-
- for (j = 0; j < n; j++) {
- mieqEnqueue (vncPointerDevice,
--#ifdef XORG_15
-+#if XORG == 15
- eventq + j
- #else
- (eventq + j)->event
-@@ -809,7 +809,7 @@ unsigned int XserverDesktop::setScreenLayout(int fb_width, int fb_height,
- RRModePtr mode;
-
- // Make sure all RandR tables are properly populated
--#ifdef XORG_15
-+#if XORG == 15
- ret = RRGetInfo(pScreen);
- #else
- ret = RRGetInfo(pScreen, FALSE);
-@@ -832,7 +832,7 @@ unsigned int XserverDesktop::setScreenLayout(int fb_width, int fb_height,
-
- // Then we have to call RRGetInfo again for it to copy the RandR
- // 1.0 information to the 1.2 structures.
--#ifdef XORG_15
-+#if XORG == 15
- ret = RRGetInfo(pScreen);
- #else
- ret = RRGetInfo(pScreen, FALSE);
-@@ -1008,7 +1008,7 @@ private:
- down ? KeyPress : KeyRelease, keycode);
- for (i = 0; i < n; i++) {
- mieqEnqueue (vncKeyboardDevice,
--#ifdef XORG_15
-+#if XORG == 15
- eventq + i
- #else
- (eventq + i)->event
-@@ -1161,7 +1161,7 @@ void XserverDesktop::keyEvent(rdr::U32 keysym, bool down)
-
- vlog.info("Added unknown keysym 0x%x to keycode %d",keysym,kc);
-
--#ifdef XORG_15
-+#if XORG == 15
- master = inputInfo.keyboard;
- #else
- master = vncKeyboardDevice->u.master;
-@@ -1169,7 +1169,7 @@ void XserverDesktop::keyEvent(rdr::U32 keysym, bool down)
- if (vncKeyboardDevice ==
- dixLookupPrivate(&master->devPrivates, CoreDevicePrivateKey)) {
- dixSetPrivate(&master->devPrivates, CoreDevicePrivateKey, NULL);
--#ifdef XORG_15
-+#if XORG == 15
- SwitchCoreKeyboard(vncKeyboardDevice);
- #else
- CopyKeyClass(vncKeyboardDevice, master);
-@@ -1213,7 +1213,7 @@ void XserverDesktop::keyEvent(rdr::U32 keysym, bool down)
- KeyPress : KeyRelease, kc);
- for (i = 0; i < n; i++) {
- mieqEnqueue (vncKeyboardDevice,
--#ifdef XORG_15
-+#if XORG == 15
- eventq + i
- #else
- (eventq + i)->event
-@@ -1492,7 +1492,7 @@ static int vfbMouseProc(DeviceIntPtr pDevice, int onoff)
- map[4] = 4;
- map[5] = 5;
- InitPointerDeviceStruct(pDev, map, 5,
--#ifdef XORG_15
-+#if XORG == 15
- GetMotionHistory,
- #endif
- (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2);
-diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h
-index 6777f09..b394d16 100644
---- a/unix/xserver/hw/vnc/XserverDesktop.h
-+++ b/unix/xserver/hw/vnc/XserverDesktop.h
-@@ -29,10 +29,10 @@
- #if XORG_VERSION_CURRENT < \
- ((1 * 10000000) + (5 * 100000) + (99 * 1000))
- /* Xorg 1.5 branch */
--#define XORG_15
-+#define XORG 15
- #else
- /* Xorg 1.6 branch */
--#define XORG_16
-+#define XORG 16
- #endif
-
- #include <rfb/SDesktop.h>
-diff --git a/unix/xserver/hw/vnc/vncHooks.cc b/unix/xserver/hw/vnc/vncHooks.cc
-index 010e955..700efbb 100644
---- a/unix/xserver/hw/vnc/vncHooks.cc
-+++ b/unix/xserver/hw/vnc/vncHooks.cc
-@@ -89,7 +89,7 @@ typedef struct {
- GCOps *wrappedOps;
- } vncHooksGCRec, *vncHooksGCPtr;
-
--#ifdef XORG_15
-+#if XORG == 15
- static DevPrivateKey vncHooksScreenPrivateKey = &vncHooksScreenPrivateKey;
- static DevPrivateKey vncHooksGCPrivateKey = &vncHooksGCPrivateKey;
- #else
-@@ -119,7 +119,7 @@ static void vncHooksInstallColormap(ColormapPtr pColormap);
- static void vncHooksStoreColors(ColormapPtr pColormap, int ndef,
- xColorItem* pdef);
- static Bool vncHooksDisplayCursor(
--#ifdef XORG_16
-+#if XORG >= 16
- DeviceIntPtr pDev,
- #endif
- ScreenPtr pScreen, CursorPtr cursor);
-@@ -454,7 +454,7 @@ static void vncHooksStoreColors(ColormapPtr pColormap, int ndef,
- // DisplayCursor - get the cursor shape
-
- static Bool vncHooksDisplayCursor(
--#ifdef XORG_16
-+#if XORG >= 16
- DeviceIntPtr pDev,
- #endif
- ScreenPtr pScreen_, CursorPtr cursor)
-@@ -462,11 +462,11 @@ static Bool vncHooksDisplayCursor(
- SCREEN_UNWRAP(pScreen_, DisplayCursor);
-
- Bool ret = (*pScreen->DisplayCursor) (
--#ifdef XORG_16
-+#if XORG >= 16
- pDev,
- #endif
- pScreen, cursor);
--#ifdef XORG_16
-+#if XORG >= 16
- /*
- * XXX DIX calls this function with NULL argument to remove cursor sprite from
- * screen. Should we handle this in setCursor as well?
-@@ -474,7 +474,7 @@ static Bool vncHooksDisplayCursor(
- if (cursor != NullCursor) {
- #endif
- vncHooksScreen->desktop->setCursor(cursor);
--#ifdef XORG_16
-+#if XORG >= 16
- }
- #endif
-
-diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc
-index 9fdcaf3..45820ee 100644
---- a/unix/xserver/hw/vnc/xvnc.cc
-+++ b/unix/xserver/hw/vnc/xvnc.cc
-@@ -736,7 +736,7 @@ vfbCrossScreen (ScreenPtr pScreen, Bool entering)
- }
-
- static Bool vfbRealizeCursor(
--#ifdef XORG_16
-+#if XORG >= 16
- DeviceIntPtr pDev,
- #endif
- ScreenPtr pScreen, CursorPtr pCursor) {
-@@ -744,7 +744,7 @@ static Bool vfbRealizeCursor(
- }
-
- static Bool vfbUnrealizeCursor(
--#ifdef XORG_16
-+#if XORG >= 16
- DeviceIntPtr pDev,
- #endif
- ScreenPtr pScreen, CursorPtr pCursor) {
-@@ -752,7 +752,7 @@ static Bool vfbUnrealizeCursor(
- }
-
- static void vfbSetCursor(
--#ifdef XORG_16
-+#if XORG >= 16
- DeviceIntPtr pDev,
- #endif
- ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
-@@ -760,14 +760,14 @@ static void vfbSetCursor(
- }
-
- static void vfbMoveCursor(
--#ifdef XORG_16
-+#if XORG >= 16
- DeviceIntPtr pDev,
- #endif
- ScreenPtr pScreen, int x, int y)
- {
- }
-
--#ifdef XORG_16
-+#if XORG >= 16
- static Bool
- vfbDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
- {
-@@ -785,7 +785,7 @@ static miPointerSpriteFuncRec vfbPointerSpriteFuncs = {
- vfbUnrealizeCursor,
- vfbSetCursor,
- vfbMoveCursor
--#ifdef XORG_16
-+#if XORG >= 16
- , vfbDeviceCursorInitialize,
- vfbDeviceCursorCleanup
- #endif
-@@ -1303,7 +1303,7 @@ Bool LegalModifier(unsigned int key, DeviceIntPtr pDev)
- void ProcessInputEvents()
- {
- mieqProcessInputEvents();
--#ifdef XORG_15
-+#if XORG == 15
- miPointerUpdate();
- #endif
- }
---
-1.5.6.5
-
-From d8dae372b65fea70a87698861eae24d1ac4b296b Mon Sep 17 00:00:00 2001
-From: atkac <atkac@3789f03b-4d11-0410-bbf8-ca57d06f2519>
-Date: Fri, 28 Aug 2009 12:02:20 +0000
-Subject: [PATCH] Move definition of XORG macro to separate header.
-
-git-svn-id: https://tigervnc.svn.sourceforge.net/svnroot/tigervnc/trunk@3884 3789f03b-4d11-0410-bbf8-ca57d06f2519
----
- unix/xserver/hw/vnc/Makefile.am | 2 +-
- unix/xserver/hw/vnc/XserverDesktop.cc | 1 +
- unix/xserver/hw/vnc/XserverDesktop.h | 9 ---------
- unix/xserver/hw/vnc/vncHooks.cc | 1 +
- unix/xserver/hw/vnc/xorg-version.h | 33 +++++++++++++++++++++++++++++++++
- unix/xserver/hw/vnc/xvnc.cc | 1 +
- 6 files changed, 37 insertions(+), 10 deletions(-)
- create mode 100644 unix/xserver/hw/vnc/xorg-version.h
-
-diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am
-index 957612a..a39a10d 100644
---- a/unix/xserver/hw/vnc/Makefile.am
-+++ b/unix/xserver/hw/vnc/Makefile.am
-@@ -9,7 +9,7 @@ COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB)
-
- noinst_LTLIBRARIES = libvnccommon.la
-
--HDRS = RegionHelper.h vncExtInit.h vncHooks.h XserverDesktop.h
-+HDRS = RegionHelper.h vncExtInit.h vncHooks.h XserverDesktop.h xorg-version.h
-
- libvnccommon_la_SOURCES = $(HDRS) vncExtInit.cc vncHooks.cc XserverDesktop.cc
-
-diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
-index a36e769..d6fe993 100644
---- a/unix/xserver/hw/vnc/XserverDesktop.cc
-+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
-@@ -41,6 +41,7 @@
- #include <rfb/Configuration.h>
- #include "XserverDesktop.h"
- #include "vncExtInit.h"
-+#include "xorg-version.h"
-
- extern "C" {
- #define public c_public
-diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h
-index b394d16..7729d3f 100644
---- a/unix/xserver/hw/vnc/XserverDesktop.h
-+++ b/unix/xserver/hw/vnc/XserverDesktop.h
-@@ -26,15 +26,6 @@
- #include <dix-config.h>
- #endif
-
--#if XORG_VERSION_CURRENT < \
-- ((1 * 10000000) + (5 * 100000) + (99 * 1000))
--/* Xorg 1.5 branch */
--#define XORG 15
--#else
--/* Xorg 1.6 branch */
--#define XORG 16
--#endif
--
- #include <rfb/SDesktop.h>
- #include <rfb/HTTPServer.h>
- #include <rfb/PixelBuffer.h>
-diff --git a/unix/xserver/hw/vnc/vncHooks.cc b/unix/xserver/hw/vnc/vncHooks.cc
-index 700efbb..23dc4ea 100644
---- a/unix/xserver/hw/vnc/vncHooks.cc
-+++ b/unix/xserver/hw/vnc/vncHooks.cc
-@@ -25,6 +25,7 @@
- #include "XserverDesktop.h"
- #include "vncHooks.h"
- #include "vncExtInit.h"
-+#include "xorg-version.h"
-
- extern "C" {
- #define class c_class
-diff --git a/unix/xserver/hw/vnc/xorg-version.h b/unix/xserver/hw/vnc/xorg-version.h
-new file mode 100644
-index 0000000..e7eeca0
---- /dev/null
-+++ b/unix/xserver/hw/vnc/xorg-version.h
-@@ -0,0 +1,33 @@
-+/* Copyright (C) 2009 TightVNC Team
-+ * Copyright (C) 2009 Red Hat, Inc.
-+ *
-+ * This is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This software is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this software; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+ * USA.
-+ */
-+
-+#ifndef XORG_VERSION_H
-+#define XORG_VERSION_H
-+
-+#ifdef HAVE_DIX_CONFIG_H
-+#include <dix-config.h>
-+#endif
-+
-+#if XORG_VERSION_CURRENT < ((1 * 10000000) + (5 * 100000) + (99 * 1000))
-+#define XORG 15
-+#else
-+#define XORG 16
-+#endif
-+
-+#endif
-diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc
-index 45820ee..05066fc 100644
---- a/unix/xserver/hw/vnc/xvnc.cc
-+++ b/unix/xserver/hw/vnc/xvnc.cc
-@@ -37,6 +37,7 @@ from the X Consortium.
- #include <rfb/LogWriter.h>
- #include <network/TcpSocket.h>
- #include "vncExtInit.h"
-+#include "xorg-version.h"
-
- extern "C" {
- #define class c_class
---
-1.5.6.5
-