Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:dgollub
synergy
synergy-svn897.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File synergy-svn897.diff of Package synergy
diff -rup synergy-1.3.1/acinclude.m4 synergy-svn//acinclude.m4 --- synergy-1.3.1/acinclude.m4 2005-11-24 20:13:27.000000000 +0100 +++ synergy-svn//acinclude.m4 2007-09-06 07:02:13.000000000 +0200 @@ -27,6 +27,23 @@ AC_DEFUN([ACX_CHECK_SOCKLEN_T], [ fi ])dnl ACX_CHECK_SOCKLEN_T +# HP-UX defines socklen_t but doesn't use it in arg 3 for accept(). +AC_DEFUN([ACX_FUNC_ACCEPT], [ + AC_MSG_CHECKING([for type of arg 3 for accept]) + acx_accept_socklen_t_arg3=int + if test x"$acx_socklen_t_ok" = xyes; then + AC_TRY_COMPILE([ + #include <unistd.h> + #include <sys/socket.h> + ], + [struct sockaddr addr; socklen_t len; accept(0, &addr, &len);], + [acx_accept_socklen_t_arg3=socklen_t], + [acx_accept_socklen_t_arg3=int]) + fi + AC_MSG_RESULT($acx_accept_socklen_t_arg3) + AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG3,$acx_accept_socklen_t_arg3,[Define to the base type of arg 3 for `accept'.]) +])dnl ACX_FUNC_ACCEPT + AC_DEFUN([ACX_CHECK_CXX], [ AC_MSG_CHECKING([if g++ defines correct C++ macro]) AC_TRY_COMPILE(, [ Only in synergy-1.3.1: aclocal.m4 Only in synergy-1.3.1: all.dsp diff -rup synergy-1.3.1/ChangeLog synergy-svn//ChangeLog --- synergy-1.3.1/ChangeLog 2007-06-17 19:31:08.000000000 +0200 +++ synergy-svn//ChangeLog 2007-09-06 07:02:04.000000000 +0200 @@ -1,3 +1,125 @@ +2007/08/22 22:33:43 crs +all.dsp +ChangeLog +cmd/exec.dsp +cmd/launcher/launcher.dsp +cmd/launcher/launcher.rc +cmd/launcher/Makefile.am +cmd/launcher/nmake.mak +cmd/synergyc/Makefile.am +cmd/synergyc/nmake.mak +cmd/synergyc/synergyc.cpp +cmd/synergyc/synergyc.dsp +cmd/synergyc/synergyc.rc +cmd/synergys/Makefile.am +cmd/synergys/nmake.mak +cmd/synergys/synergys.cpp +cmd/synergys/synergys.dsp +cmd/synergys/synergys.rc +COPYING +dist/nullsoft/installer.dsp +dist/nullsoft/installer.mak +dist/nullsoft/Makefile.am +dist/nullsoft/nmake.mak +dist/nullsoft/synergy.nsi +doc/authors.html +lib/arch/arch.dsp +lib/arch/CArchDaemonNone.cpp +lib/arch/Makefile.am +lib/arch/nmake.mak +lib/base/base.dsp +lib/base/Makefile.am +lib/base/nmake.mak +lib/client/client.dsp +lib/client/Makefile.am +lib/client/nmake.mak +lib/common/common.dsp +lib/common/Makefile.am +lib/common/nmake.mak +lib/io/io.dsp +lib/io/Makefile.am +lib/io/nmake.mak +lib/mt/Makefile.am +lib/mt/mt.dsp +lib/mt/nmake.mak +lib/net/CSocketMultiplexer.cpp +lib/net/CTCPSocket.cpp +lib/net/Makefile.am +lib/net/net.dsp +lib/net/nmake.mak +lib/platform/CMSWindowsScreen.cpp +lib/platform/CSynergyHook.cpp +lib/platform/Makefile.am +lib/platform/makehook.dsp +lib/platform/nmake.mak +lib/platform/platform.dsp +lib/platform/synrgyhk.dsp +lib/server/Makefile.am +lib/server/nmake.mak +lib/server/server.dsp +lib/synergy/libsynergy.dsp +lib/synergy/Makefile.am +lib/synergy/nmake.mak +Makefile.am +nmake.mak +synergy.dsw +synergy.xcode/project.pbxproj +win32util/autodep.cpp + +Applied patch by maruel: +- Fixed taking the address of begin() on an empty std::vector. +- Fixed nsis makefile to use %ProgramFiles% environment variable. +- Fixed nsis makefile to pass the output directory and file to makensis. +- Fixed synergy.nsi to get the files from the output directory. That + enables a debug build of the installer. +- Fixes to compile under VS2005. + +I did not apply VS2005 project files, instead adding nmake files. nmake is +pretty weak but the makefiles can be modified without having visual studio. +Also modified the .rc files to not use winres.h. This plus nmake means +synergy can now be built using the freely downloadable Microsoft Windows +SDK for Vista, available from microsoft's web site. This change removes +all of the old VC++6 project files in favor of the nmake files. It also +removes the XCode project in favor of ./configure and make. + +All of the nmake files are named nmake.mak. Only the top level makefile +is directly useful (the rest are included by it) so all builds are from +the top level directory. nmake knows the following targets: + + all: build synergy.exe, synergyc.exe and synergys.exe + clean: remove all intermediate files, keep programs + clobber: clean and remove programs + installer: build programs and an installer + debug: build a debug version of 'all' + release: build a release version of 'all' + debug-installer: build an installer of the debug build + release-installer: build an installer of the release build + +The default build version is release so 'all' and 'installer' will build +a release version. The installer itself never has debug symbols, just +the stuff it installs. The default target is 'all'. To build use: + + nmake /nologo /f nmake.mak <target> + +VC++ and VisualStudio users may need to manually run vcvars.bat in a +command.exe or cmd.exe window before invoking nmake. The Window 98/Me +command.exe may not handle potentially long command lines; I haven't +tried to verify if that works. + +---------- +2007/08/22 21:42:09 crs +lib/platform/COSXKeyState.cpp + +Allow input scripts other than roman on OS X. + +---------- +2007/06/22 19:17:24 crs +lib/platform/CXWindowsClipboard.cpp + +Applied patch 1731039. Fixes a bug in testing if X clipboard +was owned at a given time. + +---------- 2006/04/02 12:16:23 crs lib/platform/CXWindowsKeyState.cpp Only in synergy-1.3.1/cmd: exec.dsp diff -rup synergy-1.3.1/cmd/launcher/CAddScreen.cpp synergy-svn//cmd/launcher/CAddScreen.cpp --- synergy-1.3.1/cmd/launcher/CAddScreen.cpp 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/launcher/CAddScreen.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -70,7 +70,7 @@ CAddScreen::doModal() { // do dialog return (DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_ADD), - m_parent, dlgProc, (LPARAM)this) != 0); + m_parent, (DLGPROC)dlgProc, (LPARAM)this) != 0); } CString diff -rup synergy-1.3.1/cmd/launcher/CAdvancedOptions.cpp synergy-svn//cmd/launcher/CAdvancedOptions.cpp --- synergy-1.3.1/cmd/launcher/CAdvancedOptions.cpp 2005-10-18 04:31:52.000000000 +0200 +++ synergy-svn//cmd/launcher/CAdvancedOptions.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -54,7 +54,7 @@ CAdvancedOptions::doModal(bool isClient) // do dialog DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_ADVANCED_OPTIONS), - m_parent, dlgProc, (LPARAM)this); + m_parent, (DLGPROC)dlgProc, (LPARAM)this); } CString diff -rup synergy-1.3.1/cmd/launcher/CAutoStart.cpp synergy-svn//cmd/launcher/CAutoStart.cpp --- synergy-1.3.1/cmd/launcher/CAutoStart.cpp 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/launcher/CAutoStart.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -87,7 +87,7 @@ CAutoStart::doModal() // do dialog DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_AUTOSTART), - m_parent, dlgProc, (LPARAM)this); + m_parent, (DLGPROC)dlgProc, (LPARAM)this); // remove log outputter CLOG->pop_front(); diff -rup synergy-1.3.1/cmd/launcher/CGlobalOptions.cpp synergy-svn//cmd/launcher/CGlobalOptions.cpp --- synergy-1.3.1/cmd/launcher/CGlobalOptions.cpp 2005-08-07 20:43:58.000000000 +0200 +++ synergy-svn//cmd/launcher/CGlobalOptions.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -50,7 +50,7 @@ CGlobalOptions::doModal() { // do dialog DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_GLOBAL_OPTIONS), - m_parent, dlgProc, (LPARAM)this); + m_parent, (DLGPROC)dlgProc, (LPARAM)this); } void diff -rup synergy-1.3.1/cmd/launcher/CHotkeyOptions.cpp synergy-svn//cmd/launcher/CHotkeyOptions.cpp --- synergy-1.3.1/cmd/launcher/CHotkeyOptions.cpp 2007-06-17 19:31:09.000000000 +0200 +++ synergy-svn//cmd/launcher/CHotkeyOptions.cpp 2007-09-10 02:59:51.000000000 +0200 @@ -53,7 +53,7 @@ CHotkeyOptions::doModal() // do dialog m_inputFilter = m_config->getInputFilter(); DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_HOTKEY_OPTIONS), - m_parent, dlgProc, (LPARAM)this); + m_parent, (DLGPROC)dlgProc, (LPARAM)this); } void @@ -925,6 +925,8 @@ CInputFilter::CAction* CHotkeyOptions::CActionDialog::s_action = NULL; CInputFilter::CAction* CHotkeyOptions::CActionDialog::s_lastGoodAction = NULL; +std::set<CString> + CHotkeyOptions::CActionDialog::s_screens; WNDPROC CHotkeyOptions::CActionDialog::s_editWndProc = NULL; bool @@ -995,11 +997,21 @@ CHotkeyOptions::CActionDialog::doInit(HW // fill lock modes child = getItem(hwnd, IDC_HOTKEY_ACTION_LOCK_LIST); SendMessage(child, CB_ADDSTRING, 0, - (LPARAM)getString(IDS_LOCK_MODE_OFF).c_str()); + (LPARAM)getString(IDS_MODE_OFF).c_str()); SendMessage(child, CB_ADDSTRING, 0, - (LPARAM)getString(IDS_LOCK_MODE_ON).c_str()); + (LPARAM)getString(IDS_MODE_ON).c_str()); SendMessage(child, CB_ADDSTRING, 0, - (LPARAM)getString(IDS_LOCK_MODE_TOGGLE).c_str()); + (LPARAM)getString(IDS_MODE_TOGGLE).c_str()); + SendMessage(child, CB_SETCURSEL, 0, 0); + + // fill keyboard broadcast modes + child = getItem(hwnd, IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_LIST); + SendMessage(child, CB_ADDSTRING, 0, + (LPARAM)getString(IDS_MODE_OFF).c_str()); + SendMessage(child, CB_ADDSTRING, 0, + (LPARAM)getString(IDS_MODE_ON).c_str()); + SendMessage(child, CB_ADDSTRING, 0, + (LPARAM)getString(IDS_MODE_TOGGLE).c_str()); SendMessage(child, CB_SETCURSEL, 0, 0); // select when @@ -1011,6 +1023,9 @@ CHotkeyOptions::CActionDialog::doInit(HW } setItemChecked(child, true); + // no screens by default + s_screens.clear(); + // select mode child = NULL; CInputFilter::CKeystrokeAction* keyAction = @@ -1023,6 +1038,8 @@ CHotkeyOptions::CActionDialog::doInit(HW dynamic_cast<CInputFilter::CSwitchToScreenAction*>(s_action); CInputFilter::CSwitchInDirectionAction* switchInAction = dynamic_cast<CInputFilter::CSwitchInDirectionAction*>(s_action); + CInputFilter::CKeyboardBroadcastAction* keyboardBroadcastAction= + dynamic_cast<CInputFilter::CKeyboardBroadcastAction*>(s_action); if (keyAction != NULL) { if (dynamic_cast<CKeystrokeDownUpAction*>(s_action) != NULL) { child = getItem(hwnd, IDC_HOTKEY_ACTION_DOWNUP); @@ -1066,6 +1083,14 @@ CHotkeyOptions::CActionDialog::doInit(HW switchInAction->getDirection() - kLeft, 0); child = getItem(hwnd, IDC_HOTKEY_ACTION_SWITCH_IN); } + else if (keyboardBroadcastAction != NULL) { + // Save the screens we're broadcasting to + s_screens = keyboardBroadcastAction->getScreens(); + + child = getItem(hwnd, IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_LIST); + SendMessage(child, CB_SETCURSEL, keyboardBroadcastAction->getMode(), 0); + child = getItem(hwnd, IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST); + } if (child != NULL) { setItemChecked(child, true); } @@ -1111,12 +1136,18 @@ CHotkeyOptions::CActionDialog::updateCon else if (isItemChecked(getItem(hwnd, IDC_HOTKEY_ACTION_LOCK))) { mode = 4; } + else if (isItemChecked(getItem(hwnd, + IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST))) { + mode = 5; + } // enable/disable all mode specific controls enableItem(hwnd, IDC_HOTKEY_ACTION_HOTKEY, mode == 1); enableItem(hwnd, IDC_HOTKEY_ACTION_SWITCH_TO_LIST, mode == 2); enableItem(hwnd, IDC_HOTKEY_ACTION_SWITCH_IN_LIST, mode == 3); enableItem(hwnd, IDC_HOTKEY_ACTION_LOCK_LIST, mode == 4); + enableItem(hwnd, IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_LIST, mode == 5); + enableItem(hwnd, IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_SCREENS, mode == 5); // can only set screens in key actions CInputFilter::CKeystrokeAction* keyAction = @@ -1306,6 +1337,18 @@ CHotkeyOptions::CActionDialog::onSwitchI } } +void +CHotkeyOptions::CActionDialog::onKeyboardBroadcastAction(HWND hwnd) +{ + HWND child = getItem(hwnd, IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_LIST); + LRESULT index = SendMessage(child, CB_GETCURSEL, 0, 0); + if (index != CB_ERR) { + delete s_action; + s_action = new CInputFilter::CKeyboardBroadcastAction( + (CInputFilter::CKeyboardBroadcastAction::Mode)index, s_screens); + } +} + KeyID CHotkeyOptions::CActionDialog::getChar(WPARAM wParam, LPARAM lParam) { @@ -1509,6 +1552,11 @@ CHotkeyOptions::CActionDialog::dlgProc(H updateControls(hwnd); return TRUE; + case IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST: + onKeyboardBroadcastAction(hwnd); + updateControls(hwnd); + return TRUE; + case IDC_HOTKEY_ACTION_LOCK_LIST: switch (HIWORD(wParam)) { case LBN_SELCHANGE: @@ -1533,11 +1581,37 @@ CHotkeyOptions::CActionDialog::dlgProc(H } break; + case IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_LIST: + switch (HIWORD(wParam)) { + case LBN_SELCHANGE: + onKeyboardBroadcastAction(hwnd); + return TRUE; + } + break; + case IDC_HOTKEY_ACTION_SCREENS: CScreensDialog::doModal(hwnd, s_config, dynamic_cast<CInputFilter::CKeystrokeAction*>(s_action)); fillHotkey(hwnd); return TRUE; + + case IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_SCREENS: { + // convert screens to form that CScreenDialog::doModal() wants + IPlatformScreen::CKeyInfo* tmpInfo = + IPlatformScreen::CKeyInfo::alloc(0, 0, 0, 1, s_screens); + CInputFilter::CKeystrokeAction tmpAction(tmpInfo, true); + + // get the screens + CScreensDialog::doModal(hwnd, s_config, &tmpAction); + + // convert screens back + IPlatformScreen::CKeyInfo::split( + tmpAction.getInfo()->m_screens, s_screens); + + // update + onKeyboardBroadcastAction(hwnd); + return TRUE; + } } break; diff -rup synergy-1.3.1/cmd/launcher/CHotkeyOptions.h synergy-svn//cmd/launcher/CHotkeyOptions.h --- synergy-1.3.1/cmd/launcher/CHotkeyOptions.h 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/launcher/CHotkeyOptions.h 2007-09-10 02:59:51.000000000 +0200 @@ -156,6 +156,7 @@ private: static void onLockAction(HWND hwnd); static void onSwitchToAction(HWND hwnd); static void onSwitchInAction(HWND hwnd); + static void onKeyboardBroadcastAction(HWND hwnd); static KeyID getChar(WPARAM wParam, LPARAM lParam); static KeyModifierMask @@ -176,6 +177,7 @@ private: s_action; static CInputFilter::CAction* s_lastGoodAction; + static std::set<CString> s_screens; static WNDPROC s_editWndProc; }; diff -rup synergy-1.3.1/cmd/launcher/CInfo.cpp synergy-svn//cmd/launcher/CInfo.cpp --- synergy-1.3.1/cmd/launcher/CInfo.cpp 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/launcher/CInfo.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -43,7 +43,7 @@ CInfo::doModal() { // do dialog DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_INFO), - m_parent, dlgProc, (LPARAM)this); + m_parent, (DLGPROC)dlgProc, (LPARAM)this); } void diff -rup synergy-1.3.1/cmd/launcher/CScreensLinks.cpp synergy-svn//cmd/launcher/CScreensLinks.cpp --- synergy-1.3.1/cmd/launcher/CScreensLinks.cpp 2007-06-17 19:31:09.000000000 +0200 +++ synergy-svn//cmd/launcher/CScreensLinks.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -59,7 +59,7 @@ CScreensLinks::doModal() { // do dialog DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_SCREENS_LINKS), - m_parent, dlgProc, (LPARAM)this); + m_parent, (DLGPROC)dlgProc, (LPARAM)this); } void diff -rup synergy-1.3.1/cmd/launcher/launcher.cpp synergy-svn//cmd/launcher/launcher.cpp --- synergy-1.3.1/cmd/launcher/launcher.cpp 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/launcher/launcher.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -379,7 +379,7 @@ waitForChild(HWND hwnd, HANDLE thread, D // do dialog that let's the user terminate the test DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_WAIT), hwnd, - waitDlgProc, (LPARAM)&info); + (DLGPROC)waitDlgProc, (LPARAM)&info); // force the waiter thread to finish and wait for it SetEvent(info.m_ready); Only in synergy-1.3.1/cmd/launcher: launcher.dsp diff -rup synergy-1.3.1/cmd/launcher/launcher.rc synergy-svn//cmd/launcher/launcher.rc --- synergy-1.3.1/cmd/launcher/launcher.rc 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/launcher/launcher.rc 2007-09-10 02:59:51.000000000 +0200 @@ -7,7 +7,10 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include <winresrc.h> +#if !defined(IDC_STATIC) +#define IDC_STATIC (-1) +#endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +37,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include <winresrc.h>\r\n" "\0" END @@ -335,7 +338,7 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,126,37,50,14 END -IDD_HOTKEY_ACTION DIALOG DISCARDABLE 0, 0, 183, 202 +IDD_HOTKEY_ACTION DIALOG DISCARDABLE 0, 0, 183, 218 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Action" FONT 8, "MS Sans Serif" @@ -353,6 +356,9 @@ BEGIN "Button",BS_AUTORADIOBUTTON,7,101,77,10 CONTROL "Lock Cursor to Screen:",IDC_HOTKEY_ACTION_LOCK,"Button", BS_AUTORADIOBUTTON,7,117,89,10 + CONTROL "Keyboard broadcasting:", + IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST,"Button", + BS_AUTORADIOBUTTON,7,133,89,10 LTEXT "&Hot key or mouse button:",IDC_STATIC,7,55,80,8 EDITTEXT IDC_HOTKEY_ACTION_HOTKEY,7,67,152,12,ES_WANTRETURN PUSHBUTTON "...",IDC_HOTKEY_ACTION_SCREENS,162,67,14,12 @@ -362,13 +368,17 @@ BEGIN CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_HOTKEY_ACTION_LOCK_LIST,106,115,70,58, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Action takes place &when:",IDC_STATIC,7,137,81,8 + COMBOBOX IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_LIST,106,131,53,58, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "...",IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_SCREENS, + 162,131,14,12 + LTEXT "Action takes place &when:",IDC_STATIC,7,153,81,8 CONTROL "Hot key is pressed",IDC_HOTKEY_ACTION_ON_ACTIVATE, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,149,74,10 + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,165,74,10 CONTROL "Hot key is released",IDC_HOTKEY_ACTION_ON_DEACTIVATE, - "Button",BS_AUTORADIOBUTTON,7,161,76,10 - DEFPUSHBUTTON "OK",IDOK,70,181,50,14 - PUSHBUTTON "Cancel",IDCANCEL,126,181,50,14 + "Button",BS_AUTORADIOBUTTON,7,177,76,10 + DEFPUSHBUTTON "OK",IDOK,70,197,50,14 + PUSHBUTTON "Cancel",IDCANCEL,126,197,50,14 END IDD_HOTKEY_SCREENS DIALOG DISCARDABLE 0, 0, 237, 79 @@ -583,9 +593,9 @@ BEGIN IDS_AUTOSTART_SAVE_FAILED "Failed to save autostart configuration: %{1}" IDS_LOAD_FAILED "Failed to load configuration." IDS_CONFIG_CHANGED "Configuration changed on disk. Reload?" - IDS_LOCK_MODE_OFF "off" - IDS_LOCK_MODE_ON "on" - IDS_LOCK_MODE_TOGGLE "toggle" + IDS_MODE_OFF "off" + IDS_MODE_ON "on" + IDS_MODE_TOGGLE "toggle" IDS_ALL_SCREENS "All Screens" IDS_ACTIVE_SCREEN "Active Screen" END diff -rup synergy-1.3.1/cmd/launcher/Makefile.am synergy-svn//cmd/launcher/Makefile.am --- synergy-1.3.1/cmd/launcher/Makefile.am 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/launcher/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -36,7 +36,7 @@ MSWINDOWS_SOURCE_FILES = \ $(NULL) EXTRA_DIST = \ - launcher.dsp \ + Makefile.win \ synergy.ico \ $(MSWINDOWS_SOURCE_FILES) \ $(NULL) Only in synergy-1.3.1/cmd/launcher: Makefile.in Only in synergy-svn//cmd/launcher: Makefile.win diff -rup synergy-1.3.1/cmd/launcher/resource.h synergy-svn//cmd/launcher/resource.h --- synergy-1.3.1/cmd/launcher/resource.h 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/launcher/resource.h 2007-09-10 02:59:51.000000000 +0200 @@ -59,9 +59,9 @@ #define IDS_AUTOSTART_SAVE_FAILED 54 #define IDS_LOAD_FAILED 55 #define IDS_CONFIG_CHANGED 56 -#define IDS_LOCK_MODE_OFF 57 -#define IDS_LOCK_MODE_ON 58 -#define IDS_LOCK_MODE_TOGGLE 59 +#define IDS_MODE_OFF 57 +#define IDS_MODE_ON 58 +#define IDS_MODE_TOGGLE 59 #define IDS_ALL_SCREENS 60 #define IDS_ACTIVE_SCREEN 61 #define IDD_MAIN 101 @@ -169,6 +169,9 @@ #define IDC_HOTKEY_SCREENS_DST 1096 #define IDC_HOTKEY_SCREENS_ADD 1097 #define IDC_HOTKEY_SCREENS_REMOVE 1098 +#define IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST 1099 +#define IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_LIST 1100 +#define IDC_HOTKEY_ACTION_KEYBOARD_BROADCAST_SCREENS 1101 // Next default values for new objects // @@ -177,7 +180,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 116 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1098 +#define _APS_NEXT_CONTROL_VALUE 1102 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff -rup synergy-1.3.1/cmd/Makefile.am synergy-svn//cmd/Makefile.am --- synergy-1.3.1/cmd/Makefile.am 2004-05-27 06:53:48.000000000 +0200 +++ synergy-svn//cmd/Makefile.am 2007-09-06 07:01:55.000000000 +0200 @@ -20,7 +20,6 @@ SUBDIRS = \ $(NULL) EXTRA_DIST = \ - exec.dsp \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1/cmd: Makefile.in diff -rup synergy-1.3.1/cmd/synergyc/CMSWindowsClientTaskBarReceiver.cpp synergy-svn//cmd/synergyc/CMSWindowsClientTaskBarReceiver.cpp --- synergy-1.3.1/cmd/synergyc/CMSWindowsClientTaskBarReceiver.cpp 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/synergyc/CMSWindowsClientTaskBarReceiver.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -272,15 +272,15 @@ CMSWindowsClientTaskBarReceiver::createW m_window = CreateDialogParam(m_appInstance, MAKEINTRESOURCE(IDD_TASKBAR_STATUS), NULL, - &CMSWindowsClientTaskBarReceiver::staticDlgProc, + (DLGPROC)&CMSWindowsClientTaskBarReceiver::staticDlgProc, reinterpret_cast<LPARAM>( reinterpret_cast<void*>(this))); // window should appear on top of everything, including (especially) // the task bar. - DWORD style = GetWindowLong(m_window, GWL_EXSTYLE); + LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE); style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST; - SetWindowLong(m_window, GWL_EXSTYLE, style); + SetWindowLongPtr(m_window, GWL_EXSTYLE, style); // tell the task bar about this dialog CArchTaskBarWindows::addDialog(m_window); diff -rup synergy-1.3.1/cmd/synergyc/Makefile.am synergy-svn//cmd/synergyc/Makefile.am --- synergy-1.3.1/cmd/synergyc/Makefile.am 2005-08-07 20:43:59.000000000 +0200 +++ synergy-svn//cmd/synergyc/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -34,7 +34,7 @@ CARBON_SOURCE_FILES = \ $(NULL) EXTRA_DIST = \ - synergyc.dsp \ + Makefile.win \ synergyc.ico \ tb_error.ico \ tb_idle.ico \ Only in synergy-1.3.1/cmd/synergyc: Makefile.in Only in synergy-svn//cmd/synergyc: Makefile.win diff -rup synergy-1.3.1/cmd/synergyc/synergyc.cpp synergy-svn//cmd/synergyc/synergyc.cpp --- synergy-1.3.1/cmd/synergyc/synergyc.cpp 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/synergyc/synergyc.cpp 2007-09-06 07:01:44.000000000 +0200 @@ -862,16 +862,16 @@ WinMain(HINSTANCE instance, HINSTANCE, L } catch (XBase& e) { showError(instance, __argv[0], IDS_UNCAUGHT_EXCEPTION, e.what()); - throw; + //throw; } catch (XArch& e) { showError(instance, __argv[0], IDS_INIT_FAILED, e.what().c_str()); - return kExitFailed; } catch (...) { showError(instance, __argv[0], IDS_UNCAUGHT_EXCEPTION, "<unknown>"); - throw; + //throw; } + return kExitFailed; } #elif SYSAPI_UNIX Only in synergy-1.3.1/cmd/synergyc: synergyc.dsp diff -rup synergy-1.3.1/cmd/synergyc/synergyc.rc synergy-svn//cmd/synergyc/synergyc.rc --- synergy-1.3.1/cmd/synergyc/synergyc.rc 2006-03-23 07:03:00.000000000 +0100 +++ synergy-svn//cmd/synergyc/synergyc.rc 2007-09-06 07:01:51.000000000 +0200 @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "winres.h" +#include <winresrc.h> #if !defined(IDC_STATIC) #define IDC_STATIC (-1) #endif @@ -37,7 +37,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include <winresrc.h>\r\n" "\0" END diff -rup synergy-1.3.1/cmd/synergys/CMSWindowsServerTaskBarReceiver.cpp synergy-svn//cmd/synergys/CMSWindowsServerTaskBarReceiver.cpp --- synergy-1.3.1/cmd/synergys/CMSWindowsServerTaskBarReceiver.cpp 2006-03-23 07:03:01.000000000 +0100 +++ synergy-svn//cmd/synergys/CMSWindowsServerTaskBarReceiver.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -300,15 +300,15 @@ CMSWindowsServerTaskBarReceiver::createW m_window = CreateDialogParam(m_appInstance, MAKEINTRESOURCE(IDD_TASKBAR_STATUS), NULL, - &CMSWindowsServerTaskBarReceiver::staticDlgProc, + (DLGPROC)&CMSWindowsServerTaskBarReceiver::staticDlgProc, reinterpret_cast<LPARAM>( reinterpret_cast<void*>(this))); // window should appear on top of everything, including (especially) // the task bar. - DWORD style = GetWindowLong(m_window, GWL_EXSTYLE); + LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE); style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST; - SetWindowLong(m_window, GWL_EXSTYLE, style); + SetWindowLongPtr(m_window, GWL_EXSTYLE, style); // tell the task bar about this dialog CArchTaskBarWindows::addDialog(m_window); @@ -353,11 +353,11 @@ CMSWindowsServerTaskBarReceiver::staticD if (msg == WM_INITDIALOG) { self = reinterpret_cast<CMSWindowsServerTaskBarReceiver*>( reinterpret_cast<void*>(lParam)); - SetWindowLong(hwnd, GWL_USERDATA, lParam); + SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam); } else { // get the extra window data and forward the call - LONG data = GetWindowLong(hwnd, GWL_USERDATA); + LONG data = GetWindowLongPtr(hwnd, GWLP_USERDATA); if (data != 0) { self = reinterpret_cast<CMSWindowsServerTaskBarReceiver*>( reinterpret_cast<void*>(data)); diff -rup synergy-1.3.1/cmd/synergys/Makefile.am synergy-svn//cmd/synergys/Makefile.am --- synergy-1.3.1/cmd/synergys/Makefile.am 2005-08-07 20:43:59.000000000 +0200 +++ synergy-svn//cmd/synergys/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -34,7 +34,7 @@ CARBON_SOURCE_FILES = \ $(NULL) EXTRA_DIST = \ - synergys.dsp \ + Makefile.win \ synergys.ico \ tb_error.ico \ tb_idle.ico \ Only in synergy-1.3.1/cmd/synergys: Makefile.in Only in synergy-svn//cmd/synergys: Makefile.win diff -rup synergy-1.3.1/cmd/synergys/synergys.cpp synergy-svn//cmd/synergys/synergys.cpp --- synergy-1.3.1/cmd/synergys/synergys.cpp 2006-03-23 07:03:01.000000000 +0100 +++ synergy-svn//cmd/synergys/synergys.cpp 2007-09-06 07:01:44.000000000 +0200 @@ -1264,16 +1264,16 @@ WinMain(HINSTANCE instance, HINSTANCE, L } catch (XBase& e) { showError(instance, __argv[0], IDS_UNCAUGHT_EXCEPTION, e.what()); - throw; + //throw; } catch (XArch& e) { showError(instance, __argv[0], IDS_INIT_FAILED, e.what().c_str()); - return kExitFailed; } catch (...) { showError(instance, __argv[0], IDS_UNCAUGHT_EXCEPTION, "<unknown>"); - throw; + //throw; } + return kExitFailed; } #elif SYSAPI_UNIX Only in synergy-1.3.1/cmd/synergys: synergys.dsp diff -rup synergy-1.3.1/cmd/synergys/synergys.rc synergy-svn//cmd/synergys/synergys.rc --- synergy-1.3.1/cmd/synergys/synergys.rc 2006-03-23 07:03:01.000000000 +0100 +++ synergy-svn//cmd/synergys/synergys.rc 2007-09-06 07:01:51.000000000 +0200 @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "winres.h" +#include <winresrc.h> #if !defined(IDC_STATIC) #define IDC_STATIC (-1) #endif @@ -37,7 +37,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include <winresrc.h>\r\n" "\0" END diff -rup synergy-1.3.1/config/mkinstalldirs synergy-svn//config/mkinstalldirs --- synergy-1.3.1/config/mkinstalldirs 2002-08-13 04:45:38.000000000 +0200 +++ synergy-svn//config/mkinstalldirs 2002-07-09 23:22:31.000000000 +0200 @@ -4,7 +4,7 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ +# $Id$ errstatus=0 Only in synergy-1.3.1: config.h.in Only in synergy-1.3.1: configure diff -rup synergy-1.3.1/configure.in synergy-svn//configure.in --- synergy-1.3.1/configure.in 2007-06-17 19:31:08.000000000 +0200 +++ synergy-svn//configure.in 2007-09-06 07:02:13.000000000 +0200 @@ -233,6 +233,7 @@ ACX_CHECK_GETPWUID_R AC_CHECK_FUNCS(vsnprintf) AC_FUNC_SELECT_ARGTYPES ACX_CHECK_POLL +ACX_FUNC_ACCEPT dnl use AC_REPLACE_FUNCS() for stuff in string.h dnl checks for system services diff -rup synergy-1.3.1/COPYING synergy-svn//COPYING --- synergy-1.3.1/COPYING 2004-03-29 08:07:51.000000000 +0200 +++ synergy-svn//COPYING 2007-09-06 07:01:44.000000000 +0200 @@ -1,4 +1,4 @@ -Synergy is copyright (C) 2002 Chris Schoeneman. +Synergy is copyright (C) 2002-2007 Chris Schoeneman. Synergy is distributed under the following license. GNU GENERAL PUBLIC LICENSE Only in synergy-1.3.1/dist: Makefile.in Only in synergy-1.3.1/dist/nullsoft: installer.dsp Only in synergy-1.3.1/dist/nullsoft: installer.mak diff -rup synergy-1.3.1/dist/nullsoft/Makefile.am synergy-svn//dist/nullsoft/Makefile.am --- synergy-1.3.1/dist/nullsoft/Makefile.am 2004-05-27 06:53:49.000000000 +0200 +++ synergy-svn//dist/nullsoft/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,8 +14,7 @@ NULL = EXTRA_DIST = \ - installer.dsp \ - installer.mak \ + Makefile.win \ synergy.nsi \ dosify.c \ $(NULL) Only in synergy-1.3.1/dist/nullsoft: Makefile.in Only in synergy-svn//dist/nullsoft: Makefile.win diff -rup synergy-1.3.1/dist/nullsoft/synergy.nsi synergy-svn//dist/nullsoft/synergy.nsi --- synergy-1.3.1/dist/nullsoft/synergy.nsi 2006-03-23 07:03:01.000000000 +0100 +++ synergy-svn//dist/nullsoft/synergy.nsi 2007-09-06 07:01:44.000000000 +0200 @@ -7,14 +7,15 @@ ;-------------------------------- -; Path to root of tree -!define DEPTH "..\.." +!ifndef OUTPUTDIR +!define OUTPUTDIR "build\Release" +!endif ; The name of the installer Name "Synergy" ; The file to write -OutFile "${DEPTH}\build\SynergyInstaller.exe" +OutFile "${OUTPUTFILE}" ; The default installation directory InstallDir $PROGRAMFILES\Synergy @@ -42,7 +43,7 @@ ComponentText "This will install Synergy DirText "Choose a directory to install Synergy to:" UninstallText "This will uninstall Synergy from your computer." LicenseText "Synergy is distributed under the GNU GPL:" -LicenseData "COPYING.txt" +LicenseData ${OUTPUTDIR}\COPYING.txt ;-------------------------------- @@ -55,38 +56,38 @@ Section "Synergy (required)" SetOutPath $INSTDIR ; Put files there - File "${DEPTH}\build\synergy.exe" - File "${DEPTH}\build\synergyc.exe" - File "${DEPTH}\build\synergys.exe" - File "${DEPTH}\build\*.dll" - File COPYING.txt - File ChangeLog.txt - File ${DEPTH}\doc\PORTING - File ${DEPTH}\doc\about.html - File ${DEPTH}\doc\authors.html - File ${DEPTH}\doc\autostart.html - File ${DEPTH}\doc\banner.html - File ${DEPTH}\doc\compiling.html - File ${DEPTH}\doc\configuration.html - File ${DEPTH}\doc\contact.html - File ${DEPTH}\doc\developer.html - File ${DEPTH}\doc\faq.html - File ${DEPTH}\doc\history.html - File ${DEPTH}\doc\home.html - File ${DEPTH}\doc\index.html - File ${DEPTH}\doc\license.html - File ${DEPTH}\doc\news.html - File ${DEPTH}\doc\roadmap.html - File ${DEPTH}\doc\running.html - File ${DEPTH}\doc\security.html - File ${DEPTH}\doc\synergy.css - File ${DEPTH}\doc\tips.html - File ${DEPTH}\doc\toc.html - File ${DEPTH}\doc\trouble.html + File "${OUTPUTDIR}\synergy.exe" + File "${OUTPUTDIR}\synergyc.exe" + File "${OUTPUTDIR}\synergys.exe" + File "${OUTPUTDIR}\*.dll" + File "${OUTPUTDIR}\COPYING.txt" + File "${OUTPUTDIR}\ChangeLog.txt" + File doc\PORTING + File doc\about.html + File doc\authors.html + File doc\autostart.html + File doc\banner.html + File doc\compiling.html + File doc\configuration.html + File doc\contact.html + File doc\developer.html + File doc\faq.html + File doc\history.html + File doc\home.html + File doc\index.html + File doc\license.html + File doc\news.html + File doc\roadmap.html + File doc\running.html + File doc\security.html + File doc\synergy.css + File doc\tips.html + File doc\toc.html + File doc\trouble.html SetOutPath $INSTDIR\images - File ${DEPTH}\doc\images\logo.gif - File ${DEPTH}\doc\images\warp.gif + File doc\images\logo.gif + File doc\images\warp.gif ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\Synergy "Install_Dir" "$INSTDIR" Only in synergy-1.3.1/dist/rpm: Makefile.in diff -rup synergy-1.3.1/doc/authors.html synergy-svn//doc/authors.html --- synergy-1.3.1/doc/authors.html 2006-03-23 07:03:06.000000000 +0100 +++ synergy-svn//doc/authors.html 2007-09-06 07:01:44.000000000 +0200 @@ -54,6 +54,13 @@ <td> </td> <td>Re-resolving server hostname on each connection</td> </tr> + <tr> + <td>Marc-Antoine Ruel</td> + <td> </td> + <td><span class="fakelink">maruel@users.sourceforge<span class="hide">.no_spam</span>.net</span></td> + <td> </td> + <td>Visual Studio 2005 port</td> + </tr> </table> </p><p> To avoid spam bots, the above email addresses have ".no_spam" diff -rup synergy-1.3.1/doc/compiling.html synergy-svn//doc/compiling.html --- synergy-1.3.1/doc/compiling.html 2006-03-23 07:03:06.000000000 +0100 +++ synergy-svn//doc/compiling.html 2007-09-06 07:07:29.000000000 +0200 @@ -15,7 +15,8 @@ To build synergy from the sources you'll <ul> <li>Windows <ul> - <li>VC++ 6.0 or up + <li>Microsoft Windows SDK for Vista; or + <li>VC++ 6.0 or up should work </ul> </p><p> <li>Unix @@ -26,14 +27,14 @@ To build synergy from the sources you'll </p><p> <li>Mac OS X <ul> - <li>XCode; or gcc 2.95 or up + <li>gcc 2.95 or up <li>Carbon development headers and libraries </ul> </ul> </p><p> </p><h3>Configuring the build</h3><p> </p><p> -This step is not necessary when using VC++ or XCode. +This step is not necessary on Windows. </p><p> To configure the build for your platform use the configure script: <pre> @@ -52,14 +53,17 @@ so synergy can find the X11 includes and </p><h3>Building</h3><p> <ul> <li>Windows -</p><p> - Start VC++ and open <span class="code">synergy.dsw</span>. Set the - active configuration (Build > Set Active Configuration) to - <span class="code">All - Debug</span> or <span class="code">All - - Release</span> then build. Binaries are built into - <span class="code">./debug</span> or <span class="code">./build</span>. -</p><p> -<li>Unix or Mac OS X without XCode +<p> + Open a command prompt window (cmd.exe or command.exe). If necessary + run vcvars.bat, created when VC++ or Visual Studio was installed. (Use + search to find it.) It's necessary to run the file if you didn't have + the installer set up environment variables for you. Then enter: + <pre> + nmake /nologo /f Makefile.win + </pre> + This will build the programs into <span class="code">build\Release</span>. +</p> +<li>Unix or Mac OS X </p><p> Simply enter: <pre> @@ -67,27 +71,24 @@ so synergy can find the X11 includes and </pre> This will build the client and server and leave them in their respective source directories. -</p><p> -<li>Mac OS X with XCode -</p><p> - Start XCode and open the <span class="code">synergy.xcode</span> - project. Build the <span class="code">all</span> project using - the <span class="code">Deployment</span> flavor. -</p><p> +</p> </ul> -</p><p> +<p> </p><h3>Installing</h3><p> <ul> <li>Windows -</p><p> - You'll need <a target="_top" href="http://nsis.sourceforge.net/">NSIS</a>, the - Nullsoft Scriptable Install System. Build <span class="code">All - - Release</span> then build <span class="code">Installer - Release</span>. - This creates <span class="code">SynergyInstaller.exe</span> in the - <span class="code">build</span> directory. Run this to install synergy. +<p> + You'll need <a target="_top" href="http://nsis.sourceforge.net/">NSIS</a>, + the Nullsoft Scriptable Install System. As in the building on Windows + description above, enter: + <pre> + nmake /nologo /f Makefile.win installer + </pre> + to build <span class="code">build\Release\SynergyInstaller.exe</span>. Run + this to install synergy. </p><p> Alternatively, you can simply copy the following files from the - <span class="code">debug</span> or <span class="code">build</span> + <span class="code">build\Release</span> directory to a directory you choose (perhaps under the <span class="code">Program Files</span> directory): <ul class="code"> @@ -96,24 +97,15 @@ so synergy can find the X11 includes and <li>synergys.exe <li>synrgyhk.dll </ul> -</p><p> -<li>Unix or Mac OS X without XCode -</p><p> +</p> +<li>Unix or Mac OS X +<p> <pre> make install </pre> will install the client and server into <span class="code">/usr/local/bin</span> unless you specified a different directory when you ran configure. -</p><p> -<li>Mac OS X with XCode -</p><p> - Copy the following files from ./build to a convenient location: -</p><p> - <ul class="code"> - <li>synergyc - <li>synergys - </ul> </p> </body> diff -rup synergy-1.3.1/doc/configuration.html synergy-svn//doc/configuration.html --- synergy-1.3.1/doc/configuration.html 2006-03-23 07:03:06.000000000 +0100 +++ synergy-svn//doc/configuration.html 2007-09-10 02:59:51.000000000 +0200 @@ -406,6 +406,8 @@ Allowed individual actions are: <span class="arg">screens</span> lists the screen or screens to direct the event to, regardless of the active screen. If not given then the event is directed to the active screen only. + (Due to a bug, keys cannot be directed to the server while on a + client screen.) </p><p> <span class="code">keyDown</span> synthesizes a key press and <span class="code">keyUp</span> synthesizes a key release. @@ -458,6 +460,30 @@ Allowed individual actions are: <span class="code">right</span>, <span class="code">up</span> or <span class="code">down</span>. </p><p> +<li><a name="keyboardBroadcast"></a><span class="code">keyboardBroadcast(<span class="arg">mode</span>[,<span class="arg">screens</span>])</span> +</p><p> + Turns broadcasting of keystrokes to multiple screens on and off. When + turned on all key presses and releases are sent to all of the screens + listed in <span class="arg">screens</span>. If not given, empty or + <span class="code">*</span> then keystrokes are broadcast to all screens. + (However, due to a bug, keys cannot be sent to the server while on a + client screen.) +</p><p> + <span class="arg">mode</span> can be <span class="code">off</span> + to turn broadcasting off, <span class="code">on</span> to turn it + on, or <span class="code">toggle</span> to toggle the current + state. The default is <span class="code">toggle</span>. +</p><p> + <span class="arg">screens</span> is either <span class="code">*</span> + to indicate all screens or a colon (:) separated list of screen + names. (Note that the screen name must have already been encountered + in the configuration file so you'll probably want to put actions at + the bottom of the file.) +</p><p> + Multiple <span class="code">keyboardBroadcast</span> actions may be + configured with different <span class="arg">screens</span>. The most + recently performed action defines the screens to broadcast to. +</p><p> </ul> </p><p> Examples: Only in synergy-1.3.1/doc: Makefile.in diff -rup synergy-1.3.1/doc/synergy.css synergy-svn//doc/synergy.css --- synergy-1.3.1/doc/synergy.css 2006-03-23 07:03:06.000000000 +0100 +++ synergy-svn//doc/synergy.css 2007-09-10 03:25:57.000000000 +0200 @@ -44,7 +44,7 @@ b { pre { display: block; white-space: pre; - font-family: courier; + font-family: courier new; font-size: 87.5%; } @@ -124,19 +124,19 @@ pre { .arg { font-style: italic; - font-family: courier; + font-family: courier new; } .userinput { display: block; white-space: pre; - font-family: courier; + font-family: courier new; font-size: 87.5%; font-weight: bold; } .code { - font-family: courier; + font-family: courier new; } .code table { @@ -147,7 +147,7 @@ pre { .codeblock { display: block; white-space: pre; - font-family: courier; + font-family: courier new; font-size: 87.5%; border: 1px solid #000000; padding: 1em; Only in synergy-svn//doc: todo.html Only in synergy-1.3.1/lib/arch: arch.dsp diff -rup synergy-1.3.1/lib/arch/CArchDaemonNone.cpp synergy-svn//lib/arch/CArchDaemonNone.cpp --- synergy-1.3.1/lib/arch/CArchDaemonNone.cpp 2004-05-27 06:53:49.000000000 +0200 +++ synergy-svn//lib/arch/CArchDaemonNone.cpp 2007-09-06 07:01:44.000000000 +0200 @@ -60,7 +60,7 @@ CArchDaemonNone::canInstallDaemon(const } bool -CArchDaemonNone::isDaemonInstalled(const char* name, bool allUsers) +CArchDaemonNone::isDaemonInstalled(const char*, bool) { return false; } diff -rup synergy-1.3.1/lib/arch/CArchNetworkBSD.cpp synergy-svn//lib/arch/CArchNetworkBSD.cpp --- synergy-1.3.1/lib/arch/CArchNetworkBSD.cpp 2007-06-17 19:31:10.000000000 +0200 +++ synergy-svn//lib/arch/CArchNetworkBSD.cpp 2007-09-06 07:02:13.000000000 +0200 @@ -212,7 +212,9 @@ CArchNetworkBSD::acceptSocket(CArchSocke *addr = new CArchNetAddressImpl; // accept on socket - int fd = accept(s->m_fd, &(*addr)->m_addr, &(*addr)->m_len); + ACCEPT_TYPE_ARG3 len = (ACCEPT_TYPE_ARG3)((*addr)->m_len); + int fd = accept(s->m_fd, &(*addr)->m_addr, &len); + (*addr)->m_len = (socklen_t)len; if (fd == -1) { int err = errno; delete newSocket; @@ -528,7 +530,7 @@ CArchNetworkBSD::throwErrorOnSocket(CArc // get the error from the socket layer int err = 0; - socklen_t size = sizeof(err); + socklen_t size = (socklen_t)sizeof(err); if (getsockopt(s->m_fd, SOL_SOCKET, SO_ERROR, (optval_t*)&err, &size) == -1) { err = errno; @@ -567,14 +569,14 @@ CArchNetworkBSD::setNoDelayOnSocket(CArc // get old state int oflag; - socklen_t size = sizeof(oflag); + socklen_t size = (socklen_t)sizeof(oflag); if (getsockopt(s->m_fd, IPPROTO_TCP, TCP_NODELAY, (optval_t*)&oflag, &size) == -1) { throwError(errno); } int flag = noDelay ? 1 : 0; - size = sizeof(flag); + size = (socklen_t)sizeof(flag); if (setsockopt(s->m_fd, IPPROTO_TCP, TCP_NODELAY, (optval_t*)&flag, size) == -1) { throwError(errno); @@ -590,14 +592,14 @@ CArchNetworkBSD::setReuseAddrOnSocket(CA // get old state int oflag; - socklen_t size = sizeof(oflag); + socklen_t size = (socklen_t)sizeof(oflag); if (getsockopt(s->m_fd, SOL_SOCKET, SO_REUSEADDR, (optval_t*)&oflag, &size) == -1) { throwError(errno); } int flag = reuse ? 1 : 0; - size = sizeof(flag); + size = (socklen_t)sizeof(flag); if (setsockopt(s->m_fd, SOL_SOCKET, SO_REUSEADDR, (optval_t*)&flag, size) == -1) { throwError(errno); @@ -633,7 +635,7 @@ CArchNetworkBSD::newAnyAddr(EAddressFami ipAddr->sin_family = AF_INET; ipAddr->sin_port = 0; ipAddr->sin_addr.s_addr = INADDR_ANY; - addr->m_len = sizeof(struct sockaddr_in); + addr->m_len = (socklen_t)sizeof(struct sockaddr_in); break; } @@ -665,7 +667,7 @@ CArchNetworkBSD::nameToAddr(const std::s memset(&inaddr, 0, sizeof(inaddr)); if (inet_aton(name.c_str(), &inaddr.sin_addr) != 0) { // it's a dot notation address - addr->m_len = sizeof(struct sockaddr_in); + addr->m_len = (socklen_t)sizeof(struct sockaddr_in); inaddr.sin_family = AF_INET; inaddr.sin_port = 0; memcpy(&addr->m_addr, &inaddr, addr->m_len); @@ -683,7 +685,7 @@ CArchNetworkBSD::nameToAddr(const std::s // copy over address (only IPv4 currently supported) if (info->h_addrtype == AF_INET) { - addr->m_len = sizeof(struct sockaddr_in); + addr->m_len = (socklen_t)sizeof(struct sockaddr_in); inaddr.sin_family = info->h_addrtype; inaddr.sin_port = 0; memcpy(&inaddr.sin_addr, info->h_addr_list[0], @@ -819,7 +821,7 @@ CArchNetworkBSD::isAnyAddr(CArchNetAddre struct sockaddr_in* ipAddr = reinterpret_cast<struct sockaddr_in*>(&addr->m_addr); return (ipAddr->sin_addr.s_addr == INADDR_ANY && - addr->m_len == sizeof(struct sockaddr_in)); + addr->m_len == (socklen_t)sizeof(struct sockaddr_in)); } default: diff -rup synergy-1.3.1/lib/arch/Makefile.am synergy-svn//lib/arch/Makefile.am --- synergy-1.3.1/lib/arch/Makefile.am 2005-08-07 20:44:00.000000000 +0200 +++ synergy-svn//lib/arch/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -89,8 +89,8 @@ WIN32_SOURCE_FILES = \ $(NULL) EXTRA_DIST = \ - arch.dsp \ CMultibyte.cpp \ + Makefile.win \ vsnprintf.cpp \ $(UNIX_SOURCE_FILES) \ $(WIN32_SOURCE_FILES) \ Only in synergy-1.3.1/lib/arch: Makefile.in Only in synergy-svn//lib/arch: Makefile.win Only in synergy-1.3.1/lib/base: base.dsp diff -rup synergy-1.3.1/lib/base/Makefile.am synergy-svn//lib/base/Makefile.am --- synergy-1.3.1/lib/base/Makefile.am 2004-05-27 06:53:50.000000000 +0200 +++ synergy-svn//lib/base/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,7 +14,7 @@ NULL = EXTRA_DIST = \ - base.dsp \ + Makefile.win \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1/lib/base: Makefile.in Only in synergy-svn//lib/base: Makefile.win Only in synergy-1.3.1/lib/client: client.dsp diff -rup synergy-1.3.1/lib/client/Makefile.am synergy-svn//lib/client/Makefile.am --- synergy-1.3.1/lib/client/Makefile.am 2004-05-27 06:53:50.000000000 +0200 +++ synergy-svn//lib/client/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,7 +14,7 @@ NULL = EXTRA_DIST = \ - client.dsp \ + Makefile.win \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1/lib/client: Makefile.in Only in synergy-svn//lib/client: Makefile.win Only in synergy-1.3.1/lib/common: common.dsp diff -rup synergy-1.3.1/lib/common/common.h synergy-svn//lib/common/common.h --- synergy-1.3.1/lib/common/common.h 2007-06-17 19:31:11.000000000 +0200 +++ synergy-svn//lib/common/common.h 2007-09-06 07:02:13.000000000 +0200 @@ -127,9 +127,7 @@ #endif // define NULL -#ifndef NULL -#define NULL 0 -#endif +#include <stddef.h> // make assert available since we use it a lot #include <assert.h> diff -rup synergy-1.3.1/lib/common/Makefile.am synergy-svn//lib/common/Makefile.am --- synergy-1.3.1/lib/common/Makefile.am 2004-08-06 07:26:11.000000000 +0200 +++ synergy-svn//lib/common/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,7 +14,7 @@ NULL = EXTRA_DIST = \ - common.dsp \ + Makefile.win \ BasicTypes.h \ IInterface.h \ MacOSXPrecomp.h \ Only in synergy-1.3.1/lib/common: Makefile.in Only in synergy-svn//lib/common: Makefile.win diff -rup synergy-1.3.1/lib/common/Version.h synergy-svn//lib/common/Version.h --- synergy-1.3.1/lib/common/Version.h 2007-06-17 19:31:11.000000000 +0200 +++ synergy-svn//lib/common/Version.h 2007-09-06 07:02:01.000000000 +0200 @@ -19,7 +19,7 @@ // set version macro if not set yet #if !defined(VERSION) -# define VERSION "1.3.1" +# define VERSION "1.3.2" #endif // important strings diff -rup synergy-1.3.1/lib/io/CStreamBuffer.cpp synergy-svn//lib/io/CStreamBuffer.cpp --- synergy-1.3.1/lib/io/CStreamBuffer.cpp 2002-08-13 04:45:11.000000000 +0200 +++ synergy-svn//lib/io/CStreamBuffer.cpp 2007-09-10 03:23:40.000000000 +0200 @@ -37,6 +37,12 @@ CStreamBuffer::peek(UInt32 n) { assert(n <= m_size); + // if requesting no data then return NULL so we don't try to access + // an empty list. + if (n == 0) { + return NULL; + } + // reserve space in first chunk ChunkList::iterator head = m_chunks.begin(); head->reserve(n + m_headUsed); Only in synergy-1.3.1/lib/io: io.dsp diff -rup synergy-1.3.1/lib/io/Makefile.am synergy-svn//lib/io/Makefile.am --- synergy-1.3.1/lib/io/Makefile.am 2004-05-27 06:53:51.000000000 +0200 +++ synergy-svn//lib/io/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,7 +14,7 @@ NULL = EXTRA_DIST = \ - io.dsp \ + Makefile.win \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1/lib/io: Makefile.in Only in synergy-svn//lib/io: Makefile.win Only in synergy-1.3.1/lib: Makefile.in diff -rup synergy-1.3.1/lib/mt/Makefile.am synergy-svn//lib/mt/Makefile.am --- synergy-1.3.1/lib/mt/Makefile.am 2004-05-27 06:53:51.000000000 +0200 +++ synergy-svn//lib/mt/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,7 +14,7 @@ NULL = EXTRA_DIST = \ - mt.dsp \ + Makefile.win \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1/lib/mt: Makefile.in Only in synergy-svn//lib/mt: Makefile.win Only in synergy-1.3.1/lib/mt: mt.dsp diff -rup synergy-1.3.1/lib/net/CSocketMultiplexer.cpp synergy-svn//lib/net/CSocketMultiplexer.cpp --- synergy-1.3.1/lib/net/CSocketMultiplexer.cpp 2004-11-13 01:25:52.000000000 +0100 +++ synergy-svn//lib/net/CSocketMultiplexer.cpp 2007-09-06 07:01:44.000000000 +0200 @@ -201,7 +201,12 @@ CSocketMultiplexer::serviceThread(void*) int status; try { // check for status - status = ARCH->pollSocket(&pfds[0], pfds.size(), -1); + if (!pfds.empty()) { + status = ARCH->pollSocket(&pfds[0], pfds.size(), -1); + } + else { + status = 0; + } } catch (XArchNetwork& e) { LOG((CLOG_WARN "error in socket multiplexer: %s", e.what().c_str())); diff -rup synergy-1.3.1/lib/net/CTCPSocket.cpp synergy-svn//lib/net/CTCPSocket.cpp --- synergy-1.3.1/lib/net/CTCPSocket.cpp 2007-06-17 19:31:12.000000000 +0200 +++ synergy-svn//lib/net/CTCPSocket.cpp 2007-09-06 07:01:44.000000000 +0200 @@ -123,7 +123,7 @@ CTCPSocket::read(void* buffer, UInt32 n) if (n > size) { n = size; } - if (buffer != NULL) { + if (buffer != NULL && n != 0) { memcpy(buffer, m_inputBuffer.peek(n), n); } m_inputBuffer.pop(n); diff -rup synergy-1.3.1/lib/net/Makefile.am synergy-svn//lib/net/Makefile.am --- synergy-1.3.1/lib/net/Makefile.am 2004-05-27 06:53:52.000000000 +0200 +++ synergy-svn//lib/net/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,7 +14,7 @@ NULL = EXTRA_DIST = \ - net.dsp \ + Makefile.win \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1/lib/net: Makefile.in Only in synergy-svn//lib/net: Makefile.win Only in synergy-1.3.1/lib/net: net.dsp diff -rup synergy-1.3.1/lib/platform/CMSWindowsKeyState.cpp synergy-svn//lib/platform/CMSWindowsKeyState.cpp --- synergy-1.3.1/lib/platform/CMSWindowsKeyState.cpp 2007-06-17 19:31:12.000000000 +0200 +++ synergy-svn//lib/platform/CMSWindowsKeyState.cpp 2007-09-09 18:12:59.000000000 +0200 @@ -56,11 +56,11 @@ const KeyID CMSWindowsKeyState::s_vir /* 0x012 */ { kKeyAlt_L }, // VK_MENU /* 0x013 */ { kKeyPause }, // VK_PAUSE /* 0x014 */ { kKeyCapsLock }, // VK_CAPITAL - /* 0x015 */ { kKeyNone }, // VK_KANA - /* 0x016 */ { kKeyNone }, // VK_HANGUL - /* 0x017 */ { kKeyNone }, // VK_JUNJA - /* 0x018 */ { kKeyNone }, // VK_FINAL - /* 0x019 */ { kKeyZenkaku }, // VK_KANJI + /* 0x015 */ { kKeyHangulKana }, // VK_HANGUL, VK_KANA + /* 0x016 */ { kKeyNone }, // undefined + /* 0x017 */ { kKeyNone }, // VK_JUNJA + /* 0x018 */ { kKeyNone }, // VK_FINAL + /* 0x019 */ { kKeyHanjaKanzi }, // VK_KANJI /* 0x01a */ { kKeyNone }, // undefined /* 0x01b */ { kKeyEscape }, // VK_ESCAPE /* 0x01c */ { kKeyHenkan }, // VK_CONVERT @@ -277,9 +277,9 @@ const KeyID CMSWindowsKeyState::s_vir /* 0x0ef */ { kKeyNone }, // OEM specific /* 0x0f0 */ { kKeyNone }, // OEM specific /* 0x0f1 */ { kKeyNone }, // OEM specific - /* 0x0f2 */ { kKeyNone }, // OEM specific - /* 0x0f3 */ { kKeyNone }, // OEM specific - /* 0x0f4 */ { kKeyNone }, // OEM specific + /* 0x0f2 */ { kKeyHiraganaKatakana }, // VK_OEM_COPY + /* 0x0f3 */ { kKeyZenkaku }, // VK_OEM_AUTO + /* 0x0f4 */ { kKeyZenkaku }, // VK_OEM_ENLW /* 0x0f5 */ { kKeyNone }, // OEM specific /* 0x0f6 */ { kKeyNone }, // VK_ATTN /* 0x0f7 */ { kKeyNone }, // VK_CRSEL @@ -534,9 +534,9 @@ const KeyID CMSWindowsKeyState::s_vir /* 0x1ef */ { kKeyNone }, // OEM specific /* 0x1f0 */ { kKeyNone }, // OEM specific /* 0x1f1 */ { kKeyNone }, // OEM specific - /* 0x1f2 */ { kKeyNone }, // OEM specific - /* 0x1f3 */ { kKeyNone }, // OEM specific - /* 0x1f4 */ { kKeyNone }, // OEM specific + /* 0x1f2 */ { kKeyNone }, // VK_OEM_COPY + /* 0x1f3 */ { kKeyNone }, // VK_OEM_AUTO + /* 0x1f4 */ { kKeyNone }, // VK_OEM_ENLW /* 0x1f5 */ { kKeyNone }, // OEM specific /* 0x1f6 */ { kKeyNone }, // VK_ATTN /* 0x1f7 */ { kKeyNone }, // VK_CRSEL diff -rup synergy-1.3.1/lib/platform/CMSWindowsScreen.cpp synergy-svn//lib/platform/CMSWindowsScreen.cpp --- synergy-1.3.1/lib/platform/CMSWindowsScreen.cpp 2006-03-23 07:03:20.000000000 +0100 +++ synergy-svn//lib/platform/CMSWindowsScreen.cpp 2007-09-06 07:01:44.000000000 +0200 @@ -1500,10 +1500,11 @@ CMSWindowsScreen::fixClipboardViewer() // i'm not sure how that could happen. the m_nextClipboardWindow = NULL // was not in the code that infinite loops and may fix the bug but i // doubt it. - return; +/* ChangeClipboardChain(m_window, m_nextClipboardWindow); m_nextClipboardWindow = NULL; m_nextClipboardWindow = SetClipboardViewer(m_window); +*/ } void diff -rup synergy-1.3.1/lib/platform/CMSWindowsScreenSaver.cpp synergy-svn//lib/platform/CMSWindowsScreenSaver.cpp --- synergy-1.3.1/lib/platform/CMSWindowsScreenSaver.cpp 2005-11-12 21:45:26.000000000 +0100 +++ synergy-svn//lib/platform/CMSWindowsScreenSaver.cpp 2007-09-09 22:48:03.000000000 +0200 @@ -294,7 +294,7 @@ BOOL CALLBACK CMSWindowsScreenSaver::killScreenSaverFunc(HWND hwnd, LPARAM arg) { if (IsWindowVisible(hwnd)) { - HINSTANCE instance = (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE); + HINSTANCE instance = (HINSTANCE)GetWindowLongPtr(hwnd, GWLP_HINSTANCE); if (instance != CMSWindowsScreen::getInstance()) { PostMessage(hwnd, WM_CLOSE, 0, 0); *reinterpret_cast<bool*>(arg) = true; diff -rup synergy-1.3.1/lib/platform/COSXKeyState.cpp synergy-svn//lib/platform/COSXKeyState.cpp --- synergy-1.3.1/lib/platform/COSXKeyState.cpp 2007-06-17 19:31:12.000000000 +0200 +++ synergy-svn//lib/platform/COSXKeyState.cpp 2007-09-09 21:24:57.000000000 +0200 @@ -32,6 +32,8 @@ static const UInt32 s_controlVK = 59; static const UInt32 s_altVK = 55; static const UInt32 s_superVK = 58; static const UInt32 s_capsLockVK = 57; +static const UInt32 s_numLockVK = 71; +static const UInt32 s_osxNumLock = 1 << 16; struct CKeyEntry { public: KeyID m_keyID; @@ -68,6 +70,24 @@ static const CKeyEntry s_controlKeys[] = { kKeyF15, 113 }, { kKeyF16, 106 }, + { kKeyKP_0, 82 }, + { kKeyKP_1, 83 }, + { kKeyKP_2, 84 }, + { kKeyKP_3, 85 }, + { kKeyKP_4, 86 }, + { kKeyKP_5, 87 }, + { kKeyKP_6, 88 }, + { kKeyKP_7, 89 }, + { kKeyKP_8, 91 }, + { kKeyKP_9, 92 }, + { kKeyKP_Decimal, 65 }, + { kKeyKP_Equal, 81 }, + { kKeyKP_Multiply, 67 }, + { kKeyKP_Add, 69 }, + { kKeyKP_Divide, 75 }, + { kKeyKP_Subtract, 79 }, + { kKeyKP_Enter, 76 }, + // virtual key 110 is fn+enter and i have no idea what that's supposed // to map to. also the enter key with numlock on is a modifier but i // don't know which. @@ -86,7 +106,7 @@ static const CKeyEntry s_controlKeys[] = { kKeyMeta_R, s_superVK }, // 61 // toggle modifiers -// { kKeyNumLock, 71 }, + { kKeyNumLock, s_numLockVK }, { kKeyCapsLock, s_capsLockVK } }; @@ -98,6 +118,9 @@ static const CKeyEntry s_controlKeys[] = COSXKeyState::COSXKeyState() : m_deadKeyState(0) { + // enable input in scripts other that roman + KeyScript(smKeyEnableKybds); + // build virtual key map for (size_t i = 0; i < sizeof(s_controlKeys) / sizeof(s_controlKeys[0]); ++i) { @@ -114,6 +137,7 @@ COSXKeyState::~COSXKeyState() KeyModifierMask COSXKeyState::mapModifiersFromOSX(UInt32 mask) const { +LOG((CLOG_DEBUG1 "mask: %04x", mask)); // convert KeyModifierMask outMask = 0; if ((mask & shiftKey) != 0) { @@ -140,6 +164,9 @@ COSXKeyState::mapModifiersFromOSX(UInt32 if ((mask & alphaLock) != 0) { outMask |= KeyModifierCapsLock; } + if ((mask & s_osxNumLock) != 0) { + outMask |= KeyModifierNumLock; + } return outMask; } @@ -569,6 +596,9 @@ COSXKeyState::mapSynergyHotKeyToMac(KeyI if ((mask & KeyModifierCapsLock) != 0) { macModifierMask |= alphaLock; } + if ((mask & KeyModifierNumLock) != 0) { + macModifierMask |= s_osxNumLock; + } return true; } @@ -601,6 +631,10 @@ COSXKeyState::handleModifierKeys(void* t handleModifierKey(target, s_capsLockVK, kKeyCapsLock, (newMask & KeyModifierCapsLock) != 0, newMask); } + if ((changed & KeyModifierNumLock) != 0) { + handleModifierKey(target, s_numLockVK, kKeyNumLock, + (newMask & KeyModifierNumLock) != 0, newMask); + } } void @@ -790,6 +824,13 @@ COSXKeyState::CKeyResource::getKeyID(UIn str, GetScriptManagerVariable(smKeyScript), kCFAllocatorNull); + // sometimes CFStringCreate...() returns NULL (e.g. Apple Korean + // encoding with char value 214). if it did then make no key, + // otherwise CFStringCreateMutableCopy() will crash. + if (cfString == NULL) { + return kKeyNone; + } + // convert to precomposed CFMutableStringRef mcfString = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, cfString); diff -rup synergy-1.3.1/lib/platform/CSynergyHook.cpp synergy-svn//lib/platform/CSynergyHook.cpp --- synergy-1.3.1/lib/platform/CSynergyHook.cpp 2006-03-23 07:03:20.000000000 +0100 +++ synergy-svn//lib/platform/CSynergyHook.cpp 2007-09-06 07:01:44.000000000 +0200 @@ -15,6 +15,20 @@ #include "CSynergyHook.h" #include "ProtocolTypes.h" #include <zmouse.h> +#include <tchar.h> + +#if _MSC_VER >= 1400 +// VS2005 hack - we don't use assert here because we don't want to link with the CRT. +#undef assert +#if _DEBUG +#define assert(_X_) if (!(_X_)) __debugbreak() +#else +#define assert(_X_) __noop() +#endif +// VS2005 is a bit more smart than VC6 and optimize simple copy loop to +// intrinsic memcpy. +#pragma function(memcpy) +#endif // // debugging compile flag. when not zero the server doesn't grab @@ -766,6 +780,79 @@ DllMain(HINSTANCE instance, DWORD reason extern "C" { +// VS2005 hack to not link with the CRT +#if _MSC_VER >= 1400 +BOOL WINAPI _DllMainCRTStartup( + HINSTANCE instance, DWORD reason, LPVOID lpreserved) +{ + return DllMain(instance, reason, lpreserved); +} + +// VS2005 is a bit more bright than VC6 and optimize simple copy loop to +// intrinsic memcpy. +void * __cdecl memcpy(void * _Dst, const void * _Src, size_t _MaxCount) +{ + void * _DstBackup = _Dst; + switch (_MaxCount & 3) { + case 3: + ((char*)_Dst)[0] = ((char*)_Src)[0]; + ++(char*&)_Dst; + ++(char*&)_Src; + --_MaxCount; + case 2: + ((char*)_Dst)[0] = ((char*)_Src)[0]; + ++(char*&)_Dst; + ++(char*&)_Src; + --_MaxCount; + case 1: + ((char*)_Dst)[0] = ((char*)_Src)[0]; + ++(char*&)_Dst; + ++(char*&)_Src; + --_MaxCount; + break; + case 0: + break; + + default: + __assume(0); + break; + } + + // I think it's faster on intel to deference than modify the pointer. + const size_t max = _MaxCount / sizeof(UINT_PTR); + for (size_t i = 0; i < max; ++i) { + ((UINT_PTR*)_Dst)[i] = ((UINT_PTR*)_Src)[i]; + } + + (UINT_PTR*&)_Dst += max; + (UINT_PTR*&)_Src += max; + + switch (_MaxCount & 3) { + case 3: + ((char*)_Dst)[0] = ((char*)_Src)[0]; + ++(char*&)_Dst; + ++(char*&)_Src; + case 2: + ((char*)_Dst)[0] = ((char*)_Src)[0]; + ++(char*&)_Dst; + ++(char*&)_Src; + case 1: + ((char*)_Dst)[0] = ((char*)_Src)[0]; + ++(char*&)_Dst; + ++(char*&)_Src; + break; + case 0: + break; + + default: + __assume(0); + break; + } + + return _DstBackup; +} +#endif + int init(DWORD threadID) { @@ -786,7 +873,7 @@ init(DWORD threadID) // clean up after old process. the system should've already // removed the hooks so we just need to reset our state. - g_hinstance = GetModuleHandle("synrgyhk"); + g_hinstance = GetModuleHandle(_T("synrgyhk")); g_processID = GetCurrentProcessId(); g_wheelSupport = kWheelNone; g_threadID = 0; diff -rup synergy-1.3.1/lib/platform/CXWindowsClipboard.cpp synergy-svn//lib/platform/CXWindowsClipboard.cpp --- synergy-1.3.1/lib/platform/CXWindowsClipboard.cpp 2007-06-17 19:31:12.000000000 +0200 +++ synergy-svn//lib/platform/CXWindowsClipboard.cpp 2007-09-06 07:02:13.000000000 +0200 @@ -929,16 +929,19 @@ CXWindowsClipboard::pushReplies() // send the first reply for each window if that reply hasn't // been sent yet. for (CReplyMap::iterator index = m_replies.begin(); - index != m_replies.end(); ++index) { + index != m_replies.end(); ) { assert(!index->second.empty()); if (!index->second.front()->m_replied) { pushReplies(index, index->second, index->second.begin()); } + else { + ++index; + } } } void -CXWindowsClipboard::pushReplies(CReplyMap::iterator mapIndex, +CXWindowsClipboard::pushReplies(CReplyMap::iterator& mapIndex, CReplyList& replies, CReplyList::iterator index) { CReply* reply = *index; @@ -959,9 +962,12 @@ CXWindowsClipboard::pushReplies(CReplyMa CXWindowsUtil::CErrorLock lock(m_display); Window requestor = mapIndex->first; XSelectInput(m_display, requestor, m_eventMasks[requestor]); - m_replies.erase(mapIndex); + m_replies.erase(mapIndex++); m_eventMasks.erase(requestor); } + else { + ++mapIndex; + } } bool @@ -1188,7 +1194,7 @@ CXWindowsClipboard::wasOwnedAtTime(::Tim // compare time to range Time duration = lost - m_timeOwned; Time when = time - m_timeOwned; - return (/*when >= 0 &&*/ when < duration); + return (/*when >= 0 &&*/ when <= duration); } Atom diff -rup synergy-1.3.1/lib/platform/CXWindowsClipboard.h synergy-svn//lib/platform/CXWindowsClipboard.h --- synergy-1.3.1/lib/platform/CXWindowsClipboard.h 2005-10-18 04:31:52.000000000 +0200 +++ synergy-svn//lib/platform/CXWindowsClipboard.h 2007-09-06 07:02:13.000000000 +0200 @@ -265,7 +265,7 @@ private: bool insertMultipleReply(Window, ::Time, Atom); void insertReply(CReply*); void pushReplies(); - void pushReplies(CReplyMap::iterator, + void pushReplies(CReplyMap::iterator&, CReplyList&, CReplyList::iterator); bool sendReply(CReply*); void clearReplies(); diff -rup synergy-1.3.1/lib/platform/CXWindowsUtil.cpp synergy-svn//lib/platform/CXWindowsUtil.cpp --- synergy-1.3.1/lib/platform/CXWindowsUtil.cpp 2006-03-23 07:03:20.000000000 +0100 +++ synergy-svn//lib/platform/CXWindowsUtil.cpp 2007-09-06 07:02:13.000000000 +0200 @@ -188,6 +188,7 @@ struct codepair { { XK_uogonek, 0x0173 }, /* LATIN SMALL LETTER U WITH OGONEK */ { XK_utilde, 0x0169 }, /* LATIN SMALL LETTER U WITH TILDE */ { XK_umacron, 0x016b }, /* LATIN SMALL LETTER U WITH MACRON */ +#if defined(XK_Babovedot) { XK_Babovedot, 0x1e02 }, /* LATIN CAPITAL LETTER B WITH DOT ABOVE */ { XK_babovedot, 0x1e03 }, /* LATIN SMALL LETTER B WITH DOT ABOVE */ { XK_Dabovedot, 0x1e0a }, /* LATIN CAPITAL LETTER D WITH DOT ABOVE */ @@ -214,6 +215,8 @@ struct codepair { { XK_wcircumflex, 0x0175 }, /* LATIN SMALL LETTER W WITH CIRCUMFLEX */ { XK_tabovedot, 0x1e6b }, /* LATIN SMALL LETTER T WITH DOT ABOVE */ { XK_ycircumflex, 0x0177 }, /* LATIN SMALL LETTER Y WITH CIRCUMFLEX */ +#endif // defined(XK_Babovedot) +#if defined(XK_overline) { XK_overline, 0x203e }, /* OVERLINE */ { XK_kana_fullstop, 0x3002 }, /* IDEOGRAPHIC FULL STOP */ { XK_kana_openingbracket, 0x300c }, /* LEFT CORNER BRACKET */ @@ -278,6 +281,8 @@ struct codepair { { XK_kana_N, 0x30f3 }, /* KATAKANA LETTER N */ { XK_voicedsound, 0x309b }, /* KATAKANA-HIRAGANA VOICED SOUND MARK */ { XK_semivoicedsound, 0x309c }, /* KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */ +#endif // defined(XK_overline) +#if defined(XK_Farsi_0) { XK_Farsi_0, 0x06f0 }, /* EXTENDED ARABIC-INDIC DIGIT 0 */ { XK_Farsi_1, 0x06f1 }, /* EXTENDED ARABIC-INDIC DIGIT 1 */ { XK_Farsi_2, 0x06f2 }, /* EXTENDED ARABIC-INDIC DIGIT 2 */ @@ -366,6 +371,8 @@ struct codepair { { XK_Arabic_farsi_yeh, 0x06cc }, /* ARABIC LETTER FARSI YEH */ { XK_Arabic_yeh_baree, 0x06d2 }, /* ARABIC LETTER YEH BAREE */ { XK_Arabic_heh_goal, 0x06c1 }, /* ARABIC LETTER HEH GOAL */ +#endif // defined(XK_Farsi_0) +#if defined(XK_Serbian_dje) { XK_Serbian_dje, 0x0452 }, /* CYRILLIC SMALL LETTER DJE */ { XK_Macedonia_gje, 0x0453 }, /* CYRILLIC SMALL LETTER GJE */ { XK_Cyrillic_io, 0x0451 }, /* CYRILLIC SMALL LETTER IO */ @@ -378,7 +385,9 @@ struct codepair { { XK_Cyrillic_nje, 0x045a }, /* CYRILLIC SMALL LETTER NJE */ { XK_Serbian_tshe, 0x045b }, /* CYRILLIC SMALL LETTER TSHE */ { XK_Macedonia_kje, 0x045c }, /* CYRILLIC SMALL LETTER KJE */ +#if defined(XK_Ukrainian_ghe_with_upturn) { XK_Ukrainian_ghe_with_upturn, 0x0491 }, /* CYRILLIC SMALL LETTER GHE WITH UPTURN */ +#endif { XK_Byelorussian_shortu, 0x045e }, /* CYRILLIC SMALL LETTER SHORT U */ { XK_Cyrillic_dzhe, 0x045f }, /* CYRILLIC SMALL LETTER DZHE */ { XK_numerosign, 0x2116 }, /* NUMERO SIGN */ @@ -394,7 +403,9 @@ struct codepair { { XK_Cyrillic_NJE, 0x040a }, /* CYRILLIC CAPITAL LETTER NJE */ { XK_Serbian_TSHE, 0x040b }, /* CYRILLIC CAPITAL LETTER TSHE */ { XK_Macedonia_KJE, 0x040c }, /* CYRILLIC CAPITAL LETTER KJE */ +#if defined(XK_Ukrainian_GHE_WITH_UPTURN) { XK_Ukrainian_GHE_WITH_UPTURN, 0x0490 }, /* CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ +#endif { XK_Byelorussian_SHORTU, 0x040e }, /* CYRILLIC CAPITAL LETTER SHORT U */ { XK_Cyrillic_DZHE, 0x040f }, /* CYRILLIC CAPITAL LETTER DZHE */ { XK_Cyrillic_yu, 0x044e }, /* CYRILLIC SMALL LETTER YU */ @@ -461,6 +472,8 @@ struct codepair { { XK_Cyrillic_SHCHA, 0x0429 }, /* CYRILLIC CAPITAL LETTER SHCHA */ { XK_Cyrillic_CHE, 0x0427 }, /* CYRILLIC CAPITAL LETTER CHE */ { XK_Cyrillic_HARDSIGN, 0x042a }, /* CYRILLIC CAPITAL LETTER HARD SIGN */ +#endif // defined(XK_Serbian_dje) +#if defined(XK_Greek_ALPHAaccent) { XK_Greek_ALPHAaccent, 0x0386 }, /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ { XK_Greek_EPSILONaccent, 0x0388 }, /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ { XK_Greek_ETAaccent, 0x0389 }, /* GREEK CAPITAL LETTER ETA WITH TONOS */ @@ -532,6 +545,7 @@ struct codepair { { XK_Greek_chi, 0x03c7 }, /* GREEK SMALL LETTER CHI */ { XK_Greek_psi, 0x03c8 }, /* GREEK SMALL LETTER PSI */ { XK_Greek_omega, 0x03c9 }, /* GREEK SMALL LETTER OMEGA */ +#endif // defined(XK_Greek_ALPHAaccent) { XK_leftradical, 0x23b7 }, /* ??? */ { XK_topleftradical, 0x250c }, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ { XK_horizconnector, 0x2500 }, /* BOX DRAWINGS LIGHT HORIZONTAL */ @@ -700,6 +714,7 @@ struct codepair { { XK_leftshoe, 0x2282 }, /* SUBSET OF */ { XK_lefttack, 0x22a2 }, /* RIGHT TACK */ { XK_righttack, 0x22a3 }, /* LEFT TACK */ +#if defined(XK_hebrew_doublelowline) { XK_hebrew_doublelowline, 0x2017 }, /* DOUBLE LOW LINE */ { XK_hebrew_aleph, 0x05d0 }, /* HEBREW LETTER ALEF */ { XK_hebrew_bet, 0x05d1 }, /* HEBREW LETTER BET */ @@ -728,6 +743,8 @@ struct codepair { { XK_hebrew_resh, 0x05e8 }, /* HEBREW LETTER RESH */ { XK_hebrew_shin, 0x05e9 }, /* HEBREW LETTER SHIN */ { XK_hebrew_taw, 0x05ea }, /* HEBREW LETTER TAV */ +#endif // defined(XK_hebrew_doublelowline) +#if defined(XK_Thai_kokai) { XK_Thai_kokai, 0x0e01 }, /* THAI CHARACTER KO KAI */ { XK_Thai_khokhai, 0x0e02 }, /* THAI CHARACTER KHO KHAI */ { XK_Thai_khokhuat, 0x0e03 }, /* THAI CHARACTER KHO KHUAT */ @@ -812,6 +829,8 @@ struct codepair { { XK_Thai_lekchet, 0x0e57 }, /* THAI DIGIT SEVEN */ { XK_Thai_lekpaet, 0x0e58 }, /* THAI DIGIT EIGHT */ { XK_Thai_lekkao, 0x0e59 }, /* THAI DIGIT NINE */ +#endif // defined(XK_Thai_kokai) +#if defined(XK_Hangul_Kiyeog) { XK_Hangul_Kiyeog, 0x3131 }, /* HANGUL LETTER KIYEOK */ { XK_Hangul_SsangKiyeog, 0x3132 }, /* HANGUL LETTER SSANGKIYEOK */ { XK_Hangul_KiyeogSios, 0x3133 }, /* HANGUL LETTER KIYEOK-SIOS */ @@ -903,6 +922,7 @@ struct codepair { { XK_Hangul_J_KkogjiDalrinIeung, 0x11f0 }, /* HANGUL JONGSEONG YESIEUNG */ { XK_Hangul_J_YeorinHieuh, 0x11f9 }, /* HANGUL JONGSEONG YEORINHIEUH */ { XK_Korean_Won, 0x20a9 }, /* WON SIGN */ +#endif // defined(XK_Hangul_Kiyeog) { XK_OE, 0x0152 }, /* LATIN CAPITAL LIGATURE OE */ { XK_oe, 0x0153 }, /* LATIN SMALL LIGATURE OE */ { XK_Ydiaeresis, 0x0178 }, /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ diff -rup synergy-1.3.1/lib/platform/Makefile.am synergy-svn//lib/platform/Makefile.am --- synergy-1.3.1/lib/platform/Makefile.am 2005-08-07 20:44:01.000000000 +0200 +++ synergy-svn//lib/platform/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -92,9 +92,7 @@ CARBON_SOURCE_FILES = \ $(NULL) EXTRA_DIST = \ - makehook.dsp \ - platform.dsp \ - synrgyhk.dsp \ + Makefile.win \ $(XWINDOWS_SOURCE_FILES) \ $(MSWINDOWS_SOURCE_FILES) \ $(MSWINDOWS_HOOK_SOURCE_FILES) \ Only in synergy-1.3.1/lib/platform: Makefile.in Only in synergy-svn//lib/platform: Makefile.win Only in synergy-1.3.1/lib/platform: makehook.dsp Only in synergy-1.3.1/lib/platform: platform.dsp Only in synergy-1.3.1/lib/platform: synrgyhk.dsp diff -rup synergy-1.3.1/lib/server/CClientProxy1_0.cpp synergy-svn//lib/server/CClientProxy1_0.cpp --- synergy-1.3.1/lib/server/CClientProxy1_0.cpp 2007-06-17 19:31:13.000000000 +0200 +++ synergy-svn//lib/server/CClientProxy1_0.cpp 2007-09-06 07:02:13.000000000 +0200 @@ -401,12 +401,16 @@ CClientProxy1_0::recvInfo() &x, &y, &w, &h, &dummy1, &mx, &my)) { return false; } - LOG((CLOG_DEBUG "received client \"%s\" info shape=%d,%d %dx%d", getName().c_str(), x, y, w, h)); + LOG((CLOG_DEBUG "received client \"%s\" info shape=%d,%d %dx%d at %d,%d", getName().c_str(), x, y, w, h, mx, my)); // validate if (w <= 0 || h <= 0) { return false; } + if (mx < x || mx >= x + w || my < y || my >= y + h) { + mx = x + w / 2; + my = y + h / 2; + } // save m_info.m_x = x; diff -rup synergy-1.3.1/lib/server/CConfig.cpp synergy-svn//lib/server/CConfig.cpp --- synergy-1.3.1/lib/server/CConfig.cpp 2006-03-23 07:03:22.000000000 +0100 +++ synergy-svn//lib/server/CConfig.cpp 2007-09-10 02:59:51.000000000 +0200 @@ -1203,6 +1203,36 @@ CConfig::parseAction(CConfigReadContext& action = new CInputFilter::CLockCursorToScreenAction(mode); } + else if (name == "keyboardBroadcast") { + if (args.size() > 2) { + throw XConfigRead(s, "syntax for action: keyboardBroadcast([{off|on|toggle}[,screens]])"); + } + + CInputFilter::CKeyboardBroadcastAction::Mode mode = + CInputFilter::CKeyboardBroadcastAction::kToggle; + if (args.size() >= 1) { + if (args[0] == "off") { + mode = CInputFilter::CKeyboardBroadcastAction::kOff; + } + else if (args[0] == "on") { + mode = CInputFilter::CKeyboardBroadcastAction::kOn; + } + else if (args[0] == "toggle") { + mode = CInputFilter::CKeyboardBroadcastAction::kToggle; + } + else { + throw XConfigRead(s, "syntax for action: keyboardBroadcast([{off|on|toggle}[,screens]])"); + } + } + + std::set<CString> screens; + if (args.size() >= 2) { + parseScreens(s, args[1], screens); + } + + action = new CInputFilter::CKeyboardBroadcastAction(mode, screens); + } + else { throw XConfigRead(s, "unknown action argument \"%{1}\"", name); } diff -rup synergy-1.3.1/lib/server/CInputFilter.cpp synergy-svn//lib/server/CInputFilter.cpp --- synergy-1.3.1/lib/server/CInputFilter.cpp 2007-06-17 19:31:13.000000000 +0200 +++ synergy-svn//lib/server/CInputFilter.cpp 2007-09-10 02:59:51.000000000 +0200 @@ -268,13 +268,12 @@ CInputFilter::CAction::~CAction() // do nothing } -CInputFilter::CLockCursorToScreenAction::CLockCursorToScreenAction(Mode mode): +CInputFilter::CLockCursorToScreenAction::CLockCursorToScreenAction(Mode mode) : m_mode(mode) { // do nothing } - CInputFilter::CLockCursorToScreenAction::Mode CInputFilter::CLockCursorToScreenAction::getMode() const { @@ -399,6 +398,74 @@ CInputFilter::CSwitchInDirectionAction:: event.getTarget(), info, CEvent::kDeliverImmediately)); } + +CInputFilter::CKeyboardBroadcastAction::CKeyboardBroadcastAction(Mode mode) : + m_mode(mode) +{ + // do nothing +} + +CInputFilter::CKeyboardBroadcastAction::CKeyboardBroadcastAction( + Mode mode, + const std::set<CString>& screens) : + m_mode(mode), + m_screens(IKeyState::CKeyInfo::join(screens)) +{ + // do nothing +} + +CInputFilter::CKeyboardBroadcastAction::Mode +CInputFilter::CKeyboardBroadcastAction::getMode() const +{ + return m_mode; +} + +std::set<CString> +CInputFilter::CKeyboardBroadcastAction::getScreens() const +{ + std::set<CString> screens; + IKeyState::CKeyInfo::split(m_screens.c_str(), screens); + return screens; +} + +CInputFilter::CAction* +CInputFilter::CKeyboardBroadcastAction::clone() const +{ + return new CKeyboardBroadcastAction(*this); +} + +CString +CInputFilter::CKeyboardBroadcastAction::format() const +{ + static const char* s_mode[] = { "off", "on", "toggle" }; + static const char* s_name = "keyboardBroadcast"; + + if (m_screens.empty() || m_screens[0] == '*') { + return CStringUtil::print("%s(%s)", s_name, s_mode[m_mode]); + } + else { + return CStringUtil::print("%s(%s,%.*s)", s_name, s_mode[m_mode], + m_screens.size() - 2, + m_screens.c_str() + 1); + } +} + +void +CInputFilter::CKeyboardBroadcastAction::perform(const CEvent& event) +{ + static const CServer::CKeyboardBroadcastInfo::State s_state[] = { + CServer::CKeyboardBroadcastInfo::kOff, + CServer::CKeyboardBroadcastInfo::kOn, + CServer::CKeyboardBroadcastInfo::kToggle + }; + + // send event + CServer::CKeyboardBroadcastInfo* info = + CServer::CKeyboardBroadcastInfo::alloc(s_state[m_mode], m_screens); + EVENTQUEUE->addEvent(CEvent(CServer::getKeyboardBroadcastEvent(), + event.getTarget(), info, + CEvent::kDeliverImmediately)); +} CInputFilter::CKeystrokeAction::CKeystrokeAction( IPlatformScreen::CKeyInfo* info, bool press) : diff -rup synergy-1.3.1/lib/server/CInputFilter.h synergy-svn//lib/server/CInputFilter.h --- synergy-1.3.1/lib/server/CInputFilter.h 2006-03-23 07:03:22.000000000 +0100 +++ synergy-svn//lib/server/CInputFilter.h 2007-09-10 02:59:51.000000000 +0200 @@ -21,6 +21,7 @@ #include "IPlatformScreen.h" #include "CString.h" #include "stdmap.h" +#include "stdset.h" class CPrimaryClient; class CEvent; @@ -173,6 +174,27 @@ public: EDirection m_direction; }; + // CKeyboardBroadcastAction + class CKeyboardBroadcastAction : public CAction { + public: + enum Mode { kOff, kOn, kToggle }; + + CKeyboardBroadcastAction(Mode = kToggle); + CKeyboardBroadcastAction(Mode, const std::set<CString>& screens); + + Mode getMode() const; + std::set<CString> getScreens() const; + + // CAction overrides + virtual CAction* clone() const; + virtual CString format() const; + virtual void perform(const CEvent&); + + private: + Mode m_mode; + CString m_screens; + }; + // CKeystrokeAction class CKeystrokeAction : public CAction { public: diff -rup synergy-1.3.1/lib/server/CServer.cpp synergy-svn//lib/server/CServer.cpp --- synergy-1.3.1/lib/server/CServer.cpp 2007-06-17 19:31:13.000000000 +0200 +++ synergy-svn//lib/server/CServer.cpp 2007-09-10 02:59:51.000000000 +0200 @@ -39,6 +39,7 @@ CEvent::Type CServer::s_connectedEvent CEvent::Type CServer::s_disconnectedEvent = CEvent::kUnknown; CEvent::Type CServer::s_switchToScreen = CEvent::kUnknown; CEvent::Type CServer::s_switchInDirection = CEvent::kUnknown; +CEvent::Type CServer::s_keyboardBroadcast = CEvent::kUnknown; CEvent::Type CServer::s_lockCursorToScreen = CEvent::kUnknown; CServer::CServer(const CConfig& config, CPrimaryClient* primaryClient) : @@ -61,6 +62,7 @@ CServer::CServer(const CConfig& config, m_switchTwoTapArmed(false), m_switchTwoTapZone(3), m_relativeMoves(false), + m_keyboardBroadcasting(false), m_lockedToScreen(false) { // must have a primary client and it must have a canonical name @@ -133,6 +135,10 @@ CServer::CServer(const CConfig& config, m_inputFilter, new TMethodEventJob<CServer>(this, &CServer::handleSwitchInDirectionEvent)); + EVENTQUEUE->adoptHandler(getKeyboardBroadcastEvent(), + m_inputFilter, + new TMethodEventJob<CServer>(this, + &CServer::handleKeyboardBroadcastEvent)); EVENTQUEUE->adoptHandler(getLockCursorToScreenEvent(), m_inputFilter, new TMethodEventJob<CServer>(this, @@ -356,6 +362,13 @@ CServer::getSwitchInDirectionEvent() } CEvent::Type +CServer::getKeyboardBroadcastEvent() +{ + return CEvent::registerTypeOnce(s_keyboardBroadcast, + "CServer:keyboardBroadcast"); +} + +CEvent::Type CServer::getLockCursorToScreenEvent() { return CEvent::registerTypeOnce(s_lockCursorToScreen, @@ -1365,6 +1378,37 @@ CServer::handleSwitchInDirectionEvent(co } void +CServer::handleKeyboardBroadcastEvent(const CEvent& event, void*) +{ + CKeyboardBroadcastInfo* info = (CKeyboardBroadcastInfo*)event.getData(); + + // choose new state + bool newState; + switch (info->m_state) { + case CKeyboardBroadcastInfo::kOff: + newState = false; + break; + + default: + case CKeyboardBroadcastInfo::kOn: + newState = true; + break; + + case CKeyboardBroadcastInfo::kToggle: + newState = !m_keyboardBroadcasting; + break; + } + + // enter new state + if (newState != m_keyboardBroadcasting || + info->m_screens != m_keyboardBroadcastingScreens) { + m_keyboardBroadcasting = newState; + m_keyboardBroadcastingScreens = info->m_screens; + LOG((CLOG_DEBUG "keyboard broadcasting %s: %s", m_keyboardBroadcasting ? "on" : "off", m_keyboardBroadcastingScreens.c_str())); + } +} + +void CServer::handleLockCursorToScreenEvent(const CEvent& event, void*) { CLockCursorToScreenInfo* info = (CLockCursorToScreenInfo*)event.getData(); @@ -1513,10 +1557,17 @@ CServer::onKeyDown(KeyID id, KeyModifier assert(m_active != NULL); // relay - if (IKeyState::CKeyInfo::isDefault(screens)) { + if (!m_keyboardBroadcasting || + (screens && IKeyState::CKeyInfo::isDefault(screens))) { m_active->keyDown(id, mask, button); } else { + if (!screens && m_keyboardBroadcasting) { + screens = m_keyboardBroadcastingScreens.c_str(); + if (IKeyState::CKeyInfo::isDefault(screens)) { + screens = "*"; + } + } for (CClientList::const_iterator index = m_clients.begin(); index != m_clients.end(); ++index) { if (IKeyState::CKeyInfo::contains(screens, index->first)) { @@ -1534,10 +1585,17 @@ CServer::onKeyUp(KeyID id, KeyModifierMa assert(m_active != NULL); // relay - if (IKeyState::CKeyInfo::isDefault(screens)) { + if (!m_keyboardBroadcasting || + (screens && IKeyState::CKeyInfo::isDefault(screens))) { m_active->keyUp(id, mask, button); } else { + if (!screens && m_keyboardBroadcasting) { + screens = m_keyboardBroadcastingScreens.c_str(); + if (IKeyState::CKeyInfo::isDefault(screens)) { + screens = "*"; + } + } for (CClientList::const_iterator index = m_clients.begin(); index != m_clients.end(); ++index) { if (IKeyState::CKeyInfo::contains(screens, index->first)) { @@ -2090,3 +2148,29 @@ CServer::CScreenConnectedInfo::alloc(con strcpy(info->m_screen, screen.c_str()); return info; } + + +// +// CServer::CKeyboardBroadcastInfo +// + +CServer::CKeyboardBroadcastInfo* +CServer::CKeyboardBroadcastInfo::alloc(State state) +{ + CKeyboardBroadcastInfo* info = + (CKeyboardBroadcastInfo*)malloc(sizeof(CKeyboardBroadcastInfo)); + info->m_state = state; + info->m_screens[0] = '\0'; + return info; +} + +CServer::CKeyboardBroadcastInfo* +CServer::CKeyboardBroadcastInfo::alloc(State state, const CString& screens) +{ + CKeyboardBroadcastInfo* info = + (CKeyboardBroadcastInfo*)malloc(sizeof(CKeyboardBroadcastInfo) + + screens.size()); + info->m_state = state; + strcpy(info->m_screens, screens.c_str()); + return info; +} diff -rup synergy-1.3.1/lib/server/CServer.h synergy-svn//lib/server/CServer.h --- synergy-1.3.1/lib/server/CServer.h 2007-06-17 19:31:13.000000000 +0200 +++ synergy-svn//lib/server/CServer.h 2007-09-10 02:59:51.000000000 +0200 @@ -77,6 +77,20 @@ public: char m_screen[1]; }; + //! Keyboard broadcast data + class CKeyboardBroadcastInfo { + public: + enum State { kOff, kOn, kToggle }; + + static CKeyboardBroadcastInfo* alloc(State state = kToggle); + static CKeyboardBroadcastInfo* alloc(State state, + const CString& screens); + + public: + State m_state; + char m_screens[1]; + }; + /*! Start the server with the configuration \p config and the primary client (local screen) \p primaryClient. The client retains @@ -166,6 +180,14 @@ public: */ static CEvent::Type getSwitchInDirectionEvent(); + //! Get keyboard broadcast event type + /*! + Returns the keyboard broadcast event type. The server responds + to this by turning on keyboard broadcasting or turning it off. The + event data is a \c CKeyboardBroadcastInfo*. + */ + static CEvent::Type getKeyboardBroadcastEvent(); + //! Get lock cursor event type /*! Returns the lock cursor event type. The server responds to this @@ -304,6 +326,7 @@ private: void handleClientCloseTimeout(const CEvent&, void*); void handleSwitchToScreenEvent(const CEvent&, void*); void handleSwitchInDirectionEvent(const CEvent&, void*); + void handleKeyboardBroadcastEvent(const CEvent&,void*); void handleLockCursorToScreenEvent(const CEvent&, void*); void handleFakeInputBeginEvent(const CEvent&, void*); void handleFakeInputEndEvent(const CEvent&, void*); @@ -421,6 +444,11 @@ private: // relative mouse move option bool m_relativeMoves; + // flag whether or not we have broadcasting enabled and the screens to + // which we should send broadcasted keys. + bool m_keyboardBroadcasting; + CString m_keyboardBroadcastingScreens; + // screen locking (former scroll lock) bool m_lockedToScreen; @@ -429,6 +457,7 @@ private: static CEvent::Type s_disconnectedEvent; static CEvent::Type s_switchToScreen; static CEvent::Type s_switchInDirection; + static CEvent::Type s_keyboardBroadcast; static CEvent::Type s_lockCursorToScreen; }; diff -rup synergy-1.3.1/lib/server/Makefile.am synergy-svn//lib/server/Makefile.am --- synergy-1.3.1/lib/server/Makefile.am 2007-06-17 19:31:13.000000000 +0200 +++ synergy-svn//lib/server/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,7 +14,7 @@ NULL = EXTRA_DIST = \ - server.dsp \ + Makefile.win \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1/lib/server: Makefile.in Only in synergy-svn//lib/server: Makefile.win Only in synergy-1.3.1/lib/server: server.dsp diff -rup synergy-1.3.1/lib/synergy/IKeyState.cpp synergy-svn//lib/synergy/IKeyState.cpp --- synergy-1.3.1/lib/synergy/IKeyState.cpp 2006-03-23 07:03:22.000000000 +0100 +++ synergy-svn//lib/synergy/IKeyState.cpp 2007-09-10 02:59:51.000000000 +0200 @@ -53,12 +53,13 @@ IKeyState::CKeyInfo* IKeyState::CKeyInfo::alloc(KeyID id, KeyModifierMask mask, KeyButton button, SInt32 count) { - CKeyInfo* info = (CKeyInfo*)malloc(sizeof(CKeyInfo)); - info->m_key = id; - info->m_mask = mask; - info->m_button = button; - info->m_count = count; - info->m_screens[0] = '\0'; + CKeyInfo* info = (CKeyInfo*)malloc(sizeof(CKeyInfo)); + info->m_key = id; + info->m_mask = mask; + info->m_button = button; + info->m_count = count; + info->m_screens = NULL; + info->m_screensBuffer[0] = '\0'; return info; } @@ -67,44 +68,30 @@ IKeyState::CKeyInfo::alloc(KeyID id, KeyModifierMask mask, KeyButton button, SInt32 count, const std::set<CString>& destinations) { - // collect destinations into a string. names are surrounded by ':' - // which makes searching easy later. the string is empty if there - // are no destinations and "*" means all destinations. - CString screens; - for (std::set<CString>::const_iterator i = destinations.begin(); - i != destinations.end(); ++i) { - if (*i == "*") { - screens = "*"; - break; - } - else { - if (screens.empty()) { - screens = ":"; - } - screens += *i; - screens += ":"; - } - } + CString screens = join(destinations); // build structure - CKeyInfo* info = (CKeyInfo*)malloc(sizeof(CKeyInfo) + screens.size()); - info->m_key = id; - info->m_mask = mask; - info->m_button = button; - info->m_count = count; - strcpy(info->m_screens, screens.c_str()); + CKeyInfo* info = (CKeyInfo*)malloc(sizeof(CKeyInfo) + screens.size()); + info->m_key = id; + info->m_mask = mask; + info->m_button = button; + info->m_count = count; + info->m_screens = info->m_screensBuffer; + strcpy(info->m_screensBuffer, screens.c_str()); return info; } IKeyState::CKeyInfo* IKeyState::CKeyInfo::alloc(const CKeyInfo& x) { - CKeyInfo* info = (CKeyInfo*)malloc(sizeof(CKeyInfo) + strlen(x.m_screens)); - info->m_key = x.m_key; - info->m_mask = x.m_mask; - info->m_button = x.m_button; - info->m_count = x.m_count; - strcpy(info->m_screens, x.m_screens); + CKeyInfo* info = (CKeyInfo*)malloc(sizeof(CKeyInfo) + + strlen(x.m_screensBuffer)); + info->m_key = x.m_key; + info->m_mask = x.m_mask; + info->m_button = x.m_button; + info->m_count = x.m_count; + info->m_screens = x.m_screens ? info->m_screensBuffer : NULL; + strcpy(info->m_screensBuffer, x.m_screensBuffer); return info; } @@ -141,7 +128,31 @@ IKeyState::CKeyInfo::equal(const CKeyInf a->m_mask == b->m_mask && a->m_button == b->m_button && a->m_count == b->m_count && - strcmp(a->m_screens, b->m_screens) == 0); + strcmp(a->m_screensBuffer, b->m_screensBuffer) == 0); +} + +CString +IKeyState::CKeyInfo::join(const std::set<CString>& destinations) +{ + // collect destinations into a string. names are surrounded by ':' + // which makes searching easy. the string is empty if there are no + // destinations and "*" means all destinations. + CString screens; + for (std::set<CString>::const_iterator i = destinations.begin(); + i != destinations.end(); ++i) { + if (*i == "*") { + screens = "*"; + break; + } + else { + if (screens.empty()) { + screens = ":"; + } + screens += *i; + screens += ":"; + } + } + return screens; } void diff -rup synergy-1.3.1/lib/synergy/IKeyState.h synergy-svn//lib/synergy/IKeyState.h --- synergy-1.3.1/lib/synergy/IKeyState.h 2006-03-23 07:03:22.000000000 +0100 +++ synergy-svn//lib/synergy/IKeyState.h 2007-09-10 02:59:51.000000000 +0200 @@ -43,6 +43,7 @@ public: static bool isDefault(const char* screens); static bool contains(const char* screens, const CString& name); static bool equal(const CKeyInfo*, const CKeyInfo*); + static CString join(const std::set<CString>& destinations); static void split(const char* screens, std::set<CString>&); public: @@ -50,7 +51,8 @@ public: KeyModifierMask m_mask; KeyButton m_button; SInt32 m_count; - char m_screens[1]; + char* m_screens; + char m_screensBuffer[1]; }; typedef std::set<KeyButton> KeyButtonSet; diff -rup synergy-1.3.1/lib/synergy/KeyTypes.h synergy-svn//lib/synergy/KeyTypes.h --- synergy-1.3.1/lib/synergy/KeyTypes.h 2006-03-23 07:03:22.000000000 +0100 +++ synergy-svn//lib/synergy/KeyTypes.h 2007-09-09 18:12:59.000000000 +0200 @@ -104,7 +104,10 @@ static const KeyID kKeyScrollLock = 0xE static const KeyID kKeySysReq = 0xEF15; static const KeyID kKeyEscape = 0xEF1B; static const KeyID kKeyHenkan = 0xEF23; /* Start/Stop Conversion */ +static const KeyID kKeyHangulKana = 0xEF26; /* Hangul, Kana */ +static const KeyID kKeyHiraganaKatakana = 0xEF27; /* Hiragana/Katakana toggle */ static const KeyID kKeyZenkaku = 0xEF2A; /* Zenkaku/Hankaku */ +static const KeyID kKeyHanjaKanzi = 0xEF2A; /* Hanja, Kanzi */ static const KeyID kKeyDelete = 0xEFFF; /* Delete, rubout */ // cursor control Only in synergy-1.3.1/lib/synergy: libsynergy.dsp diff -rup synergy-1.3.1/lib/synergy/Makefile.am synergy-svn//lib/synergy/Makefile.am --- synergy-1.3.1/lib/synergy/Makefile.am 2006-03-23 07:03:22.000000000 +0100 +++ synergy-svn//lib/synergy/Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -14,7 +14,7 @@ NULL = EXTRA_DIST = \ - libsynergy.dsp \ + Makefile.win \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1/lib/synergy: Makefile.in Only in synergy-svn//lib/synergy: Makefile.win diff -rup synergy-1.3.1/Makefile.am synergy-svn//Makefile.am --- synergy-1.3.1/Makefile.am 2004-08-06 07:26:08.000000000 +0200 +++ synergy-svn//Makefile.am 2007-09-06 07:07:29.000000000 +0200 @@ -21,10 +21,9 @@ SUBDIRS = \ $(NULL) EXTRA_DIST = \ - all.dsp \ - synergy.dsw \ - synergy.xcode/project.pbxproj \ + Makefile.win \ examples/synergy.conf \ + win32util/autodep.cpp \ $(NULL) MAINTAINERCLEANFILES = \ Only in synergy-1.3.1: Makefile.in Only in synergy-svn/: Makefile.win Only in synergy-1.3.1: synergy.dsw Only in synergy-1.3.1: synergy.xcode Only in synergy-svn/: win32util
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor