From: Pierre Ossman Date: Thu, 2 Apr 2020 09:18:00 +0000 (+0200) Subject: Remove legacy Xorg code X-Git-Tag: v1.10.90~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6449ce6a5f80932e4e572102f6f9e83396aff965;p=tigervnc.git Remove legacy Xorg code We now require at least 1.16, so remove all code that handled older versions than that. --- diff --git a/unix/xserver/hw/vnc/Input.c b/unix/xserver/hw/vnc/Input.c index b342d4d6..3fe6d31c 100644 --- a/unix/xserver/hw/vnc/Input.c +++ b/unix/xserver/hw/vnc/Input.c @@ -29,9 +29,7 @@ #include "RFBGlue.h" #include "inputstr.h" -#if XORG >= 110 #include "inpututils.h" -#endif #include "mi.h" #include "mipointer.h" #include "exevents.h" @@ -51,11 +49,6 @@ extern const unsigned int code_map_qnum_to_xorgkbd_len; #define BUTTONS 7 -/* Event queue is shared between all devices. */ -#if XORG < 111 -static EventList *eventq = NULL; -#endif - DeviceIntPtr vncKeyboardDev; DeviceIntPtr vncPointerDev; @@ -130,61 +123,21 @@ void vncInitInputDevice(void) !EnableDevice(vncKeyboardDev, TRUE)) FatalError("Failed to activate TigerVNC devices\n"); -#if XORG < 111 - /* eventq is never free()-ed because it exists during server life. */ - if (eventq == NULL) - GetEventList(&eventq); -#endif - vncPrepareInputDevices(); } -#if XORG < 111 -static void enqueueEvents(DeviceIntPtr dev, int n) -{ - int i; - - for (i = 0; i < n; i++) { - /* - * Passing arguments in global variable eventq is probably not - * good programming practise but in this case it is safe and - * clear. - */ - mieqEnqueue(dev, (InternalEvent *) (eventq + i)->event); - } -} -#endif /* XORG < 111 */ - void vncPointerButtonAction(int buttonMask) { int i; -#if XORG < 111 - int n; -#endif -#if XORG >= 110 ValuatorMask mask; -#endif for (i = 0; i < BUTTONS; i++) { if ((buttonMask ^ oldButtonMask) & (1 << i)) { int action = (buttonMask & (1<= 110 ValuatorMask mask; -#endif if (cursorPosX == x && cursorPosY == y) return; valuators[0] = x; valuators[1] = y; -#if XORG < 110 - n = GetPointerEvents(eventq, vncPointerDev, MotionNotify, 0, - POINTER_ABSOLUTE, 0, 2, valuators); - enqueueEvents(vncPointerDev, n); -#elif XORG < 111 - valuator_mask_set_range(&mask, 0, 2, valuators); - n = GetPointerEvents(eventq, vncPointerDev, MotionNotify, 0, - POINTER_ABSOLUTE, &mask); - enqueueEvents(vncPointerDev, n); -#else valuator_mask_set_range(&mask, 0, 2, valuators); QueuePointerEvents(vncPointerDev, MotionNotify, 0, POINTER_ABSOLUTE, &mask); -#endif cursorPosX = x; cursorPosY = y; @@ -327,18 +264,12 @@ static int vncKeyboardProc(DeviceIntPtr pDevice, int onoff) static inline void pressKey(DeviceIntPtr dev, int kc, Bool down, const char *msg) { int action; -#if XORG < 111 - unsigned int n; -#endif if (msg != NULL) LOG_DEBUG("%s %d %s", msg, kc, down ? "down" : "up"); action = down ? KeyPress : KeyRelease; -#if XORG < 111 - n = GetKeyboardEvents(eventq, dev, action, kc); - enqueueEvents(dev, n); -#elif XORG < 118 +#if XORG < 118 QueueKeyboardEvents(dev, action, kc, NULL); #else QueueKeyboardEvents(dev, action, kc); diff --git a/unix/xserver/hw/vnc/InputXKB.c b/unix/xserver/hw/vnc/InputXKB.c index f84a6e4f..6ad8d538 100644 --- a/unix/xserver/hw/vnc/InputXKB.c +++ b/unix/xserver/hw/vnc/InputXKB.c @@ -43,12 +43,8 @@ #endif #if XORG < 118 -#if XORG < 110 -#define GetMaster(dev, type) ((dev)->u.master) -#else #define GetMaster(dev, type) ((dev)->master) #endif -#endif extern DeviceIntPtr vncKeyboardDev; diff --git a/unix/xserver/hw/vnc/vncExt.c b/unix/xserver/hw/vnc/vncExt.c index fd65eab6..89c10550 100644 --- a/unix/xserver/hw/vnc/vncExt.c +++ b/unix/xserver/hw/vnc/vncExt.c @@ -89,14 +89,8 @@ int vncNotifyQueryConnect(void) ev.sequenceNumber = cur->client->sequence; ev.window = cur->window; if (cur->client->swapped) { -#if XORG < 112 - int n; - swaps(&ev.sequenceNumber, n); - swapl(&ev.window, n); -#else swaps(&ev.sequenceNumber); swapl(&ev.window); -#endif } WriteToClient(cur->client, sizeof(xVncExtQueryConnectNotifyEvent), (char *)&ev); @@ -147,14 +141,8 @@ deny: free(param); if (client->swapped) { -#if XORG < 112 - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); -#else swaps(&rep.sequenceNumber); swapl(&rep.length); -#endif } WriteToClient(client, sizeof(xVncExtSetParamReply), (char *)&rep); return (client->noClientException); @@ -163,12 +151,7 @@ deny: static int SProcVncExtSetParam(ClientPtr client) { REQUEST(xVncExtSetParamReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else swaps(&stuff->length); -#endif REQUEST_AT_LEAST_SIZE(xVncExtSetParamReq); return ProcVncExtSetParam(client); } @@ -202,16 +185,9 @@ static int ProcVncExtGetParam(ClientPtr client) rep.length = (len + 3) >> 2; rep.valueLen = len; if (client->swapped) { -#if XORG < 112 - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.valueLen, n); -#else swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.valueLen); -#endif } WriteToClient(client, sizeof(xVncExtGetParamReply), (char *)&rep); if (value) @@ -223,12 +199,7 @@ static int ProcVncExtGetParam(ClientPtr client) static int SProcVncExtGetParam(ClientPtr client) { REQUEST(xVncExtGetParamReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else swaps(&stuff->length); -#endif REQUEST_AT_LEAST_SIZE(xVncExtGetParamReq); return ProcVncExtGetParam(client); } @@ -262,16 +233,9 @@ static int ProcVncExtGetParamDesc(ClientPtr client) rep.length = (len + 3) >> 2; rep.descLen = len; if (client->swapped) { -#if XORG < 112 - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.descLen, n); -#else swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.descLen); -#endif } WriteToClient(client, sizeof(xVncExtGetParamDescReply), (char *)&rep); if (desc) @@ -282,12 +246,7 @@ static int ProcVncExtGetParamDesc(ClientPtr client) static int SProcVncExtGetParamDesc(ClientPtr client) { REQUEST(xVncExtGetParamDescReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else swaps(&stuff->length); -#endif REQUEST_AT_LEAST_SIZE(xVncExtGetParamDescReq); return ProcVncExtGetParamDesc(client); } @@ -312,16 +271,9 @@ static int ProcVncExtListParams(ClientPtr client) rep.length = (len + 3) >> 2; rep.nParams = vncGetParamCount(); if (client->swapped) { -#if XORG < 112 - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.nParams, n); -#else swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.nParams); -#endif } WriteToClient(client, sizeof(xVncExtListParamsReply), (char *)&rep); WriteToClient(client, len, (char*)params); @@ -332,12 +284,7 @@ static int ProcVncExtListParams(ClientPtr client) static int SProcVncExtListParams(ClientPtr client) { REQUEST(xVncExtListParamsReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else swaps(&stuff->length); -#endif REQUEST_SIZE_MATCH(xVncExtListParamsReq); return ProcVncExtListParams(client); } @@ -379,20 +326,10 @@ static int ProcVncExtSelectInput(ClientPtr client) static int SProcVncExtSelectInput(ClientPtr client) { REQUEST(xVncExtSelectInputReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else swaps(&stuff->length); -#endif REQUEST_SIZE_MATCH(xVncExtSelectInputReq); -#if XORG < 112 - swapl(&stuff->window, n); - swapl(&stuff->mask, n); -#else swapl(&stuff->window); swapl(&stuff->mask); -#endif return ProcVncExtSelectInput(client); } @@ -418,14 +355,8 @@ static int ProcVncExtConnect(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; if (client->swapped) { -#if XORG < 112 - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); -#else swaps(&rep.sequenceNumber); swapl(&rep.length); -#endif } WriteToClient(client, sizeof(xVncExtConnectReply), (char *)&rep); @@ -437,12 +368,7 @@ static int ProcVncExtConnect(ClientPtr client) static int SProcVncExtConnect(ClientPtr client) { REQUEST(xVncExtConnectReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else swaps(&stuff->length); -#endif REQUEST_AT_LEAST_SIZE(xVncExtConnectReq); return ProcVncExtConnect(client); } @@ -468,22 +394,12 @@ static int ProcVncExtGetQueryConnect(ClientPtr client) rep.opaqueId = (CARD32)(long)opaqueId; rep.length = ((rep.userLen + 3) >> 2) + ((rep.addrLen + 3) >> 2); if (client->swapped) { -#if XORG < 112 - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.addrLen, n); - swapl(&rep.userLen, n); - swapl(&rep.timeout, n); - swapl(&rep.opaqueId, n); - swapl(&rep.length, n); -#else swaps(&rep.sequenceNumber); swapl(&rep.addrLen); swapl(&rep.userLen); swapl(&rep.timeout); swapl(&rep.opaqueId); swapl(&rep.length); -#endif } WriteToClient(client, sizeof(xVncExtGetQueryConnectReply), (char *)&rep); if (qcTimeout) @@ -496,12 +412,7 @@ static int ProcVncExtGetQueryConnect(ClientPtr client) static int SProcVncExtGetQueryConnect(ClientPtr client) { REQUEST(xVncExtGetQueryConnectReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); -#else swaps(&stuff->length); -#endif REQUEST_SIZE_MATCH(xVncExtGetQueryConnectReq); return ProcVncExtGetQueryConnect(client); } @@ -520,14 +431,8 @@ static int ProcVncExtApproveConnect(ClientPtr client) static int SProcVncExtApproveConnect(ClientPtr client) { REQUEST(xVncExtApproveConnectReq); -#if XORG < 112 - register char n; - swaps(&stuff->length, n); - swapl(&stuff->opaqueId, n); -#else swaps(&stuff->length); swapl(&stuff->opaqueId); -#endif REQUEST_SIZE_MATCH(xVncExtApproveConnectReq); return ProcVncExtApproveConnect(client); } diff --git a/unix/xserver/hw/vnc/vncHooks.c b/unix/xserver/hw/vnc/vncHooks.c index 5cf2c0d1..35629084 100644 --- a/unix/xserver/hw/vnc/vncHooks.c +++ b/unix/xserver/hw/vnc/vncHooks.c @@ -61,9 +61,6 @@ typedef struct _vncHooksScreenRec { CreateGCProcPtr CreateGC; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; -#if XORG < 110 - RestoreAreasProcPtr RestoreAreas; -#endif DisplayCursorProcPtr DisplayCursor; ScreenBlockHandlerProcPtr BlockHandler; #ifdef RENDER @@ -72,10 +69,8 @@ typedef struct _vncHooksScreenRec { CompositeRectsProcPtr CompositeRects; TrapezoidsProcPtr Trapezoids; TrianglesProcPtr Triangles; -#if PICTURE_SCREEN_VERSION >= 2 TriStripProcPtr TriStrip; TriFanProcPtr TriFan; -#endif #endif RRSetConfigProcPtr rrSetConfig; RRScreenSetSizeProcPtr rrScreenSetSize; @@ -83,13 +78,8 @@ typedef struct _vncHooksScreenRec { } vncHooksScreenRec, *vncHooksScreenPtr; typedef struct _vncHooksGCRec { -#if XORG >= 116 const GCFuncs *funcs; const GCOps *ops; -#else - GCFuncs *funcs; - GCOps *ops; -#endif } vncHooksGCRec, *vncHooksGCPtr; #define wrap(priv, real, mem, func) {\ @@ -101,17 +91,10 @@ typedef struct _vncHooksGCRec { real->mem = priv->mem; \ } -#if XORG < 19 -static int vncHooksScreenPrivateKeyIndex; -static int vncHooksGCPrivateKeyIndex; -static DevPrivateKey vncHooksScreenPrivateKey = &vncHooksScreenPrivateKeyIndex; -static DevPrivateKey vncHooksGCPrivateKey = &vncHooksGCPrivateKeyIndex; -#else static DevPrivateKeyRec vncHooksScreenKeyRec; static DevPrivateKeyRec vncHooksGCKeyRec; #define vncHooksScreenPrivateKey (&vncHooksScreenKeyRec) #define vncHooksGCPrivateKey (&vncHooksGCKeyRec) -#endif #define vncHooksScreenPrivate(pScreen) \ (vncHooksScreenPtr) dixLookupPrivate(&(pScreen)->devPrivates, \ @@ -122,25 +105,15 @@ static DevPrivateKeyRec vncHooksGCKeyRec; // screen functions -#if XORG <= 112 -static Bool vncHooksCloseScreen(int i, ScreenPtr pScreen); -#else static Bool vncHooksCloseScreen(ScreenPtr pScreen); -#endif static Bool vncHooksCreateGC(GCPtr pGC); static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, 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 Bool vncHooksDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr cursor); -#if XORG <= 112 -static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout, - pointer pReadmask); -#elif XORG <= 118 +#if XORG <= 118 static void vncHooksBlockHandler(ScreenPtr pScreen, void * pTimeout, void * pReadmask); #else @@ -161,7 +134,6 @@ static void vncHooksTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, static void vncHooksTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris); -#if PICTURE_SCREEN_VERSION >= 2 static void vncHooksTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoint, xPointFixed * points); @@ -169,7 +141,6 @@ static void vncHooksTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoint, xPointFixed * points); #endif -#endif static Bool vncHooksRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize); static Bool vncHooksRandRScreenSetSize(ScreenPtr pScreen, @@ -280,17 +251,6 @@ int vncHooksInit(int scrIdx) return FALSE; } -#if XORG < 19 - if (!dixRequestPrivate(vncHooksScreenPrivateKey, sizeof(vncHooksScreenRec))) { - ErrorF("vncHooksInit: Allocation of vncHooksScreen failed\n"); - return FALSE; - } - if (!dixRequestPrivate(vncHooksGCPrivateKey, sizeof(vncHooksGCRec))) { - ErrorF("vncHooksInit: Allocation of vncHooksGCRec failed\n"); - return FALSE; - } - -#else if (!dixRegisterPrivateKey(&vncHooksScreenKeyRec, PRIVATE_SCREEN, sizeof(vncHooksScreenRec))) { ErrorF("vncHooksInit: Allocation of vncHooksScreen failed\n"); @@ -302,8 +262,6 @@ int vncHooksInit(int scrIdx) return FALSE; } -#endif - vncHooksScreen = vncHooksScreenPrivate(pScreen); vncHooksScreen->ignoreHooks = 0; @@ -312,9 +270,6 @@ int vncHooksInit(int scrIdx) wrap(vncHooksScreen, pScreen, CreateGC, vncHooksCreateGC); wrap(vncHooksScreen, pScreen, CopyWindow, vncHooksCopyWindow); wrap(vncHooksScreen, pScreen, ClearToBackground, vncHooksClearToBackground); -#if XORG < 110 - wrap(vncHooksScreen, pScreen, RestoreAreas, vncHooksRestoreAreas); -#endif wrap(vncHooksScreen, pScreen, DisplayCursor, vncHooksDisplayCursor); wrap(vncHooksScreen, pScreen, BlockHandler, vncHooksBlockHandler); #ifdef RENDER @@ -325,10 +280,8 @@ int vncHooksInit(int scrIdx) wrap(vncHooksScreen, ps, CompositeRects, vncHooksCompositeRects); wrap(vncHooksScreen, ps, Trapezoids, vncHooksTrapezoids); wrap(vncHooksScreen, ps, Triangles, vncHooksTriangles); -#if PICTURE_SCREEN_VERSION >= 2 wrap(vncHooksScreen, ps, TriStrip, vncHooksTriStrip); wrap(vncHooksScreen, ps, TriFan, vncHooksTriFan); -#endif } #endif rp = rrGetScrPriv(pScreen); @@ -363,11 +316,7 @@ void vncGetScreenImage(int scrIdx, int x, int y, int width, int height, // We do one line at a time since GetImage() cannot handle stride for (i = y; i < y + height; i++) { DrawablePtr pDrawable; -#if XORG < 19 - pDrawable = (DrawablePtr) WindowTable[scrIdx]; -#else pDrawable = (DrawablePtr) pScreen->root; -#endif (*pScreen->GetImage) (pDrawable, x, i, width, 1, ZPixmap, (unsigned long)~0L, buffer); @@ -454,11 +403,7 @@ static inline Bool is_visible(DrawablePtr drawable) // CloseScreen - unwrap the screen functions and call the original CloseScreen // function -#if XORG <= 112 -static Bool vncHooksCloseScreen(int i, ScreenPtr pScreen_) -#else static Bool vncHooksCloseScreen(ScreenPtr pScreen_) -#endif { #ifdef RENDER PictureScreenPtr ps; @@ -470,9 +415,6 @@ static Bool vncHooksCloseScreen(ScreenPtr pScreen_) unwrap(vncHooksScreen, pScreen, CreateGC); unwrap(vncHooksScreen, pScreen, CopyWindow); unwrap(vncHooksScreen, pScreen, ClearToBackground); -#if XORG < 110 - unwrap(vncHooksScreen, pScreen, RestoreAreas); -#endif unwrap(vncHooksScreen, pScreen, DisplayCursor); unwrap(vncHooksScreen, pScreen, BlockHandler); #ifdef RENDER @@ -483,10 +425,8 @@ static Bool vncHooksCloseScreen(ScreenPtr pScreen_) unwrap(vncHooksScreen, ps, CompositeRects); unwrap(vncHooksScreen, ps, Trapezoids); unwrap(vncHooksScreen, ps, Triangles); -#if PICTURE_SCREEN_VERSION >= 2 unwrap(vncHooksScreen, ps, TriStrip); unwrap(vncHooksScreen, ps, TriFan); -#endif } #endif rp = rrGetScrPriv(pScreen); @@ -498,11 +438,7 @@ static Bool vncHooksCloseScreen(ScreenPtr pScreen_) DBGPRINT((stderr,"vncHooksCloseScreen: unwrapped screen functions\n")); -#if XORG <= 112 - return (*pScreen->CloseScreen)(i, pScreen); -#else return (*pScreen->CloseScreen)(pScreen); -#endif } // CreateGC - wrap the "GC funcs" @@ -601,30 +537,6 @@ static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w, SCREEN_EPILOGUE(ClearToBackground); } -#if XORG < 110 -// RestoreAreas - changed region is the given region - -static RegionPtr vncHooksRestoreAreas(WindowPtr pWin, RegionPtr pRegion) -{ - RegionRec reg; - - SCREEN_PROLOGUE(pWin->drawable.pScreen, RestoreAreas); - - REGION_NULL(pScreen, ®); - REGION_COPY(pScreen, ®, pRegion); - - RegionPtr result = (*pScreen->RestoreAreas) (pWin, pRegion); - - add_changed(pScreen, ®); - - REGION_UNINIT(pScreen, ®); - - SCREEN_EPILOGUE(RestoreAreas); - - return result; -} -#endif - // DisplayCursor - get the cursor shape static Bool vncHooksDisplayCursor(DeviceIntPtr pDev, @@ -656,7 +568,6 @@ static Bool vncHooksDisplayCursor(DeviceIntPtr pDev, if (rgbaData == NULL) goto out; -#ifdef ARGB_CURSOR if (cursor->bits->argb) { unsigned char *out; CARD32 *in; @@ -673,7 +584,6 @@ static Bool vncHooksDisplayCursor(DeviceIntPtr pDev, in++; } } else { -#endif unsigned char *out; int xMaskBytesPerRow; @@ -707,9 +617,7 @@ static Bool vncHooksDisplayCursor(DeviceIntPtr pDev, out += 4; } } -#ifdef ARGB_CURSOR } -#endif vncSetCursor(width, height, hotX, hotY, rgbaData); @@ -725,27 +633,18 @@ out: // BlockHandler - ignore any changes during the block handler - it's likely // these are just drawing the cursor. -#if XORG <= 112 -static void vncHooksBlockHandler(int i, pointer blockData, pointer pTimeout, - pointer pReadmask) -#elif XORG <= 118 +#if XORG <= 118 static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout, void * pReadmask) #else static void vncHooksBlockHandler(ScreenPtr pScreen_, void * pTimeout) #endif { -#if XORG <= 112 - SCREEN_PROLOGUE(screenInfo.screens[i], BlockHandler); -#else SCREEN_PROLOGUE(pScreen_, BlockHandler); -#endif vncHooksScreen->ignoreHooks++; -#if XORG <= 112 - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); -#elif XORG <= 118 +#if XORG <= 118 (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); #else (*pScreen->BlockHandler) (pScreen, pTimeout); @@ -1075,8 +974,6 @@ static void vncHooksTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, RENDER_EPILOGUE(Triangles); } -#if PICTURE_SCREEN_VERSION >= 2 - static void vncHooksTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoint, xPointFixed * points) @@ -1195,8 +1092,6 @@ static void vncHooksTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, RENDER_EPILOGUE(TriFan); } -#endif /* PICTURE_SCREEN_VERSION */ - #endif /* RENDER */ // Unwrap and rewrap helpers @@ -1348,21 +1243,12 @@ static void vncHooksCopyClip(GCPtr dst, GCPtr src) { // Unwrap and rewrap helpers -#if XORG >= 116 #define GC_OP_PROLOGUE(pGC, name)\ vncHooksGCPtr pGCPriv = vncHooksGCPrivate(pGC);\ const GCFuncs *oldFuncs = pGC->funcs;\ unwrap(pGCPriv, pGC, funcs);\ unwrap(pGCPriv, pGC, ops);\ DBGPRINT((stderr,"vncHooks" #name " called\n")) -#else -#define GC_OP_PROLOGUE(pGC, name)\ - vncHooksGCPtr pGCPriv = vncHooksGCPrivate(pGC);\ - GCFuncs *oldFuncs = pGC->funcs;\ - unwrap(pGCPriv, pGC, funcs);\ - unwrap(pGCPriv, pGC, ops);\ - DBGPRINT((stderr,"vncHooks" #name " called\n")) -#endif #define GC_OP_EPILOGUE(pGC)\ wrap(pGCPriv, pGC, funcs, oldFuncs); \ diff --git a/unix/xserver/hw/vnc/vncModule.c b/unix/xserver/hw/vnc/vncModule.c index 451f527a..a448c2f1 100644 --- a/unix/xserver/hw/vnc/vncModule.c +++ b/unix/xserver/hw/vnc/vncModule.c @@ -27,9 +27,6 @@ #include "randrstr.h" #include "xorg-version.h" -#if XORG <= 111 -typedef pointer XF86OptionPtr; -#endif #include "xf86.h" #include "xf86Module.h" @@ -47,10 +44,6 @@ ExtensionModule vncExt = { vncModuleInit, "VNC", -#if XORG < 112 - NULL, - NULL, -#endif NULL }; @@ -72,11 +65,7 @@ _X_EXPORT XF86ModuleData vncModuleData = { &vncVersRec, vncSetup, NULL }; static void * vncSetup(void * module, void * opts, int *errmaj, int *errmin) { -#if XORG >= 116 LoadExtensionList(&vncExt, 1, FALSE); -#else - LoadExtension(&vncExt, FALSE); -#endif /* Need a non-NULL return value to indicate success */ return (void *)1; } diff --git a/unix/xserver/hw/vnc/xorg-version.h b/unix/xserver/hw/vnc/xorg-version.h index 16145711..5effe7e9 100644 --- a/unix/xserver/hw/vnc/xorg-version.h +++ b/unix/xserver/hw/vnc/xorg-version.h @@ -24,26 +24,8 @@ #include #endif -#if XORG_VERSION_CURRENT < ((1 * 10000000) + (6 * 100000) + (99 * 1000)) -#error "X.Org older than 1.7 is not supported" -#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (7 * 100000) + (99 * 1000)) -#define XORG 17 -#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (8 * 100000) + (99 * 1000)) -#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 -#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (11 * 100000) + (99 * 1000)) -#define XORG 111 -#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (12 * 100000) + (99 * 1000)) -#define XORG 112 -#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (13 * 100000) + (99 * 1000)) -#define XORG 113 -#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (14 * 100000) + (99 * 1000)) -#define XORG 114 -#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (15 * 100000) + (99 * 1000)) -#define XORG 115 +#if XORG_VERSION_CURRENT < ((1 * 10000000) + (15 * 100000) + (99 * 1000)) +#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)) diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c index d50fc262..424f8a64 100644 --- a/unix/xserver/hw/vnc/xvnc.c +++ b/unix/xserver/hw/vnc/xvnc.c @@ -47,15 +47,10 @@ from the X Consortium. #include #include #include "scrnintstr.h" -#if XORG >= 120 #include "glx_extinit.h" -#endif #include "servermd.h" #include "fb.h" #include "mi.h" -#if XORG < 114 -#include "mibstore.h" -#endif #include "colormapst.h" #include "gcstruct.h" #include "input.h" @@ -224,11 +219,7 @@ Bool DPMSSupported(void) #endif #endif -#if XORG < 111 -void ddxGiveUp() -#else void ddxGiveUp(enum ExitCode error) -#endif { int i; @@ -238,17 +229,9 @@ void ddxGiveUp(enum ExitCode error) } void -#if XORG < 111 -AbortDDX() -#else AbortDDX(enum ExitCode error) -#endif { -#if XORG < 111 - ddxGiveUp(); -#else ddxGiveUp(error); -#endif } #ifdef __DARWIN__ @@ -280,11 +263,7 @@ OsVendorInit(void) } void -#if XORG < 113 -OsVendorFatalError() -#else OsVendorFatalError(const char *f, va_list args) -#endif { } @@ -661,25 +640,17 @@ GetTimeInMillis() } #endif -#if XORG < 113 -static ColormapPtr InstalledMaps[MAXSCREENS]; -#else static DevPrivateKeyRec cmapScrPrivateKeyRec; #define cmapScrPrivateKey (&cmapScrPrivateKeyRec) #define GetInstalledColormap(s) ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, cmapScrPrivateKey)) #define SetInstalledColormap(s,c) (dixSetPrivate(&(s)->devPrivates, cmapScrPrivateKey, c)) -#endif static int vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) { /* By the time we are processing requests, we can guarantee that there * is always a colormap installed */ -#if XORG < 113 - *pmaps = InstalledMaps[pScreen->myNum]->mid; -#else *pmaps = GetInstalledColormap(pScreen)->mid; -#endif return (1); } @@ -687,16 +658,9 @@ vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) static void vfbInstallColormap(ColormapPtr pmap) { -#if XORG < 113 - int index = pmap->pScreen->myNum; -#endif ColormapPtr oldpmap; -#if XORG < 113 - oldpmap = InstalledMaps[index]; -#else oldpmap = GetInstalledColormap(pmap->pScreen); -#endif if (pmap != oldpmap) { @@ -710,11 +674,7 @@ vfbInstallColormap(ColormapPtr pmap) if(oldpmap != (ColormapPtr)None) WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid); /* Install pmap */ -#if XORG < 113 - InstalledMaps[index] = pmap; -#else SetInstalledColormap(pmap->pScreen, pmap); -#endif WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid); entries = pmap->pVisual->ColormapEntries; @@ -728,11 +688,7 @@ vfbInstallColormap(ColormapPtr pmap) for (i = 0; i < entries; i++) ppix[i] = i; /* XXX truecolor */ -#if XORG < 19 - QueryColors(pmap, entries, ppix, prgb); -#else QueryColors(pmap, entries, ppix, prgb, serverClient); -#endif for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */ defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */ @@ -752,26 +708,17 @@ vfbInstallColormap(ColormapPtr pmap) static void vfbUninstallColormap(ColormapPtr pmap) { -#if XORG < 113 - ColormapPtr curpmap = InstalledMaps[pmap->pScreen->myNum]; -#else ColormapPtr curpmap = GetInstalledColormap(pmap->pScreen); -#endif if(pmap == curpmap) { if (pmap->mid != pmap->pScreen->defColormap) { -#if XORG < 111 - curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap, - RT_COLORMAP); -#else int rc = dixLookupResourceByType((void * *) &curpmap, pmap->pScreen->defColormap, RT_COLORMAP, serverClient, DixUnknownAccess); if (rc != Success) ErrorF("Failed to uninstall color map\n"); else -#endif (*pmap->pScreen->InstallColormap)(curpmap); } } @@ -973,20 +920,10 @@ static Bool vncRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) static void xf86SetRootClip (ScreenPtr pScreen, Bool enable) { -#if XORG < 19 - WindowPtr pWin = WindowTable[pScreen->myNum]; -#else WindowPtr pWin = pScreen->root; -#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; @@ -1044,13 +981,6 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) if (WasViewable) { -#if XORG < 110 - if (pWin->backStorage) - { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); - } -#endif if (pWin->firstChild) { @@ -1064,50 +994,15 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) anyMarked = TRUE; } -#if XORG < 110 && defined(DO_SAVE_UNDERS) - if (DO_SAVE_UNDERS(pWin)) - { - dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin); - } -#endif /* DO_SAVE_UNDERS */ - if (anyMarked) (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); } -#if XORG < 110 - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); - if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - } -#endif if (WasViewable) { if (anyMarked) (*pScreen->HandleExposures)(pWin); -#if XORG < 110 && defined(DO_SAVE_UNDERS) - if (dosave) - (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin); -#endif /* DO_SAVE_UNDERS */ if (anyMarked && pScreen->PostValidateTree) (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther); } @@ -1506,17 +1401,9 @@ static Bool vncRandRInit(ScreenPtr pScreen) static Bool -#if XORG < 113 -vfbCloseScreen(int index, ScreenPtr pScreen) -#else vfbCloseScreen(ScreenPtr pScreen) -#endif { -#if XORG < 113 - vfbScreenInfoPtr pvfb = &vfbScreens[index]; -#else vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; -#endif int i; pScreen->CloseScreen = pvfb->closeScreen; @@ -1525,12 +1412,6 @@ vfbCloseScreen(ScreenPtr pScreen) * XXX probably lots of stuff to clean. For now, * clear installed colormaps so that server reset works correctly. */ -#if XORG < 113 - for (i = 0; i < MAXSCREENS; i++) - InstalledMaps[i] = NULL; - - return pScreen->CloseScreen(index, pScreen); -#else for (i = 0; i < screenInfo.numScreens; i++) SetInstalledColormap(screenInfo.screens[i], NULL); @@ -1542,19 +1423,12 @@ vfbCloseScreen(ScreenPtr pScreen) pScreen->devPrivate = NULL; return pScreen->CloseScreen(pScreen); -#endif } static Bool -#if XORG < 113 -vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) -#else vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) -#endif { -#if XORG >= 113 int index = pScreen->myNum; -#endif vfbScreenInfoPtr pvfb = &vfbScreens[index]; int dpi; int ret; @@ -1562,10 +1436,8 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) rrScrPrivPtr rp; -#if XORG >= 113 if (!dixRegisterPrivateKey(&cmapScrPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; -#endif /* 96 is the default used by most other systems */ dpi = 96; @@ -1618,10 +1490,6 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) if (!ret) return FALSE; -#if XORG < 110 - miInitializeBackingStore(pScreen); -#endif - /* * Circumvent the backing store that was just initialised. This amounts * to a truely bizarre way of initialising SaveDoomedAreas and friends. @@ -1716,7 +1584,6 @@ static void vfbClientStateChange(CallbackListPtr *a, void *b, void *c) { } } -#if XORG >= 113 #ifdef GLXEXT extern void GlxExtensionInit(void); @@ -1726,7 +1593,6 @@ static ExtensionModule glxExt = { &noGlxExtension }; #endif -#endif void InitOutput(ScreenInfo *scrInfo, int argc, char **argv) @@ -1740,15 +1606,9 @@ InitOutput(ScreenInfo *scrInfo, int argc, char **argv) xorgGlxCreateVendor(); #else -#if XORG >= 113 #ifdef GLXEXT if (serverGeneration == 1) -#if XORG >= 116 LoadExtensionList(&glxExt, 1, TRUE); -#else - LoadExtension(&glxExt, TRUE); -#endif -#endif #endif #endif @@ -1832,11 +1692,9 @@ void InitInput(int argc, char *argv[]) mieqInit (); } -#if XORG > 17 void CloseInput(void) { } -#endif void vncClientGone(int fd) {