Remove synergyp
This commit is contained in:
parent
790d108a56
commit
1759afd82d
|
@ -23,6 +23,3 @@ if (BUILD_SERVICE)
|
|||
add_subdirectory(synergyd)
|
||||
endif (BUILD_SERVICE)
|
||||
|
||||
if (WIN32)
|
||||
add_subdirectory(synergyp)
|
||||
endif()
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
# synergy -- mouse and keyboard sharing utility
|
||||
# Copyright (C) 2012-2016 Symless Ltd.
|
||||
# Copyright (C) 2009 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 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(sources
|
||||
synergyp.cpp
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
file(GLOB arch_headers "MSWindows*.h")
|
||||
file(GLOB arch_sources "MSWindows*.cpp")
|
||||
list(APPEND sources
|
||||
resource.h
|
||||
synergyp.ico
|
||||
synergyp.rc
|
||||
tb_error.ico
|
||||
tb_idle.ico
|
||||
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()
|
||||
|
||||
include_directories(
|
||||
../
|
||||
../../lib/
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
include_directories(
|
||||
../../..
|
||||
)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
add_executable(synergyp WIN32 ${sources})
|
||||
else()
|
||||
add_executable(synergyp ${sources})
|
||||
endif()
|
||||
|
||||
target_link_libraries(synergyp
|
||||
arch base client common io mt net ipc platform server synergy client ${libs} ${OPENSSL_LIBS})
|
||||
|
||||
if (WIN32)
|
||||
add_custom_command(
|
||||
TARGET synergyp
|
||||
POST_BUILD
|
||||
COMMAND xcopy /Y /Q
|
||||
..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\synergyp.*
|
||||
..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR}
|
||||
)
|
||||
else ()
|
||||
if (CONF_CPACK)
|
||||
install(TARGETS
|
||||
synergyp
|
||||
COMPONENT core
|
||||
DESTINATION bin)
|
||||
endif()
|
||||
endif()
|
|
@ -1,394 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "synergyp/MSWindowsPortableTaskBarReceiver.h"
|
||||
|
||||
#include "resource.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"
|
||||
|
||||
//
|
||||
// MSWindowsPortableTaskBarReceiver
|
||||
//
|
||||
|
||||
const UINT MSWindowsPortableTaskBarReceiver::s_stateToIconID[kMaxState] =
|
||||
{
|
||||
IDI_TASKBAR_NOT_RUNNING,
|
||||
IDI_TASKBAR_NOT_WORKING,
|
||||
IDI_TASKBAR_NOT_CONNECTED,
|
||||
IDI_TASKBAR_CONNECTED
|
||||
};
|
||||
|
||||
MSWindowsPortableTaskBarReceiver::MSWindowsPortableTaskBarReceiver(
|
||||
HINSTANCE appInstance, const BufferedLogOutputter* logBuffer, IEventQueue* events) :
|
||||
PortableTaskBarReceiver(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
|
||||
MSWindowsPortableTaskBarReceiver::cleanup()
|
||||
{
|
||||
ARCH->removeReceiver(this);
|
||||
for (UInt32 i = 0; i < kMaxState; ++i) {
|
||||
deleteIcon(m_icon[i]);
|
||||
}
|
||||
DestroyMenu(m_menu);
|
||||
destroyWindow();
|
||||
}
|
||||
|
||||
MSWindowsPortableTaskBarReceiver::~MSWindowsPortableTaskBarReceiver()
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
MSWindowsPortableTaskBarReceiver::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());
|
||||
child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_CLIENTS);
|
||||
SendMessage(child, LB_RESETCONTENT, 0, 0);
|
||||
|
||||
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
|
||||
MSWindowsPortableTaskBarReceiver::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
|
||||
MSWindowsPortableTaskBarReceiver::primaryAction()
|
||||
{
|
||||
showStatus();
|
||||
}
|
||||
|
||||
const IArchTaskBarReceiver::Icon
|
||||
MSWindowsPortableTaskBarReceiver::getIcon() const
|
||||
{
|
||||
return static_cast<Icon>(m_icon[getStatus()]);
|
||||
}
|
||||
|
||||
void
|
||||
MSWindowsPortableTaskBarReceiver::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
|
||||
MSWindowsPortableTaskBarReceiver::onStatusChanged()
|
||||
{
|
||||
if (IsWindowVisible(m_window)) {
|
||||
showStatus();
|
||||
}
|
||||
}
|
||||
|
||||
HICON
|
||||
MSWindowsPortableTaskBarReceiver::loadIcon(UINT id)
|
||||
{
|
||||
HANDLE icon = LoadImage(m_appInstance,
|
||||
MAKEINTRESOURCE(id),
|
||||
IMAGE_ICON,
|
||||
0, 0,
|
||||
LR_DEFAULTCOLOR);
|
||||
return static_cast<HICON>(icon);
|
||||
}
|
||||
|
||||
void
|
||||
MSWindowsPortableTaskBarReceiver::deleteIcon(HICON icon)
|
||||
{
|
||||
if (icon != NULL) {
|
||||
DestroyIcon(icon);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MSWindowsPortableTaskBarReceiver::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)&MSWindowsPortableTaskBarReceiver::staticDlgProc,
|
||||
reinterpret_cast<LPARAM>(
|
||||
static_cast<void*>(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
|
||||
MSWindowsPortableTaskBarReceiver::destroyWindow()
|
||||
{
|
||||
if (m_window != NULL) {
|
||||
ArchTaskBarWindows::removeDialog(m_window);
|
||||
DestroyWindow(m_window);
|
||||
m_window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL
|
||||
MSWindowsPortableTaskBarReceiver::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
|
||||
MSWindowsPortableTaskBarReceiver::staticDlgProc(HWND hwnd,
|
||||
UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
// if msg is WM_INITDIALOG, extract the MSWindowsPortableTaskBarReceiver*
|
||||
// and put it in the extra window data then forward the call.
|
||||
MSWindowsPortableTaskBarReceiver* self = NULL;
|
||||
if (msg == WM_INITDIALOG) {
|
||||
self = static_cast<MSWindowsPortableTaskBarReceiver*>(
|
||||
reinterpret_cast<void*>(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<MSWindowsPortableTaskBarReceiver*>(
|
||||
reinterpret_cast<void*>(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 MSWindowsPortableTaskBarReceiver(
|
||||
MSWindowsScreen::getWindowInstance(), logBuffer, events);
|
||||
}
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "synergy/PortableTaskBarReceiver.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
class BufferedLogOutputter;
|
||||
class IEventQueue;
|
||||
|
||||
//! Implementation of PortableTaskBarReceiver for Microsoft Windows
|
||||
class MSWindowsPortableTaskBarReceiver : public PortableTaskBarReceiver {
|
||||
public:
|
||||
MSWindowsPortableTaskBarReceiver(HINSTANCE, const BufferedLogOutputter*, IEventQueue* events);
|
||||
virtual ~MSWindowsPortableTaskBarReceiver();
|
||||
|
||||
// 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;
|
||||
|
||||
// PortableTaskBarReceiver 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[];
|
||||
};
|
|
@ -1,66 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "synergys/OSXServerTaskBarReceiver.h"
|
||||
#include "arch/Arch.h"
|
||||
|
||||
//
|
||||
// OSXServerTaskBarReceiver
|
||||
//
|
||||
|
||||
OSXServerTaskBarReceiver::OSXServerTaskBarReceiver(
|
||||
const BufferedLogOutputter*)
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
return new OSXServerTaskBarReceiver(logBuffer);
|
||||
}
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "synergyp/PortableTaskBarReceiver.h"
|
||||
|
||||
class BufferedLogOutputter;
|
||||
|
||||
//! Implementation of PortableTaskBarReceiver for OS X
|
||||
class OSXServerTaskBarReceiver : public PortableTaskBarReceiver {
|
||||
public:
|
||||
OSXServerTaskBarReceiver(const BufferedLogOutputter*);
|
||||
virtual ~OSXServerTaskBarReceiver();
|
||||
|
||||
// IArchTaskBarReceiver overrides
|
||||
virtual void showStatus();
|
||||
virtual void runMenu(int x, int y);
|
||||
virtual void primaryAction();
|
||||
virtual const Icon getIcon() const;
|
||||
};
|
|
@ -1,66 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "synergys/XWindowsServerTaskBarReceiver.h"
|
||||
#include "arch/Arch.h"
|
||||
|
||||
//
|
||||
// CXWindowsServerTaskBarReceiver
|
||||
//
|
||||
|
||||
CXWindowsServerTaskBarReceiver::CXWindowsServerTaskBarReceiver(
|
||||
const BufferedLogOutputter*)
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
return new CXWindowsServerTaskBarReceiver(logBuffer);
|
||||
}
|
|
@ -1,36 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "synergyp/PortableTaskBarReceiver.h"
|
||||
|
||||
class BufferedLogOutputter;
|
||||
|
||||
//! Implementation of PortableTaskBarReceiver for X Windows
|
||||
class CXWindowsServerTaskBarReceiver : public PortableTaskBarReceiver {
|
||||
public:
|
||||
CXWindowsServerTaskBarReceiver(const BufferedLogOutputter*);
|
||||
virtual ~CXWindowsServerTaskBarReceiver();
|
||||
|
||||
// IArchTaskBarReceiver overrides
|
||||
virtual void showStatus();
|
||||
virtual void runMenu(int x, int y);
|
||||
virtual void primaryAction();
|
||||
virtual const Icon getIcon() const;
|
||||
};
|
|
@ -1,42 +0,0 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by synergys.rc
|
||||
//
|
||||
#define IDS_FAILED 1
|
||||
#define IDS_INIT_FAILED 2
|
||||
#define IDS_UNCAUGHT_EXCEPTION 3
|
||||
#define IDI_SYNERGY 101
|
||||
#define IDI_TASKBAR_NOT_RUNNING 102
|
||||
#define IDI_TASKBAR_NOT_WORKING 103
|
||||
#define IDI_TASKBAR_NOT_CONNECTED 104
|
||||
#define IDI_TASKBAR_CONNECTED 105
|
||||
#define IDR_TASKBAR 107
|
||||
#define IDD_TASKBAR_STATUS 108
|
||||
#define IDC_TASKBAR_STATUS_STATUS 1000
|
||||
#define IDC_TASKBAR_STATUS_CLIENTS 1001
|
||||
#define IDC_TASKBAR_QUIT 40003
|
||||
#define IDC_TASKBAR_STATUS 40004
|
||||
#define IDC_TASKBAR_LOG 40005
|
||||
#define IDC_RELOAD_CONFIG 40006
|
||||
#define IDC_FORCE_RECONNECT 40007
|
||||
#define IDC_TASKBAR_SHOW_LOG 40008
|
||||
#define IDC_TASKBAR_LOG_LEVEL_ERROR 40009
|
||||
#define IDC_TASKBAR_LOG_LEVEL_WARNING 40010
|
||||
#define IDC_TASKBAR_LOG_LEVEL_NOTE 40011
|
||||
#define IDC_TASKBAR_LOG_LEVEL_INFO 40012
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG 40013
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG1 40014
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG2 40015
|
||||
#define ID_SYNERGY_RELOADSYSTEM 40016
|
||||
#define ID_SYNERGY_RESETSERVER 40017
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 109
|
||||
#define _APS_NEXT_COMMAND_VALUE 40018
|
||||
#define _APS_NEXT_CONTROL_VALUE 1003
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
* synergy -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2013-2016 Symless Ltd.
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "synergy/ServerApp.h"
|
||||
#include "synergy/ClientApp.h"
|
||||
#include "arch/Arch.h"
|
||||
#include "base/Log.h"
|
||||
#include "base/EventQueue.h"
|
||||
|
||||
#if WINAPI_MSWINDOWS
|
||||
#include "MSWindowsPortableTaskBarReceiver.h"
|
||||
#elif WINAPI_XWINDOWS
|
||||
#include "XWindowsPortableTaskBarReceiver.h"
|
||||
#elif WINAPI_CARBON
|
||||
#include "OSXPortableTaskBarReceiver.h"
|
||||
#else
|
||||
#error Platform not supported.
|
||||
#endif
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
INT WINAPI
|
||||
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow)
|
||||
{
|
||||
#if SYSAPI_WIN32
|
||||
// record window instance for tray icon, etc
|
||||
ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
|
||||
#endif
|
||||
|
||||
Arch arch;
|
||||
arch.init();
|
||||
|
||||
Log log;
|
||||
EventQueue events;
|
||||
|
||||
CLOG->insert(new MesssageBoxLogOutputter());
|
||||
|
||||
int argc = __argc;
|
||||
char** argv = __argv;
|
||||
|
||||
bool server = false, client = false;
|
||||
for (int i = 0; i < argc; i++) {
|
||||
if (std::string(argv[i]) == "--server") {
|
||||
server = true;
|
||||
}
|
||||
else if (std::string(argv[i]) == "--client") {
|
||||
client = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!server && !client) {
|
||||
MessageBox(NULL,
|
||||
"Either the --server argument or the --client argument must be provided.",
|
||||
"Server or client?", MB_OK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argc <= 2) {
|
||||
MessageBox(NULL,
|
||||
"No additional arguments were provided. Append the --help argument for help.\n\n"
|
||||
"Hint: Create a shortcut and append the \"Target\" field with the arguments.",
|
||||
"No additional arguments", MB_OK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (server) {
|
||||
ServerApp app(&events, createTaskBarReceiver);
|
||||
return app.run(argc, argv);
|
||||
}
|
||||
else if (client) {
|
||||
ClientApp app(&events, createTaskBarReceiver);
|
||||
return app.run(argc, argv);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 281 KiB |
|
@ -1,134 +0,0 @@
|
|||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include <winresrc.h>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include <winresrc.h>\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_SYNERGY ICON "synergyp.ico"
|
||||
IDI_TASKBAR_NOT_RUNNING ICON "tb_idle.ico"
|
||||
IDI_TASKBAR_NOT_WORKING ICON "tb_error.ico"
|
||||
IDI_TASKBAR_NOT_CONNECTED ICON "tb_wait.ico"
|
||||
IDI_TASKBAR_CONNECTED ICON "tb_run.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_TASKBAR MENU
|
||||
BEGIN
|
||||
POPUP "Synergy"
|
||||
BEGIN
|
||||
MENUITEM "Show Status", IDC_TASKBAR_STATUS
|
||||
MENUITEM "Show Log", IDC_TASKBAR_SHOW_LOG
|
||||
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
|
||||
POPUP "Set Log Level"
|
||||
BEGIN
|
||||
MENUITEM "Error", IDC_TASKBAR_LOG_LEVEL_ERROR
|
||||
MENUITEM "Warning", IDC_TASKBAR_LOG_LEVEL_WARNING
|
||||
MENUITEM "Note", IDC_TASKBAR_LOG_LEVEL_NOTE
|
||||
MENUITEM "Info", IDC_TASKBAR_LOG_LEVEL_INFO
|
||||
MENUITEM "Debug", IDC_TASKBAR_LOG_LEVEL_DEBUG
|
||||
MENUITEM "Debug1", IDC_TASKBAR_LOG_LEVEL_DEBUG1
|
||||
MENUITEM "Debug2", IDC_TASKBAR_LOG_LEVEL_DEBUG2
|
||||
END
|
||||
MENUITEM "Reload Configuration", IDC_RELOAD_CONFIG
|
||||
MENUITEM "Force Reconnect", IDC_FORCE_RECONNECT
|
||||
MENUITEM "Reset", ID_SYNERGY_RESETSERVER
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Quit", IDC_TASKBAR_QUIT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_TASKBAR_STATUS DIALOG 0, 0, 145, 60
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT IDC_TASKBAR_STATUS_STATUS,3,3,139,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LISTBOX IDC_TASKBAR_STATUS_CLIENTS,3,17,139,40,NOT LBS_NOTIFY | LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_FAILED "Synergy is about to quit with errors or warnings. Please check the log then click OK."
|
||||
IDS_INIT_FAILED "Synergy failed to initialize: %{1}"
|
||||
IDS_UNCAUGHT_EXCEPTION "Uncaught exception: %{1}"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 318 B |
Binary file not shown.
Before Width: | Height: | Size: 318 B |
Binary file not shown.
Before Width: | Height: | Size: 318 B |
Binary file not shown.
Before Width: | Height: | Size: 318 B |
Loading…
Reference in New Issue