Inherit SocketServer directly from VNCServer
This makes VNCServer a sufficiently complete interface that callers
don't need to know about the specific implementation (VNCServerST
currently). And assuming that all servers will use sockets is not
that outrageous.
diff --git a/common/rfb/VNCServer.h b/common/rfb/VNCServer.h
index 5bb7c0b..298326f 100644
--- a/common/rfb/VNCServer.h
+++ b/common/rfb/VNCServer.h
@@ -22,15 +22,16 @@
#ifndef __RFB_VNCSERVER_H__
#define __RFB_VNCSERVER_H__
+#include <network/Socket.h>
+
#include <rfb/UpdateTracker.h>
#include <rfb/SSecurity.h>
#include <rfb/ScreenSet.h>
-namespace network { class Socket; }
-
namespace rfb {
- class VNCServer : public UpdateTracker {
+ class VNCServer : public UpdateTracker,
+ public network::SocketServer {
public:
// blockUpdates()/unblockUpdates() tells the server that the pixel buffer
// is currently in flux and may not be accessed. The attributes of the
diff --git a/common/rfb/VNCServerST.h b/common/rfb/VNCServerST.h
index 52b2289..ed8561a 100644
--- a/common/rfb/VNCServerST.h
+++ b/common/rfb/VNCServerST.h
@@ -31,7 +31,6 @@
#include <rfb/Blacklist.h>
#include <rfb/Cursor.h>
#include <rfb/Timer.h>
-#include <network/Socket.h>
#include <rfb/ScreenSet.h>
namespace rfb {
@@ -43,8 +42,7 @@
class KeyRemapper;
class VNCServerST : public VNCServer,
- public Timer::Callback,
- public network::SocketServer {
+ public Timer::Callback {
public:
// -=- Constructors
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx
index 62a18a0..9a047c8 100644
--- a/unix/x0vncserver/XDesktop.cxx
+++ b/unix/x0vncserver/XDesktop.cxx
@@ -236,7 +236,7 @@
pb = new XPixelBuffer(dpy, factory, geometry->getRect());
vlog.info("Allocated %s", pb->getImage()->classDesc());
- server = (VNCServerST *)vs;
+ server = vs;
server->setPixelBuffer(pb, computeScreenLayout());
#ifdef HAVE_XDAMAGE
diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h
index dc616e9..7d06061 100644
--- a/unix/x0vncserver/XDesktop.h
+++ b/unix/x0vncserver/XDesktop.h
@@ -21,7 +21,7 @@
#ifndef __XDESKTOP_H__
#define __XDESKTOP_H__
-#include <rfb/VNCServerST.h>
+#include <rfb/SDesktop.h>
#include <tx/TXWindow.h>
#include <unixcommon.h>
@@ -70,7 +70,7 @@
Display* dpy;
Geometry* geometry;
XPixelBuffer* pb;
- rfb::VNCServerST* server;
+ rfb::VNCServer* server;
QueryConnectDialog* queryConnectDialog;
network::Socket* queryConnectSock;
int oldButtonMask;
diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h
index 04666cd..ff36b3b 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.h
+++ b/unix/xserver/hw/vnc/XserverDesktop.h
@@ -34,7 +34,7 @@
#include <rfb/SDesktop.h>
#include <rfb/PixelBuffer.h>
#include <rfb/Configuration.h>
-#include <rfb/VNCServerST.h>
+#include <rfb/Timer.h>
#include <unixcommon.h>
#include "Input.h"
@@ -111,7 +111,7 @@
private:
int screenIndex;
- rfb::VNCServerST* server;
+ rfb::VNCServer* server;
std::list<network::SocketListener*> listeners;
bool directFbptr;