From 435bb738e6075912b0e9330406ffd37b2a8f6830 Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 11 Aug 2002 11:49:36 +0000 Subject: [PATCH] added win32 launcher program. also changed VC++ dsp and dsw files to binary form so \r\n aren't converted. added icons to client and server apps on win32. --- all.dsp | 126 +-- cmd/Makefile.am | 1 + cmd/launcher/Makefile.am | 28 + cmd/launcher/launcher.cpp | 1183 +++++++++++++++++++++++++++++ cmd/launcher/launcher.dsp | 122 +++ cmd/launcher/launcher.rc | 218 ++++++ cmd/launcher/resource.h | 62 ++ cmd/launcher/synergy.ico | Bin 0 -> 1078 bytes cmd/synergy/Makefile.am | 5 +- cmd/synergy/resource.h | 50 +- cmd/synergy/synergy.cpp | 175 +++-- cmd/synergy/synergy.dsp | 238 +++--- cmd/synergy/synergy.ico | Bin 0 -> 1078 bytes cmd/synergy/synergy.rc | 214 +++--- cmd/synergyd/Makefile.am | 3 +- cmd/synergyd/resource.h | 50 +- cmd/synergyd/synergy.ico | Bin 0 -> 1078 bytes cmd/synergyd/synergyd.cpp | 213 +++--- cmd/synergyd/synergyd.dsp | 238 +++--- cmd/synergyd/synergyd.rc | 215 +++--- configure.in | 2 +- lib/base/CString.cpp | 3 +- lib/base/Version.h | 4 +- lib/base/base.dsp | 408 +++++----- lib/client/client.dsp | 268 +++---- lib/http/http.dsp | 220 +++--- lib/io/io.dsp | 308 ++++---- lib/mt/mt.dsp | 292 +++---- lib/net/net.dsp | 324 ++++---- lib/platform/CMSWindowsScreen.cpp | 2 +- lib/platform/makehook.dsp | 126 +-- lib/platform/platform.dsp | 350 ++++----- lib/platform/synrgyhk.dsp | 232 +++--- lib/server/CConfig.cpp | 124 ++- lib/server/CConfig.h | 22 +- lib/server/server.dsp | 332 ++++---- lib/synergy/libsynergy.dsp | 388 +++++----- synergy.dsw | 520 +++++++------ 38 files changed, 4463 insertions(+), 2603 deletions(-) create mode 100644 cmd/launcher/Makefile.am create mode 100644 cmd/launcher/launcher.cpp create mode 100644 cmd/launcher/launcher.dsp create mode 100644 cmd/launcher/launcher.rc create mode 100644 cmd/launcher/resource.h create mode 100644 cmd/launcher/synergy.ico create mode 100644 cmd/synergy/synergy.ico create mode 100644 cmd/synergyd/synergy.ico diff --git a/all.dsp b/all.dsp index 0c7635eb..6f01a095 100644 --- a/all.dsp +++ b/all.dsp @@ -1,63 +1,63 @@ -# Microsoft Developer Studio Project File - Name="all" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Generic Project" 0x010a - -CFG=all - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "all.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "all.mak" CFG="all - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "all - Win32 Release" (based on "Win32 (x86) Generic Project") -!MESSAGE "all - Win32 Debug" (based on "Win32 (x86) Generic Project") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -MTL=midl.exe - -!IF "$(CFG)" == "all - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "all - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "all___Win32_Debug" -# PROP BASE Intermediate_Dir "all___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "all - Win32 Release" -# Name "all - Win32 Debug" -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="all" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=all - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "all.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "all.mak" CFG="all - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "all - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "all - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "all - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "all - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "all___Win32_Debug" +# PROP BASE Intermediate_Dir "all___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "all - Win32 Release" +# Name "all - Win32 Debug" +# End Target +# End Project diff --git a/cmd/Makefile.am b/cmd/Makefile.am index 3fe79050..e267fba6 100644 --- a/cmd/Makefile.am +++ b/cmd/Makefile.am @@ -16,6 +16,7 @@ DEPTH = .. VDEPTH = ./$(VPATH)/$(DEPTH) SUBDIRS = \ + launcher \ synergy \ synergyd \ $(NULL) diff --git a/cmd/launcher/Makefile.am b/cmd/launcher/Makefile.am new file mode 100644 index 00000000..79e6a7e4 --- /dev/null +++ b/cmd/launcher/Makefile.am @@ -0,0 +1,28 @@ +# synergy -- mouse and keyboard sharing utility +# Copyright (C) 2002 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 COPYING that should have accompanied this file. +# +# This package is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +## Process this file with automake to produce Makefile.in +NULL = +DEPTH = ../.. +VDEPTH = ./$(VPATH)/$(DEPTH) + +EXTRA_DIST = \ + launcher.cpp \ + launcher.dsp \ + launcher.rc \ + resource.h \ + synergy.ico \ + $(NULL) + +MAINTAINERCLEANFILES = \ + Makefile.in \ + $(NULL) diff --git a/cmd/launcher/launcher.cpp b/cmd/launcher/launcher.cpp new file mode 100644 index 00000000..e8d96cc6 --- /dev/null +++ b/cmd/launcher/launcher.cpp @@ -0,0 +1,1183 @@ +/* + * synergy -- mouse and keyboard sharing utility + * Copyright (C) 2002 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 COPYING that should have accompanied this file. + * + * This package is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "CConfig.h" +#include "ProtocolTypes.h" +#include "CPlatform.h" +#include "CNetwork.h" +#include "Version.h" +#include "stdfstream.h" +#include "stdvector.h" +#include "resource.h" + +#define WINDOWS_LEAN_AND_MEAN +#include + +#define CONFIG_NAME "synergy.sgc" +#define CLIENT_APP "synergyc.exe" +#define SERVER_APP "synergyd.exe" + +typedef std::vector CStringList; + +class CScreenInfo { +public: + CString m_screen; + CStringList m_aliases; +}; + +class CChildWaitInfo { +public: + HWND m_dialog; + HANDLE m_child; + DWORD m_childID; + HANDLE m_ready; + HANDLE m_stop; +}; + +static const TCHAR* s_mainClass = TEXT("GoSynergy"); +static const TCHAR* s_layoutClass = TEXT("SynergyLayout"); +static HINSTANCE s_instance = NULL; + +static HWND s_mainWindow; +static CConfig s_config; +static CConfig s_oldConfig; +static CStringList s_screens; + +static +BOOL CALLBACK +addDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); + +static +void +tokenize(CStringList& tokens, const CString& src) +{ + // find first non-whitespace + CString::size_type x = src.find_first_not_of(" \t\r\n"); + if (x == CString::npos) { + return; + } + + // find next whitespace + do { + CString::size_type y = src.find_first_of(" \t\r\n", x); + if (y == CString::npos) { + y = src.size(); + } + tokens.push_back(src.substr(x, y - x)); + x = src.find_first_not_of(" \t\r\n", y); + } while (x != CString::npos); +} + +static +bool +isNameInList(const CStringList& names, const CString& name) +{ + for (CStringList::const_iterator index = names.begin(); + index != names.end(); ++index) { + if (CStringUtil::CaselessCmp::equal(name, *index)) { + return true; + } + } + return false; +} + +static +CString +getString(DWORD id) +{ + char buffer[1024]; + buffer[0] = '\0'; + LoadString(s_instance, id, buffer, sizeof(buffer) / sizeof(buffer[0])); + return buffer; +} + +static +CString +getErrorString(DWORD error) +{ + char* buffer; + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_FROM_SYSTEM, + 0, + error, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&buffer, + 0, + NULL) == 0) { + return getString(IDS_ERROR); + } + else { + CString result(buffer); + LocalFree(buffer); + return result; + } +} + +static +void +showError(HWND hwnd, const CString& msg) +{ + CString title = getString(IDS_ERROR); + MessageBox(hwnd, msg.c_str(), title.c_str(), MB_OK | MB_APPLMODAL); +} + +static +void +askOkay(HWND hwnd, const CString& title, const CString& msg) +{ + MessageBox(hwnd, msg.c_str(), title.c_str(), MB_OK | MB_APPLMODAL); +} + +static +bool +askVerify(HWND hwnd, const CString& msg) +{ + CString title = getString(IDS_VERIFY); + int result = MessageBox(hwnd, msg.c_str(), + title.c_str(), MB_OKCANCEL | MB_APPLMODAL); + return (result == IDOK); +} + +static +CString +getWindowText(HWND hwnd) +{ + LRESULT size = SendMessage(hwnd, WM_GETTEXTLENGTH, 0, 0); + char* buffer = new char[size + 1]; + SendMessage(hwnd, WM_GETTEXT, size + 1, (LPARAM)buffer); + buffer[size] = '\0'; + CString result(buffer); + delete[] buffer; + return result; +} + +static +void +enableItem(HWND hwnd, int id, bool enabled) +{ + EnableWindow(GetDlgItem(hwnd, id), enabled); +} + +static +bool +isClientChecked(HWND hwnd) +{ + HWND child = GetDlgItem(hwnd, IDC_MAIN_CLIENT_RADIO); + return (SendMessage(child, BM_GETCHECK, 0, 0) == BST_CHECKED); +} + +static +void +enableScreensControls(HWND hwnd) +{ + // decide if edit and remove buttons should be enabled + bool client = isClientChecked(hwnd); + bool screenSelected = false; + if (!client) { + HWND child = GetDlgItem(hwnd, IDC_MAIN_SERVER_SCREENS_LIST); + if (SendMessage(child, LB_GETCURSEL, 0, 0) != LB_ERR) { + screenSelected = true; + } + } + + // enable/disable controls + enableItem(hwnd, IDC_MAIN_SERVER_SCREENS_LABEL, !client); + enableItem(hwnd, IDC_MAIN_SERVER_SCREENS_LIST, !client); + enableItem(hwnd, IDC_MAIN_SERVER_ADD_BUTTON, !client); + enableItem(hwnd, IDC_MAIN_SERVER_EDIT_BUTTON, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_REMOVE_BUTTON, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_LAYOUT_LABEL, !client); + enableItem(hwnd, IDC_MAIN_SERVER_LEFT_COMBO, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_RIGHT_COMBO, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_TOP_COMBO, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_BOTTOM_COMBO, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_LEFT_LABEL, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_RIGHT_LABEL, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_TOP_LABEL, screenSelected); + enableItem(hwnd, IDC_MAIN_SERVER_BOTTOM_LABEL, screenSelected); +} + +static +void +enableMainWindowControls(HWND hwnd) +{ + bool client = isClientChecked(hwnd); + enableItem(hwnd, IDC_MAIN_CLIENT_SERVER_NAME_LABEL, client); + enableItem(hwnd, IDC_MAIN_CLIENT_SERVER_NAME_EDIT, client); + enableScreensControls(hwnd); +} + +static +void +updateNeighbor(HWND hwnd, const CString& screen, EDirection direction) +{ + // remove all neighbors from combo box + SendMessage(hwnd, CB_RESETCONTENT, 0, 0); + + // add all screens to combo box + if (!screen.empty()) { + for (CConfig::const_iterator index = s_config.begin(); + index != s_config.end(); ++index) { + SendMessage(hwnd, CB_INSERTSTRING, + (WPARAM)-1, (LPARAM)index->c_str()); + } + } + + // add empty neighbor to combo box + SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM)"---"); + + // select neighbor in combo box + LRESULT index = 0; + if (!screen.empty()) { + const CString& neighbor = s_config.getNeighbor(screen, direction); + if (!neighbor.empty()) { + index = SendMessage(hwnd, CB_FINDSTRINGEXACT, + 0, (LPARAM)neighbor.c_str()); + if (index == LB_ERR) { + index = 0; + } + } + } + SendMessage(hwnd, CB_SETCURSEL, index, 0); +} + +static +void +updateNeighbors(HWND hwnd) +{ + // get selected screen name or empty string if no selection + CString screen; + HWND child = GetDlgItem(hwnd, IDC_MAIN_SERVER_SCREENS_LIST); + LRESULT index = SendMessage(child, LB_GETCURSEL, 0, 0); + if (index != LB_ERR) { + screen = s_screens[index]; + } + + // set neighbor combo boxes + child = GetDlgItem(hwnd, IDC_MAIN_SERVER_LEFT_COMBO); + updateNeighbor(child, screen, kLeft); + child = GetDlgItem(hwnd, IDC_MAIN_SERVER_RIGHT_COMBO); + updateNeighbor(child, screen, kRight); + child = GetDlgItem(hwnd, IDC_MAIN_SERVER_TOP_COMBO); + updateNeighbor(child, screen, kTop); + child = GetDlgItem(hwnd, IDC_MAIN_SERVER_BOTTOM_COMBO); + updateNeighbor(child, screen, kBottom); +} + +static +void +addScreen(HWND hwnd) +{ + // empty screen info + CScreenInfo info; + + // run dialog + if (DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_ADD), + hwnd, addDlgProc, (LPARAM)&info) != 0) { + // get current number of screens + UInt32 i = s_screens.size(); + + // add screen to list control + HWND child = GetDlgItem(hwnd, IDC_MAIN_SERVER_SCREENS_LIST); + CString item = CStringUtil::print("%d. %s", + i + 1, info.m_screen.c_str()); + SendMessage(child, LB_ADDSTRING, 0, (LPARAM)item.c_str()); + + // add screen to screen list + s_screens.push_back(info.m_screen); + + // add screen to config + s_config.addScreen(info.m_screen); + + // add aliases to config + for (CStringList::const_iterator index = info.m_aliases.begin(); + index != info.m_aliases.end(); ++index) { + s_config.addAlias(info.m_screen, *index); + } + + // update neighbors + updateNeighbors(hwnd); + enableScreensControls(hwnd); + } +} + +static +void +editScreen(HWND hwnd) +{ + // get selected list item + HWND child = GetDlgItem(hwnd, IDC_MAIN_SERVER_SCREENS_LIST); + LRESULT index = SendMessage(child, LB_GETCURSEL, 0, 0); + if (index == LB_ERR) { + // no selection + return; + } + + // fill in screen info + CScreenInfo info; + info.m_screen = s_screens[index]; + for (CConfig::all_const_iterator index = s_config.beginAll(); + index != s_config.endAll(); ++index) { + if (CStringUtil::CaselessCmp::equal(index->second, info.m_screen) && + !CStringUtil::CaselessCmp::equal(index->second, index->first)) { + info.m_aliases.push_back(index->first); + } + } + + // save current info + CScreenInfo oldInfo = info; + + // run dialog + if (DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_ADD), + hwnd, addDlgProc, (LPARAM)&info) != 0) { + // replace screen + s_screens[index] = info.m_screen; + + // remove old aliases + for (CStringList::const_iterator index = oldInfo.m_aliases.begin(); + index != oldInfo.m_aliases.end(); ++index) { + s_config.removeAlias(*index); + } + + // replace name + s_config.renameScreen(oldInfo.m_screen, info.m_screen); + + // add new aliases + for (CStringList::const_iterator index = info.m_aliases.begin(); + index != info.m_aliases.end(); ++index) { + s_config.addAlias(info.m_screen, *index); + } + + // update list + CString item = CStringUtil::print("%d. %s", + index + 1, info.m_screen.c_str()); + SendMessage(child, LB_DELETESTRING, index, 0); + SendMessage(child, LB_INSERTSTRING, index, + (LPARAM)item.c_str()); + SendMessage(child, LB_SETCURSEL, index, 0); + + // update neighbors + updateNeighbors(hwnd); + } +} + +static +void +removeScreen(HWND hwnd) +{ + // get selected list item + HWND child = GetDlgItem(hwnd, IDC_MAIN_SERVER_SCREENS_LIST); + LRESULT index = SendMessage(child, LB_GETCURSEL, 0, 0); + if (index == LB_ERR) { + // no selection + return; + } + + // get screen name + CString name = s_screens[index]; + + // remove screen from list control + SendMessage(child, LB_DELETESTRING, index, 0); + + // remove screen from screen list + s_screens.erase(&s_screens[index]); + + // remove screen from config (this also removes aliases) + s_config.removeScreen(name); + + // update neighbors + updateNeighbors(hwnd); + enableScreensControls(hwnd); +} + +static +void +changeNeighbor(HWND hwnd, HWND combo, EDirection direction) +{ + // get selected screen + HWND child = GetDlgItem(hwnd, IDC_MAIN_SERVER_SCREENS_LIST); + LRESULT index = SendMessage(child, LB_GETCURSEL, 0, 0); + if (index == LB_ERR) { + // no selection + return; + } + + // get screen name + CString screen = s_screens[index]; + + // get selected neighbor + index = SendMessage(combo, CB_GETCURSEL, 0, 0); + + // remove old connection + s_config.disconnect(screen, direction); + + // add new connection + if (index != LB_ERR && index != 0) { + LRESULT size = SendMessage(combo, CB_GETLBTEXTLEN, index, 0); + char* neighbor = new char[size + 1]; + SendMessage(combo, CB_GETLBTEXT, index, (LPARAM)neighbor); + s_config.connect(screen, direction, CString(neighbor)); + delete[] neighbor; + } +} + +static +bool +execApp(const char* app, const CString& cmdLine, PROCESS_INFORMATION* procInfo) +{ + // prepare startup info + STARTUPINFO startup; + startup.cb = sizeof(startup); + startup.lpReserved = NULL; + startup.lpDesktop = NULL; + startup.lpTitle = NULL; + startup.dwX = (DWORD)CW_USEDEFAULT; + startup.dwY = (DWORD)CW_USEDEFAULT; + startup.dwXSize = (DWORD)CW_USEDEFAULT; + startup.dwYSize = (DWORD)CW_USEDEFAULT; + startup.dwXCountChars = 0; + startup.dwYCountChars = 0; + startup.dwFillAttribute = 0; + startup.dwFlags = STARTF_FORCEONFEEDBACK; + startup.wShowWindow = SW_SHOWDEFAULT; + startup.cbReserved2 = 0; + startup.lpReserved2 = NULL; + startup.hStdInput = NULL; + startup.hStdOutput = NULL; + startup.hStdError = NULL; + + // prepare path to app + CPlatform platform; + char myPathname[MAX_PATH]; + GetModuleFileName(s_instance, myPathname, MAX_PATH); + const char* myBasename = platform.getBasename(myPathname); + CString appPath = CString(myPathname, myBasename - myPathname); + appPath += app; + + // start child + if (CreateProcess(appPath.c_str(), + (char*)cmdLine.c_str(), + NULL, + NULL, + FALSE, + CREATE_DEFAULT_ERROR_MODE | + CREATE_NEW_PROCESS_GROUP | + NORMAL_PRIORITY_CLASS, + NULL, + NULL, + &startup, + procInfo) == 0) { + return false; + } + else { + return true; + } +} + +static +bool +uninstallApp(const char* app) +{ + PROCESS_INFORMATION procInfo; + + // uninstall + DWORD exitCode = kExitFailed; + if (execApp(app, "-z --uninstall", &procInfo)) { + WaitForSingleObject(procInfo.hProcess, INFINITE); + GetExitCodeProcess(procInfo.hProcess, &exitCode); + CloseHandle(procInfo.hProcess); + CloseHandle(procInfo.hThread); + } + + return (exitCode == kExitSuccess); +} + +static +HANDLE +launchApp(HWND hwnd, bool testing, DWORD* threadID) +{ + // decide if client or server + const bool isClient = isClientChecked(hwnd); + const char* app = isClient ? CLIENT_APP : SERVER_APP; + + // get and verify screen name + HWND child = GetDlgItem(hwnd, IDC_MAIN_ADVANCED_NAME_EDIT); + CString name = getWindowText(child); + if (!s_config.isValidScreenName(name)) { + showError(hwnd, CStringUtil::format( + getString(IDS_INVALID_SCREEN_NAME).c_str(), + name.c_str())); + SetFocus(child); + return NULL; + } + if (!isClient && !s_config.isScreen(name)) { + showError(hwnd, CStringUtil::format( + getString(IDS_UNKNOWN_SCREEN_NAME).c_str(), + name.c_str())); + SetFocus(child); + return NULL; + } + + // get and verify port + child = GetDlgItem(hwnd, IDC_MAIN_ADVANCED_PORT_EDIT); + CString portString = getWindowText(child); + UInt32 port = (UInt32)atoi(portString.c_str()); + if (port < 1 || port > 65535) { + CString defaultPortString = CStringUtil::print("%d", kDefaultPort); + showError(hwnd, CStringUtil::format( + getString(IDS_INVALID_PORT).c_str(), + portString.c_str(), + defaultPortString.c_str())); + SetFocus(child); + return NULL; + } + + // prepare command line + CString cmdLine; + if (testing) { + cmdLine += " -z --no-restart --no-daemon"; + } + cmdLine += " --name "; + cmdLine += name; + if (isClient) { + // check server name + child = GetDlgItem(hwnd, IDC_MAIN_CLIENT_SERVER_NAME_EDIT); + CString server = getWindowText(child); + if (!s_config.isValidScreenName(server)) { + showError(hwnd, CStringUtil::format( + getString(IDS_INVALID_SCREEN_NAME).c_str(), + server.c_str())); + SetFocus(child); + return NULL; + } + + if (testing) { + cmdLine += " --no-camp"; + } + cmdLine += " "; + cmdLine += server; + cmdLine += ":"; + cmdLine += portString; + } + else { + cmdLine += " --address :"; + cmdLine += portString; + } + + // uninstall client and server then reinstall one of them + if (!testing) { + // uninstall client and server + uninstallApp(CLIENT_APP); + uninstallApp(SERVER_APP); + + // install client or server + PROCESS_INFORMATION procInfo; + DWORD exitCode = kExitFailed; + if (execApp(app, CString("-z --install") + cmdLine, &procInfo)) { + WaitForSingleObject(procInfo.hProcess, INFINITE); + GetExitCodeProcess(procInfo.hProcess, &exitCode); + CloseHandle(procInfo.hProcess); + CloseHandle(procInfo.hThread); + } + + // see if install succeeded + if (exitCode != kExitSuccess) { + showError(hwnd, getString(IDS_INSTALL_FAILED).c_str()); + return NULL; + } + } + + // start child + PROCESS_INFORMATION procInfo; + if (!execApp(app, cmdLine, &procInfo)) { + showError(hwnd, CStringUtil::format( + getString(IDS_STARTUP_FAILED).c_str(), + getErrorString(GetLastError()).c_str())); + return NULL; + } + + // don't need process handle + CloseHandle(procInfo.hProcess); + + // save thread ID if desired + if (threadID != NULL) { + *threadID = procInfo.dwThreadId; + } + + // return thread handle + return procInfo.hThread; +} + +static +BOOL CALLBACK +waitDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + // only one wait dialog at a time! + static CChildWaitInfo* info = NULL; + + switch (message) { + case WM_INITDIALOG: + // save info pointer + info = reinterpret_cast(lParam); + + // save hwnd + info->m_dialog = hwnd; + + // signal ready + SetEvent(info->m_ready); + + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: + case IDOK: + // signal stop + SetEvent(info->m_stop); + + // done + EndDialog(hwnd, 0); + return TRUE; + } + } + + return FALSE; +} + +static +DWORD WINAPI +waitForChildThread(LPVOID vinfo) +{ + CChildWaitInfo* info = reinterpret_cast(vinfo); + + // wait for ready + WaitForSingleObject(info->m_ready, INFINITE); + + // wait for thread to complete or stop event + HANDLE handles[2]; + handles[0] = info->m_child; + handles[1] = info->m_stop; + DWORD n = WaitForMultipleObjects(2, handles, FALSE, INFINITE); + + // if stop was raised then terminate child and wait for it + if (n == WAIT_OBJECT_0 + 1) { + PostThreadMessage(info->m_childID, WM_QUIT, 0, 0); + WaitForSingleObject(info->m_child, INFINITE); + } + + // otherwise post IDOK to dialog box + else { + PostMessage(info->m_dialog, WM_COMMAND, MAKEWPARAM(IDOK, 0), 0); + } + + return 0; +} + +static +void +waitForChild(HWND hwnd, HANDLE thread, DWORD threadID) +{ + // prepare info for child wait dialog and thread + CChildWaitInfo info; + info.m_dialog = NULL; + info.m_child = thread; + info.m_childID = threadID; + info.m_ready = CreateEvent(NULL, TRUE, FALSE, NULL); + info.m_stop = CreateEvent(NULL, TRUE, FALSE, NULL); + + // create a thread to wait on the child thread and event + DWORD id; + HANDLE waiter = CreateThread(NULL, 0, &waitForChildThread, &info,0, &id); + + // do dialog that let's the user terminate the test + DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_WAIT), hwnd, + waitDlgProc, (LPARAM)&info); + + // force the waiter thread to finish and wait for it + SetEvent(info.m_ready); + SetEvent(info.m_stop); + WaitForSingleObject(waiter, INFINITE); + + // clean up + CloseHandle(waiter); + CloseHandle(info.m_ready); + CloseHandle(info.m_stop); +} + +static +bool +loadConfig(const CString& pathname, CConfig& config) +{ + try { + std::ifstream stream(pathname.c_str()); + if (stream) { + stream >> config; + return true; + } + } + catch (...) { + // ignore + } + return false; +} + +static +bool +saveConfig(const CString& pathname, const CConfig& config) +{ + try { + std::ofstream stream(pathname.c_str()); + if (stream) { + stream << config; + return !!stream; + } + } + catch (...) { + // ignore + } + return false; +} + +static +bool +saveConfig(const CConfig& config) +{ + CPlatform platform; + + CString path = platform.getUserDirectory(); + if (!path.empty()) { + // try loading the user's configuration + path = platform.addPathComponent(path, CONFIG_NAME); + if (saveConfig(path, config)) { + return true; + } + } + + // try the system-wide config file + path = platform.getSystemDirectory(); + if (!path.empty()) { + path = platform.addPathComponent(path, CONFIG_NAME); + if (saveConfig(path, config)) { + return true; + } + } + + return false; +} + +static +void +initMainWindow(HWND hwnd) +{ + CPlatform platform; + + // load configuration + bool configLoaded = false; + CString path = platform.getUserDirectory(); + if (!path.empty()) { + // try loading the user's configuration + path = platform.addPathComponent(path, CONFIG_NAME); + if (loadConfig(path, s_config)) { + configLoaded = true; + } + else { + // try the system-wide config file + path = platform.getSystemDirectory(); + if (!path.empty()) { + path = platform.addPathComponent(path, CONFIG_NAME); + if (loadConfig(path, s_config)) { + configLoaded = true; + } + } + } + } + s_oldConfig = s_config; + + // choose client/server radio buttons + HWND child; + child = GetDlgItem(hwnd, IDC_MAIN_CLIENT_RADIO); + SendMessage(child, BM_SETCHECK, !configLoaded ? + BST_CHECKED : BST_UNCHECKED, 0); + child = GetDlgItem(hwnd, IDC_MAIN_SERVER_RADIO); + SendMessage(child, BM_SETCHECK, configLoaded ? + BST_CHECKED : BST_UNCHECKED, 0); + + // if config is loaded then initialize server controls + if (configLoaded) { + int i = 1; + child = GetDlgItem(hwnd, IDC_MAIN_SERVER_SCREENS_LIST); + for (CConfig::const_iterator index = s_config.begin(); + index != s_config.end(); ++i, ++index) { + s_screens.push_back(*index); + CString item = CStringUtil::print("%d. %s", i, index->c_str()); + SendMessage(child, LB_ADDSTRING, 0, (LPARAM)item.c_str()); + } + } + + // initialize other controls + char buffer[256]; + sprintf(buffer, "%d", kDefaultPort); + child = GetDlgItem(hwnd, IDC_MAIN_ADVANCED_PORT_EDIT); + SendMessage(child, WM_SETTEXT, 0, (LPARAM)buffer); + + CNetwork::gethostname(buffer, sizeof(buffer)); + child = GetDlgItem(hwnd, IDC_MAIN_ADVANCED_NAME_EDIT); + SendMessage(child, WM_SETTEXT, 0, (LPARAM)buffer); + + // update neighbor combo boxes + enableMainWindowControls(hwnd); + updateNeighbors(hwnd); +} + +static +BOOL CALLBACK +addDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + // only one add dialog at a time! + static CScreenInfo* info = NULL; + + switch (message) { + case WM_INITDIALOG: { + info = (CScreenInfo*)lParam; + + // fill in screen name + HWND child = GetDlgItem(hwnd, IDC_ADD_SCREEN_NAME_EDIT); + SendMessage(child, WM_SETTEXT, 0, (LPARAM)info->m_screen.c_str()); + + // fill in aliases + CString aliases; + for (CStringList::const_iterator index = info->m_aliases.begin(); + index != info->m_aliases.end(); ++index) { + if (!aliases.empty()) { + aliases += "\r\n"; + } + aliases += *index; + } + child = GetDlgItem(hwnd, IDC_ADD_ALIASES_EDIT); + SendMessage(child, WM_SETTEXT, 0, (LPARAM)aliases.c_str()); + + return TRUE; + } + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: { + CString newName; + CStringList newAliases; + + // extract name and aliases + HWND child = GetDlgItem(hwnd, IDC_ADD_SCREEN_NAME_EDIT); + newName = getWindowText(child); + child = GetDlgItem(hwnd, IDC_ADD_ALIASES_EDIT); + tokenize(newAliases, getWindowText(child)); + + // name must be valid + if (!s_config.isValidScreenName(newName)) { + showError(hwnd, CStringUtil::format( + getString(IDS_INVALID_SCREEN_NAME).c_str(), + newName.c_str())); + return TRUE; + } + + // aliases must be valid + for (CStringList::const_iterator index = newAliases.begin(); + index != newAliases.end(); ++index) { + if (!s_config.isValidScreenName(*index)) { + showError(hwnd, CStringUtil::format( + getString(IDS_INVALID_SCREEN_NAME).c_str(), + index->c_str())); + return TRUE; + } + } + + // new name may not be in the new alias list + if (isNameInList(newAliases, newName)) { + showError(hwnd, CStringUtil::format( + getString(IDS_SCREEN_NAME_IS_ALIAS).c_str(), + newName.c_str())); + return TRUE; + } + + // name must not exist in config but allow same name. also + // allow name if it exists in the old alias list but not the + // new one. + if (s_config.isScreen(newName) && + !CStringUtil::CaselessCmp::equal(newName, info->m_screen) && + !isNameInList(info->m_aliases, newName)) { + showError(hwnd, CStringUtil::format( + getString(IDS_DUPLICATE_SCREEN_NAME).c_str(), + newName.c_str())); + return TRUE; + } + + // aliases must not exist in config but allow same aliases and + // allow an alias to be the old name. + for (CStringList::const_iterator index = newAliases.begin(); + index != newAliases.end(); ++index) { + if (s_config.isScreen(*index) && + !CStringUtil::CaselessCmp::equal(*index, info->m_screen) && + !isNameInList(info->m_aliases, *index)) { + showError(hwnd, CStringUtil::format( + getString(IDS_DUPLICATE_SCREEN_NAME).c_str(), + index->c_str())); + return TRUE; + } + } + + // save data + info->m_screen = newName; + info->m_aliases = newAliases; + + // success + EndDialog(hwnd, 1); + info = NULL; + return TRUE; + } + + case IDCANCEL: + EndDialog(hwnd, 0); + info = NULL; + return TRUE; + } + + default: + break; + } + + return FALSE; +} + +static +LRESULT CALLBACK +mainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: + // test for unsaved data + if (s_config != s_oldConfig) { + if (!askVerify(hwnd, getString(IDS_UNSAVED_DATA_REALLY_QUIT))) { + return 0; + } + } + + // quit + PostQuitMessage(0); + return 0; + + case IDOK: { + // save data + if (s_config != s_oldConfig) { + if (!saveConfig(s_config)) { + showError(hwnd, CStringUtil::format( + getString(IDS_SAVE_FAILED).c_str(), + getErrorString(GetLastError()).c_str())); + return 0; + } + s_oldConfig = s_config; + } + + // launch child app + HANDLE thread = launchApp(hwnd, false, NULL); + if (thread == NULL) { + return 0; + } + CloseHandle(thread); + + // notify of success + askOkay(hwnd, getString(IDS_STARTED_TITLE), + getString(IDS_STARTED)); + + // quit + PostQuitMessage(0); + return 0; + } + + case IDC_MAIN_TEST: { + // save data + if (s_config != s_oldConfig) { + if (!saveConfig(s_config)) { + showError(hwnd, CStringUtil::format( + getString(IDS_SAVE_FAILED).c_str(), + getErrorString(GetLastError()).c_str())); + return 0; + } + s_oldConfig = s_config; + } + + // launch child app + DWORD threadID; + HANDLE thread = launchApp(hwnd, true, &threadID); + if (thread == NULL) { + return 0; + } + + // wait for process to stop, allowing the user to kill it + waitForChild(hwnd, thread, threadID); + + // clean up + CloseHandle(thread); + return 0; + } + + case IDC_MAIN_UNINSTALL: { + // uninstall client and server + bool removedClient = uninstallApp(CLIENT_APP); + bool removedServer = uninstallApp(SERVER_APP); + if (!removedClient) { + showError(hwnd, CStringUtil::format( + getString(IDS_UNINSTALL_FAILED).c_str(), + getString(IDS_CLIENT).c_str())); + } + else if (!removedServer) { + showError(hwnd, CStringUtil::format( + getString(IDS_UNINSTALL_FAILED).c_str(), + getString(IDS_SERVER).c_str())); + } + else { + askOkay(hwnd, getString(IDS_UNINSTALL_TITLE), + getString(IDS_UNINSTALLED)); + } + return 0; + } + + case IDC_MAIN_CLIENT_RADIO: + case IDC_MAIN_SERVER_RADIO: + enableMainWindowControls(hwnd); + return 0; + + case IDC_MAIN_SERVER_ADD_BUTTON: + addScreen(hwnd); + return 0; + + case IDC_MAIN_SERVER_EDIT_BUTTON: + editScreen(hwnd); + return 0; + + case IDC_MAIN_SERVER_REMOVE_BUTTON: + removeScreen(hwnd); + return 0; + + case IDC_MAIN_SERVER_SCREENS_LIST: + if (HIWORD(wParam) == LBN_SELCHANGE) { + enableScreensControls(hwnd); + updateNeighbors(hwnd); + } + else if (HIWORD(wParam) == LBN_DBLCLK) { + editScreen(hwnd); + return 0; + } + break; + + case IDC_MAIN_SERVER_LEFT_COMBO: + if (HIWORD(wParam) == CBN_SELENDOK) { + changeNeighbor(hwnd, (HWND)lParam, kLeft); + return 0; + } + break; + + case IDC_MAIN_SERVER_RIGHT_COMBO: + if (HIWORD(wParam) == CBN_SELENDOK) { + changeNeighbor(hwnd, (HWND)lParam, kRight); + return 0; + } + break; + + case IDC_MAIN_SERVER_TOP_COMBO: + if (HIWORD(wParam) == CBN_SELENDOK) { + changeNeighbor(hwnd, (HWND)lParam, kTop); + return 0; + } + break; + + case IDC_MAIN_SERVER_BOTTOM_COMBO: + if (HIWORD(wParam) == CBN_SELENDOK) { + changeNeighbor(hwnd, (HWND)lParam, kBottom); + return 0; + } + break; + } + + default: + break; + } + return DefDlgProc(hwnd, message, wParam, lParam); +} + +int WINAPI +WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int nCmdShow) +{ + s_instance = instance; + + // initialize network library + CNetwork::init(); + + // register main window (dialog) class + WNDCLASSEX classInfo; + classInfo.cbSize = sizeof(classInfo); + classInfo.style = CS_HREDRAW | CS_VREDRAW; + classInfo.lpfnWndProc = &mainWndProc; + classInfo.cbClsExtra = 0; + classInfo.cbWndExtra = DLGWINDOWEXTRA; + classInfo.hInstance = instance; + classInfo.hIcon = (HICON)LoadImage(instance, + MAKEINTRESOURCE(IDI_SYNERGY), + IMAGE_ICON, + 32, 32, LR_SHARED); + classInfo.hCursor = LoadCursor(NULL, IDC_ARROW); + classInfo.hbrBackground = reinterpret_cast(COLOR_3DFACE + 1); + classInfo.lpszMenuName = NULL; + classInfo.lpszClassName = s_mainClass; + classInfo.hIconSm = (HICON)LoadImage(instance, + MAKEINTRESOURCE(IDI_SYNERGY), + IMAGE_ICON, + 16, 16, LR_SHARED); + RegisterClassEx(&classInfo); + + // create main window + s_mainWindow = CreateDialog(s_instance, MAKEINTRESOURCE(IDD_MAIN), 0, NULL); + + // prep window + initMainWindow(s_mainWindow); + + // show window + ShowWindow(s_mainWindow, nCmdShow); + + // main loop + MSG msg; + bool done = false; + do { + switch (GetMessage(&msg, NULL, 0, 0)) { + case -1: + // error + break; + + case 0: + // quit + done = true; + break; + + default: + if (!IsDialogMessage(s_mainWindow, &msg)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + break; + } + } while (!done); + + return msg.wParam; +} diff --git a/cmd/launcher/launcher.dsp b/cmd/launcher/launcher.dsp new file mode 100644 index 00000000..79301495 --- /dev/null +++ b/cmd/launcher/launcher.dsp @@ -0,0 +1,122 @@ +# Microsoft Developer Studio Project File - Name="launcher" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=launcher - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "launcher.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "launcher.mak" CFG="launcher - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "launcher - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "launcher - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "launcher - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../../Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\http" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"../../Release/synergy.exe" +# SUBTRACT LINK32 /map + +!ELSEIF "$(CFG)" == "launcher - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../../Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\http" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../Debug/synergy.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "launcher - Win32 Release" +# Name "launcher - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\launcher.cpp +# End Source File +# Begin Source File + +SOURCE=.\launcher.rc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\synergy.ico +# End Source File +# End Group +# End Target +# End Project diff --git a/cmd/launcher/launcher.rc b/cmd/launcher/launcher.rc new file mode 100644 index 00000000..f70cc55b --- /dev/null +++ b/cmd/launcher/launcher.rc @@ -0,0 +1,218 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.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 DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 32768, 0, 300, 241 +STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Synergy" +CLASS "GoSynergy" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Choose to start either the Client or Server and provide the requested information. Then click Test to check your settings or Start to save your settings and start Synergy.", + IDC_STATIC,7,7,286,19 + GROUPBOX "",IDC_STATIC,7,29,286,31 + GROUPBOX "",IDC_STATIC,7,67,286,103 + GROUPBOX "Advanced Options",IDC_STATIC,7,177,286,34 + CONTROL "Client",IDC_MAIN_CLIENT_RADIO,"Button", + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,11,29,33,10 + CONTROL "Server",IDC_MAIN_SERVER_RADIO,"Button", + BS_AUTORADIOBUTTON,11,67,37,10 + LTEXT "Server Host Name:",IDC_MAIN_CLIENT_SERVER_NAME_LABEL,12, + 41,61,8 + EDITTEXT IDC_MAIN_CLIENT_SERVER_NAME_EDIT,79,39,106,12, + ES_AUTOHSCROLL + LTEXT "Screens:",IDC_MAIN_SERVER_SCREENS_LABEL,12,79,29,8 + LISTBOX IDC_MAIN_SERVER_SCREENS_LIST,12,91,106,36, + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Add",IDC_MAIN_SERVER_ADD_BUTTON,12,132,50,14 + PUSHBUTTON "Edit",IDC_MAIN_SERVER_EDIT_BUTTON,68,132,50,14 + PUSHBUTTON "Remove",IDC_MAIN_SERVER_REMOVE_BUTTON,12,150,50,14 + LTEXT "Layout:",IDC_MAIN_SERVER_LAYOUT_LABEL,138,79,24,8 + LTEXT "Left:",IDC_MAIN_SERVER_LEFT_LABEL,144,93,15,8 + COMBOBOX IDC_MAIN_SERVER_LEFT_COMBO,175,91,118,46, + CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Right:",IDC_MAIN_SERVER_RIGHT_LABEL,144,109,20,8 + COMBOBOX IDC_MAIN_SERVER_RIGHT_COMBO,175,107,118,46, + CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Above:",IDC_MAIN_SERVER_TOP_LABEL,144,125,24,8 + COMBOBOX IDC_MAIN_SERVER_TOP_COMBO,175,123,118,46, + CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Below:",IDC_MAIN_SERVER_BOTTOM_LABEL,144,141,22,8 + COMBOBOX IDC_MAIN_SERVER_BOTTOM_COMBO,175,139,118,46, + CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Screen Name:",IDC_STATIC,12,192,46,8 + EDITTEXT IDC_MAIN_ADVANCED_NAME_EDIT,64,190,106,12,ES_AUTOHSCROLL + LTEXT "Port:",IDC_STATIC,194,192,16,8 + EDITTEXT IDC_MAIN_ADVANCED_PORT_EDIT,216,190,40,12,ES_AUTOHSCROLL | + ES_NUMBER + DEFPUSHBUTTON "Test",IDC_MAIN_TEST,75,220,50,14 + PUSHBUTTON "Start",IDOK,131,220,50,14 + PUSHBUTTON "No Auto-Start",IDC_MAIN_UNINSTALL,187,220,50,14 + PUSHBUTTON "Quit",IDCANCEL,243,220,50,14 +END + +IDD_ADD DIALOG DISCARDABLE 0, 0, 172, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION "Add Screen" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Screen Name:",IDC_STATIC,7,9,46,8 + EDITTEXT IDC_ADD_SCREEN_NAME_EDIT,59,7,106,12,ES_AUTOHSCROLL + LTEXT "Aliases:",IDC_STATIC,7,25,25,8 + EDITTEXT IDC_ADD_ALIASES_EDIT,59,26,106,40,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + DEFPUSHBUTTON "OK",IDOK,59,74,50,14 + PUSHBUTTON "Cancel",IDCANCEL,115,74,50,14 +END + +IDD_WAIT DIALOG DISCARDABLE 0, 0, 186, 54 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION "Running Test..." +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Stop",IDOK,129,33,50,14 + LTEXT "Running synergy. Press Stop to end the test.", + IDC_STATIC,7,7,172,15 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 293 + TOPMARGIN, 7 + BOTTOMMARGIN, 234 + END + + IDD_ADD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 165 + TOPMARGIN, 7 + BOTTOMMARGIN, 88 + END + + IDD_WAIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 47 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_SYNERGY ICON DISCARDABLE "synergy.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR "Error" + IDS_INVALID_SCREEN_NAME "Screen name `%{1}' is invalid." + IDS_DUPLICATE_SCREEN_NAME "The screen name `%{1}' is already being used." + IDS_SCREEN_NAME_IS_ALIAS "A name may not be an alias of itself." + IDS_VERIFY "Confirm" + IDS_UNSAVED_DATA_REALLY_QUIT "You have unsaved changes. Really quit?" + IDS_UNKNOWN_SCREEN_NAME "The screen name `%{1}' is not in the layout." + IDS_INVALID_PORT "The port `%{1}' is invalid. It must be between 1 and 65535 inclusive. %{2} is the standard port." + IDS_SAVE_FAILED "Failed to save configuration: %{1}" + IDS_STARTUP_FAILED "Failed to start synergy: %{1}" + IDS_STARTED_TITLE "Started" + IDS_STARTED "Synergy was successfully started. Use the task manager to terminate it." + IDS_INSTALL_FAILED "Failed to install synergy auto-starter. Synergy will not be started now and it will not automatically start each time you start or reboot your computer." + IDS_UNINSTALL_TITLE "Removed Auto-Start" + IDS_UNINSTALLED "Removed auto-start. Synergy will not automatically start each time you start or reboot your computer." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_UNINSTALL_FAILED "Failed to remove auto-start of %{1}. You might not have permission to remove it or it might be in use.\n\nOn Windows NT, 2000, or XP you should open the Services control panel and stop the synergy %{1} service then try again." + IDS_CLIENT "client" + IDS_SERVER "server" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/cmd/launcher/resource.h b/cmd/launcher/resource.h new file mode 100644 index 00000000..679b3e97 --- /dev/null +++ b/cmd/launcher/resource.h @@ -0,0 +1,62 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by launcher.rc +// +#define IDS_ERROR 1 +#define IDS_INVALID_SCREEN_NAME 2 +#define IDS_DUPLICATE_SCREEN_NAME 3 +#define IDS_SCREEN_NAME_IS_ALIAS 4 +#define IDS_VERIFY 5 +#define IDS_UNSAVED_DATA_REALLY_QUIT 6 +#define IDS_UNKNOWN_SCREEN_NAME 7 +#define IDS_INVALID_PORT 8 +#define IDS_SAVE_FAILED 9 +#define IDS_STARTUP_FAILED 10 +#define IDS_STARTED_TITLE 11 +#define IDS_STARTED 12 +#define IDS_INSTALL_FAILED 13 +#define IDS_UNINSTALL_TITLE 14 +#define IDS_UNINSTALLED 15 +#define IDS_UNINSTALL_FAILED 16 +#define IDS_CLIENT 17 +#define IDS_SERVER 18 +#define IDD_MAIN 101 +#define IDD_ADD 102 +#define IDD_WAIT 103 +#define IDI_SYNERGY 104 +#define IDC_MAIN_CLIENT_RADIO 1000 +#define IDC_MAIN_SERVER_RADIO 1001 +#define IDC_MAIN_CLIENT_SERVER_NAME_EDIT 1002 +#define IDC_MAIN_ADVANCED_NAME_EDIT 1006 +#define IDC_MAIN_ADVANCED_PORT_EDIT 1008 +#define IDC_MAIN_TEST 1009 +#define IDC_MAIN_CLIENT_SERVER_NAME_LABEL 1011 +#define IDC_MAIN_SERVER_SCREENS_LIST 1012 +#define IDC_MAIN_SERVER_SCREENS_LABEL 1013 +#define IDC_MAIN_SERVER_LAYOUT_LABEL 1014 +#define IDC_MAIN_SERVER_ADD_BUTTON 1018 +#define IDC_MAIN_SERVER_EDIT_BUTTON 1019 +#define IDC_ADD_SCREEN_NAME_EDIT 1020 +#define IDC_MAIN_SERVER_REMOVE_BUTTON 1020 +#define IDC_ADD_ALIASES_EDIT 1021 +#define IDC_MAIN_SERVER_LEFT_COMBO 1022 +#define IDC_MAIN_SERVER_RIGHT_COMBO 1023 +#define IDC_MAIN_SERVER_TOP_COMBO 1024 +#define IDC_MAIN_SERVER_BOTTOM_COMBO 1025 +#define IDC_MAIN_SERVER_LEFT_LABEL 1026 +#define IDC_MAIN_SERVER_RIGHT_LABEL 1027 +#define IDC_MAIN_SERVER_TOP_LABEL 1028 +#define IDC_MAIN_SERVER_BOTTOM_LABEL 1029 +#define IDC_MAIN_UNINSTALL 1030 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 105 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1031 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/cmd/launcher/synergy.ico b/cmd/launcher/synergy.ico new file mode 100644 index 0000000000000000000000000000000000000000..39e0ff8d3a06d50e01aeab55c816f77d949c772d GIT binary patch literal 1078 zcmcIjF>ZrE5FBhIED^>0AXJf`ktfl)y)G-^$50||bEOL&;nF2tnn+}JFIZr?iL8vh zyEE(_9Op5RVS~D^V7P98ch;&(`j7#yTj0QJHRFSkA!h~xXCEW5$xaBVFq0z2$ZCzr zznCUt41VmArGJJv>>-Jz+yJ}8xQA)_q84#F7>Wj+$hY&P%aul{OC3v1I=iZr3+-$OY_kFlMUs(<&!6Qm*oKUsy=X4hhYoZPM#moz)C`vDH;Q(pi8 literal 0 HcmV?d00001 diff --git a/cmd/synergy/Makefile.am b/cmd/synergy/Makefile.am index 3b8c4499..f1b78a25 100644 --- a/cmd/synergy/Makefile.am +++ b/cmd/synergy/Makefile.am @@ -16,9 +16,10 @@ DEPTH = ../.. VDEPTH = ./$(VPATH)/$(DEPTH) EXTRA_DIST = \ - synergy.dsp \ - synergy.rc \ resource.h \ + synergy.dsp \ + synergy.ico \ + synergy.rc \ $(NULL) MAINTAINERCLEANFILES = \ diff --git a/cmd/synergy/resource.h b/cmd/synergy/resource.h index 33361a75..ec3e44aa 100644 --- a/cmd/synergy/resource.h +++ b/cmd/synergy/resource.h @@ -1,31 +1,19 @@ -/* - * synergy -- mouse and keyboard sharing utility - * Copyright (C) 2002 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 COPYING that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by client.rc -// -#define IDD_SYNERGY 101 -#define IDC_LOG 1000 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by synergy.rc +// +#define IDS_FAILED 1 +#define IDD_SYNERGY 101 +#define IDI_SYNERGY 103 +#define IDC_LOG 1000 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 104 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/cmd/synergy/synergy.cpp b/cmd/synergy/synergy.cpp index f1bb35ed..f9dbb118 100644 --- a/cmd/synergy/synergy.cpp +++ b/cmd/synergy/synergy.cpp @@ -33,6 +33,7 @@ #if WINDOWS_LIKE #include "CMSWindowsSecondaryScreen.h" +#include "resource.h" #elif UNIX_LIKE #include "CXWindowsSecondaryScreen.h" #endif @@ -49,6 +50,7 @@ // static const char* pname = NULL; +static bool s_backend = false; static bool s_restartable = true; static bool s_daemon = true; static bool s_camp = true; @@ -117,104 +119,103 @@ realMain(CMutex* mutex) { // caller should have mutex locked on entry + // initialize threading library + CThread::init(); + + // make logging thread safe + CMutex logMutex; + s_logMutex = &logMutex; + CLog::setLock(&logLock); + int result = kExitSuccess; do { + bool opened = false; + bool locked = true; try { - // initialize threading library - CThread::init(); + // create client + s_client = new CClient(s_name); + s_client->camp(s_camp); + s_client->setAddress(s_serverAddress); + s_client->setScreenFactory(new CSecondaryScreenFactory); + s_client->setSocketFactory(new CTCPSocketFactory); + s_client->setStreamFilterFactory(NULL); - // make logging thread safe - CMutex logMutex; - s_logMutex = &logMutex; - CLog::setLock(&logLock); - - bool opened = false; - bool locked = true; + // open client try { - // create client - s_client = new CClient(s_name); - s_client->camp(s_camp); - s_client->setAddress(s_serverAddress); - s_client->setScreenFactory(new CSecondaryScreenFactory); - s_client->setSocketFactory(new CTCPSocketFactory); - s_client->setStreamFilterFactory(NULL); + s_client->open(); + opened = true; - // open client - try { - s_client->open(); - opened = true; - - // run client - if (mutex != NULL) { - mutex->unlock(); - } - locked = false; - s_client->mainLoop(); - locked = true; - if (mutex != NULL) { - mutex->lock(); - } - - // clean up - s_client->close(); - - // get client status - if (s_client->wasRejected()) { - // try again later. we don't want to bother - // the server very often if it doesn't want us. - throw XScreenUnavailable(60.0); - } + // run client + if (mutex != NULL) { + mutex->unlock(); } - catch (XScreenUnavailable& e) { - // wait a few seconds before retrying - if (s_restartable) { - CThread::sleep(e.getRetryTime()); - } - else { - result = kExitFailed; - } - } - catch (...) { - // rethrow thread exceptions - RETHROW_XTHREAD + locked = false; + s_client->mainLoop(); + locked = true; - // don't try to restart and fail - s_restartable = false; - result = kExitFailed; + // get client status + if (s_client->wasRejected()) { + // try again later. we don't want to bother + // the server very often if it doesn't want us. + throw XScreenUnavailable(60.0); } // clean up - delete s_client; - s_client = NULL; - CLog::setLock(NULL); - s_logMutex = NULL; +#define FINALLY do { \ + if (!locked && mutex != NULL) { \ + mutex->lock(); \ + } \ + if (s_client != NULL) { \ + if (opened) { \ + s_client->close(); \ + } \ + } \ + delete s_client; \ + s_client = NULL; \ + } while (false) + FINALLY; } - catch (...) { - // clean up - if (!locked && mutex != NULL) { - mutex->lock(); + catch (XScreenUnavailable& e) { + // wait before retrying if we're going to retry + if (s_restartable) { + CThread::sleep(e.getRetryTime()); } - if (s_client != NULL) { - if (opened) { - s_client->close(); - } - delete s_client; - s_client = NULL; + else { + result = kExitFailed; } - CLog::setLock(NULL); - s_logMutex = NULL; + FINALLY; + } + catch (XThread&) { + FINALLY; throw; } + catch (...) { + // don't try to restart and fail + s_restartable = false; + result = kExitFailed; + FINALLY; + } +#undef FINALLY } catch (XBase& e) { log((CLOG_CRIT "failed: %s", e.what())); } catch (XThread&) { // terminated - return kExitTerminated; + s_restartable = false; + result = kExitTerminated; + } + catch (...) { + CLog::setLock(NULL); + s_logMutex = NULL; + throw; } } while (s_restartable); + // clean up + CLog::setLock(NULL); + s_logMutex = NULL; + return result; } @@ -382,6 +383,10 @@ parse(int argc, const char** argv) s_restartable = true; } + else if (isArg(i, argc, argv, "-z", NULL)) { + s_backend = true; + } + else if (isArg(i, argc, argv, "-h", "--help")) { help(); bye(kExitSuccess); @@ -463,7 +468,7 @@ parse(int argc, const char** argv) catch (XSocketAddress& e) { log((CLOG_PRINT "%s: %s" BYE, pname, e.what(), pname)); - bye(kExitArgs); + bye(kExitFailed); } } @@ -500,10 +505,18 @@ parse(int argc, const char** argv) #include "CMSWindowsScreen.h" +static bool s_errors = false; + static bool logMessageBox(int priority, const char* msg) { + if (priority <= CLog::kERROR) { + s_errors = true; + } + if (s_backend) { + return true; + } if (priority <= CLog::kFATAL) { MessageBox(NULL, msg, pname, MB_OK | MB_ICONWARNING); return true; @@ -639,7 +652,8 @@ WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int) case IPlatform::kAlready: log((CLOG_CRIT "service isn't installed")); - return kExitFailed; + // return success since service is uninstalled + return kExitSuccess; } } @@ -654,7 +668,7 @@ WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int) result = platform.daemonize(DAEMON_NAME, &daemonStartup95); if (result == -1) { log((CLOG_CRIT "failed to start as a service" BYE, pname)); - return kExitFailed; + result = kExitFailed; } } else { @@ -670,6 +684,15 @@ WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int) CNetwork::cleanup(); + // if running as a non-daemon backend and there was an error then + // wait for the user to click okay so he can see the error messages. + if (s_backend && !s_daemon && (result == kExitFailed || s_errors)) { + char msg[1024]; + msg[0] = '\0'; + LoadString(instance, IDS_FAILED, msg, sizeof(msg) / sizeof(msg[0])); + MessageBox(NULL, msg, pname, MB_OK | MB_ICONWARNING); + } + return result; } diff --git a/cmd/synergy/synergy.dsp b/cmd/synergy/synergy.dsp index 991cdc26..a55230a2 100644 --- a/cmd/synergy/synergy.dsp +++ b/cmd/synergy/synergy.dsp @@ -1,117 +1,121 @@ -# Microsoft Developer Studio Project File - Name="synergy" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=synergy - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "synergy.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "synergy.mak" CFG="synergy - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "synergy - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "synergy - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "synergy - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../../Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /I "..\synergy" /I "..\platform" /I "..\..\lib\base" /I "..\..\lib\io" /I "..\..\lib\mt" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\client" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "synergy - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../../Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\..\lib\base" /I "..\..\lib\io" /I "..\..\lib\mt" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\client" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "synergy - Win32 Release" -# Name "synergy - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\synergy.cpp -# End Source File -# Begin Source File - -SOURCE=.\synergy.rc -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="synergy" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=synergy - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "synergy.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "synergy.mak" CFG="synergy - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "synergy - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "synergy - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "synergy - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../../Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /I "..\synergy" /I "..\platform" /I "..\..\lib\base" /I "..\..\lib\io" /I "..\..\lib\mt" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\client" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"../../Release/synergyc.exe" + +!ELSEIF "$(CFG)" == "synergy - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../../Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\..\lib\base" /I "..\..\lib\io" /I "..\..\lib\mt" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\client" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../Debug/synergyc.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "synergy - Win32 Release" +# Name "synergy - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\synergy.cpp +# End Source File +# Begin Source File + +SOURCE=.\synergy.rc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\synergy.ico +# End Source File +# End Group +# End Target +# End Project diff --git a/cmd/synergy/synergy.ico b/cmd/synergy/synergy.ico new file mode 100644 index 0000000000000000000000000000000000000000..23d9a0906462ab9c0d97b7493376c20036ea471e GIT binary patch literal 1078 zcmcIjF>ZrE5FC6+xQh8fs3Mn0+fY(a_&Id6Ct)f3ES};rr3*_b$?RURz;Y8=8GCnU z*gZJTV<5v0RaL_9wF5p_%QER>2D}B}$ZHj&Wn{>ifymkCh-|VGV=By~n5K!<8nb^f z&&C-1*da;TyJ!;jP^Q6N@Bgk5}L6UBBn>K0sicl|7 z>c~aHzIP$D4S{V|pr=T(rQ-7!*>yJK8teUVc(XssjjkWGz2AEMUHkF#ec5+9I81*g z>e-HOCD}%iv@d!g`Jq1~9Im|o1qc%Zpk4onNYgUHDh}lDlX-3f^Lfdr7>my*^5=;3 zI6L&T7iQ9ze6GqH(2HHmL*4TyYI|+Gsx*5&cPi41(wy8OavnuT5$#UelluIqoTrDl j{)%DX{(iHu1?m5W`_UE`Ag|c9SRp63>%}F_F6({(d|mCB literal 0 HcmV?d00001 diff --git a/cmd/synergy/synergy.rc b/cmd/synergy/synergy.rc index 60c3a920..3c6fc383 100644 --- a/cmd/synergy/synergy.rc +++ b/cmd/synergy/synergy.rc @@ -1,97 +1,117 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.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 DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SYNERGY DIALOG DISCARDABLE 0, 0, 329, 158 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Synergy" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_LOG,7,7,315,144,ES_MULTILINE | ES_AUTOHSCROLL | - ES_READONLY | WS_VSCROLL | WS_HSCROLL -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SYNERGY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 322 - TOPMARGIN, 7 - BOTTOMMARGIN, 151 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.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 DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SYNERGY DIALOG DISCARDABLE 0, 0, 329, 158 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Synergy" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_LOG,7,7,315,144,ES_MULTILINE | ES_AUTOHSCROLL | + ES_READONLY | WS_VSCROLL | WS_HSCROLL +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SYNERGY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 322 + TOPMARGIN, 7 + BOTTOMMARGIN, 151 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_SYNERGY ICON DISCARDABLE "synergy.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FAILED "Synergy is about to quit with an error. Please check the log for error messages then click OK." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/cmd/synergyd/Makefile.am b/cmd/synergyd/Makefile.am index a16ea951..5868830f 100644 --- a/cmd/synergyd/Makefile.am +++ b/cmd/synergyd/Makefile.am @@ -16,9 +16,10 @@ DEPTH = ../.. VDEPTH = ./$(VPATH)/$(DEPTH) EXTRA_DIST = \ + resource.h \ + synergy.ico \ synergyd.dsp \ synergyd.rc \ - resource.h \ $(NULL) MAINTAINERCLEANFILES = \ diff --git a/cmd/synergyd/resource.h b/cmd/synergyd/resource.h index 2c43f29d..5b67a903 100644 --- a/cmd/synergyd/resource.h +++ b/cmd/synergyd/resource.h @@ -1,31 +1,19 @@ -/* - * synergy -- mouse and keyboard sharing utility - * Copyright (C) 2002 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 COPYING that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by server.rc -// -#define IDD_SYNERGY 101 -#define IDC_LOG 1000 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by synergyd.rc +// +#define IDS_FAILED 1 +#define IDD_SYNERGY 101 +#define IDI_SYNERGY 102 +#define IDC_LOG 1000 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1002 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/cmd/synergyd/synergy.ico b/cmd/synergyd/synergy.ico new file mode 100644 index 0000000000000000000000000000000000000000..23d9a0906462ab9c0d97b7493376c20036ea471e GIT binary patch literal 1078 zcmcIjF>ZrE5FC6+xQh8fs3Mn0+fY(a_&Id6Ct)f3ES};rr3*_b$?RURz;Y8=8GCnU z*gZJTV<5v0RaL_9wF5p_%QER>2D}B}$ZHj&Wn{>ifymkCh-|VGV=By~n5K!<8nb^f z&&C-1*da;TyJ!;jP^Q6N@Bgk5}L6UBBn>K0sicl|7 z>c~aHzIP$D4S{V|pr=T(rQ-7!*>yJK8teUVc(XssjjkWGz2AEMUHkF#ec5+9I81*g z>e-HOCD}%iv@d!g`Jq1~9Im|o1qc%Zpk4onNYgUHDh}lDlX-3f^Lfdr7>my*^5=;3 zI6L&T7iQ9ze6GqH(2HHmL*4TyYI|+Gsx*5&cPi41(wy8OavnuT5$#UelluIqoTrDl j{)%DX{(iHu1?m5W`_UE`Ag|c9SRp63>%}F_F6({(d|mCB literal 0 HcmV?d00001 diff --git a/cmd/synergyd/synergyd.cpp b/cmd/synergyd/synergyd.cpp index abdbed4d..43b84a8e 100644 --- a/cmd/synergyd/synergyd.cpp +++ b/cmd/synergyd/synergyd.cpp @@ -32,6 +32,7 @@ #if WINDOWS_LIKE #include "CMSWindowsPrimaryScreen.h" +#include "resource.h" #elif UNIX_LIKE #include "CXWindowsPrimaryScreen.h" #endif @@ -55,6 +56,7 @@ // static const char* pname = NULL; +static bool s_backend = false; static bool s_restartable = true; static bool s_daemon = true; #if WINDOWS_LIKE @@ -128,117 +130,116 @@ realMain(CMutex* mutex) { // caller should have mutex locked on entry + // initialize threading library + CThread::init(); + + // make logging thread safe + CMutex logMutex; + s_logMutex = &logMutex; + CLog::setLock(&logLock); + int result = kExitSuccess; do { + bool opened = false; + bool locked = true; try { - // initialize threading library - CThread::init(); - - // make logging thread safe - CMutex logMutex; - s_logMutex = &logMutex; - CLog::setLock(&logLock); - - bool opened = false; - bool locked = true; - try { - // if configuration has no screens then add this system - // as the default - if (s_config.begin() == s_config.end()) { - s_config.addScreen(s_name); - } - - // set the contact address, if provided, in the config. - // otherwise, if the config doesn't have an address, use - // the default. - if (s_synergyAddress.isValid()) { - s_config.setSynergyAddress(s_synergyAddress); - } - else if (!s_config.getSynergyAddress().isValid()) { - s_config.setSynergyAddress(CNetworkAddress(kDefaultPort)); - } - - // set HTTP address if provided - if (s_httpAddress.isValid()) { - s_config.setHTTPAddress(s_httpAddress); - } - - // create server - s_server = new CServer(s_name); - s_server->setConfig(s_config); - s_server->setScreenFactory(new CPrimaryScreenFactory); - s_server->setSocketFactory(new CTCPSocketFactory); - s_server->setStreamFilterFactory(NULL); - - // open server - try { - s_server->open(); - opened = true; - - // run server (unlocked) - if (mutex != NULL) { - mutex->unlock(); - } - locked = false; - s_server->mainLoop(); - locked = true; - if (mutex != NULL) { - mutex->lock(); - } - - // clean up - s_server->close(); - } - catch (XScreenUnavailable& e) { - // wait before retrying if we're going to retry - if (s_restartable) { - CThread::sleep(e.getRetryTime()); - } - else { - result = kExitFailed; - } - } - catch (...) { - // rethrow thread exceptions - RETHROW_XTHREAD - - // don't try to restart and fail - s_restartable = false; - result = kExitFailed; - } - - // clean up - delete s_server; - s_server = NULL; - CLog::setLock(NULL); - s_logMutex = NULL; + // if configuration has no screens then add this system + // as the default + if (s_config.begin() == s_config.end()) { + s_config.addScreen(s_name); } - catch (...) { + + // set the contact address, if provided, in the config. + // otherwise, if the config doesn't have an address, use + // the default. + if (s_synergyAddress.isValid()) { + s_config.setSynergyAddress(s_synergyAddress); + } + else if (!s_config.getSynergyAddress().isValid()) { + s_config.setSynergyAddress(CNetworkAddress(kDefaultPort)); + } + + // set HTTP address if provided + if (s_httpAddress.isValid()) { + s_config.setHTTPAddress(s_httpAddress); + } + + // create server + s_server = new CServer(s_name); + s_server->setConfig(s_config); + s_server->setScreenFactory(new CPrimaryScreenFactory); + s_server->setSocketFactory(new CTCPSocketFactory); + s_server->setStreamFilterFactory(NULL); + + // open server + try { + s_server->open(); + opened = true; + + // run server (unlocked) + if (mutex != NULL) { + mutex->unlock(); + } + locked = false; + s_server->mainLoop(); + locked = true; + // clean up - if (!locked && mutex != NULL) { - mutex->lock(); +#define FINALLY do { \ + if (!locked && mutex != NULL) { \ + mutex->lock(); \ + } \ + if (s_server != NULL) { \ + if (opened) { \ + s_server->close(); \ + } \ + } \ + delete s_server; \ + s_server = NULL; \ + } while (false) + FINALLY; + } + catch (XScreenUnavailable& e) { + // wait before retrying if we're going to retry + if (s_restartable) { + CThread::sleep(e.getRetryTime()); } - if (s_server != NULL) { - if (opened) { - s_server->close(); - } - delete s_server; - s_server = NULL; + else { + result = kExitFailed; } - CLog::setLock(NULL); - s_logMutex = NULL; + FINALLY; + } + catch (XThread&) { + FINALLY; throw; } + catch (...) { + // don't try to restart and fail + s_restartable = false; + result = kExitFailed; + FINALLY; + } +#undef FINALLY } catch (XBase& e) { log((CLOG_CRIT "failed: %s", e.what())); } catch (XThread&) { // terminated - return kExitTerminated; + s_restartable = false; + result = kExitTerminated; + } + catch (...) { + CLog::setLock(NULL); + s_logMutex = NULL; + throw; } } while (s_restartable); + // clean up + CLog::setLock(NULL); + s_logMutex = NULL; + return result; } @@ -448,6 +449,10 @@ parse(int argc, const char** argv) s_restartable = true; } + else if (isArg(i, argc, argv, "-z", NULL)) { + s_backend = true; + } + else if (isArg(i, argc, argv, "-h", "--help")) { help(); bye(kExitSuccess); @@ -605,10 +610,18 @@ loadConfig() #include "CMSWindowsScreen.h" +static bool s_errors = false; + static bool logMessageBox(int priority, const char* msg) { + if (priority <= CLog::kERROR) { + s_errors = true; + } + if (s_backend) { + return true; + } if (priority <= CLog::kFATAL) { MessageBox(NULL, msg, pname, MB_OK | MB_ICONWARNING); return true; @@ -751,7 +764,8 @@ WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int) case IPlatform::kAlready: log((CLOG_CRIT "service isn't installed")); - return kExitFailed; + // return success since service is uninstalled + return kExitSuccess; } } @@ -769,7 +783,7 @@ WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int) result = platform.daemonize(DAEMON_NAME, &daemonStartup95); if (result == -1) { log((CLOG_CRIT "failed to start as a service" BYE, pname)); - return kExitFailed; + result = kExitFailed; } } else { @@ -785,6 +799,15 @@ WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int) CNetwork::cleanup(); + // if running as a non-daemon backend and there was an error then + // wait for the user to click okay so he can see the error messages. + if (s_backend && !s_daemon && (result == kExitFailed || s_errors)) { + char msg[1024]; + msg[0] = '\0'; + LoadString(instance, IDS_FAILED, msg, sizeof(msg) / sizeof(msg[0])); + MessageBox(NULL, msg, pname, MB_OK | MB_ICONWARNING); + } + return result; } diff --git a/cmd/synergyd/synergyd.dsp b/cmd/synergyd/synergyd.dsp index f7665026..31195ecc 100644 --- a/cmd/synergyd/synergyd.dsp +++ b/cmd/synergyd/synergyd.dsp @@ -1,117 +1,121 @@ -# Microsoft Developer Studio Project File - Name="synergyd" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=synergyd - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "synergyd.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "synergyd.mak" CFG="synergyd - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "synergyd - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "synergyd - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "synergyd - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../../Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\http" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "synergyd - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../../Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\http" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "synergyd - Win32 Release" -# Name "synergyd - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\synergyd.cpp -# End Source File -# Begin Source File - -SOURCE=.\synergyd.rc -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="synergyd" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=synergyd - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "synergyd.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "synergyd.mak" CFG="synergyd - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "synergyd - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "synergyd - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "synergyd - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../../Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\http" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 + +!ELSEIF "$(CFG)" == "synergyd - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../../Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\http" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "synergyd - Win32 Release" +# Name "synergyd - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\synergyd.cpp +# End Source File +# Begin Source File + +SOURCE=.\synergyd.rc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\synergy.ico +# End Source File +# End Group +# End Target +# End Project diff --git a/cmd/synergyd/synergyd.rc b/cmd/synergyd/synergyd.rc index 731c32ce..a289e737 100644 --- a/cmd/synergyd/synergyd.rc +++ b/cmd/synergyd/synergyd.rc @@ -1,97 +1,118 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.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 DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SYNERGY DIALOG DISCARDABLE 0, 0, 531, 159 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Synergy" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_LOG,7,7,517,145,ES_MULTILINE | ES_AUTOHSCROLL | - ES_READONLY | WS_VSCROLL | WS_HSCROLL -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SYNERGY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 524 - TOPMARGIN, 7 - BOTTOMMARGIN, 152 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.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 DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SYNERGY DIALOG DISCARDABLE 0, 0, 531, 159 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Synergy" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX IDC_LOG,7,7,517,145,NOT LBS_NOTIFY | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | + WS_TABSTOP +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SYNERGY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 524 + TOPMARGIN, 7 + BOTTOMMARGIN, 152 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_SYNERGY ICON DISCARDABLE "synergy.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FAILED "Synergy is about to quit with an error. Please check the log for error messages then click OK." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/configure.in b/configure.in index c938eda3..babd1f72 100644 --- a/configure.in +++ b/configure.in @@ -90,6 +90,7 @@ lib/platform/Makefile lib/client/Makefile lib/server/Makefile cmd/Makefile +cmd/launcher/Makefile cmd/synergy/Makefile cmd/synergyd/Makefile dist/Makefile @@ -97,4 +98,3 @@ dist/rpm/Makefile dist/rpm/synergy.spec doc/doxygen.cfg ]) - diff --git a/lib/base/CString.cpp b/lib/base/CString.cpp index 2aedb36e..13e78239 100644 --- a/lib/base/CString.cpp +++ b/lib/base/CString.cpp @@ -91,8 +91,9 @@ CStringUtil::vformat(const char* fmt, va_list args) length.push_back(1); for (int i = 0; i < maxIndex; ++i) { const char* arg = va_arg(args, const char*); + size_t len = strlen(arg); value.push_back(arg); - length.push_back(strlen(arg)); + length.push_back(len); } // compute final length diff --git a/lib/base/Version.h b/lib/base/Version.h index afaea6c5..daebab8d 100644 --- a/lib/base/Version.h +++ b/lib/base/Version.h @@ -19,13 +19,13 @@ // set version macro if not set yet #if !defined(VERSION) -# define VERSION "1.0.0" +# define VERSION "0.9.8" #endif // important strings static const char* kCopyright = "Copyright (C) 2002 Chris Schoeneman"; static const char* kContact = "Chris Schoeneman, crs23@bigfoot.com"; -static const char* kWebsite = ""; +static const char* kWebsite = "http://synergy2.sourceforge.net/"; // build version. follows linux kernel style: an even minor number implies // a release version, odd implies development version. diff --git a/lib/base/base.dsp b/lib/base/base.dsp index e55fdedc..66dc0a8e 100644 --- a/lib/base/base.dsp +++ b/lib/base/base.dsp @@ -1,202 +1,206 @@ -# Microsoft Developer Studio Project File - Name="base" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=base - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "base.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "base.mak" CFG="base - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "base - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "base - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "base - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "base - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "base - Win32 Release" -# Name "base - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CFunctionJob.cpp -# End Source File -# Begin Source File - -SOURCE=.\CLog.cpp -# End Source File -# Begin Source File - -SOURCE=.\CStopwatch.cpp -# End Source File -# Begin Source File - -SOURCE=.\CString.cpp -# End Source File -# Begin Source File - -SOURCE=.\CUnicode.cpp -# End Source File -# Begin Source File - -SOURCE=.\XBase.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\BasicTypes.h -# End Source File -# Begin Source File - -SOURCE=.\CFunctionJob.h -# End Source File -# Begin Source File - -SOURCE=.\CLog.h -# End Source File -# Begin Source File - -SOURCE=.\common.h -# End Source File -# Begin Source File - -SOURCE=.\CStopwatch.h -# End Source File -# Begin Source File - -SOURCE=.\CString.h -# End Source File -# Begin Source File - -SOURCE=.\CUnicode.h -# End Source File -# Begin Source File - -SOURCE=.\IInterface.h -# End Source File -# Begin Source File - -SOURCE=.\IJob.h -# End Source File -# Begin Source File - -SOURCE=.\stdfstream.h -# End Source File -# Begin Source File - -SOURCE=.\stdistream.h -# End Source File -# Begin Source File - -SOURCE=.\stdlist.h -# End Source File -# Begin Source File - -SOURCE=.\stdmap.h -# End Source File -# Begin Source File - -SOURCE=.\stdostream.h -# End Source File -# Begin Source File - -SOURCE=.\stdpost.h -# End Source File -# Begin Source File - -SOURCE=.\stdpre.h -# End Source File -# Begin Source File - -SOURCE=.\stdset.h -# End Source File -# Begin Source File - -SOURCE=.\stdsstream.h -# End Source File -# Begin Source File - -SOURCE=.\stdvector.h -# End Source File -# Begin Source File - -SOURCE=.\TMethodJob.h -# End Source File -# Begin Source File - -SOURCE=.\XBase.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="base" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=base - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "base.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "base.mak" CFG="base - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "base - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "base - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "base - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "base - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "base - Win32 Release" +# Name "base - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CFunctionJob.cpp +# End Source File +# Begin Source File + +SOURCE=.\CLog.cpp +# End Source File +# Begin Source File + +SOURCE=.\CStopwatch.cpp +# End Source File +# Begin Source File + +SOURCE=.\CString.cpp +# End Source File +# Begin Source File + +SOURCE=.\CUnicode.cpp +# End Source File +# Begin Source File + +SOURCE=.\XBase.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\BasicTypes.h +# End Source File +# Begin Source File + +SOURCE=.\CFunctionJob.h +# End Source File +# Begin Source File + +SOURCE=.\CLog.h +# End Source File +# Begin Source File + +SOURCE=.\common.h +# End Source File +# Begin Source File + +SOURCE=.\CStopwatch.h +# End Source File +# Begin Source File + +SOURCE=.\CString.h +# End Source File +# Begin Source File + +SOURCE=.\CUnicode.h +# End Source File +# Begin Source File + +SOURCE=.\IInterface.h +# End Source File +# Begin Source File + +SOURCE=.\IJob.h +# End Source File +# Begin Source File + +SOURCE=.\stdfstream.h +# End Source File +# Begin Source File + +SOURCE=.\stdistream.h +# End Source File +# Begin Source File + +SOURCE=.\stdlist.h +# End Source File +# Begin Source File + +SOURCE=.\stdmap.h +# End Source File +# Begin Source File + +SOURCE=.\stdostream.h +# End Source File +# Begin Source File + +SOURCE=.\stdpost.h +# End Source File +# Begin Source File + +SOURCE=.\stdpre.h +# End Source File +# Begin Source File + +SOURCE=.\stdset.h +# End Source File +# Begin Source File + +SOURCE=.\stdsstream.h +# End Source File +# Begin Source File + +SOURCE=.\stdvector.h +# End Source File +# Begin Source File + +SOURCE=.\TMethodJob.h +# End Source File +# Begin Source File + +SOURCE=.\Version.h +# End Source File +# Begin Source File + +SOURCE=.\XBase.h +# End Source File +# End Group +# End Target +# End Project diff --git a/lib/client/client.dsp b/lib/client/client.dsp index 985ffe88..0fd4a4d8 100644 --- a/lib/client/client.dsp +++ b/lib/client/client.dsp @@ -1,134 +1,134 @@ -# Microsoft Developer Studio Project File - Name="client" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=client - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "client.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "client.mak" CFG="client - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "client - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "client - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "client - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /I "..\synergy" /I "..\platform" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "client - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /I "..\synergy" /I "..\platform" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "client - Win32 Release" -# Name "client - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CClient.cpp -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsSecondaryScreen.cpp -# End Source File -# Begin Source File - -SOURCE=.\CSecondaryScreen.cpp -# End Source File -# Begin Source File - -SOURCE=.\CServerProxy.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CClient.h -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsSecondaryScreen.h -# End Source File -# Begin Source File - -SOURCE=.\CSecondaryScreen.h -# End Source File -# Begin Source File - -SOURCE=.\CServerProxy.h -# End Source File -# Begin Source File - -SOURCE=.\ISecondaryScreenFactory.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="client" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=client - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "client.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "client.mak" CFG="client - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "client - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "client - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "client - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /I "..\synergy" /I "..\platform" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "client - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /I "..\synergy" /I "..\platform" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "client - Win32 Release" +# Name "client - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CClient.cpp +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsSecondaryScreen.cpp +# End Source File +# Begin Source File + +SOURCE=.\CSecondaryScreen.cpp +# End Source File +# Begin Source File + +SOURCE=.\CServerProxy.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CClient.h +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsSecondaryScreen.h +# End Source File +# Begin Source File + +SOURCE=.\CSecondaryScreen.h +# End Source File +# Begin Source File + +SOURCE=.\CServerProxy.h +# End Source File +# Begin Source File + +SOURCE=.\ISecondaryScreenFactory.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/lib/http/http.dsp b/lib/http/http.dsp index 2330ca65..2f050878 100644 --- a/lib/http/http.dsp +++ b/lib/http/http.dsp @@ -1,110 +1,110 @@ -# Microsoft Developer Studio Project File - Name="http" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=http - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "http.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "http.mak" CFG="http - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "http - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "http - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "http - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "http - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\io" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "http - Win32 Release" -# Name "http - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CHTTPProtocol.cpp -# End Source File -# Begin Source File - -SOURCE=.\XHTTP.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CHTTPProtocol.h -# End Source File -# Begin Source File - -SOURCE=.\XHTTP.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="http" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=http - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "http.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "http.mak" CFG="http - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "http - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "http - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "http - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "http - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\io" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "http - Win32 Release" +# Name "http - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CHTTPProtocol.cpp +# End Source File +# Begin Source File + +SOURCE=.\XHTTP.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CHTTPProtocol.h +# End Source File +# Begin Source File + +SOURCE=.\XHTTP.h +# End Source File +# End Group +# End Target +# End Project diff --git a/lib/io/io.dsp b/lib/io/io.dsp index 0631be2f..c9983c9c 100644 --- a/lib/io/io.dsp +++ b/lib/io/io.dsp @@ -1,154 +1,154 @@ -# Microsoft Developer Studio Project File - Name="io" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=io - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "io.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "io.mak" CFG="io - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "io - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "io - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "io - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\mt" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "io - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\mt" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "io - Win32 Release" -# Name "io - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CBufferedInputStream.cpp -# End Source File -# Begin Source File - -SOURCE=.\CBufferedOutputStream.cpp -# End Source File -# Begin Source File - -SOURCE=.\CInputStreamFilter.cpp -# End Source File -# Begin Source File - -SOURCE=.\COutputStreamFilter.cpp -# End Source File -# Begin Source File - -SOURCE=.\CStreamBuffer.cpp -# End Source File -# Begin Source File - -SOURCE=.\XIO.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CBufferedInputStream.h -# End Source File -# Begin Source File - -SOURCE=.\CBufferedOutputStream.h -# End Source File -# Begin Source File - -SOURCE=.\CInputStreamFilter.h -# End Source File -# Begin Source File - -SOURCE=.\COutputStreamFilter.h -# End Source File -# Begin Source File - -SOURCE=.\CStreamBuffer.h -# End Source File -# Begin Source File - -SOURCE=.\IInputStream.h -# End Source File -# Begin Source File - -SOURCE=.\IOutputStream.h -# End Source File -# Begin Source File - -SOURCE=.\IStreamFilterFactory.h -# End Source File -# Begin Source File - -SOURCE=.\XIO.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="io" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=io - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "io.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "io.mak" CFG="io - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "io - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "io - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "io - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\mt" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "io - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\mt" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "io - Win32 Release" +# Name "io - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CBufferedInputStream.cpp +# End Source File +# Begin Source File + +SOURCE=.\CBufferedOutputStream.cpp +# End Source File +# Begin Source File + +SOURCE=.\CInputStreamFilter.cpp +# End Source File +# Begin Source File + +SOURCE=.\COutputStreamFilter.cpp +# End Source File +# Begin Source File + +SOURCE=.\CStreamBuffer.cpp +# End Source File +# Begin Source File + +SOURCE=.\XIO.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CBufferedInputStream.h +# End Source File +# Begin Source File + +SOURCE=.\CBufferedOutputStream.h +# End Source File +# Begin Source File + +SOURCE=.\CInputStreamFilter.h +# End Source File +# Begin Source File + +SOURCE=.\COutputStreamFilter.h +# End Source File +# Begin Source File + +SOURCE=.\CStreamBuffer.h +# End Source File +# Begin Source File + +SOURCE=.\IInputStream.h +# End Source File +# Begin Source File + +SOURCE=.\IOutputStream.h +# End Source File +# Begin Source File + +SOURCE=.\IStreamFilterFactory.h +# End Source File +# Begin Source File + +SOURCE=.\XIO.h +# End Source File +# End Group +# End Target +# End Project diff --git a/lib/mt/mt.dsp b/lib/mt/mt.dsp index baa08de9..e179518e 100644 --- a/lib/mt/mt.dsp +++ b/lib/mt/mt.dsp @@ -1,146 +1,146 @@ -# Microsoft Developer Studio Project File - Name="mt" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=mt - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "mt.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "mt.mak" CFG="mt - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "mt - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "mt - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "mt - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "mt - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "mt - Win32 Release" -# Name "mt - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CCondVar.cpp -# End Source File -# Begin Source File - -SOURCE=.\CLock.cpp -# End Source File -# Begin Source File - -SOURCE=.\CMutex.cpp -# End Source File -# Begin Source File - -SOURCE=.\CThread.cpp -# End Source File -# Begin Source File - -SOURCE=.\CThreadRep.cpp -# End Source File -# Begin Source File - -SOURCE=.\CTimerThread.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CCondVar.h -# End Source File -# Begin Source File - -SOURCE=.\CLock.h -# End Source File -# Begin Source File - -SOURCE=.\CMutex.h -# End Source File -# Begin Source File - -SOURCE=.\CThread.h -# End Source File -# Begin Source File - -SOURCE=.\CThreadRep.h -# End Source File -# Begin Source File - -SOURCE=.\CTimerThread.h -# End Source File -# Begin Source File - -SOURCE=.\XThread.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="mt" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=mt - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mt.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mt.mak" CFG="mt - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mt - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "mt - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mt - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "mt - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "mt - Win32 Release" +# Name "mt - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CCondVar.cpp +# End Source File +# Begin Source File + +SOURCE=.\CLock.cpp +# End Source File +# Begin Source File + +SOURCE=.\CMutex.cpp +# End Source File +# Begin Source File + +SOURCE=.\CThread.cpp +# End Source File +# Begin Source File + +SOURCE=.\CThreadRep.cpp +# End Source File +# Begin Source File + +SOURCE=.\CTimerThread.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CCondVar.h +# End Source File +# Begin Source File + +SOURCE=.\CLock.h +# End Source File +# Begin Source File + +SOURCE=.\CMutex.h +# End Source File +# Begin Source File + +SOURCE=.\CThread.h +# End Source File +# Begin Source File + +SOURCE=.\CThreadRep.h +# End Source File +# Begin Source File + +SOURCE=.\CTimerThread.h +# End Source File +# Begin Source File + +SOURCE=.\XThread.h +# End Source File +# End Group +# End Target +# End Project diff --git a/lib/net/net.dsp b/lib/net/net.dsp index 04cfe3ef..13a976e9 100644 --- a/lib/net/net.dsp +++ b/lib/net/net.dsp @@ -1,162 +1,162 @@ -# Microsoft Developer Studio Project File - Name="net" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=net - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "net.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "net.mak" CFG="net - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "net - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "net - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "net - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /I "..\mt" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "net - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\io" /I "..\mt" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "net - Win32 Release" -# Name "net - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CNetwork.cpp -# End Source File -# Begin Source File - -SOURCE=.\CNetworkAddress.cpp -# End Source File -# Begin Source File - -SOURCE=.\CTCPListenSocket.cpp -# End Source File -# Begin Source File - -SOURCE=.\CTCPSocket.cpp -# End Source File -# Begin Source File - -SOURCE=.\CTCPSocketFactory.cpp -# End Source File -# Begin Source File - -SOURCE=.\XNetwork.cpp -# End Source File -# Begin Source File - -SOURCE=.\XSocket.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CNetwork.h -# End Source File -# Begin Source File - -SOURCE=.\CNetworkAddress.h -# End Source File -# Begin Source File - -SOURCE=.\CTCPListenSocket.h -# End Source File -# Begin Source File - -SOURCE=.\CTCPSocket.h -# End Source File -# Begin Source File - -SOURCE=.\CTCPSocketFactory.h -# End Source File -# Begin Source File - -SOURCE=.\IListenSocket.h -# End Source File -# Begin Source File - -SOURCE=.\ISocket.h -# End Source File -# Begin Source File - -SOURCE=.\ISocketFactory.h -# End Source File -# Begin Source File - -SOURCE=.\XNetwork.h -# End Source File -# Begin Source File - -SOURCE=.\XSocket.h -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="net" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=net - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "net.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "net.mak" CFG="net - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "net - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "net - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "net - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /I "..\mt" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "net - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\io" /I "..\mt" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "net - Win32 Release" +# Name "net - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CNetwork.cpp +# End Source File +# Begin Source File + +SOURCE=.\CNetworkAddress.cpp +# End Source File +# Begin Source File + +SOURCE=.\CTCPListenSocket.cpp +# End Source File +# Begin Source File + +SOURCE=.\CTCPSocket.cpp +# End Source File +# Begin Source File + +SOURCE=.\CTCPSocketFactory.cpp +# End Source File +# Begin Source File + +SOURCE=.\XNetwork.cpp +# End Source File +# Begin Source File + +SOURCE=.\XSocket.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CNetwork.h +# End Source File +# Begin Source File + +SOURCE=.\CNetworkAddress.h +# End Source File +# Begin Source File + +SOURCE=.\CTCPListenSocket.h +# End Source File +# Begin Source File + +SOURCE=.\CTCPSocket.h +# End Source File +# Begin Source File + +SOURCE=.\CTCPSocketFactory.h +# End Source File +# Begin Source File + +SOURCE=.\IListenSocket.h +# End Source File +# Begin Source File + +SOURCE=.\ISocket.h +# End Source File +# Begin Source File + +SOURCE=.\ISocketFactory.h +# End Source File +# Begin Source File + +SOURCE=.\XNetwork.h +# End Source File +# Begin Source File + +SOURCE=.\XSocket.h +# End Source File +# End Group +# End Target +# End Project diff --git a/lib/platform/CMSWindowsScreen.cpp b/lib/platform/CMSWindowsScreen.cpp index 534d9905..56f054f4 100644 --- a/lib/platform/CMSWindowsScreen.cpp +++ b/lib/platform/CMSWindowsScreen.cpp @@ -349,7 +349,7 @@ CMSWindowsScreen::syncDesktop() // change calling thread's desktop if (!m_is95Family) { if (SetThreadDesktop(m_desk) == 0) { - log((CLOG_WARN "failed to set desktop: %d", GetLastError())); +// log((CLOG_WARN "failed to set desktop: %d", GetLastError())); } } diff --git a/lib/platform/makehook.dsp b/lib/platform/makehook.dsp index 507157ef..fc0bc115 100644 --- a/lib/platform/makehook.dsp +++ b/lib/platform/makehook.dsp @@ -1,63 +1,63 @@ -# Microsoft Developer Studio Project File - Name="makehook" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Generic Project" 0x010a - -CFG=makehook - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "makehook.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "makehook.mak" CFG="makehook - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "makehook - Win32 Release" (based on "Win32 (x86) Generic Project") -!MESSAGE "makehook - Win32 Debug" (based on "Win32 (x86) Generic Project") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -MTL=midl.exe - -!IF "$(CFG)" == "makehook - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "makehook___Win32_Release" -# PROP BASE Intermediate_Dir "makehook___Win32_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "makehook - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "makehook___Win32_Debug" -# PROP BASE Intermediate_Dir "makehook___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "makehook - Win32 Release" -# Name "makehook - Win32 Debug" -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="makehook" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=makehook - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "makehook.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "makehook.mak" CFG="makehook - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "makehook - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "makehook - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "makehook - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "makehook___Win32_Release" +# PROP BASE Intermediate_Dir "makehook___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "makehook - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "makehook___Win32_Debug" +# PROP BASE Intermediate_Dir "makehook___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "makehook - Win32 Release" +# Name "makehook - Win32 Debug" +# End Target +# End Project diff --git a/lib/platform/platform.dsp b/lib/platform/platform.dsp index 080d4de2..d78f7c92 100644 --- a/lib/platform/platform.dsp +++ b/lib/platform/platform.dsp @@ -1,175 +1,175 @@ -# Microsoft Developer Studio Project File - Name="platform" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=platform - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "platform.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "platform.mak" CFG="platform - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "platform - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "platform - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "platform - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\mt" /I "..\synergy" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "platform - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\mt" /I "..\synergy" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "platform - Win32 Release" -# Name "platform - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CMSWindowsClipboard.cpp -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsClipboardAnyTextConverter.cpp -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsClipboardTextConverter.cpp -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsClipboardUTF16Converter.cpp -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsScreen.cpp -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsScreenSaver.cpp -# End Source File -# Begin Source File - -SOURCE=.\CPlatform.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CMSWindowsClipboard.h -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsClipboardAnyTextConverter.h -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsClipboardTextConverter.h -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsClipboardUTF16Converter.h -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsScreen.h -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsScreenSaver.h -# End Source File -# Begin Source File - -SOURCE=.\CPlatform.h -# End Source File -# Begin Source File - -SOURCE=.\CWin32Platform.h -# End Source File -# Begin Source File - -SOURCE=.\IMSWindowsScreenEventHandler.h -# End Source File -# Begin Source File - -SOURCE=.\IPlatform.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Group "Included Files" - -# PROP Default_Filter "inc" -# Begin Source File - -SOURCE=.\CWin32Platform.cpp -# PROP Exclude_From_Build 1 -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="platform" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=platform - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "platform.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "platform.mak" CFG="platform - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "platform - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "platform - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "platform - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\mt" /I "..\synergy" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "platform - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\mt" /I "..\synergy" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "platform - Win32 Release" +# Name "platform - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CMSWindowsClipboard.cpp +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsClipboardAnyTextConverter.cpp +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsClipboardTextConverter.cpp +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsClipboardUTF16Converter.cpp +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsScreen.cpp +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsScreenSaver.cpp +# End Source File +# Begin Source File + +SOURCE=.\CPlatform.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CMSWindowsClipboard.h +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsClipboardAnyTextConverter.h +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsClipboardTextConverter.h +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsClipboardUTF16Converter.h +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsScreen.h +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsScreenSaver.h +# End Source File +# Begin Source File + +SOURCE=.\CPlatform.h +# End Source File +# Begin Source File + +SOURCE=.\CWin32Platform.h +# End Source File +# Begin Source File + +SOURCE=.\IMSWindowsScreenEventHandler.h +# End Source File +# Begin Source File + +SOURCE=.\IPlatform.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "Included Files" + +# PROP Default_Filter "inc" +# Begin Source File + +SOURCE=.\CWin32Platform.cpp +# PROP Exclude_From_Build 1 +# End Source File +# End Group +# End Target +# End Project diff --git a/lib/platform/synrgyhk.dsp b/lib/platform/synrgyhk.dsp index 4f1f593c..cf1717e3 100644 --- a/lib/platform/synrgyhk.dsp +++ b/lib/platform/synrgyhk.dsp @@ -1,116 +1,116 @@ -# Microsoft Developer Studio Project File - Name="synrgyhk" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=synrgyhk - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "synrgyhk.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "synrgyhk.mak" CFG="synrgyhk - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "synrgyhk - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "synrgyhk - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "synrgyhk - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "synrgyhk___Win32_Release" -# PROP BASE Intermediate_Dir "synrgyhk___Win32_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "../../Release" -# PROP Intermediate_Dir "ReleaseHook" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYNRGYHK_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O1 /I "..\base" /I "..\net" /I "..\synergy" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYNRGYHK_EXPORTS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"DllMain" /dll /machine:I386 /nodefaultlib -# SUBTRACT LINK32 /verbose - -!ELSEIF "$(CFG)" == "synrgyhk - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "synrgyhk___Win32_Debug" -# PROP BASE Intermediate_Dir "synrgyhk___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "../../Debug" -# PROP Intermediate_Dir "DebugHook" -# PROP Ignore_Export_Lib 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYNRGYHK_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\synergy" /I "..\base" /I "..\net" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYNRGYHK_EXPORTS" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"" /dll /debug /machine:I386 /pdbtype:sept -# SUBTRACT LINK32 /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "synrgyhk - Win32 Release" -# Name "synrgyhk - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CSynergyHook.cpp -# ADD CPP /D _WIN32_WINNT=0x0400 -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CSynergyHook.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="synrgyhk" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=synrgyhk - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "synrgyhk.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "synrgyhk.mak" CFG="synrgyhk - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "synrgyhk - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "synrgyhk - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "synrgyhk - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "synrgyhk___Win32_Release" +# PROP BASE Intermediate_Dir "synrgyhk___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../../Release" +# PROP Intermediate_Dir "ReleaseHook" +# PROP Ignore_Export_Lib 1 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYNRGYHK_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O1 /I "..\base" /I "..\net" /I "..\synergy" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYNRGYHK_EXPORTS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"DllMain" /dll /machine:I386 /nodefaultlib +# SUBTRACT LINK32 /verbose + +!ELSEIF "$(CFG)" == "synrgyhk - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "synrgyhk___Win32_Debug" +# PROP BASE Intermediate_Dir "synrgyhk___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../../Debug" +# PROP Intermediate_Dir "DebugHook" +# PROP Ignore_Export_Lib 1 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYNRGYHK_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\synergy" /I "..\base" /I "..\net" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYNRGYHK_EXPORTS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"" /dll /debug /machine:I386 /pdbtype:sept +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "synrgyhk - Win32 Release" +# Name "synrgyhk - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CSynergyHook.cpp +# ADD CPP /D _WIN32_WINNT=0x0400 +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CSynergyHook.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/lib/server/CConfig.cpp b/lib/server/CConfig.cpp index feb68ccd..942e23c9 100644 --- a/lib/server/CConfig.cpp +++ b/lib/server/CConfig.cpp @@ -49,6 +49,57 @@ CConfig::addScreen(const CString& name) return true; } +bool +CConfig::renameScreen(const CString& oldName, + const CString& newName) +{ + // get canonical name and find cell + CString oldCanonical = getCanonicalName(oldName); + CCellMap::iterator index = m_map.find(oldCanonical); + if (index == m_map.end()) { + return false; + } + + // accept if names are equal but replace with new name to maintain + // case. otherwise, the new name must not exist. + if (!CStringUtil::CaselessCmp::equal(oldName, newName) && + m_nameToCanonicalName.find(newName) != m_nameToCanonicalName.end()) { + return false; + } + + // update cell + CCell tmpCell = index->second; + m_map.erase(index); + m_map.insert(std::make_pair(newName, tmpCell)); + + // update name + m_nameToCanonicalName.erase(oldCanonical); + m_nameToCanonicalName.insert(std::make_pair(newName, newName)); + + // update connections + for (index = m_map.begin(); index != m_map.end(); ++index) { + for (UInt32 i = 0; i <= kLastDirection - kFirstDirection; ++i) { + if (CStringUtil::CaselessCmp::equal(getCanonicalName( + index->second.m_neighbor[i]), oldCanonical)) { + index->second.m_neighbor[i] = newName; + } + } + } + + // update alias targets + if (CStringUtil::CaselessCmp::equal(oldName, oldCanonical)) { + for (CNameMap::iterator index = m_nameToCanonicalName.begin(); + index != m_nameToCanonicalName.end(); ++index) { + if (CStringUtil::CaselessCmp::equal( + index->second, oldCanonical)) { + index->second = newName; + } + } + } + + return true; +} + void CConfig::removeScreen(const CString& name) { @@ -65,10 +116,11 @@ CConfig::removeScreen(const CString& name) // disconnect for (index = m_map.begin(); index != m_map.end(); ++index) { CCell& cell = index->second; - for (SInt32 i = 0; i <= kLastDirection - kFirstDirection; ++i) + for (UInt32 i = 0; i <= kLastDirection - kFirstDirection; ++i) { if (getCanonicalName(cell.m_neighbor[i]) == canonical) { cell.m_neighbor[i].erase(); } + } } // remove aliases (and canonical name) @@ -99,7 +151,7 @@ CConfig::addAlias(const CString& canonical, const CString& alias) } // canonical name must be known - if (m_nameToCanonicalName.find(canonical) == m_nameToCanonicalName.end()) { + if (m_map.find(canonical) == m_map.end()) { return false; } @@ -245,6 +297,18 @@ CConfig::end() const return const_iterator(m_map.end()); } +CConfig::all_const_iterator +CConfig::beginAll() const +{ + return m_nameToCanonicalName.begin(); +} + +CConfig::all_const_iterator +CConfig::endAll() const +{ + return m_nameToCanonicalName.end(); +} + bool CConfig::isScreen(const CString& name) const { @@ -295,6 +359,54 @@ CConfig::getHTTPAddress() const return m_httpAddress; } +bool +CConfig::operator==(const CConfig& x) const +{ +/* FIXME -- no compare available for CNetworkAddress + if (m_synergyAddress != x.m_synergyAddress) { + return false; + } + if (m_httpAddress != x.m_httpAddress) { + return false; + } +*/ + if (m_map.size() != x.m_map.size()) { + return false; + } + if (m_nameToCanonicalName.size() != x.m_nameToCanonicalName.size()) { + return false; + } + + for (CCellMap::const_iterator index1 = m_map.begin(), + index2 = x.m_map.begin(); + index1 != m_map.end(); ++index1, ++index2) { + for (UInt32 i = 0; i <= kLastDirection - kFirstDirection; ++i) { + if (!CStringUtil::CaselessCmp::equal(index1->second.m_neighbor[i], + index2->second.m_neighbor[i])) { + return false; + } + } + } + + for (CNameMap::const_iterator index1 = m_nameToCanonicalName.begin(), + index2 = x.m_nameToCanonicalName.begin(); + index1 != m_nameToCanonicalName.end(); + ++index1, ++index2) { + if (!CStringUtil::CaselessCmp::equal(index1->first, index2->first) || + !CStringUtil::CaselessCmp::equal(index1->second, index2->second)) { + return false; + } + } + + return true; +} + +bool +CConfig::operator!=(const CConfig& x) const +{ + return !operator==(x); +} + const char* CConfig::dirName(EDirection dir) { @@ -663,7 +775,9 @@ operator<<(std::ostream& s, const CConfig& config) // aliases section (if there are any) if (config.m_map.size() != config.m_nameToCanonicalName.size()) { // map canonical to alias - CConfig::CNameMap aliases; + typedef std::multimap CMNameMap; + CMNameMap aliases; for (CConfig::CNameMap::const_iterator index = config.m_nameToCanonicalName.begin(); index != config.m_nameToCanonicalName.end(); @@ -676,11 +790,11 @@ operator<<(std::ostream& s, const CConfig& config) // dump it CString screen; s << "section: aliases" << std::endl; - for (CConfig::CNameMap::const_iterator index = aliases.begin(); + for (CMNameMap::const_iterator index = aliases.begin(); index != aliases.end(); ++index) { if (index->first != screen) { screen = index->first; - s << "\t" << screen.c_str() << std::endl; + s << "\t" << screen.c_str() << ":" << std::endl; } s << "\t\t" << index->second.c_str() << std::endl; } diff --git a/lib/server/CConfig.h b/lib/server/CConfig.h index 3fe3cf88..c028ebf5 100644 --- a/lib/server/CConfig.h +++ b/lib/server/CConfig.h @@ -51,9 +51,11 @@ private: CString m_neighbor[kLastDirection - kFirstDirection + 1]; }; typedef std::map CCellMap; + typedef std::map CNameMap; public: typedef CCellMap::const_iterator internal_const_iterator; + typedef CNameMap::const_iterator all_const_iterator; class const_iterator : std::iterator_traits { public: explicit const_iterator() : m_i() { } @@ -93,6 +95,14 @@ public: */ bool addScreen(const CString& name); + //! Rename screen + /*! + Renames a screen. All references to the name are updated. + Returns true iff successful. + */ + bool renameScreen(const CString& oldName, + const CString& newName); + //! Remove screen /*! Removes a screen. This also removes aliases for the screen and @@ -180,6 +190,11 @@ public: //! Get ending (canonical) screen name iterator const_iterator end() const; + //! Get beginning screen name iterator + all_const_iterator beginAll() const; + //! Get ending screen name iterator + all_const_iterator endAll() const; + //! Test for screen name /*! Returns true iff \c name names a screen. @@ -212,6 +227,11 @@ public: //! Get the HTTP server address const CNetworkAddress& getHTTPAddress() const; + //! Compare configurations + bool operator==(const CConfig&) const; + //! Compare configurations + bool operator!=(const CConfig&) const; + //! Read configuration /*! Reads a configuration from a stream. Throws XConfigRead on error. @@ -241,8 +261,6 @@ private: void readSectionAliases(std::istream&); private: - typedef std::map CNameMap; - CCellMap m_map; CNameMap m_nameToCanonicalName; CNetworkAddress m_synergyAddress; diff --git a/lib/server/server.dsp b/lib/server/server.dsp index fb28378e..8d5f98df 100644 --- a/lib/server/server.dsp +++ b/lib/server/server.dsp @@ -1,166 +1,166 @@ -# Microsoft Developer Studio Project File - Name="server" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=server - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "server.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "server.mak" CFG="server - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "server - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "server - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "server - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\mt" /I "..\io" /I "..\http" /I "..\net" /I "..\synergy" /I "..\platform" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "server - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\mt" /I "..\io" /I "..\http" /I "..\net" /I "..\synergy" /I "..\platform" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "server - Win32 Release" -# Name "server - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CClientProxy.cpp -# End Source File -# Begin Source File - -SOURCE=.\CClientProxy1_0.cpp -# End Source File -# Begin Source File - -SOURCE=.\CConfig.cpp -# End Source File -# Begin Source File - -SOURCE=.\CHTTPServer.cpp -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsPrimaryScreen.cpp -# End Source File -# Begin Source File - -SOURCE=.\CPrimaryClient.cpp -# End Source File -# Begin Source File - -SOURCE=.\CPrimaryScreen.cpp -# End Source File -# Begin Source File - -SOURCE=.\CServer.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CClientProxy.h -# End Source File -# Begin Source File - -SOURCE=.\CClientProxy1_0.h -# End Source File -# Begin Source File - -SOURCE=.\CConfig.h -# End Source File -# Begin Source File - -SOURCE=.\CHTTPServer.h -# End Source File -# Begin Source File - -SOURCE=.\CMSWindowsPrimaryScreen.h -# End Source File -# Begin Source File - -SOURCE=.\CPrimaryClient.h -# End Source File -# Begin Source File - -SOURCE=.\CPrimaryScreen.h -# End Source File -# Begin Source File - -SOURCE=.\CServer.h -# End Source File -# Begin Source File - -SOURCE=.\IPrimaryScreenFactory.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="server" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=server - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "server.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "server.mak" CFG="server - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "server - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "server - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "server - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\mt" /I "..\io" /I "..\http" /I "..\net" /I "..\synergy" /I "..\platform" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "server - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\mt" /I "..\io" /I "..\http" /I "..\net" /I "..\synergy" /I "..\platform" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "server - Win32 Release" +# Name "server - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CClientProxy.cpp +# End Source File +# Begin Source File + +SOURCE=.\CClientProxy1_0.cpp +# End Source File +# Begin Source File + +SOURCE=.\CConfig.cpp +# End Source File +# Begin Source File + +SOURCE=.\CHTTPServer.cpp +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsPrimaryScreen.cpp +# End Source File +# Begin Source File + +SOURCE=.\CPrimaryClient.cpp +# End Source File +# Begin Source File + +SOURCE=.\CPrimaryScreen.cpp +# End Source File +# Begin Source File + +SOURCE=.\CServer.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CClientProxy.h +# End Source File +# Begin Source File + +SOURCE=.\CClientProxy1_0.h +# End Source File +# Begin Source File + +SOURCE=.\CConfig.h +# End Source File +# Begin Source File + +SOURCE=.\CHTTPServer.h +# End Source File +# Begin Source File + +SOURCE=.\CMSWindowsPrimaryScreen.h +# End Source File +# Begin Source File + +SOURCE=.\CPrimaryClient.h +# End Source File +# Begin Source File + +SOURCE=.\CPrimaryScreen.h +# End Source File +# Begin Source File + +SOURCE=.\CServer.h +# End Source File +# Begin Source File + +SOURCE=.\IPrimaryScreenFactory.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/lib/synergy/libsynergy.dsp b/lib/synergy/libsynergy.dsp index 79a88cc4..9a71482f 100644 --- a/lib/synergy/libsynergy.dsp +++ b/lib/synergy/libsynergy.dsp @@ -1,194 +1,194 @@ -# Microsoft Developer Studio Project File - Name="libsynergy" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=synergy - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libsynergy.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libsynergy.mak" CFG="libsynergy - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libsynergy - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libsynergy - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libsynergy - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libsynergy - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "libsynergy - Win32 Release" -# Name "libsynergy - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\CClipboard.cpp -# End Source File -# Begin Source File - -SOURCE=.\CInputPacketStream.cpp -# End Source File -# Begin Source File - -SOURCE=.\COutputPacketStream.cpp -# End Source File -# Begin Source File - -SOURCE=.\CProtocolUtil.cpp -# End Source File -# Begin Source File - -SOURCE=.\XScreen.cpp -# End Source File -# Begin Source File - -SOURCE=.\XSynergy.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\CClipboard.h -# End Source File -# Begin Source File - -SOURCE=.\CInputPacketStream.h -# End Source File -# Begin Source File - -SOURCE=.\ClipboardTypes.h -# End Source File -# Begin Source File - -SOURCE=.\COutputPacketStream.h -# End Source File -# Begin Source File - -SOURCE=.\CProtocolUtil.h -# End Source File -# Begin Source File - -SOURCE=.\IClient.h -# End Source File -# Begin Source File - -SOURCE=.\IClipboard.h -# End Source File -# Begin Source File - -SOURCE=.\IPrimaryScreenReceiver.h -# End Source File -# Begin Source File - -SOURCE=.\IScreen.h -# End Source File -# Begin Source File - -SOURCE=.\IScreenEventHandler.h -# End Source File -# Begin Source File - -SOURCE=.\IScreenReceiver.h -# End Source File -# Begin Source File - -SOURCE=.\IScreenSaver.h -# End Source File -# Begin Source File - -SOURCE=.\IServer.h -# End Source File -# Begin Source File - -SOURCE=.\KeyTypes.h -# End Source File -# Begin Source File - -SOURCE=.\MouseTypes.h -# End Source File -# Begin Source File - -SOURCE=.\ProtocolTypes.h -# End Source File -# Begin Source File - -SOURCE=.\XScreen.h -# End Source File -# Begin Source File - -SOURCE=.\XSynergy.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="libsynergy" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=synergy - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libsynergy.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libsynergy.mak" CFG="libsynergy - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libsynergy - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libsynergy - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libsynergy - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libsynergy - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "..\base" /I "..\io" /I "..\mt" /I "..\net" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libsynergy - Win32 Release" +# Name "libsynergy - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\CClipboard.cpp +# End Source File +# Begin Source File + +SOURCE=.\CInputPacketStream.cpp +# End Source File +# Begin Source File + +SOURCE=.\COutputPacketStream.cpp +# End Source File +# Begin Source File + +SOURCE=.\CProtocolUtil.cpp +# End Source File +# Begin Source File + +SOURCE=.\XScreen.cpp +# End Source File +# Begin Source File + +SOURCE=.\XSynergy.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\CClipboard.h +# End Source File +# Begin Source File + +SOURCE=.\CInputPacketStream.h +# End Source File +# Begin Source File + +SOURCE=.\ClipboardTypes.h +# End Source File +# Begin Source File + +SOURCE=.\COutputPacketStream.h +# End Source File +# Begin Source File + +SOURCE=.\CProtocolUtil.h +# End Source File +# Begin Source File + +SOURCE=.\IClient.h +# End Source File +# Begin Source File + +SOURCE=.\IClipboard.h +# End Source File +# Begin Source File + +SOURCE=.\IPrimaryScreenReceiver.h +# End Source File +# Begin Source File + +SOURCE=.\IScreen.h +# End Source File +# Begin Source File + +SOURCE=.\IScreenEventHandler.h +# End Source File +# Begin Source File + +SOURCE=.\IScreenReceiver.h +# End Source File +# Begin Source File + +SOURCE=.\IScreenSaver.h +# End Source File +# Begin Source File + +SOURCE=.\IServer.h +# End Source File +# Begin Source File + +SOURCE=.\KeyTypes.h +# End Source File +# Begin Source File + +SOURCE=.\MouseTypes.h +# End Source File +# Begin Source File + +SOURCE=.\ProtocolTypes.h +# End Source File +# Begin Source File + +SOURCE=.\XScreen.h +# End Source File +# Begin Source File + +SOURCE=.\XSynergy.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/synergy.dsw b/synergy.dsw index efbf7453..b5b1ab12 100644 --- a/synergy.dsw +++ b/synergy.dsw @@ -1,242 +1,278 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "all"=.\all.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name synergy - End Project Dependency - Begin Project Dependency - Project_Dep_Name synergyd - End Project Dependency -}}} - -############################################################################### - -Project: "base"=.\lib\base\base.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "client"=.\lib\client\client.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "http"=.\lib\HTTP\http.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "io"=.\lib\io\io.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "makehook"=.\lib\platform\makehook.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name synrgyhk - End Project Dependency -}}} - -############################################################################### - -Project: "mt"=.\lib\mt\mt.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "net"=.\lib\net\net.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "platform"=.\lib\platform\platform.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "server"=.\lib\server\server.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "synergy"=.\cmd\synergy\synergy.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name base - End Project Dependency - Begin Project Dependency - Project_Dep_Name io - End Project Dependency - Begin Project Dependency - Project_Dep_Name mt - End Project Dependency - Begin Project Dependency - Project_Dep_Name net - End Project Dependency - Begin Project Dependency - Project_Dep_Name libsynergy - End Project Dependency - Begin Project Dependency - Project_Dep_Name platform - End Project Dependency - Begin Project Dependency - Project_Dep_Name client - End Project Dependency -}}} - -############################################################################### - -Project: "synergyd"=.\cmd\synergyd\synergyd.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name base - End Project Dependency - Begin Project Dependency - Project_Dep_Name http - End Project Dependency - Begin Project Dependency - Project_Dep_Name io - End Project Dependency - Begin Project Dependency - Project_Dep_Name mt - End Project Dependency - Begin Project Dependency - Project_Dep_Name net - End Project Dependency - Begin Project Dependency - Project_Dep_Name libsynergy - End Project Dependency - Begin Project Dependency - Project_Dep_Name platform - End Project Dependency - Begin Project Dependency - Project_Dep_Name makehook - End Project Dependency - Begin Project Dependency - Project_Dep_Name server - End Project Dependency -}}} - -############################################################################### - -Project: "libsynergy"=.\lib\synergy\libsynergy.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "synrgyhk"=.\lib\platform\synrgyhk.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "all"=.\all.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name synergy + End Project Dependency + Begin Project Dependency + Project_Dep_Name synergyd + End Project Dependency + Begin Project Dependency + Project_Dep_Name launcher + End Project Dependency +}}} + +############################################################################### + +Project: "base"=.\lib\base\base.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "client"=.\lib\client\client.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "http"=.\lib\HTTP\http.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "io"=.\lib\io\io.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "launcher"=.\cmd\launcher\launcher.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name base + End Project Dependency + Begin Project Dependency + Project_Dep_Name http + End Project Dependency + Begin Project Dependency + Project_Dep_Name io + End Project Dependency + Begin Project Dependency + Project_Dep_Name mt + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency + Begin Project Dependency + Project_Dep_Name platform + End Project Dependency + Begin Project Dependency + Project_Dep_Name server + End Project Dependency +}}} + +############################################################################### + +Project: "libsynergy"=.\lib\synergy\libsynergy.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "makehook"=.\lib\platform\makehook.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name synrgyhk + End Project Dependency +}}} + +############################################################################### + +Project: "mt"=.\lib\mt\mt.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "net"=.\lib\net\net.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "platform"=.\lib\platform\platform.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "server"=.\lib\server\server.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "synergy"=.\cmd\synergy\synergy.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name base + End Project Dependency + Begin Project Dependency + Project_Dep_Name io + End Project Dependency + Begin Project Dependency + Project_Dep_Name mt + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency + Begin Project Dependency + Project_Dep_Name libsynergy + End Project Dependency + Begin Project Dependency + Project_Dep_Name platform + End Project Dependency + Begin Project Dependency + Project_Dep_Name client + End Project Dependency +}}} + +############################################################################### + +Project: "synergyd"=.\cmd\synergyd\synergyd.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name base + End Project Dependency + Begin Project Dependency + Project_Dep_Name http + End Project Dependency + Begin Project Dependency + Project_Dep_Name io + End Project Dependency + Begin Project Dependency + Project_Dep_Name mt + End Project Dependency + Begin Project Dependency + Project_Dep_Name net + End Project Dependency + Begin Project Dependency + Project_Dep_Name libsynergy + End Project Dependency + Begin Project Dependency + Project_Dep_Name platform + End Project Dependency + Begin Project Dependency + Project_Dep_Name makehook + End Project Dependency + Begin Project Dependency + Project_Dep_Name server + End Project Dependency +}}} + +############################################################################### + +Project: "synrgyhk"=.\lib\platform\synrgyhk.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### +