diff --git a/src/cmd/synergyc/CMakeLists.txt b/src/cmd/synergyc/CMakeLists.txt
index d073e342..be6edc52 100644
--- a/src/cmd/synergyc/CMakeLists.txt
+++ b/src/cmd/synergyc/CMakeLists.txt
@@ -19,8 +19,6 @@ set(sources
)
if (WIN32)
- file(GLOB arch_headers "MSWindows*.h")
- file(GLOB arch_sources "MSWindows*.cpp")
list(APPEND sources
resource.h
synergyc.ico
@@ -30,12 +28,6 @@ if (WIN32)
tb_run.ico
tb_wait.ico
)
-elseif (APPLE)
- file(GLOB arch_headers "OSX*.h")
- file(GLOB arch_sources "OSX*.cpp")
-elseif (UNIX)
- file(GLOB arch_headers "XWindows*.h")
- file(GLOB arch_sources "XWindows*.cpp")
endif()
list(APPEND sources ${arch_sources})
@@ -47,4 +39,4 @@ endif()
add_executable(synergyc ${sources})
target_link_libraries(synergyc
- arch base client common io mt net ipc platform server synlib ${libs} ${OPENSSL_LIBS})
+ arch base client common io mt net ipc platform server core ${libs} ${OPENSSL_LIBS})
diff --git a/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.cpp b/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.cpp
deleted file mode 100644
index 05af63a5..00000000
--- a/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.cpp
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2003 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#include "MSWindowsClientTaskBarReceiver.h"
-
-#include "resource.h"
-#include "client/Client.h"
-#include "platform/MSWindowsClipboard.h"
-#include "platform/MSWindowsScreen.h"
-#include "arch/win32/ArchTaskBarWindows.h"
-#include "arch/win32/ArchMiscWindows.h"
-#include "arch/Arch.h"
-#include "base/EventQueue.h"
-#include "base/log_outputters.h"
-#include "base/EventTypes.h"
-
-//
-// MSWindowsClientTaskBarReceiver
-//
-
-const UINT MSWindowsClientTaskBarReceiver::s_stateToIconID[kMaxState] =
-{
- IDI_TASKBAR_NOT_RUNNING,
- IDI_TASKBAR_NOT_WORKING,
- IDI_TASKBAR_NOT_CONNECTED,
- IDI_TASKBAR_NOT_CONNECTED,
- IDI_TASKBAR_CONNECTED
-};
-
-MSWindowsClientTaskBarReceiver::MSWindowsClientTaskBarReceiver(
- HINSTANCE appInstance, const BufferedLogOutputter* logBuffer, IEventQueue* events) :
- ClientTaskBarReceiver(events),
- m_appInstance(appInstance),
- m_window(NULL),
- m_logBuffer(logBuffer)
-{
- for (UInt32 i = 0; i < kMaxState; ++i) {
- m_icon[i] = loadIcon(s_stateToIconID[i]);
- }
- m_menu = LoadMenu(m_appInstance, MAKEINTRESOURCE(IDR_TASKBAR));
-
- // don't create the window yet. we'll create it on demand. this
- // has the side benefit of being created in the thread used for
- // the task bar. that's good because it means the existence of
- // the window won't prevent changing the main thread's desktop.
-
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-MSWindowsClientTaskBarReceiver::~MSWindowsClientTaskBarReceiver()
-{
- cleanup();
-}
-
-void
-MSWindowsClientTaskBarReceiver::cleanup()
-{
- ARCH->removeReceiver(this);
- for (UInt32 i = 0; i < kMaxState; ++i) {
- deleteIcon(m_icon[i]);
- }
- DestroyMenu(m_menu);
- destroyWindow();
-}
-
-void
-MSWindowsClientTaskBarReceiver::showStatus()
-{
- // create the window
- createWindow();
-
- // lock self while getting status
- lock();
-
- // get the current status
- std::string status = getToolTip();
-
- // done getting status
- unlock();
-
- // update dialog
- HWND child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_STATUS);
- SendMessage(child, WM_SETTEXT, 0, (LPARAM)status.c_str());
-
- if (!IsWindowVisible(m_window)) {
- // position it by the mouse
- POINT cursorPos;
- GetCursorPos(&cursorPos);
- RECT windowRect;
- GetWindowRect(m_window, &windowRect);
- int x = cursorPos.x;
- int y = cursorPos.y;
- int fw = GetSystemMetrics(SM_CXDLGFRAME);
- int fh = GetSystemMetrics(SM_CYDLGFRAME);
- int ww = windowRect.right - windowRect.left;
- int wh = windowRect.bottom - windowRect.top;
- int sw = GetSystemMetrics(SM_CXFULLSCREEN);
- int sh = GetSystemMetrics(SM_CYFULLSCREEN);
- if (fw < 1) {
- fw = 1;
- }
- if (fh < 1) {
- fh = 1;
- }
- if (x + ww - fw > sw) {
- x -= ww - fw;
- }
- else {
- x -= fw;
- }
- if (x < 0) {
- x = 0;
- }
- if (y + wh - fh > sh) {
- y -= wh - fh;
- }
- else {
- y -= fh;
- }
- if (y < 0) {
- y = 0;
- }
- SetWindowPos(m_window, HWND_TOPMOST, x, y, ww, wh,
- SWP_SHOWWINDOW);
- }
-}
-
-void
-MSWindowsClientTaskBarReceiver::runMenu(int x, int y)
-{
- // do popup menu. we need a window to pass to TrackPopupMenu().
- // the SetForegroundWindow() and SendMessage() calls around
- // TrackPopupMenu() are to get the menu to be dismissed when
- // another window gets activated and are just one of those
- // win32 weirdnesses.
- createWindow();
- SetForegroundWindow(m_window);
- HMENU menu = GetSubMenu(m_menu, 0);
- SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
- HMENU logLevelMenu = GetSubMenu(menu, 3);
- CheckMenuRadioItem(logLevelMenu, 0, 6,
- CLOG->getFilter() - kERROR, MF_BYPOSITION);
- int n = TrackPopupMenu(menu,
- TPM_NONOTIFY |
- TPM_RETURNCMD |
- TPM_LEFTBUTTON |
- TPM_RIGHTBUTTON,
- x, y, 0, m_window, NULL);
- SendMessage(m_window, WM_NULL, 0, 0);
-
- // perform the requested operation
- switch (n) {
- case IDC_TASKBAR_STATUS:
- showStatus();
- break;
-
- case IDC_TASKBAR_LOG:
- copyLog();
- break;
-
- case IDC_TASKBAR_SHOW_LOG:
- ARCH->showConsole(true);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_ERROR:
- CLOG->setFilter(kERROR);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_WARNING:
- CLOG->setFilter(kWARNING);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_NOTE:
- CLOG->setFilter(kNOTE);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_INFO:
- CLOG->setFilter(kINFO);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG:
- CLOG->setFilter(kDEBUG);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
- CLOG->setFilter(kDEBUG1);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
- CLOG->setFilter(kDEBUG2);
- break;
-
- case IDC_TASKBAR_QUIT:
- quit();
- break;
- }
-}
-
-void
-MSWindowsClientTaskBarReceiver::primaryAction()
-{
- showStatus();
-}
-
-const IArchTaskBarReceiver::Icon
-MSWindowsClientTaskBarReceiver::getIcon() const
-{
- return static_cast(m_icon[getStatus()]);
-}
-
-void
-MSWindowsClientTaskBarReceiver::copyLog() const
-{
- if (m_logBuffer != NULL) {
- // collect log buffer
- String data;
- for (BufferedLogOutputter::const_iterator index = m_logBuffer->begin();
- index != m_logBuffer->end(); ++index) {
- data += *index;
- data += "\n";
- }
-
- // copy log to clipboard
- if (!data.empty()) {
- MSWindowsClipboard clipboard(m_window);
- clipboard.open(0);
- clipboard.emptyUnowned();
- clipboard.add(IClipboard::kText, data);
- clipboard.close();
- }
- }
-}
-
-void
-MSWindowsClientTaskBarReceiver::onStatusChanged()
-{
- if (IsWindowVisible(m_window)) {
- showStatus();
- }
-}
-
-HICON
-MSWindowsClientTaskBarReceiver::loadIcon(UINT id)
-{
- HANDLE icon = LoadImage(m_appInstance,
- MAKEINTRESOURCE(id),
- IMAGE_ICON,
- 0, 0,
- LR_DEFAULTCOLOR);
- return static_cast(icon);
-}
-
-void
-MSWindowsClientTaskBarReceiver::deleteIcon(HICON icon)
-{
- if (icon != NULL) {
- DestroyIcon(icon);
- }
-}
-
-void
-MSWindowsClientTaskBarReceiver::createWindow()
-{
- // ignore if already created
- if (m_window != NULL) {
- return;
- }
-
- // get the status dialog
- m_window = CreateDialogParam(m_appInstance,
- MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
- NULL,
- (DLGPROC)&MSWindowsClientTaskBarReceiver::staticDlgProc,
- reinterpret_cast(
- static_cast(this)));
-
- // window should appear on top of everything, including (especially)
- // the task bar.
- LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE);
- style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
- SetWindowLongPtr(m_window, GWL_EXSTYLE, style);
-
- // tell the task bar about this dialog
- ArchTaskBarWindows::addDialog(m_window);
-}
-
-void
-MSWindowsClientTaskBarReceiver::destroyWindow()
-{
- if (m_window != NULL) {
- ArchTaskBarWindows::removeDialog(m_window);
- DestroyWindow(m_window);
- m_window = NULL;
- }
-}
-
-BOOL
-MSWindowsClientTaskBarReceiver::dlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM)
-{
- switch (msg) {
- case WM_INITDIALOG:
- // use default focus
- return TRUE;
-
- case WM_ACTIVATE:
- // hide when another window is activated
- if (LOWORD(wParam) == WA_INACTIVE) {
- ShowWindow(hwnd, SW_HIDE);
- }
- break;
- }
- return FALSE;
-}
-
-BOOL CALLBACK
-MSWindowsClientTaskBarReceiver::staticDlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam)
-{
- // if msg is WM_INITDIALOG, extract the MSWindowsClientTaskBarReceiver*
- // and put it in the extra window data then forward the call.
- MSWindowsClientTaskBarReceiver* self = NULL;
- if (msg == WM_INITDIALOG) {
- self = static_cast(
- reinterpret_cast(lParam));
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) lParam);
- }
- else {
- // get the extra window data and forward the call
- LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (data != 0) {
- self = (MSWindowsClientTaskBarReceiver*) data;
- }
- }
-
- // forward the message
- if (self != NULL) {
- return self->dlgProc(hwnd, msg, wParam, lParam);
- }
- else {
- return (msg == WM_INITDIALOG) ? TRUE : FALSE;
- }
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const BufferedLogOutputter* logBuffer, IEventQueue* events)
-{
- ArchMiscWindows::setIcons(
- (HICON)LoadImage(ArchMiscWindows::instanceWin32(),
- MAKEINTRESOURCE(IDI_SYNERGY),
- IMAGE_ICON,
- 32, 32, LR_SHARED),
- (HICON)LoadImage(ArchMiscWindows::instanceWin32(),
- MAKEINTRESOURCE(IDI_SYNERGY),
- IMAGE_ICON,
- 16, 16, LR_SHARED));
-
- return new MSWindowsClientTaskBarReceiver(
- MSWindowsScreen::getWindowInstance(), logBuffer, events);
-}
diff --git a/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.h b/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.h
deleted file mode 100644
index 0fa3c8fa..00000000
--- a/src/cmd/synergyc/MSWindowsClientTaskBarReceiver.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2003 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#pragma once
-
-#include "synergy/ClientTaskBarReceiver.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include
-
-class BufferedLogOutputter;
-class IEventQueue;
-
-//! Implementation of ClientTaskBarReceiver for Microsoft Windows
-class MSWindowsClientTaskBarReceiver : public ClientTaskBarReceiver {
-public:
- MSWindowsClientTaskBarReceiver(HINSTANCE, const BufferedLogOutputter*, IEventQueue* events);
- virtual ~MSWindowsClientTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
- void cleanup();
-
-protected:
- void copyLog() const;
-
- // ClientTaskBarReceiver overrides
- virtual void onStatusChanged();
-
-private:
- HICON loadIcon(UINT);
- void deleteIcon(HICON);
- void createWindow();
- void destroyWindow();
-
- BOOL dlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam);
- static BOOL CALLBACK
- staticDlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam);
-
-private:
- HINSTANCE m_appInstance;
- HWND m_window;
- HMENU m_menu;
- HICON m_icon[kMaxState];
- const BufferedLogOutputter* m_logBuffer;
-
- static const UINT s_stateToIconID[];
-};
diff --git a/src/cmd/synergyc/OSXClientTaskBarReceiver.cpp b/src/cmd/synergyc/OSXClientTaskBarReceiver.cpp
deleted file mode 100644
index 488698ba..00000000
--- a/src/cmd/synergyc/OSXClientTaskBarReceiver.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2004 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#include "OSXClientTaskBarReceiver.h"
-#include "arch/Arch.h"
-
-//
-// OSXClientTaskBarReceiver
-//
-
-OSXClientTaskBarReceiver::OSXClientTaskBarReceiver(
- const BufferedLogOutputter*,
- IEventQueue* events) :
- ClientTaskBarReceiver(events)
-{
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-OSXClientTaskBarReceiver::~OSXClientTaskBarReceiver()
-{
- ARCH->removeReceiver(this);
-}
-
-void
-OSXClientTaskBarReceiver::showStatus()
-{
- // do nothing
-}
-
-void
-OSXClientTaskBarReceiver::runMenu(int, int)
-{
- // do nothing
-}
-
-void
-OSXClientTaskBarReceiver::primaryAction()
-{
- // do nothing
-}
-
-const IArchTaskBarReceiver::Icon
-OSXClientTaskBarReceiver::getIcon() const
-{
- return NULL;
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const BufferedLogOutputter* logBuffer, IEventQueue* events)
-{
- return new OSXClientTaskBarReceiver(logBuffer, events);
-}
-
diff --git a/src/cmd/synergyc/OSXClientTaskBarReceiver.h b/src/cmd/synergyc/OSXClientTaskBarReceiver.h
deleted file mode 100644
index a24856f8..00000000
--- a/src/cmd/synergyc/OSXClientTaskBarReceiver.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2004 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#pragma once
-
-#include "synergy/ClientTaskBarReceiver.h"
-
-class BufferedLogOutputter;
-class IEventQueue;
-
-//! Implementation of ClientTaskBarReceiver for OS X
-class OSXClientTaskBarReceiver : public ClientTaskBarReceiver {
-public:
- OSXClientTaskBarReceiver(const BufferedLogOutputter*, IEventQueue* events);
- virtual ~OSXClientTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
-};
diff --git a/src/cmd/synergyc/XWindowsClientTaskBarReceiver.cpp b/src/cmd/synergyc/XWindowsClientTaskBarReceiver.cpp
deleted file mode 100644
index 20001360..00000000
--- a/src/cmd/synergyc/XWindowsClientTaskBarReceiver.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2003 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#include "XWindowsClientTaskBarReceiver.h"
-#include "arch/Arch.h"
-
-//
-// CXWindowsClientTaskBarReceiver
-//
-
-CXWindowsClientTaskBarReceiver::CXWindowsClientTaskBarReceiver(
- const BufferedLogOutputter*,
- IEventQueue* events) :
- ClientTaskBarReceiver(events)
-{
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-CXWindowsClientTaskBarReceiver::~CXWindowsClientTaskBarReceiver()
-{
- ARCH->removeReceiver(this);
-}
-
-void
-CXWindowsClientTaskBarReceiver::showStatus()
-{
- // do nothing
-}
-
-void
-CXWindowsClientTaskBarReceiver::runMenu(int, int)
-{
- // do nothing
-}
-
-void
-CXWindowsClientTaskBarReceiver::primaryAction()
-{
- // do nothing
-}
-
-const IArchTaskBarReceiver::Icon
-CXWindowsClientTaskBarReceiver::getIcon() const
-{
- return NULL;
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const BufferedLogOutputter* logBuffer, IEventQueue* events)
-{
- return new CXWindowsClientTaskBarReceiver(logBuffer, events);
-}
diff --git a/src/cmd/synergyc/XWindowsClientTaskBarReceiver.h b/src/cmd/synergyc/XWindowsClientTaskBarReceiver.h
deleted file mode 100644
index fe87a706..00000000
--- a/src/cmd/synergyc/XWindowsClientTaskBarReceiver.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2003 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#pragma once
-
-#include "synergy/ClientTaskBarReceiver.h"
-
-class BufferedLogOutputter;
-class IEventQueue;
-
-//! Implementation of ClientTaskBarReceiver for X Windows
-class CXWindowsClientTaskBarReceiver : public ClientTaskBarReceiver {
-public:
- CXWindowsClientTaskBarReceiver(
- const BufferedLogOutputter*, IEventQueue* events);
- virtual ~CXWindowsClientTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
-};
diff --git a/src/cmd/synergyc/synergyc.cpp b/src/cmd/synergyc/synergyc.cpp
index 5d598add..dd1f8e0d 100644
--- a/src/cmd/synergyc/synergyc.cpp
+++ b/src/cmd/synergyc/synergyc.cpp
@@ -16,24 +16,18 @@
* along with this program. If not, see .
*/
-#include "synergy/ClientApp.h"
+#include "core/ClientApp.h"
#include "arch/Arch.h"
#include "base/Log.h"
#include "base/EventQueue.h"
-#if WINAPI_MSWINDOWS
-#include "MSWindowsClientTaskBarReceiver.h"
-#elif WINAPI_XWINDOWS
-#include "XWindowsClientTaskBarReceiver.h"
-#elif WINAPI_CARBON
-#include "OSXClientTaskBarReceiver.h"
-#else
-#error Platform not supported.
-#endif
+#include
int
main(int argc, char** argv)
{
+ std::cerr << "warning: synergyc is deprecated. instead, use: synergy-core --client" << std::endl;
+
#if SYSAPI_WIN32
// record window instance for tray icon, etc
ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
@@ -45,6 +39,6 @@ main(int argc, char** argv)
Log log;
EventQueue events;
- ClientApp app(&events, createTaskBarReceiver);
+ ClientApp app(&events);
return app.run(argc, argv);
}
diff --git a/src/cmd/synergys/CMakeLists.txt b/src/cmd/synergys/CMakeLists.txt
index 882d854d..c6e995d4 100644
--- a/src/cmd/synergys/CMakeLists.txt
+++ b/src/cmd/synergys/CMakeLists.txt
@@ -19,8 +19,6 @@ set(sources
)
if (WIN32)
- file(GLOB arch_headers "MSWindows*.h")
- file(GLOB arch_sources "MSWindows*.cpp")
list(APPEND sources
resource.h
synergys.ico
@@ -30,21 +28,12 @@ if (WIN32)
tb_run.ico
tb_wait.ico
)
-elseif (APPLE)
- file(GLOB arch_headers "OSX*.h")
- file(GLOB arch_sources "OSX*.cpp")
-elseif (UNIX)
- file(GLOB arch_headers "XWindows*.h")
- file(GLOB arch_sources "XWindows*.cpp")
endif()
-list(APPEND sources ${arch_sources})
-list(APPEND headers ${arch_headers})
-
if (SYNERGY_ADD_HEADERS)
list(APPEND sources ${headers})
endif()
add_executable(synergys ${sources})
target_link_libraries(synergys
- arch base client common io mt net ipc platform server synlib ${libs} ${OPENSSL_LIBS})
+ arch base client common io mt net ipc platform server core ${libs} ${OPENSSL_LIBS})
diff --git a/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp b/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp
deleted file mode 100644
index 2b63c0c2..00000000
--- a/src/cmd/synergys/MSWindowsServerTaskBarReceiver.cpp
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2003 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#include "MSWindowsServerTaskBarReceiver.h"
-
-#include "resource.h"
-#include "server/Server.h"
-#include "platform/MSWindowsClipboard.h"
-#include "platform/MSWindowsScreen.h"
-#include "arch/win32/ArchTaskBarWindows.h"
-#include "arch/win32/ArchMiscWindows.h"
-#include "arch/Arch.h"
-#include "base/EventQueue.h"
-#include "base/IEventQueue.h"
-#include "base/log_outputters.h"
-#include "base/EventTypes.h"
-
-//
-// MSWindowsServerTaskBarReceiver
-//
-
-const UINT MSWindowsServerTaskBarReceiver::s_stateToIconID[kMaxState] =
-{
- IDI_TASKBAR_NOT_RUNNING,
- IDI_TASKBAR_NOT_WORKING,
- IDI_TASKBAR_NOT_CONNECTED,
- IDI_TASKBAR_CONNECTED
-};
-
-MSWindowsServerTaskBarReceiver::MSWindowsServerTaskBarReceiver(
- HINSTANCE appInstance, const BufferedLogOutputter* logBuffer, IEventQueue* events) :
- ServerTaskBarReceiver(events),
- m_events(events),
- m_appInstance(appInstance),
- m_window(NULL),
- m_logBuffer(logBuffer)
-{
- for (UInt32 i = 0; i < kMaxState; ++i) {
- m_icon[i] = loadIcon(s_stateToIconID[i]);
- }
- m_menu = LoadMenu(m_appInstance, MAKEINTRESOURCE(IDR_TASKBAR));
-
- // don't create the window yet. we'll create it on demand. this
- // has the side benefit of being created in the thread used for
- // the task bar. that's good because it means the existence of
- // the window won't prevent changing the main thread's desktop.
-
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-void
-MSWindowsServerTaskBarReceiver::cleanup()
-{
- ARCH->removeReceiver(this);
- for (UInt32 i = 0; i < kMaxState; ++i) {
- deleteIcon(m_icon[i]);
- }
- DestroyMenu(m_menu);
- destroyWindow();
-}
-
-MSWindowsServerTaskBarReceiver::~MSWindowsServerTaskBarReceiver()
-{
- cleanup();
-}
-
-void
-MSWindowsServerTaskBarReceiver::showStatus()
-{
- // create the window
- createWindow();
-
- // lock self while getting status
- lock();
-
- // get the current status
- std::string status = getToolTip();
-
- // get the connect clients, if any
- const Clients& clients = getClients();
-
- // done getting status
- unlock();
-
- // update dialog
- HWND child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_STATUS);
- SendMessage(child, WM_SETTEXT, 0, (LPARAM)status.c_str());
- child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_CLIENTS);
- SendMessage(child, LB_RESETCONTENT, 0, 0);
- for (Clients::const_iterator index = clients.begin();
- index != clients.end(); ) {
- const char* client = index->c_str();
- if (++index == clients.end()) {
- SendMessage(child, LB_ADDSTRING, 0, (LPARAM)client);
- }
- else {
- SendMessage(child, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)client);
- }
- }
-
- if (!IsWindowVisible(m_window)) {
- // position it by the mouse
- POINT cursorPos;
- GetCursorPos(&cursorPos);
- RECT windowRect;
- GetWindowRect(m_window, &windowRect);
- int x = cursorPos.x;
- int y = cursorPos.y;
- int fw = GetSystemMetrics(SM_CXDLGFRAME);
- int fh = GetSystemMetrics(SM_CYDLGFRAME);
- int ww = windowRect.right - windowRect.left;
- int wh = windowRect.bottom - windowRect.top;
- int sw = GetSystemMetrics(SM_CXFULLSCREEN);
- int sh = GetSystemMetrics(SM_CYFULLSCREEN);
- if (fw < 1) {
- fw = 1;
- }
- if (fh < 1) {
- fh = 1;
- }
- if (x + ww - fw > sw) {
- x -= ww - fw;
- }
- else {
- x -= fw;
- }
- if (x < 0) {
- x = 0;
- }
- if (y + wh - fh > sh) {
- y -= wh - fh;
- }
- else {
- y -= fh;
- }
- if (y < 0) {
- y = 0;
- }
- SetWindowPos(m_window, HWND_TOPMOST, x, y, ww, wh,
- SWP_SHOWWINDOW);
- }
-}
-
-void
-MSWindowsServerTaskBarReceiver::runMenu(int x, int y)
-{
- // do popup menu. we need a window to pass to TrackPopupMenu().
- // the SetForegroundWindow() and SendMessage() calls around
- // TrackPopupMenu() are to get the menu to be dismissed when
- // another window gets activated and are just one of those
- // win32 weirdnesses.
- createWindow();
- SetForegroundWindow(m_window);
- HMENU menu = GetSubMenu(m_menu, 0);
- SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
- HMENU logLevelMenu = GetSubMenu(menu, 3);
- CheckMenuRadioItem(logLevelMenu, 0, 6,
- CLOG->getFilter() - kERROR, MF_BYPOSITION);
- int n = TrackPopupMenu(menu,
- TPM_NONOTIFY |
- TPM_RETURNCMD |
- TPM_LEFTBUTTON |
- TPM_RIGHTBUTTON,
- x, y, 0, m_window, NULL);
- SendMessage(m_window, WM_NULL, 0, 0);
-
- // perform the requested operation
- switch (n) {
- case IDC_TASKBAR_STATUS:
- showStatus();
- break;
-
- case IDC_TASKBAR_LOG:
- copyLog();
- break;
-
- case IDC_TASKBAR_SHOW_LOG:
- ARCH->showConsole(true);
- break;
-
- case IDC_RELOAD_CONFIG:
- m_events->addEvent(Event(m_events->forServerApp().reloadConfig(),
- m_events->getSystemTarget()));
- break;
-
- case IDC_FORCE_RECONNECT:
- m_events->addEvent(Event(m_events->forServerApp().forceReconnect(),
- m_events->getSystemTarget()));
- break;
-
- case ID_SYNERGY_RESETSERVER:
- m_events->addEvent(Event(m_events->forServerApp().resetServer(),
- m_events->getSystemTarget()));
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_ERROR:
- CLOG->setFilter(kERROR);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_WARNING:
- CLOG->setFilter(kWARNING);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_NOTE:
- CLOG->setFilter(kNOTE);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_INFO:
- CLOG->setFilter(kINFO);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG:
- CLOG->setFilter(kDEBUG);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
- CLOG->setFilter(kDEBUG1);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
- CLOG->setFilter(kDEBUG2);
- break;
-
- case IDC_TASKBAR_QUIT:
- quit();
- break;
- }
-}
-
-void
-MSWindowsServerTaskBarReceiver::primaryAction()
-{
- showStatus();
-}
-
-const IArchTaskBarReceiver::Icon
-MSWindowsServerTaskBarReceiver::getIcon() const
-{
- return static_cast(m_icon[getStatus()]);
-}
-
-void
-MSWindowsServerTaskBarReceiver::copyLog() const
-{
- if (m_logBuffer != NULL) {
- // collect log buffer
- String data;
- for (BufferedLogOutputter::const_iterator index = m_logBuffer->begin();
- index != m_logBuffer->end(); ++index) {
- data += *index;
- data += "\n";
- }
-
- // copy log to clipboard
- if (!data.empty()) {
- MSWindowsClipboard clipboard(m_window);
- clipboard.open(0);
- clipboard.emptyUnowned();
- clipboard.add(IClipboard::kText, data);
- clipboard.close();
- }
- }
-}
-
-void
-MSWindowsServerTaskBarReceiver::onStatusChanged()
-{
- if (IsWindowVisible(m_window)) {
- showStatus();
- }
-}
-
-HICON
-MSWindowsServerTaskBarReceiver::loadIcon(UINT id)
-{
- HANDLE icon = LoadImage(m_appInstance,
- MAKEINTRESOURCE(id),
- IMAGE_ICON,
- 0, 0,
- LR_DEFAULTCOLOR);
- return static_cast(icon);
-}
-
-void
-MSWindowsServerTaskBarReceiver::deleteIcon(HICON icon)
-{
- if (icon != NULL) {
- DestroyIcon(icon);
- }
-}
-
-void
-MSWindowsServerTaskBarReceiver::createWindow()
-{
- // ignore if already created
- if (m_window != NULL) {
- return;
- }
-
- // get the status dialog
- m_window = CreateDialogParam(m_appInstance,
- MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
- NULL,
- (DLGPROC)&MSWindowsServerTaskBarReceiver::staticDlgProc,
- reinterpret_cast(
- static_cast(this)));
-
- // window should appear on top of everything, including (especially)
- // the task bar.
- LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE);
- style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
- SetWindowLongPtr(m_window, GWL_EXSTYLE, style);
-
- // tell the task bar about this dialog
- ArchTaskBarWindows::addDialog(m_window);
-}
-
-void
-MSWindowsServerTaskBarReceiver::destroyWindow()
-{
- if (m_window != NULL) {
- ArchTaskBarWindows::removeDialog(m_window);
- DestroyWindow(m_window);
- m_window = NULL;
- }
-}
-
-BOOL
-MSWindowsServerTaskBarReceiver::dlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM)
-{
- switch (msg) {
- case WM_INITDIALOG:
- // use default focus
- return TRUE;
-
- case WM_ACTIVATE:
- // hide when another window is activated
- if (LOWORD(wParam) == WA_INACTIVE) {
- ShowWindow(hwnd, SW_HIDE);
- }
- break;
- }
- return FALSE;
-}
-
-BOOL CALLBACK
-MSWindowsServerTaskBarReceiver::staticDlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam)
-{
- // if msg is WM_INITDIALOG, extract the MSWindowsServerTaskBarReceiver*
- // and put it in the extra window data then forward the call.
- MSWindowsServerTaskBarReceiver* self = NULL;
- if (msg == WM_INITDIALOG) {
- self = static_cast(
- reinterpret_cast(lParam));
- SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
- }
- else {
- // get the extra window data and forward the call
- LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (data != 0) {
- self = static_cast(
- reinterpret_cast(data));
- }
- }
-
- // forward the message
- if (self != NULL) {
- return self->dlgProc(hwnd, msg, wParam, lParam);
- }
- else {
- return (msg == WM_INITDIALOG) ? TRUE : FALSE;
- }
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const BufferedLogOutputter* logBuffer, IEventQueue* events)
-{
- ArchMiscWindows::setIcons(
- (HICON)LoadImage(ArchMiscWindows::instanceWin32(),
- MAKEINTRESOURCE(IDI_SYNERGY),
- IMAGE_ICON,
- 32, 32, LR_SHARED),
- (HICON)LoadImage(ArchMiscWindows::instanceWin32(),
- MAKEINTRESOURCE(IDI_SYNERGY),
- IMAGE_ICON,
- 16, 16, LR_SHARED));
-
- return new MSWindowsServerTaskBarReceiver(
- MSWindowsScreen::getWindowInstance(), logBuffer, events);
-}
diff --git a/src/cmd/synergys/MSWindowsServerTaskBarReceiver.h b/src/cmd/synergys/MSWindowsServerTaskBarReceiver.h
deleted file mode 100644
index 07f03366..00000000
--- a/src/cmd/synergys/MSWindowsServerTaskBarReceiver.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2003 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#pragma once
-
-#include "synergy/ServerTaskBarReceiver.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include
-
-class BufferedLogOutputter;
-class IEventQueue;
-
-//! Implementation of ServerTaskBarReceiver for Microsoft Windows
-class MSWindowsServerTaskBarReceiver : public ServerTaskBarReceiver {
-public:
- MSWindowsServerTaskBarReceiver(HINSTANCE, const BufferedLogOutputter*, IEventQueue* events);
- virtual ~MSWindowsServerTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
- void cleanup();
-
-protected:
- void copyLog() const;
-
- // ServerTaskBarReceiver overrides
- virtual void onStatusChanged();
-
-private:
- HICON loadIcon(UINT);
- void deleteIcon(HICON);
- void createWindow();
- void destroyWindow();
-
- BOOL dlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam);
- static BOOL CALLBACK
- staticDlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam);
-
-private:
- HINSTANCE m_appInstance;
- HWND m_window;
- HMENU m_menu;
- HICON m_icon[kMaxState];
- const BufferedLogOutputter* m_logBuffer;
- IEventQueue* m_events;
-
- static const UINT s_stateToIconID[];
-};
diff --git a/src/cmd/synergys/OSXServerTaskBarReceiver.cpp b/src/cmd/synergys/OSXServerTaskBarReceiver.cpp
deleted file mode 100644
index cd51c3f0..00000000
--- a/src/cmd/synergys/OSXServerTaskBarReceiver.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2004 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#include "OSXServerTaskBarReceiver.h"
-#include "arch/Arch.h"
-
-//
-// OSXServerTaskBarReceiver
-//
-
-OSXServerTaskBarReceiver::OSXServerTaskBarReceiver(
- const BufferedLogOutputter*, IEventQueue* events) :
- ServerTaskBarReceiver(events)
-{
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-OSXServerTaskBarReceiver::~OSXServerTaskBarReceiver()
-{
- ARCH->removeReceiver(this);
-}
-
-void
-OSXServerTaskBarReceiver::showStatus()
-{
- // do nothing
-}
-
-void
-OSXServerTaskBarReceiver::runMenu(int, int)
-{
- // do nothing
-}
-
-void
-OSXServerTaskBarReceiver::primaryAction()
-{
- // do nothing
-}
-
-const IArchTaskBarReceiver::Icon
-OSXServerTaskBarReceiver::getIcon() const
-{
- return NULL;
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const BufferedLogOutputter* logBuffer, IEventQueue* events)
-{
- return new OSXServerTaskBarReceiver(logBuffer, events);
-}
diff --git a/src/cmd/synergys/OSXServerTaskBarReceiver.h b/src/cmd/synergys/OSXServerTaskBarReceiver.h
deleted file mode 100644
index c230ee53..00000000
--- a/src/cmd/synergys/OSXServerTaskBarReceiver.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2004 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#pragma once
-
-#include "synergy/ServerTaskBarReceiver.h"
-
-class BufferedLogOutputter;
-
-//! Implementation of ServerTaskBarReceiver for OS X
-class OSXServerTaskBarReceiver : public ServerTaskBarReceiver {
-public:
- OSXServerTaskBarReceiver(const BufferedLogOutputter*, IEventQueue* events);
- virtual ~OSXServerTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
-};
diff --git a/src/cmd/synergys/XWindowsServerTaskBarReceiver.cpp b/src/cmd/synergys/XWindowsServerTaskBarReceiver.cpp
deleted file mode 100644
index cdee1a28..00000000
--- a/src/cmd/synergys/XWindowsServerTaskBarReceiver.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2003 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#include "XWindowsServerTaskBarReceiver.h"
-#include "arch/Arch.h"
-
-//
-// CXWindowsServerTaskBarReceiver
-//
-
-CXWindowsServerTaskBarReceiver::CXWindowsServerTaskBarReceiver(
- const BufferedLogOutputter*, IEventQueue* events) :
- ServerTaskBarReceiver(events)
-{
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-CXWindowsServerTaskBarReceiver::~CXWindowsServerTaskBarReceiver()
-{
- ARCH->removeReceiver(this);
-}
-
-void
-CXWindowsServerTaskBarReceiver::showStatus()
-{
- // do nothing
-}
-
-void
-CXWindowsServerTaskBarReceiver::runMenu(int, int)
-{
- // do nothing
-}
-
-void
-CXWindowsServerTaskBarReceiver::primaryAction()
-{
- // do nothing
-}
-
-const IArchTaskBarReceiver::Icon
-CXWindowsServerTaskBarReceiver::getIcon() const
-{
- return NULL;
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const BufferedLogOutputter* logBuffer, IEventQueue* events)
-{
- return new CXWindowsServerTaskBarReceiver(logBuffer, events);
-}
diff --git a/src/cmd/synergys/XWindowsServerTaskBarReceiver.h b/src/cmd/synergys/XWindowsServerTaskBarReceiver.h
deleted file mode 100644
index 351fe80a..00000000
--- a/src/cmd/synergys/XWindowsServerTaskBarReceiver.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2012-2016 Symless Ltd.
- * Copyright (C) 2003 Chris Schoeneman
- *
- * 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 LICENSE 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 .
- */
-
-#pragma once
-
-#include "synergy/ServerTaskBarReceiver.h"
-
-class BufferedLogOutputter;
-class IEventQueue;
-
-//! Implementation of ServerTaskBarReceiver for X Windows
-class CXWindowsServerTaskBarReceiver : public ServerTaskBarReceiver {
-public:
- CXWindowsServerTaskBarReceiver(
- const BufferedLogOutputter*, IEventQueue* events);
- virtual ~CXWindowsServerTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
-};
diff --git a/src/cmd/synergys/synergys.cpp b/src/cmd/synergys/synergys.cpp
index 1ec3fe4e..553cef45 100644
--- a/src/cmd/synergys/synergys.cpp
+++ b/src/cmd/synergys/synergys.cpp
@@ -16,24 +16,18 @@
* along with this program. If not, see .
*/
-#include "synergy/ServerApp.h"
+#include "core/ServerApp.h"
#include "arch/Arch.h"
#include "base/Log.h"
#include "base/EventQueue.h"
-#if WINAPI_MSWINDOWS
-#include "MSWindowsServerTaskBarReceiver.h"
-#elif WINAPI_XWINDOWS
-#include "XWindowsServerTaskBarReceiver.h"
-#elif WINAPI_CARBON
-#include "OSXServerTaskBarReceiver.h"
-#else
-#error Platform not supported.
-#endif
+#include
int
main(int argc, char** argv)
{
+ std::cerr << "warning: synergys is deprecated. instead, use: synergy-core --server" << std::endl;
+
#if SYSAPI_WIN32
// record window instance for tray icon, etc
ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
@@ -45,6 +39,6 @@ main(int argc, char** argv)
Log log;
EventQueue events;
- ServerApp app(&events, createTaskBarReceiver);
+ ServerApp app(&events);
return app.run(argc, argv);
}
diff --git a/src/lib/synergy/App.cpp b/src/lib/core/App.cpp
similarity index 89%
rename from src/lib/synergy/App.cpp
rename to src/lib/core/App.cpp
index 4c8c1808..9d8771e7 100644
--- a/src/lib/synergy/App.cpp
+++ b/src/lib/core/App.cpp
@@ -16,17 +16,17 @@
* along with this program. If not, see .
*/
-#include "synergy/App.h"
+#include "core/App.h"
#include "base/Log.h"
#include "common/Version.h"
-#include "synergy/protocol_types.h"
+#include "core/protocol_types.h"
#include "arch/Arch.h"
#include "base/XBase.h"
#include "arch/XArch.h"
#include "base/log_outputters.h"
-#include "synergy/XSynergy.h"
-#include "synergy/ArgsBase.h"
+#include "core/XSynergy.h"
+#include "core/ArgsBase.h"
#include "ipc/IpcServerProxy.h"
#include "base/TMethodEventJob.h"
#include "ipc/IpcMessage.h"
@@ -56,14 +56,12 @@ App* App::s_instance = nullptr;
// App
//
-App::App(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver, ArgsBase* args) :
+App::App(IEventQueue* events, ArgsBase* args) :
m_bye(&exit),
- m_taskBarReceiver(NULL),
m_suspended(false),
m_events(events),
m_args(args),
m_fileLog(nullptr),
- m_createTaskBarReceiver(createTaskBarReceiver),
m_appUtil(events),
m_ipcClient(nullptr),
m_socketMultiplexer(nullptr)
@@ -195,18 +193,6 @@ App::initApp(int argc, const char** argv)
// load configuration
loadConfig();
-
- if (!argsBase().m_disableTray) {
-
- // create a log buffer so we can show the latest message
- // as a tray icon tooltip
- BufferedLogOutputter* logBuffer = new BufferedLogOutputter(1000);
- CLOG->insert(logBuffer, true);
-
- // make the task bar receiver. the user can control this app
- // through the task bar.
- m_taskBarReceiver = m_createTaskBarReceiver(logBuffer, m_events);
- }
}
void
@@ -255,7 +241,7 @@ App::runEventsLoop(void*)
//
MinimalApp::MinimalApp() :
- App(NULL, NULL, new ArgsBase())
+ App(NULL, new ArgsBase())
{
m_arch.init();
setEvents(m_events);
diff --git a/src/lib/synergy/App.h b/src/lib/core/App.h
similarity index 92%
rename from src/lib/synergy/App.h
rename to src/lib/core/App.h
index 078786f9..51005bf9 100644
--- a/src/lib/synergy/App.h
+++ b/src/lib/core/App.h
@@ -19,19 +19,18 @@
#pragma once
#include "ipc/IpcClient.h"
-#include "synergy/IApp.h"
+#include "core/IApp.h"
#include "base/String.h"
#include "base/Log.h"
#include "base/EventQueue.h"
#include "common/common.h"
#if SYSAPI_WIN32
-#include "synergy/win32/AppUtilWindows.h"
+#include "core/win32/AppUtilWindows.h"
#elif SYSAPI_UNIX
-#include "synergy/unix/AppUtilUnix.h"
+#include "core/unix/AppUtilUnix.h"
#endif
-class IArchTaskBarReceiver;
class BufferedLogOutputter;
class ILogOutputter;
class FileLogOutputter;
@@ -39,11 +38,9 @@ namespace synergy { class Screen; }
class IEventQueue;
class SocketMultiplexer;
-typedef IArchTaskBarReceiver* (*CreateTaskBarReceiverFunc)(const BufferedLogOutputter*, IEventQueue* events);
-
class App : public IApp {
public:
- App(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver, ArgsBase* args);
+ App(IEventQueue* events, ArgsBase* args);
virtual ~App();
// Returns args that are common between server and client.
@@ -88,8 +85,6 @@ public:
ARCH_APP_UTIL& appUtil() { return m_appUtil; }
- virtual IArchTaskBarReceiver* taskBarReceiver() const { return m_taskBarReceiver; }
-
virtual void setByeFunc(void(*bye)(int)) { m_bye = bye; }
virtual void bye(int error) { m_bye(error); }
@@ -108,7 +103,6 @@ protected:
void cleanupIpcClient();
void runEventsLoop(void*);
- IArchTaskBarReceiver* m_taskBarReceiver;
bool m_suspended;
IEventQueue* m_events;
@@ -116,7 +110,6 @@ private:
ArgsBase* m_args;
static App* s_instance;
FileLogOutputter* m_fileLog;
- CreateTaskBarReceiverFunc m_createTaskBarReceiver;
ARCH_APP_UTIL m_appUtil;
IpcClient* m_ipcClient;
SocketMultiplexer* m_socketMultiplexer;
diff --git a/src/lib/synergy/AppUtil.cpp b/src/lib/core/AppUtil.cpp
similarity index 97%
rename from src/lib/synergy/AppUtil.cpp
rename to src/lib/core/AppUtil.cpp
index c1f9bb56..2b1ea47c 100644
--- a/src/lib/synergy/AppUtil.cpp
+++ b/src/lib/core/AppUtil.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/AppUtil.h"
+#include "core/AppUtil.h"
AppUtil* AppUtil::s_instance = nullptr;
diff --git a/src/lib/synergy/AppUtil.h b/src/lib/core/AppUtil.h
similarity index 95%
rename from src/lib/synergy/AppUtil.h
rename to src/lib/core/AppUtil.h
index dedece90..6e026248 100644
--- a/src/lib/synergy/AppUtil.h
+++ b/src/lib/core/AppUtil.h
@@ -18,8 +18,8 @@
#pragma once
-#include "synergy/IAppUtil.h"
-#include "synergy/XSynergy.h"
+#include "core/IAppUtil.h"
+#include "core/XSynergy.h"
class AppUtil : public IAppUtil {
public:
diff --git a/src/lib/synergy/ArgParser.cpp b/src/lib/core/ArgParser.cpp
similarity index 97%
rename from src/lib/synergy/ArgParser.cpp
rename to src/lib/core/ArgParser.cpp
index c9da4e55..3a91fe28 100644
--- a/src/lib/synergy/ArgParser.cpp
+++ b/src/lib/core/ArgParser.cpp
@@ -15,14 +15,14 @@
* along with this program. If not, see .
*/
-#include "synergy/ArgParser.h"
+#include "core/ArgParser.h"
-#include "synergy/StreamChunker.h"
-#include "synergy/App.h"
-#include "synergy/ServerArgs.h"
-#include "synergy/ClientArgs.h"
-#include "synergy/ToolArgs.h"
-#include "synergy/ArgsBase.h"
+#include "core/StreamChunker.h"
+#include "core/App.h"
+#include "core/ServerArgs.h"
+#include "core/ClientArgs.h"
+#include "core/ToolArgs.h"
+#include "core/ArgsBase.h"
#include "base/Log.h"
#include "base/String.h"
@@ -259,9 +259,6 @@ ArgParser::parseGenericArgs(int argc, const char* const* argv, int& i)
}
argsBase().m_shouldExit = true;
}
- else if (isArg(i, argc, argv, NULL, "--no-tray")) {
- argsBase().m_disableTray = true;
- }
else if (isArg(i, argc, argv, NULL, "--ipc")) {
argsBase().m_enableIpc = true;
}
diff --git a/src/lib/synergy/ArgParser.h b/src/lib/core/ArgParser.h
similarity index 100%
rename from src/lib/synergy/ArgParser.h
rename to src/lib/core/ArgParser.h
diff --git a/src/lib/synergy/ArgsBase.cpp b/src/lib/core/ArgsBase.cpp
similarity index 96%
rename from src/lib/synergy/ArgsBase.cpp
rename to src/lib/core/ArgsBase.cpp
index a2d70f5b..4e9c449c 100644
--- a/src/lib/synergy/ArgsBase.cpp
+++ b/src/lib/core/ArgsBase.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/ArgsBase.h"
+#include "core/ArgsBase.h"
ArgsBase::ArgsBase() :
#if SYSAPI_WIN32
@@ -37,7 +37,6 @@ m_pname(NULL),
m_logFilter(NULL),
m_logFile(NULL),
m_display(NULL),
-m_disableTray(false),
m_enableIpc(false),
m_enableDragDrop(false),
m_shouldExit(false),
diff --git a/src/lib/synergy/ArgsBase.h b/src/lib/core/ArgsBase.h
similarity index 97%
rename from src/lib/synergy/ArgsBase.h
rename to src/lib/core/ArgsBase.h
index 6ae0e3d0..9ce6e98c 100644
--- a/src/lib/synergy/ArgsBase.h
+++ b/src/lib/core/ArgsBase.h
@@ -35,7 +35,6 @@ public:
const char* m_logFile;
const char* m_display;
String m_name;
- bool m_disableTray;
bool m_enableIpc;
bool m_enableDragDrop;
#if SYSAPI_WIN32
diff --git a/src/lib/synergy/CMakeLists.txt b/src/lib/core/CMakeLists.txt
similarity index 90%
rename from src/lib/synergy/CMakeLists.txt
rename to src/lib/core/CMakeLists.txt
index 91008696..2c3fd32a 100644
--- a/src/lib/synergy/CMakeLists.txt
+++ b/src/lib/core/CMakeLists.txt
@@ -33,8 +33,8 @@ if (SYNERGY_ADD_HEADERS)
list(APPEND sources ${headers})
endif()
-add_library(synlib STATIC ${sources})
+add_library(core STATIC ${sources})
if (UNIX)
- target_link_libraries(synlib arch client ipc net base platform mt server)
+ target_link_libraries(core arch client ipc net base platform mt server)
endif()
diff --git a/src/lib/synergy/Chunk.cpp b/src/lib/core/Chunk.cpp
similarity index 96%
rename from src/lib/synergy/Chunk.cpp
rename to src/lib/core/Chunk.cpp
index 71464f70..808b0354 100644
--- a/src/lib/synergy/Chunk.cpp
+++ b/src/lib/core/Chunk.cpp
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-#include "synergy/Chunk.h"
+#include "core/Chunk.h"
#include "base/String.h"
Chunk::Chunk(size_t size): m_dataSize(0)
diff --git a/src/lib/synergy/Chunk.h b/src/lib/core/Chunk.h
similarity index 100%
rename from src/lib/synergy/Chunk.h
rename to src/lib/core/Chunk.h
diff --git a/src/lib/synergy/ClientApp.cpp b/src/lib/core/ClientApp.cpp
similarity index 95%
rename from src/lib/synergy/ClientApp.cpp
rename to src/lib/core/ClientApp.cpp
index 1accbad3..79bc74c8 100644
--- a/src/lib/synergy/ClientApp.cpp
+++ b/src/lib/core/ClientApp.cpp
@@ -16,14 +16,14 @@
* along with this program. If not, see .
*/
-#include "synergy/ClientApp.h"
+#include "core/ClientApp.h"
#include "client/Client.h"
-#include "synergy/ArgParser.h"
-#include "synergy/protocol_types.h"
-#include "synergy/Screen.h"
-#include "synergy/XScreen.h"
-#include "synergy/ClientArgs.h"
+#include "core/ArgParser.h"
+#include "core/protocol_types.h"
+#include "core/Screen.h"
+#include "core/XScreen.h"
+#include "core/ClientArgs.h"
#include "net/NetworkAddress.h"
#include "net/TCPSocketFactory.h"
#include "net/SocketMultiplexer.h"
@@ -62,8 +62,8 @@
#define RETRY_TIME 1.0
-ClientApp::ClientApp(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver) :
- App(events, createTaskBarReceiver, new ClientArgs()),
+ClientApp::ClientApp(IEventQueue* events) :
+ App(events, new ClientArgs()),
m_client(NULL),
m_clientScreen(NULL),
m_serverAddress(NULL)
@@ -194,10 +194,6 @@ ClientApp::updateStatus()
void
ClientApp::updateStatus(const String& msg)
{
- if (m_taskBarReceiver)
- {
- m_taskBarReceiver->updateStatus(m_client, msg);
- }
}
@@ -542,12 +538,6 @@ ClientApp::runInner(int argc, char** argv, ILogOutputter* outputter, StartupFunc
}
catch (...)
{
- if (m_taskBarReceiver)
- {
- // done with task bar receiver
- delete m_taskBarReceiver;
- }
-
delete m_serverAddress;
throw;
diff --git a/src/lib/synergy/ClientApp.h b/src/lib/core/ClientApp.h
similarity index 96%
rename from src/lib/synergy/ClientApp.h
rename to src/lib/core/ClientApp.h
index 24fa20c3..f7aa4e53 100644
--- a/src/lib/synergy/ClientApp.h
+++ b/src/lib/core/ClientApp.h
@@ -18,7 +18,7 @@
#pragma once
-#include "synergy/App.h"
+#include "core/App.h"
namespace synergy { class Screen; }
class Event;
@@ -29,7 +29,7 @@ class ClientArgs;
class ClientApp : public App {
public:
- ClientApp(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver);
+ ClientApp(IEventQueue* events);
virtual ~ClientApp();
// Parse client specific command line arguments.
diff --git a/src/lib/synergy/ClientArgs.cpp b/src/lib/core/ClientArgs.cpp
similarity index 95%
rename from src/lib/synergy/ClientArgs.cpp
rename to src/lib/core/ClientArgs.cpp
index 03ffd746..43f05969 100644
--- a/src/lib/synergy/ClientArgs.cpp
+++ b/src/lib/core/ClientArgs.cpp
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-#include "synergy/ClientArgs.h"
+#include "core/ClientArgs.h"
ClientArgs::ClientArgs() :
m_yscroll(0)
diff --git a/src/lib/synergy/ClientArgs.h b/src/lib/core/ClientArgs.h
similarity index 96%
rename from src/lib/synergy/ClientArgs.h
rename to src/lib/core/ClientArgs.h
index 93a7307a..4afa731e 100644
--- a/src/lib/synergy/ClientArgs.h
+++ b/src/lib/core/ClientArgs.h
@@ -17,7 +17,7 @@
#pragma once
-#include "synergy/ArgsBase.h"
+#include "core/ArgsBase.h"
class NetworkAddress;
diff --git a/src/lib/synergy/ClientTaskBarReceiver.cpp b/src/lib/core/ClientTaskBarReceiver.cpp
similarity index 98%
rename from src/lib/synergy/ClientTaskBarReceiver.cpp
rename to src/lib/core/ClientTaskBarReceiver.cpp
index d49175da..ae6368c4 100644
--- a/src/lib/synergy/ClientTaskBarReceiver.cpp
+++ b/src/lib/core/ClientTaskBarReceiver.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/ClientTaskBarReceiver.h"
+#include "core/ClientTaskBarReceiver.h"
#include "client/Client.h"
#include "mt/Lock.h"
#include "base/String.h"
diff --git a/src/lib/synergy/ClientTaskBarReceiver.h b/src/lib/core/ClientTaskBarReceiver.h
similarity index 100%
rename from src/lib/synergy/ClientTaskBarReceiver.h
rename to src/lib/core/ClientTaskBarReceiver.h
diff --git a/src/lib/synergy/Clipboard.cpp b/src/lib/core/Clipboard.cpp
similarity index 98%
rename from src/lib/synergy/Clipboard.cpp
rename to src/lib/core/Clipboard.cpp
index 86bd37b6..a48a08ef 100644
--- a/src/lib/synergy/Clipboard.cpp
+++ b/src/lib/core/Clipboard.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/Clipboard.h"
+#include "core/Clipboard.h"
//
// Clipboard
diff --git a/src/lib/synergy/Clipboard.h b/src/lib/core/Clipboard.h
similarity index 98%
rename from src/lib/synergy/Clipboard.h
rename to src/lib/core/Clipboard.h
index 81f07000..4aeeeb2e 100644
--- a/src/lib/synergy/Clipboard.h
+++ b/src/lib/core/Clipboard.h
@@ -18,7 +18,7 @@
#pragma once
-#include "synergy/IClipboard.h"
+#include "core/IClipboard.h"
//! Memory buffer clipboard
/*!
diff --git a/src/lib/synergy/ClipboardChunk.cpp b/src/lib/core/ClipboardChunk.cpp
similarity index 97%
rename from src/lib/synergy/ClipboardChunk.cpp
rename to src/lib/core/ClipboardChunk.cpp
index 0cf0ffbc..054e38f5 100644
--- a/src/lib/synergy/ClipboardChunk.cpp
+++ b/src/lib/core/ClipboardChunk.cpp
@@ -15,10 +15,10 @@
* along with this program. If not, see .
*/
-#include "synergy/ClipboardChunk.h"
+#include "core/ClipboardChunk.h"
-#include "synergy/ProtocolUtil.h"
-#include "synergy/protocol_types.h"
+#include "core/ProtocolUtil.h"
+#include "core/protocol_types.h"
#include "io/IStream.h"
#include "base/Log.h"
#include
diff --git a/src/lib/synergy/ClipboardChunk.h b/src/lib/core/ClipboardChunk.h
similarity index 96%
rename from src/lib/synergy/ClipboardChunk.h
rename to src/lib/core/ClipboardChunk.h
index 9bf4b7a4..3ae3c24f 100644
--- a/src/lib/synergy/ClipboardChunk.h
+++ b/src/lib/core/ClipboardChunk.h
@@ -17,8 +17,8 @@
#pragma once
-#include "synergy/Chunk.h"
-#include "synergy/clipboard_types.h"
+#include "core/Chunk.h"
+#include "core/clipboard_types.h"
#include "base/String.h"
#include "common/basic_types.h"
diff --git a/src/lib/synergy/DaemonApp.cpp b/src/lib/core/DaemonApp.cpp
similarity index 98%
rename from src/lib/synergy/DaemonApp.cpp
rename to src/lib/core/DaemonApp.cpp
index 84f2a784..6351fb32 100644
--- a/src/lib/synergy/DaemonApp.cpp
+++ b/src/lib/core/DaemonApp.cpp
@@ -19,12 +19,12 @@
// TODO: split this class into windows and unix to get rid
// of all the #ifdefs!
-#include "synergy/DaemonApp.h"
+#include "core/DaemonApp.h"
-#include "synergy/App.h"
-#include "synergy/ArgParser.h"
-#include "synergy/ServerArgs.h"
-#include "synergy/ClientArgs.h"
+#include "core/App.h"
+#include "core/ArgParser.h"
+#include "core/ServerArgs.h"
+#include "core/ClientArgs.h"
#include "ipc/IpcClientProxy.h"
#include "ipc/IpcMessage.h"
#include "ipc/IpcLogOutputter.h"
@@ -41,7 +41,7 @@
#include "arch/win32/ArchMiscWindows.h"
#include "arch/win32/XArchWindows.h"
-#include "synergy/Screen.h"
+#include "core/Screen.h"
#include "platform/MSWindowsScreen.h"
#include "platform/MSWindowsDebugOutputter.h"
#include "platform/MSWindowsWatchdog.h"
diff --git a/src/lib/synergy/DaemonApp.h b/src/lib/core/DaemonApp.h
similarity index 100%
rename from src/lib/synergy/DaemonApp.h
rename to src/lib/core/DaemonApp.h
diff --git a/src/lib/synergy/DragInformation.cpp b/src/lib/core/DragInformation.cpp
similarity index 99%
rename from src/lib/synergy/DragInformation.cpp
rename to src/lib/core/DragInformation.cpp
index 59136516..6af1719d 100644
--- a/src/lib/synergy/DragInformation.cpp
+++ b/src/lib/core/DragInformation.cpp
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-#include "synergy/DragInformation.h"
+#include "core/DragInformation.h"
#include "base/Log.h"
#include
diff --git a/src/lib/synergy/DragInformation.h b/src/lib/core/DragInformation.h
similarity index 100%
rename from src/lib/synergy/DragInformation.h
rename to src/lib/core/DragInformation.h
diff --git a/src/lib/synergy/DropHelper.cpp b/src/lib/core/DropHelper.cpp
similarity index 98%
rename from src/lib/synergy/DropHelper.cpp
rename to src/lib/core/DropHelper.cpp
index a99d9f8a..164ed8e0 100644
--- a/src/lib/synergy/DropHelper.cpp
+++ b/src/lib/core/DropHelper.cpp
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-#include "synergy/DropHelper.h"
+#include "core/DropHelper.h"
#include "base/Log.h"
diff --git a/src/lib/synergy/DropHelper.h b/src/lib/core/DropHelper.h
similarity index 96%
rename from src/lib/synergy/DropHelper.h
rename to src/lib/core/DropHelper.h
index 021f2cc9..4c2933e7 100644
--- a/src/lib/synergy/DropHelper.h
+++ b/src/lib/core/DropHelper.h
@@ -17,7 +17,7 @@
#pragma once
-#include "synergy/DragInformation.h"
+#include "core/DragInformation.h"
#include "base/String.h"
class DropHelper {
diff --git a/src/lib/synergy/FileChunk.cpp b/src/lib/core/FileChunk.cpp
similarity index 97%
rename from src/lib/synergy/FileChunk.cpp
rename to src/lib/core/FileChunk.cpp
index 490112df..0a86bd22 100644
--- a/src/lib/synergy/FileChunk.cpp
+++ b/src/lib/core/FileChunk.cpp
@@ -15,10 +15,10 @@
* along with this program. If not, see .
*/
-#include "synergy/FileChunk.h"
+#include "core/FileChunk.h"
-#include "synergy/ProtocolUtil.h"
-#include "synergy/protocol_types.h"
+#include "core/ProtocolUtil.h"
+#include "core/protocol_types.h"
#include "io/IStream.h"
#include "base/Stopwatch.h"
#include "base/Log.h"
diff --git a/src/lib/synergy/FileChunk.h b/src/lib/core/FileChunk.h
similarity index 98%
rename from src/lib/synergy/FileChunk.h
rename to src/lib/core/FileChunk.h
index 12d02f9c..0637e2b7 100644
--- a/src/lib/synergy/FileChunk.h
+++ b/src/lib/core/FileChunk.h
@@ -17,7 +17,7 @@
#pragma once
-#include "synergy/Chunk.h"
+#include "core/Chunk.h"
#include "base/String.h"
#include "common/basic_types.h"
diff --git a/src/lib/synergy/IApp.h b/src/lib/core/IApp.h
similarity index 96%
rename from src/lib/synergy/IApp.h
rename to src/lib/core/IApp.h
index 6dc6f844..8d061ba2 100644
--- a/src/lib/synergy/IApp.h
+++ b/src/lib/core/IApp.h
@@ -36,7 +36,6 @@ public:
virtual int standardStartup(int argc, char** argv) = 0;
virtual int runInner(int argc, char** argv, ILogOutputter* outputter, StartupFunc startup) = 0;
virtual void startNode() = 0;
- virtual IArchTaskBarReceiver* taskBarReceiver() const = 0;
virtual void bye(int error) = 0;
virtual int mainLoop() = 0;
virtual void initApp(int argc, const char** argv) = 0;
diff --git a/src/lib/synergy/IAppUtil.h b/src/lib/core/IAppUtil.h
similarity index 97%
rename from src/lib/synergy/IAppUtil.h
rename to src/lib/core/IAppUtil.h
index 5f94e82d..9eefed26 100644
--- a/src/lib/synergy/IAppUtil.h
+++ b/src/lib/core/IAppUtil.h
@@ -19,7 +19,7 @@
#pragma once
#include "common/IInterface.h"
-#include "synergy/IApp.h"
+#include "core/IApp.h"
class IAppUtil : public IInterface {
public:
diff --git a/src/lib/synergy/IClient.h b/src/lib/core/IClient.h
similarity index 97%
rename from src/lib/synergy/IClient.h
rename to src/lib/core/IClient.h
index 0a296bf3..463d4a69 100644
--- a/src/lib/synergy/IClient.h
+++ b/src/lib/core/IClient.h
@@ -18,11 +18,11 @@
#pragma once
-#include "synergy/clipboard_types.h"
-#include "synergy/IScreen.h"
-#include "synergy/key_types.h"
-#include "synergy/mouse_types.h"
-#include "synergy/option_types.h"
+#include "core/clipboard_types.h"
+#include "core/IScreen.h"
+#include "core/key_types.h"
+#include "core/mouse_types.h"
+#include "core/option_types.h"
#include "base/String.h"
//! Client interface
diff --git a/src/lib/synergy/IClipboard.cpp b/src/lib/core/IClipboard.cpp
similarity index 99%
rename from src/lib/synergy/IClipboard.cpp
rename to src/lib/core/IClipboard.cpp
index a554c9c1..63439875 100644
--- a/src/lib/synergy/IClipboard.cpp
+++ b/src/lib/core/IClipboard.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/IClipboard.h"
+#include "core/IClipboard.h"
#include "common/stdvector.h"
//
diff --git a/src/lib/synergy/IClipboard.h b/src/lib/core/IClipboard.h
similarity index 100%
rename from src/lib/synergy/IClipboard.h
rename to src/lib/core/IClipboard.h
diff --git a/src/lib/synergy/IKeyState.cpp b/src/lib/core/IKeyState.cpp
similarity index 99%
rename from src/lib/synergy/IKeyState.cpp
rename to src/lib/core/IKeyState.cpp
index a46fb64f..cd0c0c39 100644
--- a/src/lib/synergy/IKeyState.cpp
+++ b/src/lib/core/IKeyState.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/IKeyState.h"
+#include "core/IKeyState.h"
#include "base/EventQueue.h"
#include
diff --git a/src/lib/synergy/IKeyState.h b/src/lib/core/IKeyState.h
similarity index 99%
rename from src/lib/synergy/IKeyState.h
rename to src/lib/core/IKeyState.h
index 249f4e8f..32129825 100644
--- a/src/lib/synergy/IKeyState.h
+++ b/src/lib/core/IKeyState.h
@@ -18,7 +18,7 @@
#pragma once
-#include "synergy/key_types.h"
+#include "core/key_types.h"
#include "base/Event.h"
#include "base/String.h"
#include "base/IEventQueue.h"
diff --git a/src/lib/synergy/INode.h b/src/lib/core/INode.h
similarity index 100%
rename from src/lib/synergy/INode.h
rename to src/lib/core/INode.h
diff --git a/src/lib/synergy/IPlatformScreen.cpp b/src/lib/core/IPlatformScreen.cpp
similarity index 95%
rename from src/lib/synergy/IPlatformScreen.cpp
rename to src/lib/core/IPlatformScreen.cpp
index 844b34cc..a794d86b 100644
--- a/src/lib/synergy/IPlatformScreen.cpp
+++ b/src/lib/core/IPlatformScreen.cpp
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-#include "synergy/IPlatformScreen.h"
+#include "core/IPlatformScreen.h"
bool
IPlatformScreen::fakeMediaKey(KeyID id)
diff --git a/src/lib/synergy/IPlatformScreen.h b/src/lib/core/IPlatformScreen.h
similarity index 97%
rename from src/lib/synergy/IPlatformScreen.h
rename to src/lib/core/IPlatformScreen.h
index 71eed1d0..ad0def8b 100644
--- a/src/lib/synergy/IPlatformScreen.h
+++ b/src/lib/core/IPlatformScreen.h
@@ -18,13 +18,13 @@
#pragma once
-#include "synergy/DragInformation.h"
-#include "synergy/clipboard_types.h"
-#include "synergy/IScreen.h"
-#include "synergy/IPrimaryScreen.h"
-#include "synergy/ISecondaryScreen.h"
-#include "synergy/IKeyState.h"
-#include "synergy/option_types.h"
+#include "core/DragInformation.h"
+#include "core/clipboard_types.h"
+#include "core/IScreen.h"
+#include "core/IPrimaryScreen.h"
+#include "core/ISecondaryScreen.h"
+#include "core/IKeyState.h"
+#include "core/option_types.h"
class IClipboard;
diff --git a/src/lib/synergy/IPrimaryScreen.cpp b/src/lib/core/IPrimaryScreen.cpp
similarity index 98%
rename from src/lib/synergy/IPrimaryScreen.cpp
rename to src/lib/core/IPrimaryScreen.cpp
index 94c58b72..a29e2638 100644
--- a/src/lib/synergy/IPrimaryScreen.cpp
+++ b/src/lib/core/IPrimaryScreen.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/IPrimaryScreen.h"
+#include "core/IPrimaryScreen.h"
#include "base/EventQueue.h"
#include
diff --git a/src/lib/synergy/IPrimaryScreen.h b/src/lib/core/IPrimaryScreen.h
similarity index 98%
rename from src/lib/synergy/IPrimaryScreen.h
rename to src/lib/core/IPrimaryScreen.h
index c4ec04d3..7ad20d04 100644
--- a/src/lib/synergy/IPrimaryScreen.h
+++ b/src/lib/core/IPrimaryScreen.h
@@ -18,8 +18,8 @@
#pragma once
-#include "synergy/key_types.h"
-#include "synergy/mouse_types.h"
+#include "core/key_types.h"
+#include "core/mouse_types.h"
#include "base/Event.h"
#include "base/EventTypes.h"
#include "common/IInterface.h"
diff --git a/src/lib/synergy/IScreen.h b/src/lib/core/IScreen.h
similarity index 98%
rename from src/lib/synergy/IScreen.h
rename to src/lib/core/IScreen.h
index a55a238c..9d47d031 100644
--- a/src/lib/synergy/IScreen.h
+++ b/src/lib/core/IScreen.h
@@ -18,7 +18,7 @@
#pragma once
-#include "synergy/clipboard_types.h"
+#include "core/clipboard_types.h"
#include "base/Event.h"
#include "base/EventTypes.h"
#include "common/IInterface.h"
diff --git a/src/lib/synergy/IScreenSaver.h b/src/lib/core/IScreenSaver.h
similarity index 100%
rename from src/lib/synergy/IScreenSaver.h
rename to src/lib/core/IScreenSaver.h
diff --git a/src/lib/synergy/ISecondaryScreen.h b/src/lib/core/ISecondaryScreen.h
similarity index 98%
rename from src/lib/synergy/ISecondaryScreen.h
rename to src/lib/core/ISecondaryScreen.h
index 1f4e25d5..4291595d 100644
--- a/src/lib/synergy/ISecondaryScreen.h
+++ b/src/lib/core/ISecondaryScreen.h
@@ -18,7 +18,7 @@
#pragma once
-#include "synergy/mouse_types.h"
+#include "core/mouse_types.h"
#include "base/Event.h"
#include "base/EventTypes.h"
#include "common/IInterface.h"
diff --git a/src/lib/synergy/KeyMap.cpp b/src/lib/core/KeyMap.cpp
similarity index 99%
rename from src/lib/synergy/KeyMap.cpp
rename to src/lib/core/KeyMap.cpp
index e2d3edb2..e091eac0 100644
--- a/src/lib/synergy/KeyMap.cpp
+++ b/src/lib/core/KeyMap.cpp
@@ -16,8 +16,8 @@
* along with this program. If not, see .
*/
-#include "synergy/KeyMap.h"
-#include "synergy/key_types.h"
+#include "core/KeyMap.h"
+#include "core/key_types.h"
#include "base/Log.h"
#include
diff --git a/src/lib/synergy/KeyMap.h b/src/lib/core/KeyMap.h
similarity index 99%
rename from src/lib/synergy/KeyMap.h
rename to src/lib/core/KeyMap.h
index 8ed82ebc..574d48ce 100644
--- a/src/lib/synergy/KeyMap.h
+++ b/src/lib/core/KeyMap.h
@@ -18,7 +18,7 @@
#pragma once
-#include "synergy/key_types.h"
+#include "core/key_types.h"
#include "base/String.h"
#include "common/stdmap.h"
#include "common/stdset.h"
diff --git a/src/lib/synergy/KeyState.cpp b/src/lib/core/KeyState.cpp
similarity index 99%
rename from src/lib/synergy/KeyState.cpp
rename to src/lib/core/KeyState.cpp
index 73ffe727..e72e7631 100644
--- a/src/lib/synergy/KeyState.cpp
+++ b/src/lib/core/KeyState.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/KeyState.h"
+#include "core/KeyState.h"
#include "base/Log.h"
#include
diff --git a/src/lib/synergy/KeyState.h b/src/lib/core/KeyState.h
similarity index 99%
rename from src/lib/synergy/KeyState.h
rename to src/lib/core/KeyState.h
index 45282ee5..9ae3da52 100644
--- a/src/lib/synergy/KeyState.h
+++ b/src/lib/core/KeyState.h
@@ -18,8 +18,8 @@
#pragma once
-#include "synergy/IKeyState.h"
-#include "synergy/KeyMap.h"
+#include "core/IKeyState.h"
+#include "core/KeyMap.h"
//! Core key state
/*!
diff --git a/src/lib/synergy/PacketStreamFilter.cpp b/src/lib/core/PacketStreamFilter.cpp
similarity index 99%
rename from src/lib/synergy/PacketStreamFilter.cpp
rename to src/lib/core/PacketStreamFilter.cpp
index ba109dbc..652b4152 100644
--- a/src/lib/synergy/PacketStreamFilter.cpp
+++ b/src/lib/core/PacketStreamFilter.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/PacketStreamFilter.h"
+#include "core/PacketStreamFilter.h"
#include "base/IEventQueue.h"
#include "mt/Lock.h"
#include "base/TMethodEventJob.h"
diff --git a/src/lib/synergy/PacketStreamFilter.h b/src/lib/core/PacketStreamFilter.h
similarity index 100%
rename from src/lib/synergy/PacketStreamFilter.h
rename to src/lib/core/PacketStreamFilter.h
diff --git a/src/lib/synergy/PlatformScreen.cpp b/src/lib/core/PlatformScreen.cpp
similarity index 96%
rename from src/lib/synergy/PlatformScreen.cpp
rename to src/lib/core/PlatformScreen.cpp
index e94b7755..77cb705f 100644
--- a/src/lib/synergy/PlatformScreen.cpp
+++ b/src/lib/core/PlatformScreen.cpp
@@ -16,9 +16,9 @@
* along with this program. If not, see .
*/
-#include "synergy/PlatformScreen.h"
-#include "synergy/App.h"
-#include "synergy/ArgsBase.h"
+#include "core/PlatformScreen.h"
+#include "core/App.h"
+#include "core/ArgsBase.h"
PlatformScreen::PlatformScreen(IEventQueue* events) :
IPlatformScreen(events),
diff --git a/src/lib/synergy/PlatformScreen.h b/src/lib/core/PlatformScreen.h
similarity index 96%
rename from src/lib/synergy/PlatformScreen.h
rename to src/lib/core/PlatformScreen.h
index 16dc904a..8175c009 100644
--- a/src/lib/synergy/PlatformScreen.h
+++ b/src/lib/core/PlatformScreen.h
@@ -18,8 +18,8 @@
#pragma once
-#include "synergy/IPlatformScreen.h"
-#include "synergy/DragInformation.h"
+#include "core/IPlatformScreen.h"
+#include "core/DragInformation.h"
#include "common/stdexcept.h"
//! Base screen implementation
diff --git a/src/lib/synergy/PortableTaskBarReceiver.cpp b/src/lib/core/PortableTaskBarReceiver.cpp
similarity index 98%
rename from src/lib/synergy/PortableTaskBarReceiver.cpp
rename to src/lib/core/PortableTaskBarReceiver.cpp
index d103960a..8c584b99 100644
--- a/src/lib/synergy/PortableTaskBarReceiver.cpp
+++ b/src/lib/core/PortableTaskBarReceiver.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/PortableTaskBarReceiver.h"
+#include "core/PortableTaskBarReceiver.h"
#include "mt/Lock.h"
#include "base/String.h"
#include "base/IEventQueue.h"
diff --git a/src/lib/synergy/PortableTaskBarReceiver.h b/src/lib/core/PortableTaskBarReceiver.h
similarity index 98%
rename from src/lib/synergy/PortableTaskBarReceiver.h
rename to src/lib/core/PortableTaskBarReceiver.h
index ab8e6c0c..05ecfc98 100644
--- a/src/lib/synergy/PortableTaskBarReceiver.h
+++ b/src/lib/core/PortableTaskBarReceiver.h
@@ -18,7 +18,7 @@
#pragma once
-#include "synergy/INode.h"
+#include "core/INode.h"
#include "arch/IArchTaskBarReceiver.h"
#include "base/log_outputters.h"
#include "base/EventTypes.h"
diff --git a/src/lib/synergy/ProtocolUtil.cpp b/src/lib/core/ProtocolUtil.cpp
similarity index 99%
rename from src/lib/synergy/ProtocolUtil.cpp
rename to src/lib/core/ProtocolUtil.cpp
index d9f5dc32..88ca6c05 100644
--- a/src/lib/synergy/ProtocolUtil.cpp
+++ b/src/lib/core/ProtocolUtil.cpp
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-#include "synergy/ProtocolUtil.h"
+#include "core/ProtocolUtil.h"
#include "io/IStream.h"
#include "base/Log.h"
#include "common/stdvector.h"
diff --git a/src/lib/synergy/ProtocolUtil.h b/src/lib/core/ProtocolUtil.h
similarity index 100%
rename from src/lib/synergy/ProtocolUtil.h
rename to src/lib/core/ProtocolUtil.h
diff --git a/src/lib/synergy/Screen.cpp b/src/lib/core/Screen.cpp
similarity index 99%
rename from src/lib/synergy/Screen.cpp
rename to src/lib/core/Screen.cpp
index 57cb865b..216fe11a 100644
--- a/src/lib/synergy/Screen.cpp
+++ b/src/lib/core/Screen.cpp
@@ -16,9 +16,9 @@
* along with this program. If not, see .
*/
-#include "synergy/Screen.h"
-#include "synergy/IPlatformScreen.h"
-#include "synergy/protocol_types.h"
+#include "core/Screen.h"
+#include "core/IPlatformScreen.h"
+#include "core/protocol_types.h"
#include "base/Log.h"
#include "base/IEventQueue.h"
#include "server/ClientProxy.h"
diff --git a/src/lib/synergy/Screen.h b/src/lib/core/Screen.h
similarity index 98%
rename from src/lib/synergy/Screen.h
rename to src/lib/core/Screen.h
index 9c45a482..5bd6484d 100644
--- a/src/lib/synergy/Screen.h
+++ b/src/lib/core/Screen.h
@@ -18,12 +18,12 @@
#pragma once
-#include "synergy/DragInformation.h"
-#include "synergy/clipboard_types.h"
-#include "synergy/IScreen.h"
-#include "synergy/key_types.h"
-#include "synergy/mouse_types.h"
-#include "synergy/option_types.h"
+#include "core/DragInformation.h"
+#include "core/clipboard_types.h"
+#include "core/IScreen.h"
+#include "core/key_types.h"
+#include "core/mouse_types.h"
+#include "core/option_types.h"
#include "base/String.h"
class IClipboard;
diff --git a/src/lib/synergy/ServerApp.cpp b/src/lib/core/ServerApp.cpp
similarity index 97%
rename from src/lib/synergy/ServerApp.cpp
rename to src/lib/core/ServerApp.cpp
index 5d49239a..d080c502 100644
--- a/src/lib/synergy/ServerApp.cpp
+++ b/src/lib/core/ServerApp.cpp
@@ -16,17 +16,17 @@
* along with this program. If not, see .
*/
-#include "synergy/ServerApp.h"
+#include "core/ServerApp.h"
#include "server/Server.h"
#include "server/ClientListener.h"
#include "server/ClientProxy.h"
#include "server/PrimaryClient.h"
-#include "synergy/ArgParser.h"
-#include "synergy/Screen.h"
-#include "synergy/XScreen.h"
-#include "synergy/ServerTaskBarReceiver.h"
-#include "synergy/ServerArgs.h"
+#include "core/ArgParser.h"
+#include "core/Screen.h"
+#include "core/XScreen.h"
+#include "core/ServerTaskBarReceiver.h"
+#include "core/ServerArgs.h"
#include "net/SocketMultiplexer.h"
#include "net/TCPSocketFactory.h"
#include "net/XSocket.h"
@@ -64,8 +64,8 @@
// ServerApp
//
-ServerApp::ServerApp(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver) :
- App(events, createTaskBarReceiver, new ServerArgs()),
+ServerApp::ServerApp(IEventQueue* events) :
+ App(events, new ServerArgs()),
m_server(NULL),
m_serverState(kUninitialized),
m_serverScreen(NULL),
@@ -319,10 +319,6 @@ ServerApp::updateStatus()
void ServerApp::updateStatus(const String& msg)
{
- if (m_taskBarReceiver)
- {
- m_taskBarReceiver->updateStatus(m_server, msg);
- }
}
void
@@ -799,12 +795,6 @@ ServerApp::runInner(int argc, char** argv, ILogOutputter* outputter, StartupFunc
// run
int result = startup(argc, argv);
- if (m_taskBarReceiver)
- {
- // done with task bar receiver
- delete m_taskBarReceiver;
- }
-
delete args().m_config;
delete m_synergyAddress;
return result;
diff --git a/src/lib/synergy/ServerApp.h b/src/lib/core/ServerApp.h
similarity index 95%
rename from src/lib/synergy/ServerApp.h
rename to src/lib/core/ServerApp.h
index 59f9f65a..2847f272 100644
--- a/src/lib/synergy/ServerApp.h
+++ b/src/lib/core/ServerApp.h
@@ -18,14 +18,14 @@
#pragma once
-#include "synergy/ArgsBase.h"
-#include "synergy/App.h"
+#include "core/ArgsBase.h"
+#include "core/App.h"
#include "base/String.h"
#include "server/Config.h"
#include "net/NetworkAddress.h"
#include "arch/Arch.h"
#include "arch/IArchMultithread.h"
-#include "synergy/ArgsBase.h"
+#include "core/ArgsBase.h"
#include "base/EventTypes.h"
#include