Remove RFB dependencies from X server (crashes, though).
authorSteinar H. Gunderson <sesse@samfundet.no>
Fri, 4 Feb 2005 15:32:40 +0000 (15:32 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Fri, 4 Feb 2005 15:32:40 +0000 (15:32 +0000)
Xserver/config/cf/vnclibs.def
Xserver/config/cf/vnclibs.def.in
Xserver/programs/Xserver/hw/vnc/Imakefile
Xserver/programs/Xserver/hw/vnc/init.c
Xserver/programs/Xserver/hw/vnc/rfb.h

index 98dc8b2..d666f2a 100644 (file)
@@ -17,7 +17,7 @@ top_srcdir = $(RFB_TOP)
 
 ZLIB_INCLUDE = 
 
-VNCLIBS = $(RFB_TOP)/rdr/librdr.a $(RFB_TOP)/rfb/librfb.a -lz
+VNCLIBS = -lz 
 
 VNCSYSLIBS =
 
index f4ade04..1293f24 100644 (file)
@@ -17,7 +17,7 @@ top_srcdir = $(RFB_TOP)
 
 ZLIB_INCLUDE = @ZLIB_INCLUDE@
 
-VNCLIBS = $(RFB_TOP)/rdr/librdr.a $(RFB_TOP)/rfb/librfb.a @ZLIB_LIB@
+VNCLIBS = 
 
 VNCSYSLIBS =
 
index 9ab79d8..d410a37 100644 (file)
@@ -1,13 +1,8 @@
 XCOMM $XConsortium: Imakefile,v 1.5 94/01/21 22:04:27 dpw Exp $
 #include <Server.tmpl>
 
-SRCS = init.c sockets.c kbdptr.c cmap.c draw.c cutpaste.c \
-       dispcur.c sprite.c rfbserver.c translate.c httpd.c auth.c \
-       rre.c corre.c stats.c hextile.c zrle.cc
-
-OBJS = init.o sockets.o kbdptr.o cmap.o draw.o cutpaste.o \
-       dispcur.o sprite.o rfbserver.o translate.o httpd.o auth.o \
-       rre.o corre.o stats.o hextile.o zrle.o
+SRCS = init.c 
+OBJS = init.o
 
 #include <vnclibs.def>
 INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) -I$(XINCLUDESRC) \
index a55b715..fd72434 100644 (file)
@@ -82,6 +82,12 @@ from the X Consortium.
 #include "rfb.h"
 #include "dispcur.h"
 
+int rfbMaxClientWait;
+
+int rfbPort;
+int rfbListenSock;
+Bool rfbLocalhostOnly;
+
 extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
 extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
 
@@ -213,89 +219,17 @@ ddxProcessArgument (argc, argv, i)
        return 2;
     }
 
-    if (strcasecmp(argv[i], "-rfbport") == 0) {        /* -rfbport port */
-       if (i + 1 >= argc) UseMsg();
-       rfbPort = atoi(argv[i+1]);
-       return 2;
-    }
-
-    if (strcasecmp(argv[i], "-rfbwait") == 0) {        /* -rfbwait ms */
-       if (i + 1 >= argc) UseMsg();
-       rfbMaxClientWait = atoi(argv[i+1]);
-       return 2;
-    }
-
     if (strcasecmp(argv[i], "-nocursor") == 0) {
        noCursor = TRUE;
        return 1;
     }
 
