removed dead vnc integration attempt.

This commit is contained in:
Nick Bolton 2013-05-31 15:43:37 +00:00
parent 7ab09dffd9
commit 1b969a4283
12 changed files with 2 additions and 186 deletions

View File

@ -298,10 +298,6 @@ if (GAME_DEVICE_SUPPORT)
add_definitions(-DGAME_DEVICE_SUPPORT) add_definitions(-DGAME_DEVICE_SUPPORT)
endif() endif()
if (VNC_SUPPORT)
add_definitions(-DVNC_SUPPORT)
endif()
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(tools) add_subdirectory(tools)

View File

@ -55,10 +55,6 @@ if (UNIX)
) )
endif() endif()
if (VNC_SUPPORT)
list(APPEND libs vnc_server vnc_client)
endif()
include_directories(${inc}) include_directories(${inc})
add_executable(synergyc ${src}) add_executable(synergyc ${src})
target_link_libraries(synergyc target_link_libraries(synergyc

View File

@ -44,10 +44,6 @@ else()
add_executable(synergyd ${src}) add_executable(synergyd ${src})
endif() endif()
if (VNC_SUPPORT)
list(APPEND libs vnc_server vnc_client)
endif()
target_link_libraries(synergyd target_link_libraries(synergyd
arch base common io ipc mt net platform synergy cryptopp ${libs}) arch base common io ipc mt net platform synergy cryptopp ${libs})

View File

@ -169,12 +169,6 @@ CApp::parseArg(const int& argc, const char* const* argv, int& i)
argsBase().m_crypto.setMode(argv[++i]); argsBase().m_crypto.setMode(argv[++i]);
} }
#if VNC_SUPPORT
else if (isArg(i, argc, argv, NULL, "--vnc")) {
argsBase().m_enableVnc = true;
}
#endif
else { else {
// option not supported here // option not supported here
return false; return false;

View File

@ -38,7 +38,6 @@ m_pname(NULL),
m_logFilter(NULL), m_logFilter(NULL),
m_logFile(NULL), m_logFile(NULL),
m_display(NULL), m_display(NULL),
m_enableVnc(false),
m_enableIpc(false) m_enableIpc(false)
{ {
} }

View File

@ -36,7 +36,6 @@ public:
const char* m_display; const char* m_display;
CString m_name; CString m_name;
bool m_disableTray; bool m_disableTray;
bool m_enableVnc;
bool m_enableIpc; bool m_enableIpc;
CCryptoOptions m_crypto; CCryptoOptions m_crypto;
#if SYSAPI_WIN32 #if SYSAPI_WIN32

View File

@ -40,9 +40,6 @@
#if SYSAPI_WIN32 #if SYSAPI_WIN32
#include "CArchMiscWindows.h" #include "CArchMiscWindows.h"
#if VNC_SUPPORT
#include "vnc/win/winvnc/winvnc.h"
#endif
#endif #endif
#if SYSAPI_WIN32 && GAME_DEVICE_SUPPORT #if SYSAPI_WIN32 && GAME_DEVICE_SUPPORT
@ -66,15 +63,12 @@
CClientApp::CClientApp(CreateTaskBarReceiverFunc createTaskBarReceiver) : CClientApp::CClientApp(CreateTaskBarReceiverFunc createTaskBarReceiver) :
CApp(createTaskBarReceiver, new CArgs()), CApp(createTaskBarReceiver, new CArgs()),
s_client(NULL), s_client(NULL),
s_clientScreen(NULL), s_clientScreen(NULL)
m_vncThread(NULL)
{ {
} }
CClientApp::~CClientApp() CClientApp::~CClientApp()
{ {
if (m_vncThread)
delete m_vncThread;
} }
CClientApp::CArgs::CArgs() : CClientApp::CArgs::CArgs() :
@ -618,11 +612,6 @@ CClientApp::runInner(int argc, char** argv, ILogOutputter* outputter, StartupFun
void void
CClientApp::startNode() CClientApp::startNode()
{ {
if (args().m_enableVnc) {
m_vncThread = new CThread(new TMethodJob<CClientApp>(
this, &CClientApp::vncThread, NULL));
}
// start the client. if this return false then we've failed and // start the client. if this return false then we've failed and
// we shouldn't retry. // we shouldn't retry.
LOG((CLOG_DEBUG1 "starting client")); LOG((CLOG_DEBUG1 "starting client"));
@ -630,11 +619,3 @@ CClientApp::startNode()
m_bye(kExitFailed); m_bye(kExitFailed);
} }
} }
void
CClientApp::vncThread(void*)
{
#if VNC_SUPPORT
vncServerMain(0, NULL);
#endif
}

View File

@ -85,10 +85,8 @@ public:
private: private:
virtual bool parseArg(const int& argc, const char* const* argv, int& i); virtual bool parseArg(const int& argc, const char* const* argv, int& i);
void vncThread(void*);
private: private:
CClient* s_client; CClient* s_client;
CScreen* s_clientScreen; CScreen* s_clientScreen;
CThread* m_vncThread;
}; };

View File

@ -34,7 +34,6 @@
#include "LogOutputters.h" #include "LogOutputters.h"
#include "CFunctionEventJob.h" #include "CFunctionEventJob.h"
#include "TMethodJob.h" #include "TMethodJob.h"
#include "CVncClient.h"
#if SYSAPI_WIN32 #if SYSAPI_WIN32
#include "CArchMiscWindows.h" #include "CArchMiscWindows.h"
@ -65,8 +64,7 @@ s_serverState(kUninitialized),
s_serverScreen(NULL), s_serverScreen(NULL),
s_primaryClient(NULL), s_primaryClient(NULL),
s_listener(NULL), s_listener(NULL),
s_timer(NULL), s_timer(NULL)
m_vncClient(NULL)
{ {
} }
@ -324,13 +322,6 @@ CServerApp::handleClientConnected(const CEvent&, void* vlistener)
if (client != NULL) { if (client != NULL) {
s_server->adoptClient(client); s_server->adoptClient(client);
updateStatus(); updateStatus();
if (args().m_enableVnc) {
// TODO: figure out client IP address from name.
CVncClient* vncClient = new CVncClient("192.168.0.13", client->getName());
vncClient->start();
m_vncClients.insert(std::pair<CString, CVncClient*>(client->getName(), vncClient));
}
} }
} }
@ -733,24 +724,6 @@ CServerApp::handleNoClients(const CEvent&, void*)
void void
CServerApp::handleScreenSwitched(const CEvent& e, void*) CServerApp::handleScreenSwitched(const CEvent& e, void*)
{ {
if (!args().m_enableVnc)
return;
if (m_vncClient != NULL) {
LOG((CLOG_DEBUG "hiding vnc viewer for: %s", m_vncClient->m_screen.c_str()));
m_vncClient->hideViewer();
}
CServer::CSwitchToScreenInfo* info = reinterpret_cast<CServer::CSwitchToScreenInfo*>(e.getData());
std::map<CString, CVncClient*>::iterator it = m_vncClients.find(info->m_screen);
if (it == m_vncClients.end()) {
LOG((CLOG_DEBUG "could not find vnc client for: %s", info->m_screen));
return;
}
LOG((CLOG_DEBUG "showing vnc viewer for: %s", info->m_screen));
m_vncClient = it->second;
m_vncClient->showViewer();
} }
int int

View File

@ -41,7 +41,6 @@ class CScreen;
class CClientListener; class CClientListener;
class CEventQueueTimer; class CEventQueueTimer;
class ILogOutputter; class ILogOutputter;
class CVncClient;
class CServerApp : public CApp { class CServerApp : public CApp {
public: public:
@ -126,10 +125,7 @@ public:
private: private:
virtual bool parseArg(const int& argc, const char* const* argv, int& i); virtual bool parseArg(const int& argc, const char* const* argv, int& i);
void vncThread(void*);
void handleScreenSwitched(const CEvent&, void* data); void handleScreenSwitched(const CEvent&, void* data);
std::map<CString, CVncClient*> m_vncClients;
CVncClient* m_vncClient;
}; };
// configuration file name // configuration file name

View File

@ -1,72 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Bolton Software Ltd.
* Copyright (C) 2012 Nick Bolton
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package 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 program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CVncClient.h"
#include "CThread.h"
#include "TMethodJob.h"
#if VNC_SUPPORT
#include "vnc/win/vncviewer/vncviewer.h"
#include "vnc/win/vncviewer/CConn.h"
#include "vnc/win/vncviewer/CConnThread.h"
#endif
CVncClient::CVncClient(const char* hostInfo, const std::string& screen) :
m_hostInfo(hostInfo),
m_screen(screen),
m_thread(NULL),
m_connThread(NULL)
{
}
CVncClient::~CVncClient()
{
if (m_thread)
delete m_thread;
}
void
CVncClient::thread(void*)
{
#if VNC_SUPPORT
vncClientMain(this);
#endif
}
void
CVncClient::start()
{
m_thread = new CThread(new TMethodJob<CVncClient>(
this, &CVncClient::thread, NULL));
}
void
CVncClient::showViewer()
{
#if VNC_SUPPORT
m_connThread->connRef->showViewer();
#endif
}
void
CVncClient::hideViewer()
{
#if VNC_SUPPORT
m_connThread->connRef->hideViewer();
#endif
}

View File

@ -1,40 +0,0 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Bolton Software Ltd.
* Copyright (C) 2012 Nick Bolton
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package 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 program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <string>
class CThread;
namespace rfb { namespace win32 { class CConnThread; } }
class CVncClient {
public:
CVncClient(const char* hostInfo, const std::string& screen);
virtual ~CVncClient();
void thread(void*);
void start();
void showViewer();
void hideViewer();
std::string m_screen;
public:
const char* m_hostInfo;
rfb::win32::CConnThread* m_connThread;
private:
CThread* m_thread;
};