-    if (strcasecmp(argv[i], "-rfbauth") == 0) {        /* -rfbauth passwd-file */
-       if (i + 1 >= argc) UseMsg();
-       rfbAuthPasswdFile = argv[i+1];
-       return 2;
-    }
-
-    if (strcasecmp(argv[i], "-httpd") == 0) {
-       if (i + 1 >= argc) UseMsg();
-       httpDir = argv[i+1];
-       return 2;
-    }
-
-    if (strcasecmp(argv[i], "-httpport") == 0) {
-       if (i + 1 >= argc) UseMsg();
-       httpPort = atoi(argv[i+1]);
-       return 2;
-    }
-
-    if (strcasecmp(argv[i], "-deferupdate") == 0) {    /* -deferupdate ms */
-       if (i + 1 >= argc) UseMsg();
-       rfbDeferUpdateTime = atoi(argv[i+1]);
-       return 2;
-    }
-
-    if (strcasecmp(argv[i], "-economictranslate") == 0) {
-       rfbEconomicTranslate = TRUE;
-       return 1;
-    }
-
-    if (strcasecmp(argv[i], "-maxrects") == 0) {
-       if (i + 1 >= argc) UseMsg();
-       rfbMaxRects = atoi(argv[i+1]);
-       return 2;
-    }
-
-    if (strcasecmp(argv[i], "-trace") == 0) {
-        rfbTrace = TRUE;
-       return 1;
-    }
-
     if (strcasecmp(argv[i], "-desktop") == 0) {        /* -desktop desktop-name */
        if (i + 1 >= argc) UseMsg();
        desktopName = argv[i+1];
        return 2;
     }
 
-    if (strcasecmp(argv[i], "-alwaysshared") == 0) {
-       rfbAlwaysShared = TRUE;
-       return 1;
-    }
-
-    if (strcasecmp(argv[i], "-nevershared") == 0) {
-       rfbNeverShared = TRUE;
-       return 1;
-    }
-
-    if (strcasecmp(argv[i], "-dontdisconnect") == 0) {
-       rfbDontDisconnect = TRUE;
-       return 1;
-    }
-
-    if (strcasecmp(argv[i], "-localhost") == 0) {
-       rfbLocalhostOnly = TRUE;
-       return 1;
-    }
-
     if (strcasecmp(argv[i], "-inetd") == 0) {  /* -inetd */ 
        int n;
        for (n = 1; n < 100; n++) {
@@ -344,23 +278,22 @@ InitOutput(screenInfo, argc, argv)
 {
     initOutputCalled = TRUE;
 
-    rfbLog("Xvnc version %s - built %s\n", XVNCRELEASE, buildtime);
+    rfbLog("rdpsrv version 0.1 - built %s\n", buildtime);
+    rfbLog("Copyright (C) 2005 Steinar H. Gunderson\n");
     rfbLog("Copyright (C) 2002-2003 RealVNC Ltd.\n");
     rfbLog("Copyright (C) 1994-2000 AT&T Laboratories Cambridge.\n");
     rfbLog("All Rights Reserved.\n");
     rfbLog("See http://www.realvnc.com for information on VNC\n");
     rfbLog("Desktop name '%s' (%s:%s)\n",desktopName,rfbThisHost,display);
-    rfbLog("Protocol version supported %d.%d\n", rfbProtocolMajorVersion,
-          rfbProtocolMinorVersion);
 
     VNC_LAST_CLIENT_ID = MakeAtom("VNC_LAST_CLIENT_ID",
                                  strlen("VNC_LAST_CLIENT_ID"), TRUE);
     VNC_CONNECT = MakeAtom("VNC_CONNECT", strlen("VNC_CONNECT"), TRUE);
     VNC_DEFER_UPDATE = MakeAtom("VNC_DEFER_UPDATE",
                                 strlen("VNC_DEFER_UPDATE"), TRUE);
-    rfbInitSockets();
+/*    rfbInitSockets();
     if (inetdSock == -1)
-       httpInitSockets();
+       httpInitSockets(); */
    
 
     /* initialize pixmap formats */
@@ -469,22 +402,22 @@ rfbScreenInit(index, pScreen, argc, argv)
     prfb->ClearToBackground = pScreen->ClearToBackground;
     prfb->RestoreAreas = pScreen->RestoreAreas;
 
-    pScreen->CloseScreen = rfbCloseScreen;
+/*    pScreen->CloseScreen = rfbCloseScreen;
     pScreen->CreateGC = rfbCreateGC;
     pScreen->PaintWindowBackground = rfbPaintWindowBackground;
     pScreen->PaintWindowBorder = rfbPaintWindowBorder;
     pScreen->CopyWindow = rfbCopyWindow;
     pScreen->ClearToBackground = rfbClearToBackground;
-    pScreen->RestoreAreas = rfbRestoreAreas;
+    pScreen->RestoreAreas = rfbRestoreAreas; 
 
     pScreen->InstallColormap = rfbInstallColormap;
     pScreen->UninstallColormap = rfbUninstallColormap;
     pScreen->ListInstalledColormaps = rfbListInstalledColormaps;
-    pScreen->StoreColors = rfbStoreColors;
+    pScreen->StoreColors = rfbStoreColors; */
 
     pScreen->SaveScreen = rfbAlwaysTrue;
 
-    rfbDCInitialize(pScreen, &rfbPointerCursorFuncs);
+    //rfbDCInitialize(pScreen, &rfbPointerCursorFuncs);
 
     if (noCursor) {
        pScreen->DisplayCursor = rfbAlwaysTrue;
@@ -533,6 +466,7 @@ rfbScreenInit(index, pScreen, argc, argv)
        vis->blueMask = ((1 << blueBits) - 1) << vis->offsetBlue;
     }
 
+#if 0
     rfbServerFormat.bitsPerPixel = prfb->bitsPerPixel;
     rfbServerFormat.depth = prfb->depth;
     rfbServerFormat.bigEndian = !(*(char *)&rfbEndianTest);
@@ -550,6 +484,7 @@ rfbScreenInit(index, pScreen, argc, argv)
        rfbServerFormat.redShift
            = rfbServerFormat.greenShift = rfbServerFormat.blueShift = 0;
     }
+#endif
 
     if (prfb->bitsPerPixel == 1)
     {
@@ -601,22 +536,22 @@ rfbKeybdProc(pDevice, onoff)
     switch (onoff)
     {
     case DEVICE_INIT: 
-       KbdDeviceInit(pDevice, &keySyms, modMap);
-       InitKeyboardDeviceStruct(pDev, &keySyms, modMap,
+       //KbdDeviceInit(pDevice, &keySyms, modMap);
+/*     InitKeyboardDeviceStruct(pDev, &keySyms, modMap,
                                 (BellProcPtr)rfbSendBell,
-                                (KbdCtrlProcPtr)NoopDDA);
+                                (KbdCtrlProcPtr)NoopDDA); */
            break;
     case DEVICE_ON: 
        pDev->on = TRUE;
-       KbdDeviceOn();
+       //KbdDeviceOn();
        break;
     case DEVICE_OFF: 
        pDev->on = FALSE;
-       KbdDeviceOff();
+       //KbdDeviceOff();
        break;
     case DEVICE_CLOSE:
-       if (pDev->on)
-           KbdDeviceOff();
+/*     if (pDev->on)
+           KbdDeviceOff(); */
        break;
     }
     return Success;
@@ -633,30 +568,30 @@ rfbMouseProc(pDevice, onoff)
     switch (onoff)
     {
     case DEVICE_INIT:
-       PtrDeviceInit();
+       //PtrDeviceInit();
        map[1] = 1;
        map[2] = 2;
        map[3] = 3;
        map[4] = 4;
        map[5] = 5;
-       InitPointerDeviceStruct(pDev, map, 5, miPointerGetMotionEvents,
+/*     InitPointerDeviceStruct(pDev, map, 5, miPointerGetMotionEvents,
                                PtrDeviceControl,
-                               miPointerGetMotionBufferSize());
+                               miPointerGetMotionBufferSize()); */
        break;
 
     case DEVICE_ON:
        pDev->on = TRUE;
-       PtrDeviceOn(pDevice);
+//     PtrDeviceOn(pDevice);
         break;
 
     case DEVICE_OFF:
        pDev->on = FALSE;
-       PtrDeviceOff();
+//     PtrDeviceOff();
        break;
 
     case DEVICE_CLOSE:
-       if (pDev->on)
-           PtrDeviceOff();
+/*     if (pDev->on)
+           PtrDeviceOff(); */
        break;
     }
     return Success;
@@ -675,8 +610,8 @@ LegalModifier(key, pDev)
 void
 ProcessInputEvents()
 {
-    rfbCheckFds();
-    httpCheckFds();
+    /*rfbCheckFds();
+    httpCheckFds(); */
     if (*mieqCheckForInput[0] != *mieqCheckForInput[1]) {
        mieqProcessInputEvents();
        miPointerUpdate();
@@ -719,21 +654,21 @@ static Bool CheckDisplayNumber(int n)
 void
 rfbRootPropertyChange(PropertyPtr pProp)
 {
-    if ((pProp->propertyName == XA_CUT_BUFFER0) && (pProp->type == XA_STRING)
+/*    if ((pProp->propertyName == XA_CUT_BUFFER0) && (pProp->type == XA_STRING)
        && (pProp->format == 8))
     {
        rfbGotXCutText(pProp->data, pProp->size);
   }
-    else if ((pProp->propertyName == VNC_CONNECT) && (pProp->type == XA_STRING)
+ }
+    else */ if ((pProp->propertyName == VNC_CONNECT) && (pProp->type == XA_STRING)
              && (pProp->format == 8))
     {
        if (pProp->size == 0) {
           rfbClientPtr cl, nextCl;
           rfbLog("VNC_CONNECT message: disconnecting all clients\n");
-          for (cl = rfbClientHead; cl; cl = nextCl) {
+/*          for (cl = rfbClientHead; cl; cl = nextCl) {
             nextCl = cl->next;
             rfbCloseSock(cl->sock);
-          }
+          } */
         } else {
           int i;
           rfbClientPtr cl;
@@ -748,7 +683,7 @@ rfbRootPropertyChange(PropertyPtr pProp)
            }
           }
 
-          cl = rfbReverseConnection(host, port);
+//          cl = rfbReverseConnection(host, port);
 
           free(host);
         }
@@ -760,7 +695,7 @@ rfbRootPropertyChange(PropertyPtr pProp)
       char *str = (char *)Xalloc(pProp->size+1);
       memcpy(str, pProp->data, pProp->size);
       str[pProp->size] = 0;
-      rfbDeferUpdateTime = atoi(str);
+      //rfbDeferUpdateTime = atoi(str);
       free(str);
     }
 }
index ebc70a0..51efa39 100644 (file)
@@ -26,8 +26,6 @@
 #include "colormapst.h"
 #include "gcstruct.h"
 #include "osdep.h"
-#include <rfb/rfbproto.h>
-#include <rfb/vncauth.h>
 
 #define MAX_ENCODINGS 20
 
@@ -105,17 +103,6 @@ typedef struct
 } rfbScreenInfo, *rfbScreenInfoPtr;
 
 
-/*
- * rfbTranslateFnType is the type of translation functions.
- */
-
-struct rfbClientRec;
-typedef void (*rfbTranslateFnType)(char *table, rfbPixelFormat *in,
-                                  rfbPixelFormat *out,
-                                  char *iptr, char *optr,
-                                  int bytesBetweenInputLines,
-                                  int width, int height);
-
 
 /*
  * Per-client structure.
@@ -142,10 +129,6 @@ typedef struct rfbClientRec {
     int correMaxWidth, correMaxHeight;
     void* zrleData;
 
-    /* The following member is only used during VNC authentication */
-
-    CARD8 authChallenge[CHALLENGESIZE];
-
     /* The following members represent the update needed to get the client's
        framebuffer from its present state to the current state of our
        framebuffer.
@@ -191,15 +174,8 @@ typedef struct rfbClientRec {
     Bool deferredUpdateScheduled;
     OsTimerPtr deferredUpdateTimer;
 
-    /* translateFn points to the translation function which is used to copy
-       and translate a rectangle from the framebuffer to an output buffer. */
-
-    rfbTranslateFnType translateFn;
-
     char *translateLookupTable;
 
-    rfbPixelFormat format;
-
     /* statistics */
 
     int rfbBytesSent[MAX_ENCODINGS];
@@ -392,13 +368,7 @@ extern void rfbSendServerCutText(char *str, int len);
 /* translate.c */
 
 extern Bool rfbEconomicTranslate;
-extern rfbPixelFormat rfbServerFormat;
 
-extern void rfbTranslateNone(char *table, rfbPixelFormat *in,
-                            rfbPixelFormat *out,
-                            char *iptr, char *optr,
-                            int bytesBetweenInputLines,
-                            int width, int height);
 extern Bool rfbSetTranslateFunction(rfbClientPtr cl);
 extern void rfbSetClientColourMaps(int firstColour, int nColours);
 extern Bool rfbSetClientColourMap(rfbClientPtr cl, int firstColour,