Restored lost files and changes in version 1.3.1 to depot.
427
cmd/launcher/CAddScreen.cpp
Normal file
@@ -0,0 +1,427 @@
|
||||
/*
|
||||
* 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 "KeyTypes.h"
|
||||
#include "OptionTypes.h"
|
||||
#include "ProtocolTypes.h"
|
||||
#include "CStringUtil.h"
|
||||
#include "CArch.h"
|
||||
#include "CAddScreen.h"
|
||||
#include "LaunchUtil.h"
|
||||
#include "resource.h"
|
||||
|
||||
struct CModifierInfo {
|
||||
public:
|
||||
int m_ctrlID;
|
||||
const char* m_name;
|
||||
KeyModifierID m_modifierID;
|
||||
OptionID m_optionID;
|
||||
};
|
||||
|
||||
static const CModifierInfo s_modifiers[] = {
|
||||
{ IDC_ADD_MOD_SHIFT, "Shift",
|
||||
kKeyModifierIDShift, kOptionModifierMapForShift },
|
||||
{ IDC_ADD_MOD_CTRL, "Ctrl",
|
||||
kKeyModifierIDControl, kOptionModifierMapForControl },
|
||||
{ IDC_ADD_MOD_ALT, "Alt",
|
||||
kKeyModifierIDAlt, kOptionModifierMapForAlt },
|
||||
{ IDC_ADD_MOD_META, "Meta",
|
||||
kKeyModifierIDMeta, kOptionModifierMapForMeta },
|
||||
{ IDC_ADD_MOD_SUPER, "Super",
|
||||
kKeyModifierIDSuper, kOptionModifierMapForSuper }
|
||||
};
|
||||
|
||||
static const KeyModifierID baseModifier = kKeyModifierIDShift;
|
||||
|
||||
//
|
||||
// CAddScreen
|
||||
//
|
||||
|
||||
CAddScreen* CAddScreen::s_singleton = NULL;
|
||||
|
||||
CAddScreen::CAddScreen(HWND parent, CConfig* config, const CString& name) :
|
||||
m_parent(parent),
|
||||
m_config(config),
|
||||
m_name(name)
|
||||
{
|
||||
assert(s_singleton == NULL);
|
||||
s_singleton = this;
|
||||
}
|
||||
|
||||
CAddScreen::~CAddScreen()
|
||||
{
|
||||
s_singleton = NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
CAddScreen::doModal()
|
||||
{
|
||||
// do dialog
|
||||
return (DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_ADD),
|
||||
m_parent, dlgProc, (LPARAM)this) != 0);
|
||||
}
|
||||
|
||||
CString
|
||||
CAddScreen::getName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
void
|
||||
CAddScreen::init(HWND hwnd)
|
||||
{
|
||||
// set title
|
||||
CString title;
|
||||
if (m_name.empty()) {
|
||||
title = getString(IDS_ADD_SCREEN);
|
||||
}
|
||||
else {
|
||||
title = CStringUtil::format(
|
||||
getString(IDS_EDIT_SCREEN).c_str(),
|
||||
m_name.c_str());
|
||||
}
|
||||
SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)title.c_str());
|
||||
|
||||
// fill in screen name
|
||||
HWND child = getItem(hwnd, IDC_ADD_SCREEN_NAME_EDIT);
|
||||
SendMessage(child, WM_SETTEXT, 0, (LPARAM)m_name.c_str());
|
||||
|
||||
// fill in aliases
|
||||
CString aliases;
|
||||
for (CConfig::all_const_iterator index = m_config->beginAll();
|
||||
index != m_config->endAll(); ++index) {
|
||||
if (CStringUtil::CaselessCmp::equal(index->second, m_name) &&
|
||||
!CStringUtil::CaselessCmp::equal(index->second, index->first)) {
|
||||
if (!aliases.empty()) {
|
||||
aliases += "\r\n";
|
||||
}
|
||||
aliases += index->first;
|
||||
}
|
||||
}
|
||||
child = getItem(hwnd, IDC_ADD_ALIASES_EDIT);
|
||||
SendMessage(child, WM_SETTEXT, 0, (LPARAM)aliases.c_str());
|
||||
|
||||
// set options
|
||||
CConfig::CScreenOptions options;
|
||||
getOptions(options);
|
||||
CConfig::CScreenOptions::const_iterator index;
|
||||
child = getItem(hwnd, IDC_ADD_HD_CAPS_CHECK);
|
||||
index = options.find(kOptionHalfDuplexCapsLock);
|
||||
setItemChecked(child, (index != options.end() && index->second != 0));
|
||||
child = getItem(hwnd, IDC_ADD_HD_NUM_CHECK);
|
||||
index = options.find(kOptionHalfDuplexNumLock);
|
||||
setItemChecked(child, (index != options.end() && index->second != 0));
|
||||
child = getItem(hwnd, IDC_ADD_HD_SCROLL_CHECK);
|
||||
index = options.find(kOptionHalfDuplexScrollLock);
|
||||
setItemChecked(child, (index != options.end() && index->second != 0));
|
||||
|
||||
// modifier options
|
||||
for (UInt32 i = 0; i < sizeof(s_modifiers) /
|
||||
sizeof(s_modifiers[0]); ++i) {
|
||||
child = getItem(hwnd, s_modifiers[i].m_ctrlID);
|
||||
|
||||
// fill in options
|
||||
for (UInt32 j = 0; j < sizeof(s_modifiers) /
|
||||
sizeof(s_modifiers[0]); ++j) {
|
||||
SendMessage(child, CB_ADDSTRING, 0,
|
||||
(LPARAM)s_modifiers[j].m_name);
|
||||
}
|
||||
|
||||
// choose current value
|
||||
index = options.find(s_modifiers[i].m_optionID);
|
||||
KeyModifierID id = s_modifiers[i].m_modifierID;
|
||||
if (index != options.end()) {
|
||||
id = index->second;
|
||||
}
|
||||
SendMessage(child, CB_SETCURSEL, id - baseModifier, 0);
|
||||
}
|
||||
|
||||
// dead corners
|
||||
UInt32 corners = 0;
|
||||
index = options.find(kOptionScreenSwitchCorners);
|
||||
if (index != options.end()) {
|
||||
corners = index->second;
|
||||
}
|
||||
child = getItem(hwnd, IDC_ADD_DC_TOP_LEFT);
|
||||
setItemChecked(child, (corners & kTopLeftMask) != 0);
|
||||
child = getItem(hwnd, IDC_ADD_DC_TOP_RIGHT);
|
||||
setItemChecked(child, (corners & kTopRightMask) != 0);
|
||||
child = getItem(hwnd, IDC_ADD_DC_BOTTOM_LEFT);
|
||||
setItemChecked(child, (corners & kBottomLeftMask) != 0);
|
||||
child = getItem(hwnd, IDC_ADD_DC_BOTTOM_RIGHT);
|
||||
setItemChecked(child, (corners & kBottomRightMask) != 0);
|
||||
index = options.find(kOptionScreenSwitchCornerSize);
|
||||
SInt32 size = 0;
|
||||
if (index != options.end()) {
|
||||
size = index->second;
|
||||
}
|
||||
char buffer[20];
|
||||
sprintf(buffer, "%d", size);
|
||||
child = getItem(hwnd, IDC_ADD_DC_SIZE);
|
||||
SendMessage(child, WM_SETTEXT, 0, (LPARAM)buffer);
|
||||
}
|
||||
|
||||
bool
|
||||
CAddScreen::save(HWND hwnd)
|
||||
{
|
||||
// get the old aliases and options
|
||||
CStringList oldAliases;
|
||||
getAliases(oldAliases);
|
||||
CConfig::CScreenOptions options;
|
||||
getOptions(options);
|
||||
|
||||
// extract name and aliases
|
||||
CString newName;
|
||||
HWND child = getItem(hwnd, IDC_ADD_SCREEN_NAME_EDIT);
|
||||
newName = getWindowText(child);
|
||||
CStringList newAliases;
|
||||
child = getItem(hwnd, IDC_ADD_ALIASES_EDIT);
|
||||
tokenize(newAliases, getWindowText(child));
|
||||
|
||||
// name must be valid
|
||||
if (!m_config->isValidScreenName(newName)) {
|
||||
showError(hwnd, CStringUtil::format(
|
||||
getString(IDS_INVALID_SCREEN_NAME).c_str(),
|
||||
newName.c_str()));
|
||||
return false;
|
||||
}
|
||||
|
||||
// aliases must be valid
|
||||
for (CStringList::const_iterator index = newAliases.begin();
|
||||
index != newAliases.end(); ++index) {
|
||||
if (!m_config->isValidScreenName(*index)) {
|
||||
showError(hwnd, CStringUtil::format(
|
||||
getString(IDS_INVALID_SCREEN_NAME).c_str(),
|
||||
index->c_str()));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 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 false;
|
||||
}
|
||||
|
||||
// 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 (m_config->isScreen(newName) &&
|
||||
!CStringUtil::CaselessCmp::equal(newName, m_name) &&
|
||||
!isNameInList(oldAliases, newName)) {
|
||||
showError(hwnd, CStringUtil::format(
|
||||
getString(IDS_DUPLICATE_SCREEN_NAME).c_str(),
|
||||
newName.c_str()));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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 (m_config->isScreen(*index) &&
|
||||
!CStringUtil::CaselessCmp::equal(*index, m_name) &&
|
||||
!isNameInList(oldAliases, *index)) {
|
||||
showError(hwnd, CStringUtil::format(
|
||||
getString(IDS_DUPLICATE_SCREEN_NAME).c_str(),
|
||||
index->c_str()));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// dead corner size must be non-negative
|
||||
child = getItem(hwnd, IDC_ADD_DC_SIZE);
|
||||
CString valueString = getWindowText(child);
|
||||
int cornerSize = atoi(valueString.c_str());
|
||||
if (cornerSize < 0) {
|
||||
showError(hwnd, CStringUtil::format(
|
||||
getString(IDS_INVALID_CORNER_SIZE).c_str(),
|
||||
valueString.c_str()));
|
||||
SetFocus(child);
|
||||
return false;
|
||||
}
|
||||
|
||||
// collect options
|
||||
child = getItem(hwnd, IDC_ADD_HD_CAPS_CHECK);
|
||||
if (isItemChecked(child)) {
|
||||
options[kOptionHalfDuplexCapsLock] = 1;
|
||||
}
|
||||
else {
|
||||
options.erase(kOptionHalfDuplexCapsLock);
|
||||
}
|
||||
child = getItem(hwnd, IDC_ADD_HD_NUM_CHECK);
|
||||
if (isItemChecked(child)) {
|
||||
options[kOptionHalfDuplexNumLock] = 1;
|
||||
}
|
||||
else {
|
||||
options.erase(kOptionHalfDuplexNumLock);
|
||||
}
|
||||
child = getItem(hwnd, IDC_ADD_HD_SCROLL_CHECK);
|
||||
if (isItemChecked(child)) {
|
||||
options[kOptionHalfDuplexScrollLock] = 1;
|
||||
}
|
||||
else {
|
||||
options.erase(kOptionHalfDuplexScrollLock);
|
||||
}
|
||||
|
||||
// save modifier options
|
||||
for (UInt32 i = 0; i < sizeof(s_modifiers) /
|
||||
sizeof(s_modifiers[0]); ++i) {
|
||||
child = getItem(hwnd, s_modifiers[i].m_ctrlID);
|
||||
KeyModifierID id = static_cast<KeyModifierID>(
|
||||
SendMessage(child, CB_GETCURSEL, 0, 0) +
|
||||
baseModifier);
|
||||
if (id != s_modifiers[i].m_modifierID) {
|
||||
options[s_modifiers[i].m_optionID] = id;
|
||||
}
|
||||
else {
|
||||
options.erase(s_modifiers[i].m_optionID);
|
||||
}
|
||||
}
|
||||
|
||||
// save dead corner options
|
||||
UInt32 corners = 0;
|
||||
if (isItemChecked(getItem(hwnd, IDC_ADD_DC_TOP_LEFT))) {
|
||||
corners |= kTopLeftMask;
|
||||
}
|
||||
if (isItemChecked(getItem(hwnd, IDC_ADD_DC_TOP_RIGHT))) {
|
||||
corners |= kTopRightMask;
|
||||
}
|
||||
if (isItemChecked(getItem(hwnd, IDC_ADD_DC_BOTTOM_LEFT))) {
|
||||
corners |= kBottomLeftMask;
|
||||
}
|
||||
if (isItemChecked(getItem(hwnd, IDC_ADD_DC_BOTTOM_RIGHT))) {
|
||||
corners |= kBottomRightMask;
|
||||
}
|
||||
options[kOptionScreenSwitchCorners] = corners;
|
||||
options[kOptionScreenSwitchCornerSize] = cornerSize;
|
||||
|
||||
// save new data to config
|
||||
if (m_name.empty()) {
|
||||
// added screen
|
||||
m_config->addScreen(newName);
|
||||
}
|
||||
else {
|
||||
// edited screen
|
||||
m_config->removeAliases(m_name);
|
||||
m_config->removeOptions(m_name);
|
||||
m_config->renameScreen(m_name, newName);
|
||||
}
|
||||
m_name = newName;
|
||||
for (CStringList::const_iterator index = newAliases.begin();
|
||||
index != newAliases.end(); ++index) {
|
||||
m_config->addAlias(m_name, *index);
|
||||
}
|
||||
for (CConfig::CScreenOptions::const_iterator
|
||||
index = options.begin();
|
||||
index != options.end(); ++index) {
|
||||
m_config->addOption(m_name, index->first, index->second);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL
|
||||
CAddScreen::doDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
init(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
if (save(hwnd)) {
|
||||
EndDialog(hwnd, 1);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hwnd, 0);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
CAddScreen::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return s_singleton->doDlgProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
void
|
||||
CAddScreen::getAliases(CStringList& aliases) const
|
||||
{
|
||||
for (CConfig::all_const_iterator index = m_config->beginAll();
|
||||
index != m_config->endAll(); ++index) {
|
||||
if (CStringUtil::CaselessCmp::equal(index->second, m_name) &&
|
||||
!CStringUtil::CaselessCmp::equal(index->second, index->first)) {
|
||||
aliases.push_back(index->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CAddScreen::getOptions(CConfig::CScreenOptions& optionsOut) const
|
||||
{
|
||||
const CConfig::CScreenOptions* options = m_config->getOptions(m_name);
|
||||
if (options == NULL) {
|
||||
optionsOut = CConfig::CScreenOptions();
|
||||
}
|
||||
else {
|
||||
optionsOut = *options;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CAddScreen::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);
|
||||
}
|
||||
|
||||
bool
|
||||
CAddScreen::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;
|
||||
}
|
||||
74
cmd/launcher/CAddScreen.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* synergy -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2003 Chris Schoeneman
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file 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.
|
||||
*/
|
||||
|
||||
#ifndef CADDSCREEN_H
|
||||
#define CADDSCREEN_H
|
||||
|
||||
#include "CString.h"
|
||||
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
class CConfig;
|
||||
|
||||
//! Add screen dialog for Microsoft Windows launcher
|
||||
class CAddScreen {
|
||||
public:
|
||||
CAddScreen(HWND parent, CConfig*, const CString& name);
|
||||
~CAddScreen();
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
//! Run dialog
|
||||
/*!
|
||||
Display and handle the dialog until closed by the user. Return
|
||||
\c true if the user accepted the changes, false otherwise.
|
||||
*/
|
||||
bool doModal();
|
||||
|
||||
//@}
|
||||
//! @name accessors
|
||||
//@{
|
||||
|
||||
CString getName() const;
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
typedef std::vector<CString> CStringList;
|
||||
|
||||
void getAliases(CStringList&) const;
|
||||
void getOptions(CConfig::CScreenOptions&) const;
|
||||
|
||||
static void tokenize(CStringList& tokens, const CString& src);
|
||||
static bool isNameInList(const CStringList& tokens,
|
||||
const CString& src);
|
||||
|
||||
void init(HWND hwnd);
|
||||
bool save(HWND hwnd);
|
||||
|
||||
// message handling
|
||||
BOOL doDlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
static BOOL CALLBACK dlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
private:
|
||||
static CAddScreen* s_singleton;
|
||||
|
||||
HWND m_parent;
|
||||
CConfig* m_config;
|
||||
CString m_name;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -206,7 +206,7 @@ CAdvancedOptions::save(HWND hwnd)
|
||||
m_interface = iface;
|
||||
|
||||
// save values to registry
|
||||
HKEY key = CArchMiscWindows::openKey(HKEY_CURRENT_USER, getSettingsPath());
|
||||
HKEY key = CArchMiscWindows::addKey(HKEY_CURRENT_USER, getSettingsPath());
|
||||
if (key != NULL) {
|
||||
CArchMiscWindows::setValue(key, "port", m_port);
|
||||
CArchMiscWindows::setValue(key, "name", m_screenName);
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
#include "LaunchUtil.h"
|
||||
#include "resource.h"
|
||||
|
||||
#define CLIENT_DAEMON_NAME "Synergy Client"
|
||||
#define SERVER_DAEMON_NAME "Synergy Server"
|
||||
#define CLIENT_DAEMON_INFO "Shares this system's mouse and keyboard with others."
|
||||
#define SERVER_DAEMON_INFO "Shares this system's mouse and keyboard with others."
|
||||
static const char* CLIENT_DAEMON_NAME = "Synergy Client";
|
||||
static const char* SERVER_DAEMON_NAME = "Synergy Server";
|
||||
static const char* CLIENT_DAEMON_INFO = "Uses a shared mouse and keyboard.";
|
||||
static const char* SERVER_DAEMON_INFO = "Shares this system's mouse and keyboard with others.";
|
||||
|
||||
//
|
||||
// CAutoStartOutputter
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
// ILogOutputter overrides
|
||||
virtual void open(const char*) { }
|
||||
virtual void close() { }
|
||||
virtual void show(bool) { }
|
||||
virtual bool write(ELevel level, const char* message);
|
||||
virtual const char* getNewline() const { return ""; }
|
||||
|
||||
@@ -63,14 +64,11 @@ CAutoStartOutputter::write(ELevel level, const char* message)
|
||||
|
||||
CAutoStart* CAutoStart::s_singleton = NULL;
|
||||
|
||||
CAutoStart::CAutoStart(HWND parent, CConfig* config, const CString& cmdLine) :
|
||||
CAutoStart::CAutoStart(HWND parent, bool isServer, const CString& cmdLine) :
|
||||
m_parent(parent),
|
||||
m_config(config),
|
||||
m_isServer(config != NULL),
|
||||
m_isServer(isServer),
|
||||
m_cmdLine(cmdLine),
|
||||
m_name((config != NULL) ? SERVER_DAEMON_NAME : CLIENT_DAEMON_NAME),
|
||||
m_userConfigSaved(false)
|
||||
|
||||
m_name(isServer ? SERVER_DAEMON_NAME : CLIENT_DAEMON_NAME)
|
||||
{
|
||||
assert(s_singleton == NULL);
|
||||
s_singleton = this;
|
||||
@@ -87,9 +85,6 @@ CAutoStart::doModal()
|
||||
// install our log outputter
|
||||
CLOG->insert(new CAutoStartOutputter(&m_errorMessage));
|
||||
|
||||
// reset saved flag
|
||||
m_userConfigSaved = false;
|
||||
|
||||
// do dialog
|
||||
DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_AUTOSTART),
|
||||
m_parent, dlgProc, (LPARAM)this);
|
||||
@@ -98,10 +93,98 @@ CAutoStart::doModal()
|
||||
CLOG->pop_front();
|
||||
}
|
||||
|
||||
bool
|
||||
CAutoStart::wasUserConfigSaved() const
|
||||
void
|
||||
CAutoStart::reinstallDaemon(bool isClient, const CString& cmdLine)
|
||||
{
|
||||
return m_userConfigSaved;
|
||||
// get installation state
|
||||
const char* name = (isClient ? CLIENT_DAEMON_NAME : SERVER_DAEMON_NAME);
|
||||
bool installedSystem = ARCH->isDaemonInstalled(name, true);
|
||||
bool installedUser = ARCH->isDaemonInstalled(name, false);
|
||||
|
||||
// reinstall if anything is installed
|
||||
if (installedSystem || installedUser) {
|
||||
ARCH->installDaemon(name,
|
||||
isClient ? CLIENT_DAEMON_INFO : SERVER_DAEMON_INFO,
|
||||
getAppPath(isClient ? CLIENT_APP : SERVER_APP).c_str(),
|
||||
cmdLine.c_str(),
|
||||
NULL,
|
||||
installedSystem);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CAutoStart::uninstallDaemons(bool client)
|
||||
{
|
||||
if (client) {
|
||||
try {
|
||||
ARCH->uninstallDaemon(CLIENT_DAEMON_NAME, true);
|
||||
}
|
||||
catch (...) {
|
||||
}
|
||||
try {
|
||||
ARCH->uninstallDaemon(CLIENT_DAEMON_NAME, false);
|
||||
}
|
||||
catch (...) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
ARCH->uninstallDaemon(SERVER_DAEMON_NAME, true);
|
||||
}
|
||||
catch (...) {
|
||||
}
|
||||
try {
|
||||
ARCH->uninstallDaemon(SERVER_DAEMON_NAME, false);
|
||||
}
|
||||
catch (...) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CAutoStart::startDaemon()
|
||||
{
|
||||
const char* name = NULL;
|
||||
if (ARCH->isDaemonInstalled(CLIENT_DAEMON_NAME, true)) {
|
||||
name = CLIENT_DAEMON_NAME;
|
||||
}
|
||||
else if (ARCH->isDaemonInstalled(SERVER_DAEMON_NAME, true)) {
|
||||
name = SERVER_DAEMON_NAME;
|
||||
}
|
||||
if (name == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// open service manager
|
||||
SC_HANDLE mgr = OpenSCManager(NULL, NULL, GENERIC_READ);
|
||||
if (mgr == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// open the service
|
||||
SC_HANDLE service = OpenService(mgr, name, SERVICE_START);
|
||||
if (service == NULL) {
|
||||
CloseServiceHandle(mgr);
|
||||
return false;
|
||||
}
|
||||
|
||||
// start the service
|
||||
BOOL okay = StartService(service, 0, NULL);
|
||||
|
||||
// clean up
|
||||
CloseServiceHandle(service);
|
||||
CloseServiceHandle(mgr);
|
||||
|
||||
return (okay != 0);
|
||||
}
|
||||
|
||||
bool
|
||||
CAutoStart::isDaemonInstalled()
|
||||
{
|
||||
return (ARCH->isDaemonInstalled(CLIENT_DAEMON_NAME, false) ||
|
||||
ARCH->isDaemonInstalled(CLIENT_DAEMON_NAME, true) ||
|
||||
ARCH->isDaemonInstalled(SERVER_DAEMON_NAME, false) ||
|
||||
ARCH->isDaemonInstalled(SERVER_DAEMON_NAME, true));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -177,22 +260,6 @@ CAutoStart::onInstall(bool allUsers)
|
||||
return onUninstall(allUsers);
|
||||
}
|
||||
|
||||
// try saving configuration. if we can't then don't try
|
||||
// installing the daemon.
|
||||
if (m_config != NULL) {
|
||||
if (!saveConfig(*m_config, allUsers)) {
|
||||
showError(m_hwnd, CStringUtil::format(
|
||||
getString(IDS_SAVE_FAILED).c_str(),
|
||||
getErrorString(GetLastError()).c_str()));
|
||||
return false;
|
||||
}
|
||||
|
||||
// note if we've saved the user's configuration
|
||||
if (!allUsers) {
|
||||
m_userConfigSaved = true;
|
||||
}
|
||||
}
|
||||
|
||||
// get the app path
|
||||
CString appPath = getAppPath(m_isServer ? SERVER_APP : CLIENT_APP);
|
||||
|
||||
|
||||
@@ -20,14 +20,10 @@
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
class CConfig;
|
||||
|
||||
//! Auto start dialog for Microsoft Windows launcher
|
||||
class CAutoStart {
|
||||
public:
|
||||
// if config == NULL then it's assumed we're installing/uninstalling
|
||||
// the client, otherwise the server.
|
||||
CAutoStart(HWND parent, CConfig* config, const CString& cmdLine);
|
||||
CAutoStart(HWND parent, bool isServer, const CString& cmdLine);
|
||||
~CAutoStart();
|
||||
|
||||
//! @name manipulators
|
||||
@@ -39,16 +35,34 @@ public:
|
||||
*/
|
||||
void doModal();
|
||||
|
||||
//! Reinstall daemon
|
||||
/*!
|
||||
Reinstalls the currently installed daemon.
|
||||
*/
|
||||
static void reinstallDaemon(bool isClient, const CString& cmdLine);
|
||||
|
||||
//! Uninstalls daemon
|
||||
/*!
|
||||
Uninstalls all installed client (\p client is \c true) or server daemons.
|
||||
*/
|
||||
static void uninstallDaemons(bool client);
|
||||
|
||||
//! Starts an installed daemon
|
||||
/*!
|
||||
Returns \c true iff a daemon was started. This will only start daemons
|
||||
installed for all users.
|
||||
*/
|
||||
static bool startDaemon();
|
||||
|
||||
//@}
|
||||
//! @name accessors
|
||||
//@{
|
||||
|
||||
//! Test if user configuration was saved
|
||||
//! Tests if any daemons are installed
|
||||
/*!
|
||||
Returns true if the user's configuration (as opposed to the system-wide
|
||||
configuration) was saved successfully while in doModal().
|
||||
Returns \c true if any daemons are installed.
|
||||
*/
|
||||
bool wasUserConfigSaved() const;
|
||||
static bool isDaemonInstalled();
|
||||
|
||||
//@}
|
||||
|
||||
@@ -65,14 +79,12 @@ private:
|
||||
static CAutoStart* s_singleton;
|
||||
|
||||
HWND m_parent;
|
||||
CConfig* m_config;
|
||||
bool m_isServer;
|
||||
CString m_cmdLine;
|
||||
CString m_name;
|
||||
HWND m_hwnd;
|
||||
bool m_install;
|
||||
CString m_errorMessage;
|
||||
bool m_userConfigSaved;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,6 +79,8 @@ CGlobalOptions::init(HWND hwnd)
|
||||
setItemChecked(child, true);
|
||||
child = getItem(hwnd, IDC_GLOBAL_RELATIVE_MOVES);
|
||||
setItemChecked(child, false);
|
||||
child = getItem(hwnd, IDC_GLOBAL_LEAVE_FOREGROUND);
|
||||
setItemChecked(child, false);
|
||||
|
||||
// get the global options
|
||||
const CConfig::CScreenOptions* options = m_config->getOptions("");
|
||||
@@ -122,6 +124,10 @@ CGlobalOptions::init(HWND hwnd)
|
||||
child = getItem(hwnd, IDC_GLOBAL_RELATIVE_MOVES);
|
||||
setItemChecked(child, (value != 0));
|
||||
}
|
||||
else if (id == kOptionWin32KeepForeground) {
|
||||
child = getItem(hwnd, IDC_GLOBAL_LEAVE_FOREGROUND);
|
||||
setItemChecked(child, (value != 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,6 +193,7 @@ CGlobalOptions::save(HWND hwnd)
|
||||
m_config->removeOption("", kOptionHeartbeat);
|
||||
m_config->removeOption("", kOptionScreenSaverSync);
|
||||
m_config->removeOption("", kOptionRelativeMouseMoves);
|
||||
m_config->removeOption("", kOptionWin32KeepForeground);
|
||||
|
||||
// add requested options
|
||||
child = getItem(hwnd, IDC_GLOBAL_DELAY_CHECK);
|
||||
@@ -209,6 +216,10 @@ CGlobalOptions::save(HWND hwnd)
|
||||
if (isItemChecked(child)) {
|
||||
m_config->addOption("", kOptionRelativeMouseMoves, 1);
|
||||
}
|
||||
child = getItem(hwnd, IDC_GLOBAL_LEAVE_FOREGROUND);
|
||||
if (isItemChecked(child)) {
|
||||
m_config->addOption("", kOptionWin32KeepForeground, 1);
|
||||
}
|
||||
|
||||
// save last values
|
||||
m_delayTime = newDelayTime;
|
||||
|
||||
1864
cmd/launcher/CHotkeyOptions.cpp
Normal file
225
cmd/launcher/CHotkeyOptions.h
Normal file
@@ -0,0 +1,225 @@
|
||||
/*
|
||||
* synergy -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2006 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.
|
||||
*/
|
||||
|
||||
#ifndef CHOTKEYOPTIONS_H
|
||||
#define CHOTKEYOPTIONS_H
|
||||
|
||||
#include "CString.h"
|
||||
#include "KeyTypes.h"
|
||||
#include "MouseTypes.h"
|
||||
#include "CInputFilter.h"
|
||||
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
class CConfig;
|
||||
|
||||
//! Hotkey options dialog for Microsoft Windows launcher
|
||||
class CHotkeyOptions {
|
||||
public:
|
||||
CHotkeyOptions(HWND parent, CConfig*);
|
||||
~CHotkeyOptions();
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
//! Run dialog
|
||||
/*!
|
||||
Display and handle the dialog until closed by the user.
|
||||
*/
|
||||
void doModal();
|
||||
|
||||
//@}
|
||||
//! @name accessors
|
||||
//@{
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
void doInit(HWND hwnd);
|
||||
|
||||
void fillHotkeys(HWND hwnd, UInt32 select = (UInt32)-1);
|
||||
void updateHotkeysControls(HWND hwnd);
|
||||
|
||||
void addHotkey(HWND hwnd);
|
||||
void removeHotkey(HWND hwnd);
|
||||
void editHotkey(HWND hwnd);
|
||||
|
||||
void fillActions(HWND hwnd, UInt32 select = (UInt32)-1);
|
||||
void updateActionsControls(HWND hwnd);
|
||||
|
||||
void addAction(HWND hwnd);
|
||||
void removeAction(HWND hwnd);
|
||||
void editAction(HWND hwnd);
|
||||
|
||||
bool editCondition(HWND hwnd, CInputFilter::CCondition*&);
|
||||
bool editAction(HWND hwnd, CInputFilter::CAction*&,
|
||||
bool& onActivate);
|
||||
|
||||
void openRule(HWND hwnd);
|
||||
void closeRule(HWND hwnd);
|
||||
UInt32 findMatchingAction(
|
||||
const CInputFilter::CKeystrokeAction*) const;
|
||||
UInt32 findMatchingAction(
|
||||
const CInputFilter::CMouseButtonAction*) const;
|
||||
|
||||
// message handling
|
||||
BOOL doDlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
static BOOL CALLBACK dlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
// special actions we use to combine matching down/up actions into a
|
||||
// single action for the convenience of the user.
|
||||
class CKeystrokeDownUpAction : public CInputFilter::CKeystrokeAction {
|
||||
public:
|
||||
CKeystrokeDownUpAction(IPlatformScreen::CKeyInfo* adoptedInfo) :
|
||||
CInputFilter::CKeystrokeAction(adoptedInfo, true) { }
|
||||
|
||||
// CAction overrides
|
||||
virtual CInputFilter::CAction* clone() const
|
||||
{
|
||||
IKeyState::CKeyInfo* info = IKeyState::CKeyInfo::alloc(*getInfo());
|
||||
return new CKeystrokeDownUpAction(info);
|
||||
}
|
||||
|
||||
protected:
|
||||
// CKeystrokeAction overrides
|
||||
virtual const char* formatName() const { return "keystroke"; }
|
||||
};
|
||||
class CMouseButtonDownUpAction : public CInputFilter::CMouseButtonAction {
|
||||
public:
|
||||
CMouseButtonDownUpAction(IPrimaryScreen::CButtonInfo* adoptedInfo) :
|
||||
CInputFilter::CMouseButtonAction(adoptedInfo, true) { }
|
||||
|
||||
// CAction overrides
|
||||
virtual CInputFilter::CAction* clone() const
|
||||
{
|
||||
IPlatformScreen::CButtonInfo* info =
|
||||
IPrimaryScreen::CButtonInfo::alloc(*getInfo());
|
||||
return new CMouseButtonDownUpAction(info);
|
||||
}
|
||||
|
||||
protected:
|
||||
// CMouseButtonAction overrides
|
||||
virtual const char* formatName() const { return "mousebutton"; }
|
||||
};
|
||||
|
||||
class CConditionDialog {
|
||||
public:
|
||||
static bool doModal(HWND parent, CInputFilter::CCondition*&);
|
||||
|
||||
private:
|
||||
static void doInit(HWND hwnd);
|
||||
static void fillHotkey(HWND hwnd);
|
||||
|
||||
static void onButton(HWND hwnd, ButtonID button);
|
||||
static void onKey(HWND hwnd, WPARAM wParam, LPARAM lParam);
|
||||
static KeyID getChar(WPARAM wParam, LPARAM lParam);
|
||||
static KeyModifierMask
|
||||
getModifiers();
|
||||
|
||||
static bool isGoodCondition();
|
||||
|
||||
static BOOL CALLBACK dlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
static LRESULT CALLBACK editProc(HWND hwnd, UINT, WPARAM, LPARAM);
|
||||
|
||||
private:
|
||||
static CInputFilter::CCondition*
|
||||
s_condition;
|
||||
static CInputFilter::CCondition*
|
||||
s_lastGoodCondition;
|
||||
static WNDPROC s_editWndProc;
|
||||
};
|
||||
|
||||
class CActionDialog {
|
||||
public:
|
||||
static bool doModal(HWND parent, CConfig* config,
|
||||
CInputFilter::CAction*&, bool& onActivate);
|
||||
|
||||
private:
|
||||
static void doInit(HWND hwnd);
|
||||
static void fillHotkey(HWND hwnd);
|
||||
static void updateControls(HWND hwnd);
|
||||
|
||||
static void onButton(HWND hwnd, ButtonID button);
|
||||
static void onKey(HWND hwnd, WPARAM wParam, LPARAM lParam);
|
||||
static void onLockAction(HWND hwnd);
|
||||
static void onSwitchToAction(HWND hwnd);
|
||||
static void onSwitchInAction(HWND hwnd);
|
||||
|
||||
static KeyID getChar(WPARAM wParam, LPARAM lParam);
|
||||
static KeyModifierMask
|
||||
getModifiers();
|
||||
|
||||
static bool isGoodAction();
|
||||
static void convertAction(HWND hwnd);
|
||||
|
||||
static bool isDownUpAction();
|
||||
|
||||
static BOOL CALLBACK dlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
static LRESULT CALLBACK editProc(HWND hwnd, UINT, WPARAM, LPARAM);
|
||||
|
||||
private:
|
||||
static CConfig* s_config;
|
||||
static bool s_onActivate;
|
||||
static CInputFilter::CAction*
|
||||
s_action;
|
||||
static CInputFilter::CAction*
|
||||
s_lastGoodAction;
|
||||
static WNDPROC s_editWndProc;
|
||||
};
|
||||
|
||||
// public to allow CActionDialog to use it
|
||||
public:
|
||||
class CScreensDialog {
|
||||
public:
|
||||
static void doModal(HWND parent, CConfig* config,
|
||||
CInputFilter::CKeystrokeAction*);
|
||||
|
||||
// public due to compiler brokenness
|
||||
typedef std::set<CString> CScreens;
|
||||
|
||||
private:
|
||||
|
||||
static void doInit(HWND hwnd);
|
||||
static void doFini(HWND hwnd);
|
||||
static void fillScreens(HWND hwnd);
|
||||
static void updateControls(HWND hwnd);
|
||||
|
||||
static void add(HWND hwnd);
|
||||
static void remove(HWND hwnd);
|
||||
|
||||
static void getSelected(HWND hwnd, UINT id,
|
||||
const CScreens& inScreens, CScreens& outScreens);
|
||||
|
||||
static BOOL CALLBACK dlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
private:
|
||||
static CConfig* s_config;
|
||||
static CInputFilter::CKeystrokeAction* s_action;
|
||||
static CScreens s_nonTargets;
|
||||
static CScreens s_targets;
|
||||
static CString s_allScreens;
|
||||
};
|
||||
|
||||
private:
|
||||
static CHotkeyOptions* s_singleton;
|
||||
|
||||
HWND m_parent;
|
||||
CConfig* m_config;
|
||||
CInputFilter* m_inputFilter;
|
||||
CInputFilter::CRule m_activeRule;
|
||||
UInt32 m_activeRuleIndex;
|
||||
};
|
||||
|
||||
#endif
|
||||
111
cmd/launcher/CInfo.cpp
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* synergy -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2006 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 "ProtocolTypes.h"
|
||||
#include "CStringUtil.h"
|
||||
#include "Version.h"
|
||||
#include "CArch.h"
|
||||
#include "CInfo.h"
|
||||
#include "LaunchUtil.h"
|
||||
#include "resource.h"
|
||||
|
||||
//
|
||||
// CInfo
|
||||
//
|
||||
|
||||
CInfo* CInfo::s_singleton = NULL;
|
||||
|
||||
CInfo::CInfo(HWND parent) :
|
||||
m_parent(parent)
|
||||
{
|
||||
assert(s_singleton == NULL);
|
||||
s_singleton = this;
|
||||
}
|
||||
|
||||
CInfo::~CInfo()
|
||||
{
|
||||
s_singleton = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
CInfo::doModal()
|
||||
{
|
||||
// do dialog
|
||||
DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_INFO),
|
||||
m_parent, dlgProc, (LPARAM)this);
|
||||
}
|
||||
|
||||
void
|
||||
CInfo::init(HWND hwnd)
|
||||
{
|
||||
// collect info
|
||||
CString version =
|
||||
CStringUtil::format(getString(IDS_TITLE).c_str(), VERSION);
|
||||
CString hostname = ARCH->getHostName();
|
||||
CString address = ARCH->addrToString(ARCH->nameToAddr(hostname));
|
||||
CString userConfig = ARCH->getUserDirectory();
|
||||
if (!userConfig.empty()) {
|
||||
userConfig = ARCH->concatPath(userConfig, CONFIG_NAME);
|
||||
}
|
||||
CString sysConfig = ARCH->getSystemDirectory();
|
||||
if (!sysConfig.empty()) {
|
||||
sysConfig = ARCH->concatPath(sysConfig, CONFIG_NAME);
|
||||
}
|
||||
|
||||
// set info
|
||||
HWND child;
|
||||
child = getItem(hwnd, IDC_INFO_VERSION);
|
||||
setWindowText(child, version);
|
||||
child = getItem(hwnd, IDC_INFO_HOSTNAME);
|
||||
setWindowText(child, hostname);
|
||||
child = getItem(hwnd, IDC_INFO_IP_ADDRESS);
|
||||
setWindowText(child, address);
|
||||
child = getItem(hwnd, IDC_INFO_USER_CONFIG);
|
||||
setWindowText(child, userConfig);
|
||||
child = getItem(hwnd, IDC_INFO_SYS_CONFIG);
|
||||
setWindowText(child, sysConfig);
|
||||
|
||||
// focus on okay button
|
||||
SetFocus(getItem(hwnd, IDOK));
|
||||
}
|
||||
|
||||
BOOL
|
||||
CInfo::doDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
init(hwnd);
|
||||
return FALSE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
EndDialog(hwnd, 0);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
CInfo::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return s_singleton->doDlgProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
57
cmd/launcher/CInfo.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* synergy -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2006 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.
|
||||
*/
|
||||
|
||||
#ifndef CINFO_H
|
||||
#define CINFO_H
|
||||
|
||||
#include "CString.h"
|
||||
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
//! Info dialog for Microsoft Windows launcher
|
||||
class CInfo {
|
||||
public:
|
||||
CInfo(HWND parent);
|
||||
~CInfo();
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
//! Run dialog
|
||||
/*!
|
||||
Display and handle the dialog until closed by the user.
|
||||
*/
|
||||
void doModal();
|
||||
|
||||
//@}
|
||||
//! @name accessors
|
||||
//@{
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
void init(HWND hwnd);
|
||||
|
||||
// message handling
|
||||
BOOL doDlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
static BOOL CALLBACK dlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
private:
|
||||
static CInfo* s_singleton;
|
||||
|
||||
HWND m_parent;
|
||||
};
|
||||
|
||||
#endif
|
||||
855
cmd/launcher/CScreensLinks.cpp
Normal file
@@ -0,0 +1,855 @@
|
||||
/*
|
||||
* 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 "CStringUtil.h"
|
||||
#include "CArch.h"
|
||||
#include "CScreensLinks.h"
|
||||
#include "CAddScreen.h"
|
||||
#include "LaunchUtil.h"
|
||||
#include "resource.h"
|
||||
|
||||
//
|
||||
// CScreensLinks
|
||||
//
|
||||
|
||||
CScreensLinks* CScreensLinks::s_singleton = NULL;
|
||||
|
||||
CScreensLinks::CScreensLinks(HWND parent, CConfig* config) :
|
||||
m_parent(parent),
|
||||
m_mainConfig(config),
|
||||
m_config(&m_scratchConfig)
|
||||
{
|
||||
assert(s_singleton == NULL);
|
||||
s_singleton = this;
|
||||
|
||||
// get formatting strings
|
||||
m_linkFormat = getString(IDS_LINK_FORMAT);
|
||||
m_intervalFormat = getString(IDS_LINK_INTERVAL_FORMAT);
|
||||
m_newLinkLabel = getString(IDS_NEW_LINK);
|
||||
m_sideLabel[kLeft - kFirstDirection] = getString(IDS_SIDE_LEFT);
|
||||
m_sideLabel[kRight - kFirstDirection] = getString(IDS_SIDE_RIGHT);
|
||||
m_sideLabel[kTop - kFirstDirection] = getString(IDS_SIDE_TOP);
|
||||
m_sideLabel[kBottom - kFirstDirection] = getString(IDS_SIDE_BOTTOM);
|
||||
|
||||
// GDI objects
|
||||
m_redPen = CreatePen(PS_INSIDEFRAME, 1, RGB(255, 0, 0));
|
||||
}
|
||||
|
||||
CScreensLinks::~CScreensLinks()
|
||||
{
|
||||
DeleteObject(m_redPen);
|
||||
s_singleton = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::doModal()
|
||||
{
|
||||
// do dialog
|
||||
DialogBoxParam(s_instance, MAKEINTRESOURCE(IDD_SCREENS_LINKS),
|
||||
m_parent, dlgProc, (LPARAM)this);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::init(HWND hwnd)
|
||||
{
|
||||
// get initial config
|
||||
m_scratchConfig = *m_mainConfig;
|
||||
|
||||
// fill side list box (in EDirection order)
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_SRC_SIDE);
|
||||
SendMessage(child, CB_ADDSTRING, 0, (LPARAM)TEXT("---"));
|
||||
SendMessage(child, CB_ADDSTRING, 0,
|
||||
(LPARAM)getString(IDS_EDGE_LEFT).c_str());
|
||||
SendMessage(child, CB_ADDSTRING, 0,
|
||||
(LPARAM)getString(IDS_EDGE_RIGHT).c_str());
|
||||
SendMessage(child, CB_ADDSTRING, 0,
|
||||
(LPARAM)getString(IDS_EDGE_TOP).c_str());
|
||||
SendMessage(child, CB_ADDSTRING, 0,
|
||||
(LPARAM)getString(IDS_EDGE_BOTTOM).c_str());
|
||||
|
||||
// create error boxes
|
||||
m_srcSideError = createErrorBox(hwnd);
|
||||
m_srcScreenError = createErrorBox(hwnd);
|
||||
m_dstScreenError = createErrorBox(hwnd);
|
||||
resizeErrorBoxes();
|
||||
|
||||
m_selectedLink = -1;
|
||||
m_editedLink = CEdgeLink();
|
||||
m_edgeLinks.clear();
|
||||
updateScreens(hwnd, "");
|
||||
updateScreensControls(hwnd);
|
||||
updateLinks(hwnd);
|
||||
updateLinksControls(hwnd);
|
||||
}
|
||||
|
||||
bool
|
||||
CScreensLinks::save(HWND /*hwnd*/)
|
||||
{
|
||||
*m_mainConfig = m_scratchConfig;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL
|
||||
CScreensLinks::doDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
init(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case WM_SIZE:
|
||||
resizeErrorBoxes();
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
SetFocus(getItem(hwnd, IDOK));
|
||||
if (save(hwnd)) {
|
||||
EndDialog(hwnd, 0);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hwnd, 0);
|
||||
return TRUE;
|
||||
|
||||
case IDC_SCREENS_SCREENS:
|
||||
switch (HIWORD(wParam)) {
|
||||
case LBN_DBLCLK:
|
||||
editScreen(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case LBN_SELCHANGE:
|
||||
updateScreensControls(hwnd);
|
||||
updateLinkView(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case LBN_SELCANCEL:
|
||||
updateScreensControls(hwnd);
|
||||
updateLinkView(hwnd);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SCREENS_ADD_SCREEN:
|
||||
addScreen(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case IDC_SCREENS_REMOVE_SCREEN:
|
||||
removeScreen(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case IDC_SCREENS_EDIT_SCREEN:
|
||||
editScreen(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case IDC_SCREENS_LINKS:
|
||||
switch (HIWORD(wParam)) {
|
||||
case LBN_SELCHANGE:
|
||||
editLink(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case LBN_SELCANCEL:
|
||||
editLink(hwnd);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SCREENS_ADD_LINK:
|
||||
addLink(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case IDC_SCREENS_REMOVE_LINK:
|
||||
removeLink(hwnd);
|
||||
return TRUE;
|
||||
|
||||
case IDC_SCREENS_SRC_SIDE:
|
||||
switch (HIWORD(wParam)) {
|
||||
case CBN_SELCHANGE:
|
||||
changeSrcSide(hwnd);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SCREENS_SRC_SCREEN:
|
||||
switch (HIWORD(wParam)) {
|
||||
case CBN_SELCHANGE:
|
||||
changeSrcScreen(hwnd);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SCREENS_DST_SCREEN:
|
||||
switch (HIWORD(wParam)) {
|
||||
case CBN_SELCHANGE:
|
||||
changeDstScreen(hwnd);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SCREENS_SRC_START:
|
||||
switch (HIWORD(wParam)) {
|
||||
case EN_KILLFOCUS:
|
||||
changeIntervalStart(hwnd, LOWORD(wParam),
|
||||
m_editedLink.m_srcInterval);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SCREENS_SRC_END:
|
||||
switch (HIWORD(wParam)) {
|
||||
case EN_KILLFOCUS:
|
||||
changeIntervalEnd(hwnd, LOWORD(wParam),
|
||||
m_editedLink.m_srcInterval);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SCREENS_DST_START:
|
||||
switch (HIWORD(wParam)) {
|
||||
case EN_KILLFOCUS:
|
||||
changeIntervalStart(hwnd, LOWORD(wParam),
|
||||
m_editedLink.m_dstInterval);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SCREENS_DST_END:
|
||||
switch (HIWORD(wParam)) {
|
||||
case EN_KILLFOCUS:
|
||||
changeIntervalEnd(hwnd, LOWORD(wParam),
|
||||
m_editedLink.m_dstInterval);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_CTLCOLORSTATIC:
|
||||
switch (GetDlgCtrlID((HWND)lParam)) {
|
||||
case IDC_SCREENS_OVERLAP_ERROR:
|
||||
SetBkColor((HDC)wParam, GetSysColor(COLOR_3DFACE));
|
||||
SetTextColor((HDC)wParam, RGB(255, 0, 0));
|
||||
return (BOOL)GetSysColorBrush(COLOR_3DFACE);
|
||||
}
|
||||
break;
|
||||
|
||||
// error outlines
|
||||
case WM_DRAWITEM: {
|
||||
DRAWITEMSTRUCT* di = (DRAWITEMSTRUCT*)lParam;
|
||||
if (di->CtlType == ODT_STATIC) {
|
||||
HGDIOBJ oldPen = SelectObject(di->hDC, m_redPen);
|
||||
HGDIOBJ oldBrush = SelectObject(di->hDC,
|
||||
GetStockObject(NULL_BRUSH));
|
||||
Rectangle(di->hDC, di->rcItem.left, di->rcItem.top,
|
||||
di->rcItem.right, di->rcItem.bottom);
|
||||
SelectObject(di->hDC, oldPen);
|
||||
SelectObject(di->hDC, oldBrush);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
CScreensLinks::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return s_singleton->doDlgProc(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
CString
|
||||
CScreensLinks::getSelectedScreen(HWND hwnd) const
|
||||
{
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_SCREENS);
|
||||
LRESULT index = SendMessage(child, LB_GETCURSEL, 0, 0);
|
||||
if (index == LB_ERR) {
|
||||
return CString();
|
||||
}
|
||||
|
||||
LRESULT size = SendMessage(child, LB_GETTEXTLEN, index, 0);
|
||||
char* buffer = new char[size + 1];
|
||||
SendMessage(child, LB_GETTEXT, index, (LPARAM)buffer);
|
||||
buffer[size] = '\0';
|
||||
CString result(buffer);
|
||||
delete[] buffer;
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::addScreen(HWND hwnd)
|
||||
{
|
||||
CAddScreen dialog(hwnd, m_config, "");
|
||||
if (dialog.doModal()) {
|
||||
updateScreens(hwnd, dialog.getName());
|
||||
updateScreensControls(hwnd);
|
||||
updateLinks(hwnd);
|
||||
updateLinksControls(hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::editScreen(HWND hwnd)
|
||||
{
|
||||
CString oldName = getSelectedScreen(hwnd);
|
||||
CAddScreen dialog(hwnd, m_config, oldName);
|
||||
if (dialog.doModal()) {
|
||||
CString newName = dialog.getName();
|
||||
|
||||
// rename screens in the edge list
|
||||
if (newName != oldName) {
|
||||
for (size_t i = 0; i < m_edgeLinks.size(); ++i) {
|
||||
m_edgeLinks[i].rename(oldName, newName);
|
||||
}
|
||||
m_editedLink.rename(oldName, newName);
|
||||
}
|
||||
|
||||
updateScreens(hwnd, newName);
|
||||
updateScreensControls(hwnd);
|
||||
updateLinks(hwnd);
|
||||
updateLinksControls(hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::removeScreen(HWND hwnd)
|
||||
{
|
||||
// remove screen from config (this also removes aliases)
|
||||
m_config->removeScreen(getSelectedScreen(hwnd));
|
||||
|
||||
// update dialog
|
||||
updateScreens(hwnd, "");
|
||||
updateScreensControls(hwnd);
|
||||
updateLinks(hwnd);
|
||||
updateLinksControls(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::addLink(HWND hwnd)
|
||||
{
|
||||
if (m_editedLink.connect(m_config)) {
|
||||
m_editedLink = CEdgeLink();
|
||||
updateLinks(hwnd);
|
||||
updateLinksControls(hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::editLink(HWND hwnd)
|
||||
{
|
||||
// get selection
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_LINKS);
|
||||
DWORD i = SendMessage(child, LB_GETCURSEL, 0, 0);
|
||||
if (i != LB_ERR && i != (DWORD)m_edgeLinks.size()) {
|
||||
// existing link
|
||||
m_selectedLink = (SInt32)SendMessage(child, LB_GETITEMDATA, i, 0);
|
||||
m_editedLink = m_edgeLinks[m_selectedLink];
|
||||
}
|
||||
else {
|
||||
// new link
|
||||
m_selectedLink = -1;
|
||||
m_editedLink = CEdgeLink();
|
||||
}
|
||||
updateLinksControls(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::removeLink(HWND hwnd)
|
||||
{
|
||||
if (m_editedLink.disconnect(m_config)) {
|
||||
updateLinks(hwnd);
|
||||
updateLinksControls(hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateScreens(HWND hwnd, const CString& selectName)
|
||||
{
|
||||
HWND child;
|
||||
|
||||
// set screen list
|
||||
child = getItem(hwnd, IDC_SCREENS_SCREENS);
|
||||
SendMessage(child, LB_RESETCONTENT, 0, 0);
|
||||
for (CConfig::const_iterator index = m_config->begin();
|
||||
index != m_config->end(); ) {
|
||||
const CString& name = *index;
|
||||
++index;
|
||||
if (index != m_config->end()) {
|
||||
SendMessage(child, LB_INSERTSTRING,
|
||||
(WPARAM)-1, (LPARAM)name.c_str());
|
||||
}
|
||||
else {
|
||||
SendMessage(child, LB_ADDSTRING, 0, (LPARAM)name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// find the named screen
|
||||
if (!selectName.empty()) {
|
||||
DWORD i = SendMessage(child, LB_FINDSTRINGEXACT,
|
||||
(UINT)-1, (LPARAM)selectName.c_str());
|
||||
if (i != LB_ERR) {
|
||||
SendMessage(child, LB_SETSEL, TRUE, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateScreensControls(HWND hwnd)
|
||||
{
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_SCREENS);
|
||||
bool screenSelected = (SendMessage(child, LB_GETCURSEL, 0, 0) != LB_ERR);
|
||||
|
||||
enableItem(hwnd, IDC_SCREENS_ADD_SCREEN, TRUE);
|
||||
enableItem(hwnd, IDC_SCREENS_EDIT_SCREEN, screenSelected);
|
||||
enableItem(hwnd, IDC_SCREENS_REMOVE_SCREEN, screenSelected);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateLinks(HWND hwnd)
|
||||
{
|
||||
HWND links = getItem(hwnd, IDC_SCREENS_LINKS);
|
||||
HWND srcScreens = getItem(hwnd, IDC_SCREENS_SRC_SCREEN);
|
||||
HWND dstScreens = getItem(hwnd, IDC_SCREENS_DST_SCREEN);
|
||||
|
||||
// get old selection
|
||||
CEdgeLink oldLink;
|
||||
if (m_selectedLink != -1) {
|
||||
oldLink = m_edgeLinks[m_selectedLink];
|
||||
}
|
||||
|
||||
// clear links and screens
|
||||
SendMessage(links, LB_RESETCONTENT, 0, 0);
|
||||
SendMessage(srcScreens, CB_RESETCONTENT, 0, 0);
|
||||
SendMessage(dstScreens, CB_RESETCONTENT, 0, 0);
|
||||
m_edgeLinks.clear();
|
||||
|
||||
// add "no screen" items
|
||||
SendMessage(srcScreens, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)TEXT("----"));
|
||||
SendMessage(dstScreens, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)TEXT("----"));
|
||||
|
||||
// add links and screens
|
||||
for (CConfig::const_iterator i = m_config->begin();
|
||||
i != m_config->end(); ++i) {
|
||||
const CString& name = *i;
|
||||
|
||||
// add screen
|
||||
SendMessage(srcScreens, CB_INSERTSTRING, (WPARAM)-1,
|
||||
(LPARAM)name.c_str());
|
||||
SendMessage(dstScreens, CB_INSERTSTRING, (WPARAM)-1,
|
||||
(LPARAM)name.c_str());
|
||||
|
||||
// add links for screen
|
||||
for (CConfig::link_const_iterator j = m_config->beginNeighbor(name),
|
||||
n = m_config->endNeighbor(name);
|
||||
j != n; ++j) {
|
||||
DWORD k = m_edgeLinks.size();
|
||||
m_edgeLinks.push_back(CEdgeLink(name, *j));
|
||||
SendMessage(links, LB_INSERTSTRING, (WPARAM)-1,
|
||||
(LPARAM)formatLink(m_edgeLinks.back()).c_str());
|
||||
SendMessage(links, LB_SETITEMDATA, (WPARAM)k, (LPARAM)k);
|
||||
}
|
||||
}
|
||||
|
||||
// add "new link" item to sort
|
||||
SendMessage(links, LB_ADDSTRING, 0, (LPARAM)m_newLinkLabel.c_str());
|
||||
|
||||
// remove the "new link" item then insert it on the end
|
||||
DWORD i = SendMessage(links, LB_FINDSTRINGEXACT,
|
||||
(UINT)-1, (LPARAM)m_newLinkLabel.c_str());
|
||||
if (i != LB_ERR) {
|
||||
SendMessage(links, LB_DELETESTRING, i, 0);
|
||||
}
|
||||
SendMessage(links, LB_INSERTSTRING, (WPARAM)-1,
|
||||
(LPARAM)getString(IDS_NEW_LINK).c_str());
|
||||
SendMessage(links, LB_SETITEMDATA, (WPARAM)m_edgeLinks.size(),
|
||||
(LPARAM)-1);
|
||||
|
||||
// select the same link as before
|
||||
SendMessage(links, LB_SETCURSEL, (WPARAM)m_edgeLinks.size(), 0);
|
||||
if (m_selectedLink != -1) {
|
||||
m_selectedLink = -1;
|
||||
for (size_t j = 0; j < m_edgeLinks.size(); ++j) {
|
||||
if (m_edgeLinks[j] == oldLink) {
|
||||
// found matching link
|
||||
m_selectedLink = j;
|
||||
for (size_t k = 0; k < m_edgeLinks.size(); ++k) {
|
||||
if (SendMessage(links, LB_GETITEMDATA, k, 0) == (int)j) {
|
||||
SendMessage(links, LB_SETCURSEL, k, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if we can't find the link anymore then reset edited link
|
||||
if (m_selectedLink == -1) {
|
||||
m_editedLink = CEdgeLink();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateLinksControls(HWND hwnd)
|
||||
{
|
||||
// get selection. select "new link" if nothing is selected.
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_LINKS);
|
||||
if (m_selectedLink == -1) {
|
||||
SendMessage(child, LB_SETCURSEL, m_edgeLinks.size(), 0);
|
||||
}
|
||||
|
||||
// enable/disable remove button
|
||||
enableItem(hwnd, IDC_SCREENS_REMOVE_LINK, m_selectedLink != -1);
|
||||
|
||||
// fill link entry controls from m_editedLink
|
||||
updateLinkEditControls(hwnd, m_editedLink);
|
||||
updateLinkValid(hwnd, m_editedLink);
|
||||
updateLinkView(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::changeSrcSide(HWND hwnd)
|
||||
{
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_SRC_SIDE);
|
||||
m_editedLink.m_srcSide = (EDirection)SendMessage(child, CB_GETCURSEL, 0, 0);
|
||||
updateLink(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::changeSrcScreen(HWND hwnd)
|
||||
{
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_SRC_SCREEN);
|
||||
m_editedLink.m_srcName = getWindowText(child);
|
||||
updateLink(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::changeDstScreen(HWND hwnd)
|
||||
{
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_DST_SCREEN);
|
||||
m_editedLink.m_dstName = getWindowText(child);
|
||||
updateLink(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::changeIntervalStart(HWND hwnd, int id, CConfig::CInterval& i)
|
||||
{
|
||||
int x = (int)GetDlgItemInt(hwnd, id, NULL, FALSE);
|
||||
if (x < 0) {
|
||||
x = 0;
|
||||
}
|
||||
else if (x > 99) {
|
||||
x = 99;
|
||||
}
|
||||
|
||||
i.first = 0.01f * (float)x;
|
||||
if (i.first >= i.second) {
|
||||
i.second = 0.01f * (float)(x + 1);
|
||||
}
|
||||
|
||||
updateLinkIntervalControls(hwnd, m_editedLink);
|
||||
updateLink(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::changeIntervalEnd(HWND hwnd, int id, CConfig::CInterval& i)
|
||||
{
|
||||
int x = (int)GetDlgItemInt(hwnd, id, NULL, FALSE);
|
||||
if (x < 1) {
|
||||
x = 1;
|
||||
}
|
||||
else if (x > 100) {
|
||||
x = 100;
|
||||
}
|
||||
|
||||
i.second = 0.01f * (float)x;
|
||||
if (i.first >= i.second) {
|
||||
i.first = 0.01f * (float)(x - 1);
|
||||
}
|
||||
|
||||
updateLinkIntervalControls(hwnd, m_editedLink);
|
||||
updateLink(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::selectScreen(HWND hwnd, int id, const CString& name)
|
||||
{
|
||||
HWND child = getItem(hwnd, id);
|
||||
DWORD i = SendMessage(child, CB_FINDSTRINGEXACT, (WPARAM)-1,
|
||||
(LPARAM)name.c_str());
|
||||
if (i == CB_ERR) {
|
||||
// no match, select no screen
|
||||
SendMessage(child, CB_SETCURSEL, 0, 0);
|
||||
}
|
||||
else {
|
||||
SendMessage(child, CB_SETCURSEL, i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateLinkEditControls(HWND hwnd, const CEdgeLink& link)
|
||||
{
|
||||
// fill link entry controls from link
|
||||
HWND child = getItem(hwnd, IDC_SCREENS_SRC_SIDE);
|
||||
SendMessage(child, CB_SETCURSEL, link.m_srcSide, 0);
|
||||
selectScreen(hwnd, IDC_SCREENS_SRC_SCREEN, link.m_srcName);
|
||||
selectScreen(hwnd, IDC_SCREENS_DST_SCREEN, link.m_dstName);
|
||||
updateLinkIntervalControls(hwnd, link);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateLinkIntervalControls(HWND hwnd, const CEdgeLink& link)
|
||||
{
|
||||
HWND child;
|
||||
|
||||
// src interval
|
||||
child = getItem(hwnd, IDC_SCREENS_SRC_START);
|
||||
setWindowText(child, formatIntervalValue(link.m_srcInterval.first));
|
||||
child = getItem(hwnd, IDC_SCREENS_SRC_END);
|
||||
setWindowText(child, formatIntervalValue(link.m_srcInterval.second));
|
||||
|
||||
// dst interval
|
||||
child = getItem(hwnd, IDC_SCREENS_DST_START);
|
||||
setWindowText(child, formatIntervalValue(link.m_dstInterval.first));
|
||||
child = getItem(hwnd, IDC_SCREENS_DST_END);
|
||||
setWindowText(child, formatIntervalValue(link.m_dstInterval.second));
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateLink(HWND hwnd)
|
||||
{
|
||||
updateLinkValid(hwnd, m_editedLink);
|
||||
|
||||
// update link in config
|
||||
if (m_selectedLink != -1 && m_editedLinkIsValid) {
|
||||
// editing an existing link and entry is valid
|
||||
if (m_edgeLinks[m_selectedLink].disconnect(m_config)) {
|
||||
// successfully removed old link
|
||||
if (!m_editedLink.connect(m_config)) {
|
||||
// couldn't set new link so restore old link
|
||||
m_edgeLinks[m_selectedLink].connect(m_config);
|
||||
}
|
||||
else {
|
||||
m_edgeLinks[m_selectedLink] = m_editedLink;
|
||||
updateLinks(hwnd);
|
||||
updateLinkEditControls(hwnd, m_editedLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateLinkView(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateLinkValid(HWND hwnd, const CEdgeLink& link)
|
||||
{
|
||||
m_editedLinkIsValid = true;
|
||||
|
||||
// check source side and screen
|
||||
if (link.m_srcSide == kNoDirection) {
|
||||
m_editedLinkIsValid = false;
|
||||
ShowWindow(m_srcSideError, SW_SHOWNA);
|
||||
}
|
||||
else {
|
||||
ShowWindow(m_srcSideError, SW_HIDE);
|
||||
}
|
||||
if (!m_config->isCanonicalName(link.m_srcName)) {
|
||||
m_editedLinkIsValid = false;
|
||||
ShowWindow(m_srcScreenError, SW_SHOWNA);
|
||||
}
|
||||
else {
|
||||
ShowWindow(m_srcScreenError, SW_HIDE);
|
||||
}
|
||||
|
||||
// check for overlap. if editing a link we must remove it, then
|
||||
// check for overlap and restore the old link.
|
||||
bool overlap = false;
|
||||
if (m_editedLinkIsValid) {
|
||||
if (m_selectedLink == -1) {
|
||||
if (link.overlaps(m_config)) {
|
||||
m_editedLinkIsValid = false;
|
||||
overlap = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (m_edgeLinks[m_selectedLink].disconnect(m_config)) {
|
||||
overlap = link.overlaps(m_config);
|
||||
m_edgeLinks[m_selectedLink].connect(m_config);
|
||||
if (overlap) {
|
||||
m_editedLinkIsValid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ShowWindow(getItem(hwnd, IDC_SCREENS_OVERLAP_ERROR),
|
||||
overlap ? SW_SHOWNA : SW_HIDE);
|
||||
|
||||
// check dst screen
|
||||
if (!m_config->isCanonicalName(link.m_dstName)) {
|
||||
m_editedLinkIsValid = false;
|
||||
ShowWindow(m_dstScreenError, SW_SHOWNA);
|
||||
}
|
||||
else {
|
||||
ShowWindow(m_dstScreenError, SW_HIDE);
|
||||
}
|
||||
|
||||
// update add link button
|
||||
enableItem(hwnd, IDC_SCREENS_ADD_LINK,
|
||||
m_selectedLink == -1 && m_editedLinkIsValid);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::updateLinkView(HWND /*hwnd*/)
|
||||
{
|
||||
// XXX -- draw visual of selected screen, highlighting selected link
|
||||
}
|
||||
|
||||
HWND
|
||||
CScreensLinks::createErrorBox(HWND parent)
|
||||
{
|
||||
return CreateWindow(TEXT("STATIC"), TEXT(""),
|
||||
WS_CHILD | SS_OWNERDRAW,
|
||||
0, 0, 1, 1,
|
||||
parent, (HMENU)-1,
|
||||
s_instance, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::resizeErrorBoxes()
|
||||
{
|
||||
HWND hwnd = GetParent(m_srcSideError);
|
||||
resizeErrorBox(m_srcSideError, getItem(hwnd, IDC_SCREENS_SRC_SIDE));
|
||||
resizeErrorBox(m_srcScreenError, getItem(hwnd, IDC_SCREENS_SRC_SCREEN));
|
||||
resizeErrorBox(m_dstScreenError, getItem(hwnd, IDC_SCREENS_DST_SCREEN));
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::resizeErrorBox(HWND box, HWND assoc)
|
||||
{
|
||||
RECT rect;
|
||||
GetWindowRect(assoc, &rect);
|
||||
MapWindowPoints(NULL, GetParent(box), (POINT*)&rect, 2);
|
||||
SetWindowPos(box, HWND_TOP, rect.left - 1, rect.top - 1,
|
||||
rect.right - rect.left + 2,
|
||||
rect.bottom - rect.top + 2, SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
CString
|
||||
CScreensLinks::formatIntervalValue(float x) const
|
||||
{
|
||||
return CStringUtil::print("%d", (int)(x * 100.0f + 0.5f));
|
||||
}
|
||||
|
||||
CString
|
||||
CScreensLinks::formatInterval(const CConfig::CInterval& i) const
|
||||
{
|
||||
if (i.first == 0.0f && i.second == 1.0f) {
|
||||
return "";
|
||||
}
|
||||
else {
|
||||
CString start = formatIntervalValue(i.first);
|
||||
CString end = formatIntervalValue(i.second);
|
||||
return CStringUtil::format(m_intervalFormat.c_str(),
|
||||
start.c_str(), end.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
CString
|
||||
CScreensLinks::formatLink(const CEdgeLink& link) const
|
||||
{
|
||||
CString srcInterval = formatInterval(link.m_srcInterval);
|
||||
CString dstInterval = formatInterval(link.m_dstInterval);
|
||||
return CStringUtil::format(m_linkFormat.c_str(),
|
||||
link.m_srcName.c_str(), srcInterval.c_str(),
|
||||
m_sideLabel[link.m_srcSide - kFirstDirection].c_str(),
|
||||
link.m_dstName.c_str(), dstInterval.c_str());
|
||||
}
|
||||
|
||||
//
|
||||
// CScreensLinks::CEdgeLink
|
||||
//
|
||||
|
||||
CScreensLinks::CEdgeLink::CEdgeLink() :
|
||||
m_srcName(),
|
||||
m_srcSide(kNoDirection),
|
||||
m_srcInterval(0.0f, 1.0f),
|
||||
m_dstName(),
|
||||
m_dstInterval(0.0f, 1.0f)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
CScreensLinks::CEdgeLink::CEdgeLink(const CString& name,
|
||||
const CConfigLink& link) :
|
||||
m_srcName(name),
|
||||
m_srcSide(link.first.getSide()),
|
||||
m_srcInterval(link.first.getInterval()),
|
||||
m_dstName(link.second.getName()),
|
||||
m_dstInterval(link.second.getInterval())
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
bool
|
||||
CScreensLinks::CEdgeLink::connect(CConfig* config)
|
||||
{
|
||||
return config->connect(m_srcName, m_srcSide,
|
||||
m_srcInterval.first, m_srcInterval.second,
|
||||
m_dstName,
|
||||
m_dstInterval.first, m_dstInterval.second);
|
||||
}
|
||||
|
||||
bool
|
||||
CScreensLinks::CEdgeLink::disconnect(CConfig* config)
|
||||
{
|
||||
return config->disconnect(m_srcName, m_srcSide, 0.5f *
|
||||
(m_srcInterval.first + m_srcInterval.second));
|
||||
}
|
||||
|
||||
void
|
||||
CScreensLinks::CEdgeLink::rename(const CString& oldName, const CString& newName)
|
||||
{
|
||||
if (m_srcName == oldName) {
|
||||
m_srcName = newName;
|
||||
}
|
||||
if (m_dstName == oldName) {
|
||||
m_dstName = newName;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CScreensLinks::CEdgeLink::overlaps(const CConfig* config) const
|
||||
{
|
||||
return config->hasNeighbor(m_srcName, m_srcSide,
|
||||
m_srcInterval.first, m_srcInterval.second);
|
||||
}
|
||||
|
||||
bool
|
||||
CScreensLinks::CEdgeLink::operator==(const CEdgeLink& x) const
|
||||
{
|
||||
return (m_srcName == x.m_srcName &&
|
||||
m_srcSide == x.m_srcSide &&
|
||||
m_srcInterval == x.m_srcInterval &&
|
||||
m_dstName == x.m_dstName &&
|
||||
m_dstInterval == x.m_dstInterval);
|
||||
}
|
||||
138
cmd/launcher/CScreensLinks.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* synergy -- mouse and keyboard sharing utility
|
||||
* Copyright (C) 2003 Chris Schoeneman
|
||||
*
|
||||
* This package is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* found in the file 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.
|
||||
*/
|
||||
|
||||
#ifndef CSCREENSLINKS_H
|
||||
#define CSCREENSLINKS_H
|
||||
|
||||
#include "CConfig.h"
|
||||
#include "ProtocolTypes.h"
|
||||
#include "CString.h"
|
||||
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
//! Screens and links dialog for Microsoft Windows launcher
|
||||
class CScreensLinks {
|
||||
public:
|
||||
CScreensLinks(HWND parent, CConfig*);
|
||||
~CScreensLinks();
|
||||
|
||||
//! @name manipulators
|
||||
//@{
|
||||
|
||||
//! Run dialog
|
||||
/*!
|
||||
Display and handle the dialog until closed by the user.
|
||||
*/
|
||||
void doModal();
|
||||
|
||||
//@}
|
||||
//! @name accessors
|
||||
//@{
|
||||
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
typedef std::pair<CConfig::CCellEdge, CConfig::CCellEdge> CConfigLink;
|
||||
struct CEdgeLink {
|
||||
public:
|
||||
CEdgeLink();
|
||||
CEdgeLink(const CString& name, const CConfigLink&);
|
||||
|
||||
bool connect(CConfig*);
|
||||
bool disconnect(CConfig*);
|
||||
void rename(const CString& oldName, const CString& newName);
|
||||
|
||||
bool overlaps(const CConfig* config) const;
|
||||
bool operator==(const CEdgeLink&) const;
|
||||
|
||||
public:
|
||||
CString m_srcName;
|
||||
EDirection m_srcSide;
|
||||
CConfig::CInterval m_srcInterval;
|
||||
CString m_dstName;
|
||||
CConfig::CInterval m_dstInterval;
|
||||
};
|
||||
typedef std::vector<CEdgeLink> CEdgeLinkList;
|
||||
|
||||
void init(HWND hwnd);
|
||||
bool save(HWND hwnd);
|
||||
|
||||
CString getSelectedScreen(HWND hwnd) const;
|
||||
void addScreen(HWND hwnd);
|
||||
void editScreen(HWND hwnd);
|
||||
void removeScreen(HWND hwnd);
|
||||
void addLink(HWND hwnd);
|
||||
void editLink(HWND hwnd);
|
||||
void removeLink(HWND hwnd);
|
||||
|
||||
void updateScreens(HWND hwnd, const CString& name);
|
||||
void updateScreensControls(HWND hwnd);
|
||||
void updateLinks(HWND hwnd);
|
||||
void updateLinksControls(HWND hwnd);
|
||||
|
||||
void changeSrcSide(HWND hwnd);
|
||||
void changeSrcScreen(HWND hwnd);
|
||||
void changeDstScreen(HWND hwnd);
|
||||
void changeIntervalStart(HWND hwnd, int id,
|
||||
CConfig::CInterval&);
|
||||
void changeIntervalEnd(HWND hwnd, int id,
|
||||
CConfig::CInterval&);
|
||||
|
||||
void selectScreen(HWND hwnd, int id, const CString& name);
|
||||
void updateLinkEditControls(HWND hwnd,
|
||||
const CEdgeLink& link);
|
||||
void updateLinkIntervalControls(HWND hwnd,
|
||||
const CEdgeLink& link);
|
||||
void updateLink(HWND hwnd);
|
||||
void updateLinkValid(HWND hwnd, const CEdgeLink& link);
|
||||
|
||||
void updateLinkView(HWND hwnd);
|
||||
|
||||
HWND createErrorBox(HWND parent);
|
||||
void resizeErrorBoxes();
|
||||
void resizeErrorBox(HWND box, HWND assoc);
|
||||
|
||||
CString formatIntervalValue(float) const;
|
||||
CString formatInterval(const CConfig::CInterval&) const;
|
||||
CString formatLink(const CEdgeLink&) const;
|
||||
|
||||
// message handling
|
||||
BOOL doDlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
static BOOL CALLBACK dlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
private:
|
||||
static CScreensLinks* s_singleton;
|
||||
|
||||
HWND m_parent;
|
||||
CConfig* m_mainConfig;
|
||||
CConfig m_scratchConfig;
|
||||
CConfig* m_config;
|
||||
|
||||
CString m_linkFormat;
|
||||
CString m_intervalFormat;
|
||||
CString m_newLinkLabel;
|
||||
CString m_sideLabel[kNumDirections];
|
||||
CEdgeLinkList m_edgeLinks;
|
||||
SInt32 m_selectedLink;
|
||||
CEdgeLink m_editedLink;
|
||||
bool m_editedLinkIsValid;
|
||||
HPEN m_redPen;
|
||||
HWND m_srcSideError;
|
||||
HWND m_srcScreenError;
|
||||
HWND m_dstScreenError;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "resource.h"
|
||||
#include "stdfstream.h"
|
||||
|
||||
#define CONFIG_NAME "synergy.sgc"
|
||||
size_t s_showingDialog = 0;
|
||||
|
||||
CString
|
||||
getString(DWORD id)
|
||||
@@ -37,24 +37,36 @@ void
|
||||
showError(HWND hwnd, const CString& msg)
|
||||
{
|
||||
CString title = getString(IDS_ERROR);
|
||||
++s_showingDialog;
|
||||
MessageBox(hwnd, msg.c_str(), title.c_str(), MB_OK | MB_APPLMODAL);
|
||||
--s_showingDialog;
|
||||
}
|
||||
|
||||
void
|
||||
askOkay(HWND hwnd, const CString& title, const CString& msg)
|
||||
{
|
||||
++s_showingDialog;
|
||||
MessageBox(hwnd, msg.c_str(), title.c_str(), MB_OK | MB_APPLMODAL);
|
||||
--s_showingDialog;
|
||||
}
|
||||
|
||||
bool
|
||||
askVerify(HWND hwnd, const CString& msg)
|
||||
{
|
||||
CString title = getString(IDS_VERIFY);
|
||||
++s_showingDialog;
|
||||
int result = MessageBox(hwnd, msg.c_str(),
|
||||
title.c_str(), MB_OKCANCEL | MB_APPLMODAL);
|
||||
--s_showingDialog;
|
||||
return (result == IDOK);
|
||||
}
|
||||
|
||||
bool
|
||||
isShowingDialog()
|
||||
{
|
||||
return (s_showingDialog != 0);
|
||||
}
|
||||
|
||||
void
|
||||
setWindowText(HWND hwnd, const CString& msg)
|
||||
{
|
||||
@@ -109,6 +121,39 @@ getAppPath(const CString& appName)
|
||||
return appPath;
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
getFileTime(const CString& path, time_t& t)
|
||||
{
|
||||
struct _stat s;
|
||||
if (_stat(path.c_str(), &s) != -1) {
|
||||
t = s.st_mtime;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
isConfigNewer(time_t& oldTime, bool userConfig)
|
||||
{
|
||||
time_t newTime = oldTime;
|
||||
if (userConfig) {
|
||||
CString path = ARCH->getUserDirectory();
|
||||
if (!path.empty()) {
|
||||
path = ARCH->concatPath(path, CONFIG_NAME);
|
||||
getFileTime(path, newTime);
|
||||
}
|
||||
}
|
||||
else {
|
||||
CString path = ARCH->getSystemDirectory();
|
||||
if (!path.empty()) {
|
||||
path = ARCH->concatPath(path, CONFIG_NAME);
|
||||
getFileTime(path, newTime);
|
||||
}
|
||||
}
|
||||
bool result = (newTime > oldTime);
|
||||
oldTime = newTime;
|
||||
return result;
|
||||
}
|
||||
|
||||
static
|
||||
bool
|
||||
loadConfig(const CString& pathname, CConfig& config)
|
||||
@@ -127,7 +172,7 @@ loadConfig(const CString& pathname, CConfig& config)
|
||||
}
|
||||
|
||||
bool
|
||||
loadConfig(CConfig& config)
|
||||
loadConfig(CConfig& config, time_t& t, bool& userConfig)
|
||||
{
|
||||
// load configuration
|
||||
bool configLoaded = false;
|
||||
@@ -137,6 +182,8 @@ loadConfig(CConfig& config)
|
||||
path = ARCH->concatPath(path, CONFIG_NAME);
|
||||
if (loadConfig(path, config)) {
|
||||
configLoaded = true;
|
||||
userConfig = true;
|
||||
getFileTime(path, t);
|
||||
}
|
||||
else {
|
||||
// try the system-wide config file
|
||||
@@ -145,6 +192,8 @@ loadConfig(CConfig& config)
|
||||
path = ARCH->concatPath(path, CONFIG_NAME);
|
||||
if (loadConfig(path, config)) {
|
||||
configLoaded = true;
|
||||
userConfig = false;
|
||||
getFileTime(path, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,7 +219,7 @@ saveConfig(const CString& pathname, const CConfig& config)
|
||||
}
|
||||
|
||||
bool
|
||||
saveConfig(const CConfig& config, bool sysOnly)
|
||||
saveConfig(const CConfig& config, bool sysOnly, time_t& t)
|
||||
{
|
||||
// try saving the user's configuration
|
||||
if (!sysOnly) {
|
||||
@@ -178,6 +227,7 @@ saveConfig(const CConfig& config, bool sysOnly)
|
||||
if (!path.empty()) {
|
||||
path = ARCH->concatPath(path, CONFIG_NAME);
|
||||
if (saveConfig(path, config)) {
|
||||
getFileTime(path, t);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -189,6 +239,7 @@ saveConfig(const CConfig& config, bool sysOnly)
|
||||
if (!path.empty()) {
|
||||
path = ARCH->concatPath(path, CONFIG_NAME);
|
||||
if (saveConfig(path, config)) {
|
||||
getFileTime(path, t);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,12 @@
|
||||
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define CLIENT_APP "synergyc.exe"
|
||||
#define SERVER_APP "synergys.exe"
|
||||
#define CONFIG_NAME "synergy.sgc"
|
||||
|
||||
class CConfig;
|
||||
|
||||
@@ -35,6 +38,7 @@ void showError(HWND hwnd, const CString& msg);
|
||||
void askOkay(HWND hwnd, const CString& title,
|
||||
const CString& msg);
|
||||
bool askVerify(HWND hwnd, const CString& msg);
|
||||
bool isShowingDialog();
|
||||
|
||||
void setWindowText(HWND hwnd, const CString& msg);
|
||||
CString getWindowText(HWND hwnd);
|
||||
@@ -47,8 +51,10 @@ bool isItemChecked(HWND);
|
||||
|
||||
CString getAppPath(const CString& appName);
|
||||
|
||||
bool loadConfig(CConfig& config);
|
||||
bool saveConfig(const CConfig& config, bool sysOnly);
|
||||
bool isConfigNewer(time_t&, bool userConfig);
|
||||
bool loadConfig(CConfig& config, time_t&, bool& userConfig);
|
||||
bool saveConfig(const CConfig& config,
|
||||
bool sysOnly, time_t&);
|
||||
|
||||
const TCHAR* const* getSettingsPath();
|
||||
|
||||
|
||||
@@ -14,14 +14,22 @@
|
||||
NULL =
|
||||
|
||||
MSWINDOWS_SOURCE_FILES = \
|
||||
CAddScreen.cpp \
|
||||
CAdvancedOptions.cpp \
|
||||
CAutoStart.cpp \
|
||||
CGlobalOptions.cpp \
|
||||
CHotkeyOptions.cpp \
|
||||
CInfo.cpp \
|
||||
CScreensLinks.cpp \
|
||||
LaunchUtil.cpp \
|
||||
launcher.cpp \
|
||||
CAddScreen.h \
|
||||
CAdvancedOptions.h \
|
||||
CAutoStart.h \
|
||||
CGlobalOptions.h \
|
||||
CHotkeyOptions.h \
|
||||
CInfo.h \
|
||||
CScreensLinks.h \
|
||||
LaunchUtil.h \
|
||||
resource.h \
|
||||
launcher.rc \
|
||||
|
||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# 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\common" /I "..\..\lib\arch" /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fd"..\..\gen\build\launcher.pdb" /FD /c
|
||||
# ADD CPP /nologo /MT /W4 /GR /GX /O2 /I "..\..\lib\common" /I "..\..\lib\arch" /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fd"..\..\gen\build\launcher.pdb" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -71,7 +71,7 @@ LINK32=link.exe
|
||||
# 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\common" /I "..\..\lib\arch" /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fd"..\..\gen\debug\launcher.pdb" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W4 /Gm /GR /GX /ZI /Od /I "..\..\lib\common" /I "..\..\lib\arch" /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fd"..\..\gen\debug\launcher.pdb" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
@@ -95,6 +95,10 @@ LINK32=link.exe
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CAddScreen.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CAdvancedOptions.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -107,6 +111,18 @@ SOURCE=.\CGlobalOptions.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CHotkeyOptions.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CInfo.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CScreensLinks.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\launcher.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -123,6 +139,10 @@ SOURCE=.\LaunchUtil.cpp
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CAddScreen.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CAdvancedOptions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -135,6 +155,18 @@ SOURCE=.\CGlobalOptions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CHotkeyOptions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CInfo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CScreensLinks.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LaunchUtil.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -7,10 +7,7 @@
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
#if !defined(IDC_STATIC)
|
||||
#define IDC_STATIC (-1)
|
||||
#endif
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
@@ -55,55 +52,41 @@ END
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_MAIN DIALOG DISCARDABLE 32768, 0, 300, 262
|
||||
IDD_MAIN DIALOG DISCARDABLE 32768, 0, 300, 199
|
||||
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.",
|
||||
LTEXT "Choose to share or use a shared keyboard and mouse, 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 "Options",IDC_STATIC,7,177,286,56
|
||||
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,
|
||||
GROUPBOX "",IDC_STATIC,7,29,286,36
|
||||
GROUPBOX "",IDC_STATIC,7,72,286,36
|
||||
GROUPBOX "Options",IDC_STATIC,7,115,286,56
|
||||
CONTROL "&Use another computer's shared keyboard and mouse (client)",
|
||||
IDC_MAIN_CLIENT_RADIO,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_GROUP | WS_TABSTOP,11,29,205,10
|
||||
CONTROL "Share this computer's keyboard and mouse (server)",
|
||||
IDC_MAIN_SERVER_RADIO,"Button",BS_AUTORADIOBUTTON,11,72,
|
||||
177,10
|
||||
LTEXT "Other Computer's &Host Name:",
|
||||
IDC_MAIN_CLIENT_SERVER_NAME_LABEL,12,46,94,8
|
||||
EDITTEXT IDC_MAIN_CLIENT_SERVER_NAME_EDIT,111,44,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,111,75,
|
||||
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,112,75,
|
||||
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,112,75,
|
||||
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,112,75,
|
||||
CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "&Options...",IDC_MAIN_OPTIONS,12,191,50,14
|
||||
PUSHBUTTON "Adva&nced...",IDC_MAIN_ADVANCED,68,191,50,14
|
||||
LTEXT "Automatic Startup:",IDC_STATIC,138,193,59,8
|
||||
PUSHBUTTON "Con&figure...",IDC_MAIN_AUTOSTART,202,191,50,14
|
||||
LTEXT "Lo&gging Level:",IDC_STATIC,12,216,48,8
|
||||
COMBOBOX IDC_MAIN_DEBUG,68,213,61,60,CBS_DROPDOWNLIST |
|
||||
LTEXT "&Screens && Links:",IDC_MAIN_SERVER_SCREENS_LABEL,12,89,
|
||||
54,8
|
||||
PUSHBUTTON "Configure...",IDC_MAIN_SCREENS,71,86,50,14
|
||||
PUSHBUTTON "&Options...",IDC_MAIN_OPTIONS,12,129,50,14
|
||||
PUSHBUTTON "Hot &Keys...",IDC_MAIN_HOTKEYS,68,129,50,14
|
||||
PUSHBUTTON "Adva&nced...",IDC_MAIN_ADVANCED,124,129,50,14
|
||||
PUSHBUTTON "&AutoStart...",IDC_MAIN_AUTOSTART,180,129,50,14
|
||||
LTEXT "&Logging Level:",IDC_STATIC,12,154,48,8
|
||||
COMBOBOX IDC_MAIN_DEBUG,68,151,61,60,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Sa&ve",IDC_MAIN_SAVE,75,241,50,14
|
||||
DEFPUSHBUTTON "&Test",IDC_MAIN_TEST,131,241,50,14
|
||||
PUSHBUTTON "Start",IDOK,187,241,50,14
|
||||
PUSHBUTTON "Quit",IDCANCEL,243,241,50,14
|
||||
PUSHBUTTON "&Info",IDC_MAIN_INFO,7,178,50,14
|
||||
DEFPUSHBUTTON "&Test",IDC_MAIN_TEST,131,179,50,14
|
||||
PUSHBUTTON "Start",IDOK,187,179,50,14
|
||||
PUSHBUTTON "Quit",IDCANCEL,243,179,50,14
|
||||
END
|
||||
|
||||
IDD_ADD DIALOG DISCARDABLE 0, 0, 192, 254
|
||||
@@ -114,33 +97,46 @@ BEGIN
|
||||
LTEXT "&Screen Name:",IDC_STATIC,7,9,46,8
|
||||
EDITTEXT IDC_ADD_SCREEN_NAME_EDIT,79,7,106,12,ES_AUTOHSCROLL
|
||||
LTEXT "&Aliases:",IDC_STATIC,7,25,25,8
|
||||
EDITTEXT IDC_ADD_ALIASES_EDIT,79,26,106,40,ES_MULTILINE |
|
||||
EDITTEXT IDC_ADD_ALIASES_EDIT,79,26,106,24,ES_MULTILINE |
|
||||
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
GROUPBOX "Options",IDC_STATIC,7,72,178,80
|
||||
GROUPBOX "Options",IDC_STATIC,7,55,178,54
|
||||
LTEXT "If your Caps, Num, or Scroll Lock keys behave strangely on this client screen then try turning the half-duplex options on and reconnect the client.",
|
||||
IDC_STATIC,13,82,165,25
|
||||
CONTROL "Half-duplex &Caps Lock",IDC_ADD_HD_CAPS_CHECK,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,13,110,165,10
|
||||
CONTROL "Half-duplex &Num Lock",IDC_ADD_HD_NUM_CHECK,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,13,122,165,10
|
||||
CONTROL "Half-duplex Sc&roll Lock",IDC_ADD_HD_SCROLL_CHECK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,134,165,10
|
||||
GROUPBOX "Modifiers",IDC_STATIC,7,155,178,65
|
||||
LTEXT "Shift",IDC_STATIC,13,171,15,8
|
||||
COMBOBOX IDC_ADD_MOD_SHIFT,37,168,48,60,CBS_DROPDOWNLIST |
|
||||
IDC_STATIC,13,65,165,25
|
||||
CONTROL "&Caps Lock",IDC_ADD_HD_CAPS_CHECK,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,13,93,51,10
|
||||
CONTROL "&Num Lock",IDC_ADD_HD_NUM_CHECK,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,69,93,51,10
|
||||
CONTROL "Sc&roll Lock",IDC_ADD_HD_SCROLL_CHECK,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,125,93,51,10
|
||||
GROUPBOX "Modifiers",IDC_STATIC,7,113,178,65
|
||||
LTEXT "Shift",IDC_STATIC,13,129,15,8
|
||||
COMBOBOX IDC_ADD_MOD_SHIFT,37,126,48,60,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Ctrl",IDC_STATIC,13,186,11,8
|
||||
COMBOBOX IDC_ADD_MOD_CTRL,37,184,48,60,CBS_DROPDOWNLIST |
|
||||
LTEXT "Ctrl",IDC_STATIC,13,144,11,8
|
||||
COMBOBOX IDC_ADD_MOD_CTRL,37,142,48,60,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Alt",IDC_STATIC,13,202,9,8
|
||||
COMBOBOX IDC_ADD_MOD_ALT,37,200,48,60,CBS_DROPDOWNLIST |
|
||||
LTEXT "Alt",IDC_STATIC,13,160,9,8
|
||||
COMBOBOX IDC_ADD_MOD_ALT,37,158,48,60,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Meta",IDC_STATIC,101,170,17,8
|
||||
COMBOBOX IDC_ADD_MOD_META,125,168,48,60,CBS_DROPDOWNLIST |
|
||||
LTEXT "Meta",IDC_STATIC,101,128,17,8
|
||||
COMBOBOX IDC_ADD_MOD_META,125,126,48,60,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Super",IDC_STATIC,101,186,20,8
|
||||
COMBOBOX IDC_ADD_MOD_SUPER,125,184,48,60,CBS_DROPDOWNLIST |
|
||||
LTEXT "Super",IDC_STATIC,101,144,20,8
|
||||
COMBOBOX IDC_ADD_MOD_SUPER,125,142,48,60,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
GROUPBOX "Dead Corners",IDC_STATIC,7,183,178,43
|
||||
LTEXT "Don't switch in these corners:",IDC_STATIC,14,198,52,18
|
||||
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME,68,193,47,28
|
||||
CONTROL "",IDC_ADD_DC_TOP_LEFT,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,76,197,16,8
|
||||
CONTROL "",IDC_ADD_DC_TOP_RIGHT,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,98,197,16,8
|
||||
CONTROL "",IDC_ADD_DC_BOTTOM_LEFT,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,76,210,16,8
|
||||
CONTROL "",IDC_ADD_DC_BOTTOM_RIGHT,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,98,210,16,8
|
||||
LTEXT "Size",IDC_STATIC,120,202,14,8
|
||||
EDITTEXT IDC_ADD_DC_SIZE,139,200,40,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
DEFPUSHBUTTON "OK",IDOK,79,233,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,135,233,50,14
|
||||
END
|
||||
@@ -175,7 +171,7 @@ BEGIN
|
||||
IDC_STATIC,7,43,181,17
|
||||
END
|
||||
|
||||
IDD_GLOBAL_OPTIONS DIALOG DISCARDABLE 0, 0, 207, 269
|
||||
IDD_GLOBAL_OPTIONS DIALOG DISCARDABLE 0, 0, 207, 290
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Options"
|
||||
FONT 8, "MS Sans Serif"
|
||||
@@ -207,12 +203,15 @@ BEGIN
|
||||
IDC_STATIC,7,176,193,8
|
||||
CONTROL "Synchronize screen savers",IDC_GLOBAL_SCREENSAVER_SYNC,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,192,101,10
|
||||
LTEXT "Experimental: Relative mouse moves on secondary screens.",
|
||||
IDC_STATIC,7,213,193,8
|
||||
LTEXT "Relative mouse moves on secondary screens.",IDC_STATIC,
|
||||
7,213,193,8
|
||||
CONTROL "Use relative mouse moves",IDC_GLOBAL_RELATIVE_MOVES,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,229,99,10
|
||||
DEFPUSHBUTTON "OK",IDOK,94,248,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,150,248,50,14
|
||||
CONTROL "Don't take foreground window on Windows servers",
|
||||
IDC_GLOBAL_LEAVE_FOREGROUND,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,250,177,10
|
||||
DEFPUSHBUTTON "OK",IDOK,94,269,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,150,269,50,14
|
||||
END
|
||||
|
||||
IDD_ADVANCED_OPTIONS DIALOG DISCARDABLE 0, 0, 230, 186
|
||||
@@ -238,6 +237,158 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,173,165,50,14
|
||||
END
|
||||
|
||||
IDD_SCREENS_LINKS DIALOG DISCARDABLE 0, 0, 354, 213
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Screens & Links"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "&Screens:",IDC_STATIC,7,7,29,8
|
||||
LISTBOX IDC_SCREENS_SCREENS,7,18,100,36,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "+",IDC_SCREENS_ADD_SCREEN,7,57,17,14
|
||||
PUSHBUTTON "-",IDC_SCREENS_REMOVE_SCREEN,28,57,17,14
|
||||
PUSHBUTTON "Edit",IDC_SCREENS_EDIT_SCREEN,49,57,24,14
|
||||
LTEXT "&Links:",IDC_STATIC,7,83,20,8
|
||||
LISTBOX IDC_SCREENS_LINKS,7,94,339,59,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
EDITTEXT IDC_SCREENS_SRC_START,7,156,16,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
LTEXT "to",IDC_STATIC,25,158,8,8
|
||||
EDITTEXT IDC_SCREENS_SRC_END,33,156,16,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
LTEXT "% of the",IDC_STATIC,52,158,27,8
|
||||
COMBOBOX IDC_SCREENS_SRC_SIDE,80,156,48,69,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "of",IDC_STATIC,129,158,8,8
|
||||
COMBOBOX IDC_SCREENS_SRC_SCREEN,139,156,59,53,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "goes to",IDC_STATIC,200,158,24,8
|
||||
EDITTEXT IDC_SCREENS_DST_START,225,156,16,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
LTEXT "to",IDC_STATIC,243,158,8,8
|
||||
EDITTEXT IDC_SCREENS_DST_END,251,156,16,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
LTEXT "% of",IDC_STATIC,270,158,15,8
|
||||
COMBOBOX IDC_SCREENS_DST_SCREEN,287,156,59,53,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "+",IDC_SCREENS_ADD_LINK,7,172,17,14
|
||||
PUSHBUTTON "-",IDC_SCREENS_REMOVE_LINK,28,172,17,14
|
||||
DEFPUSHBUTTON "OK",IDOK,241,192,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,297,192,50,14
|
||||
LTEXT "Source edge overlaps an existing edge.",
|
||||
IDC_SCREENS_OVERLAP_ERROR,72,175,126,8,NOT WS_VISIBLE |
|
||||
NOT WS_GROUP
|
||||
END
|
||||
|
||||
IDD_INFO DIALOG DISCARDABLE 0, 0, 186, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Info"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Version:",IDC_STATIC,7,7,26,8
|
||||
EDITTEXT IDC_INFO_VERSION,52,7,127,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Hostname:",IDC_STATIC,7,19,35,8
|
||||
EDITTEXT IDC_INFO_HOSTNAME,52,19,127,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "IP Address:",IDC_STATIC,7,31,37,8
|
||||
EDITTEXT IDC_INFO_IP_ADDRESS,52,31,127,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "User Config:",IDC_STATIC,7,43,40,8
|
||||
EDITTEXT IDC_INFO_USER_CONFIG,52,43,127,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Sys Config:",IDC_STATIC,7,55,36,8
|
||||
EDITTEXT IDC_INFO_SYS_CONFIG,52,55,127,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY | NOT WS_BORDER
|
||||
DEFPUSHBUTTON "OK",IDOK,129,74,50,14
|
||||
END
|
||||
|
||||
IDD_HOTKEY_OPTIONS DIALOG DISCARDABLE 0, 0, 360, 151
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hot Keys"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "&Hot Keys:",IDC_STATIC,7,7,32,8
|
||||
LISTBOX IDC_HOTKEY_HOTKEYS,7,18,169,88,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "+",IDC_HOTKEY_ADD_HOTKEY,7,109,17,14
|
||||
PUSHBUTTON "-",IDC_HOTKEY_REMOVE_HOTKEY,28,109,17,14
|
||||
PUSHBUTTON "Edit",IDC_HOTKEY_EDIT_HOTKEY,49,109,24,14
|
||||
LTEXT "&Actions:",IDC_STATIC,183,7,26,8
|
||||
LISTBOX IDC_HOTKEY_ACTIONS,183,18,169,88,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "+",IDC_HOTKEY_ADD_ACTION,183,109,17,14
|
||||
PUSHBUTTON "-",IDC_HOTKEY_REMOVE_ACTION,204,109,17,14
|
||||
PUSHBUTTON "Edit",IDC_HOTKEY_EDIT_ACTION,225,109,24,14
|
||||
DEFPUSHBUTTON "OK",IDOK,302,130,50,14
|
||||
END
|
||||
|
||||
IDD_HOTKEY_CONDITION DIALOG DISCARDABLE 0, 0, 183, 58
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hot Key"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Enter &new hot key or mouse button:",IDC_STATIC,7,7,113,
|
||||
8
|
||||
EDITTEXT IDC_HOTKEY_CONDITION_HOTKEY,7,17,169,12,ES_WANTRETURN
|
||||
DEFPUSHBUTTON "OK",IDOK,70,37,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,126,37,50,14
|
||||
END
|
||||
|
||||
IDD_HOTKEY_ACTION DIALOG DISCARDABLE 0, 0, 183, 202
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Action"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "&Action:",IDC_STATIC,7,7,23,8
|
||||
CONTROL "Press:",IDC_HOTKEY_ACTION_DOWN,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_TABSTOP,7,19,35,10
|
||||
CONTROL "Release:",IDC_HOTKEY_ACTION_UP,"Button",
|
||||
BS_AUTORADIOBUTTON,7,31,44,10
|
||||
CONTROL "Press && Release:",IDC_HOTKEY_ACTION_DOWNUP,"Button",
|
||||
BS_AUTORADIOBUTTON,7,43,69,10
|
||||
CONTROL "Switch To Screen:",IDC_HOTKEY_ACTION_SWITCH_TO,"Button",
|
||||
BS_AUTORADIOBUTTON,7,85,75,10
|
||||
CONTROL "Switch In Direction:",IDC_HOTKEY_ACTION_SWITCH_IN,
|
||||
"Button",BS_AUTORADIOBUTTON,7,101,77,10
|
||||
CONTROL "Lock Cursor to Screen:",IDC_HOTKEY_ACTION_LOCK,"Button",
|
||||
BS_AUTORADIOBUTTON,7,117,89,10
|
||||
LTEXT "&Hot key or mouse button:",IDC_STATIC,7,55,80,8
|
||||
EDITTEXT IDC_HOTKEY_ACTION_HOTKEY,7,67,152,12,ES_WANTRETURN
|
||||
PUSHBUTTON "...",IDC_HOTKEY_ACTION_SCREENS,162,67,14,12
|
||||
COMBOBOX IDC_HOTKEY_ACTION_SWITCH_TO_LIST,87,83,89,62,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_HOTKEY_ACTION_SWITCH_IN_LIST,106,99,70,66,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_HOTKEY_ACTION_LOCK_LIST,106,115,70,58,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Action takes place &when:",IDC_STATIC,7,137,81,8
|
||||
CONTROL "Hot key is pressed",IDC_HOTKEY_ACTION_ON_ACTIVATE,
|
||||
"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,149,74,10
|
||||
CONTROL "Hot key is released",IDC_HOTKEY_ACTION_ON_DEACTIVATE,
|
||||
"Button",BS_AUTORADIOBUTTON,7,161,76,10
|
||||
DEFPUSHBUTTON "OK",IDOK,70,181,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,126,181,50,14
|
||||
END
|
||||
|
||||
IDD_HOTKEY_SCREENS DIALOG DISCARDABLE 0, 0, 237, 79
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Target Screens"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "&Available screens:",IDC_STATIC,7,7,58,8
|
||||
LISTBOX IDC_HOTKEY_SCREENS_SRC,7,17,100,36,LBS_NOINTEGRALHEIGHT |
|
||||
LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_HOTKEY_SCREENS_DST,130,17,100,36,
|
||||
LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "-->",IDC_HOTKEY_SCREENS_ADD,109,21,17,14
|
||||
PUSHBUTTON "<--",IDC_HOTKEY_SCREENS_REMOVE,109,38,17,14
|
||||
DEFPUSHBUTTON "OK",IDOK,124,58,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,180,58,50,14
|
||||
LTEXT "&Send action to screens:",IDC_STATIC,130,7,76,8
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -252,7 +403,7 @@ BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 293
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 255
|
||||
BOTTOMMARGIN, 192
|
||||
END
|
||||
|
||||
IDD_ADD, DIALOG
|
||||
@@ -284,7 +435,7 @@ BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 200
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 262
|
||||
BOTTOMMARGIN, 283
|
||||
END
|
||||
|
||||
IDD_ADVANCED_OPTIONS, DIALOG
|
||||
@@ -294,6 +445,54 @@ BEGIN
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 179
|
||||
END
|
||||
|
||||
IDD_SCREENS_LINKS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 347
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 206
|
||||
END
|
||||
|
||||
IDD_INFO, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 88
|
||||
END
|
||||
|
||||
IDD_HOTKEY_OPTIONS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 353
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 144
|
||||
END
|
||||
|
||||
IDD_HOTKEY_CONDITION, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 176
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 51
|
||||
END
|
||||
|
||||
IDD_HOTKEY_ACTION, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 176
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 195
|
||||
END
|
||||
|
||||
IDD_HOTKEY_SCREENS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 230
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 72
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
@@ -358,13 +557,37 @@ BEGIN
|
||||
IDS_UNINSTALLED_USER "Removed auto-start. Synergy will not automatically start each time you log in."
|
||||
IDS_INVALID_SERVER_NAME "Server name `%{1}' is invalid."
|
||||
IDS_TITLE "Synergy - Version %{1}"
|
||||
IDS_SERVER_IS_CLIENT "Please enter the computer name of the synergy server, not\nthe name of this computer, in the Server Host Name field."
|
||||
IDS_SERVER_IS_CLIENT "Please enter the name of the computer sharing a\nkeyboard and mouse, not the name of this computer,\nin the Other Computer's Host Name field."
|
||||
IDS_ADD_SCREEN "Add Screen"
|
||||
IDS_EDIT_SCREEN "Edit Screen %{1}"
|
||||
IDS_ERROR_CODE "Error code: %{1}"
|
||||
IDS_AUTOSTART_PERMISSION_ALL
|
||||
"You have sufficient access rights to install and uninstall Auto Start for all users or for just yourself."
|
||||
IDS_INVALID_INTERFACE_NAME "The interface '%{1}' is invalid: %{2}"
|
||||
IDS_INVALID_CORNER_SIZE "The dead corner size %{1} is invalid; it must be 0 or higher."
|
||||
IDS_NEW_LINK "[New Link]"
|
||||
IDS_SIDE_LEFT "left of"
|
||||
IDS_SIDE_RIGHT "right of"
|
||||
IDS_SIDE_TOP "above"
|
||||
IDS_SIDE_BOTTOM "below"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_LINK_FORMAT "%{4}%{5} is %{3} %{1}%{2}"
|
||||
IDS_LINK_INTERVAL_FORMAT "(%{1},%{2})"
|
||||
IDS_EDGE_LEFT "left"
|
||||
IDS_EDGE_RIGHT "right"
|
||||
IDS_EDGE_TOP "top"
|
||||
IDS_EDGE_BOTTOM "bottom"
|
||||
IDS_AUTOSTART_SAVE_FAILED "Failed to save autostart configuration: %{1}"
|
||||
IDS_LOAD_FAILED "Failed to load configuration."
|
||||
IDS_CONFIG_CHANGED "Configuration changed on disk. Reload?"
|
||||
IDS_LOCK_MODE_OFF "off"
|
||||
IDS_LOCK_MODE_ON "on"
|
||||
IDS_LOCK_MODE_TOGGLE "toggle"
|
||||
IDS_ALL_SCREENS "All Screens"
|
||||
IDS_ACTIVE_SCREEN "Active Screen"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
|
||||
@@ -44,6 +44,26 @@
|
||||
#define IDS_ERROR_CODE 39
|
||||
#define IDS_AUTOSTART_PERMISSION_ALL 40
|
||||
#define IDS_INVALID_INTERFACE_NAME 41
|
||||
#define IDS_INVALID_CORNER_SIZE 42
|
||||
#define IDS_NEW_LINK 43
|
||||
#define IDS_SIDE_LEFT 44
|
||||
#define IDS_SIDE_RIGHT 45
|
||||
#define IDS_SIDE_TOP 46
|
||||
#define IDS_SIDE_BOTTOM 47
|
||||
#define IDS_LINK_FORMAT 48
|
||||
#define IDS_LINK_INTERVAL_FORMAT 49
|
||||
#define IDS_EDGE_LEFT 50
|
||||
#define IDS_EDGE_RIGHT 51
|
||||
#define IDS_EDGE_TOP 52
|
||||
#define IDS_EDGE_BOTTOM 53
|
||||
#define IDS_AUTOSTART_SAVE_FAILED 54
|
||||
#define IDS_LOAD_FAILED 55
|
||||
#define IDS_CONFIG_CHANGED 56
|
||||
#define IDS_LOCK_MODE_OFF 57
|
||||
#define IDS_LOCK_MODE_ON 58
|
||||
#define IDS_LOCK_MODE_TOGGLE 59
|
||||
#define IDS_ALL_SCREENS 60
|
||||
#define IDS_ACTIVE_SCREEN 61
|
||||
#define IDD_MAIN 101
|
||||
#define IDD_ADD 102
|
||||
#define IDD_WAIT 103
|
||||
@@ -51,45 +71,36 @@
|
||||
#define IDD_AUTOSTART 105
|
||||
#define IDD_ADVANCED_OPTIONS 106
|
||||
#define IDD_GLOBAL_OPTIONS 107
|
||||
#define IDD_SCREENS_LINKS 110
|
||||
#define IDD_INFO 111
|
||||
#define IDD_HOTKEY_OPTIONS 112
|
||||
#define IDD_HOTKEY_CONDITION 113
|
||||
#define IDD_HOTKEY_ACTION 114
|
||||
#define IDD_HOTKEY_SCREENS 115
|
||||
#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_CLIENT_SERVER_NAME_LABEL 1002
|
||||
#define IDC_MAIN_CLIENT_SERVER_NAME_EDIT 1003
|
||||
#define IDC_MAIN_SERVER_SCREENS_LABEL 1004
|
||||
#define IDC_MAIN_SCREENS 1005
|
||||
#define IDC_MAIN_OPTIONS 1006
|
||||
#define IDC_MAIN_ADVANCED 1007
|
||||
#define IDC_MAIN_AUTOSTART 1008
|
||||
#define IDC_MAIN_TEST 1009
|
||||
#define IDC_MAIN_SAVE 1010
|
||||
#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_MAIN_HOTKEYS 1010
|
||||
#define IDC_MAIN_DEBUG 1011
|
||||
#define IDC_ADD_SCREEN_NAME_EDIT 1020
|
||||
#define IDC_MAIN_SERVER_REMOVE_BUTTON 1020
|
||||
#define IDC_ADD_ALIASES_EDIT 1021
|
||||
#define IDC_MAIN_SERVER_OPTIONS_BUTTON 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
|
||||
#define IDC_AUTOSTART_INSTALLED_MSG 1031
|
||||
#define IDC_AUTOSTART_PERMISSION_MSG 1032
|
||||
#define IDC_AUTOSTART_INSTALL_USER 1033
|
||||
#define IDC_AUTOSTART_INSTALL_SYSTEM 1034
|
||||
#define IDC_MAIN_AUTOSTART 1035
|
||||
#define IDC_MAIN_OPTIONS 1036
|
||||
#define IDC_ADD_HD_CAPS_CHECK 1037
|
||||
#define IDC_MAIN_ADVANCED 1037
|
||||
#define IDC_ADD_HD_NUM_CHECK 1038
|
||||
#define IDC_ADVANCED_NAME_EDIT 1038
|
||||
#define IDC_ADVANCED_PORT_EDIT 1039
|
||||
#define IDC_ADD_HD_SCROLL_CHECK 1039
|
||||
#define IDC_MAIN_DEBUG 1040
|
||||
#define IDC_ADVANCED_INTERFACE_EDIT 1040
|
||||
#define IDC_GLOBAL_DELAY_CHECK 1041
|
||||
#define IDC_GLOBAL_DELAY_TIME 1042
|
||||
@@ -105,15 +116,68 @@
|
||||
#define IDC_GLOBAL_SCREENSAVER_SYNC 1047
|
||||
#define IDC_GLOBAL_RELATIVE_MOVES 1048
|
||||
#define IDC_ADVANCED_DEFAULTS 1049
|
||||
#define IDC_GLOBAL_LEAVE_FOREGROUND 1049
|
||||
#define IDC_ADD_DC_SIZE 1052
|
||||
#define IDC_ADD_DC_TOP_LEFT 1053
|
||||
#define IDC_ADD_DC_TOP_RIGHT 1054
|
||||
#define IDC_ADD_DC_BOTTOM_LEFT 1055
|
||||
#define IDC_ADD_DC_BOTTOM_RIGHT 1056
|
||||
#define IDC_SCREENS_SRC_SIDE 1057
|
||||
#define IDC_SCREENS_SRC_START 1058
|
||||
#define IDC_SCREENS_SRC_END 1059
|
||||
#define IDC_SCREENS_SRC_SCREEN 1060
|
||||
#define IDC_SCREENS_SCREENS 1061
|
||||
#define IDC_SCREENS_ADD_SCREEN 1062
|
||||
#define IDC_SCREENS_LINKS 1063
|
||||
#define IDC_SCREENS_DST_START 1064
|
||||
#define IDC_SCREENS_DST_END 1065
|
||||
#define IDC_SCREENS_DST_SCREEN 1066
|
||||
#define IDC_SCREENS_REMOVE_SCREEN 1067
|
||||
#define IDC_SCREENS_EDIT_SCREEN 1068
|
||||
#define IDC_SCREENS_ADD_LINK 1069
|
||||
#define IDC_SCREENS_REMOVE_LINK 1070
|
||||
#define IDC_SCREENS_OVERLAP_ERROR 1071
|
||||
#define IDC_INFO_VERSION 1073
|
||||
#define IDC_MAIN_INFO 1074
|
||||
#define IDC_INFO_HOSTNAME 1076
|
||||
#define IDC_HOTKEY_HOTKEYS 1076
|
||||
#define IDC_INFO_IP_ADDRESS 1077
|
||||
#define IDC_HOTKEY_ADD_HOTKEY 1077
|
||||
#define IDC_INFO_USER_CONFIG 1078
|
||||
#define IDC_HOTKEY_REMOVE_HOTKEY 1078
|
||||
#define IDC_INFO_SYS_CONFIG 1079
|
||||
#define IDC_HOTKEY_EDIT_HOTKEY 1079
|
||||
#define IDC_HOTKEY_ACTIONS 1080
|
||||
#define IDC_HOTKEY_CONDITION_HOTKEY 1080
|
||||
#define IDC_HOTKEY_ACTION_DOWNUP 1081
|
||||
#define IDC_HOTKEY_ADD_ACTION 1082
|
||||
#define IDC_HOTKEY_ACTION_DOWN 1082
|
||||
#define IDC_HOTKEY_REMOVE_ACTION 1083
|
||||
#define IDC_HOTKEY_ACTION_UP 1083
|
||||
#define IDC_HOTKEY_EDIT_ACTION 1084
|
||||
#define IDC_HOTKEY_ACTION_HOTKEY 1085
|
||||
#define IDC_HOTKEY_ACTION_SWITCH_TO_LIST 1086
|
||||
#define IDC_HOTKEY_ACTION_SWITCH_TO 1087
|
||||
#define IDC_HOTKEY_ACTION_SWITCH_IN 1088
|
||||
#define IDC_HOTKEY_ACTION_LOCK 1089
|
||||
#define IDC_HOTKEY_ACTION_SWITCH_IN_LIST 1090
|
||||
#define IDC_HOTKEY_ACTION_LOCK_LIST 1091
|
||||
#define IDC_HOTKEY_ACTION_ON_ACTIVATE 1092
|
||||
#define IDC_HOTKEY_ACTION_ON_DEACTIVATE 1093
|
||||
#define IDC_HOTKEY_ACTION_SCREENS 1094
|
||||
#define IDC_HOTKEY_SCREENS_SRC 1095
|
||||
#define IDC_HOTKEY_SCREENS_DST 1096
|
||||
#define IDC_HOTKEY_SCREENS_ADD 1097
|
||||
#define IDC_HOTKEY_SCREENS_REMOVE 1098
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 110
|
||||
#define _APS_NEXT_RESOURCE_VALUE 116
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1052
|
||||
#define _APS_NEXT_CONTROL_VALUE 1098
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -15,8 +15,10 @@
|
||||
#include "CClientTaskBarReceiver.h"
|
||||
#include "CClient.h"
|
||||
#include "CLock.h"
|
||||
#include "CStringUtil.h"
|
||||
#include "IEventQueue.h"
|
||||
#include "CArch.h"
|
||||
#include "Version.h"
|
||||
|
||||
//
|
||||
// CClientTaskBarReceiver
|
||||
@@ -48,6 +50,8 @@ CClientTaskBarReceiver::updateStatus(CClient* client, const CString& errorMsg)
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_server = client->getServerAddress().getHostname();
|
||||
|
||||
if (client->isConnected()) {
|
||||
m_state = kConnected;
|
||||
}
|
||||
@@ -108,19 +112,23 @@ CClientTaskBarReceiver::getToolTip() const
|
||||
{
|
||||
switch (m_state) {
|
||||
case kNotRunning:
|
||||
return "Synergy: Not running";
|
||||
return CStringUtil::print("%s: Not running", kAppVersion);
|
||||
|
||||
case kNotWorking:
|
||||
return CString("Synergy: ") + m_errorMessage;
|
||||
return CStringUtil::print("%s: %s",
|
||||
kAppVersion, m_errorMessage.c_str());
|
||||
|
||||
case kNotConnected:
|
||||
return CString("Synergy: Not connected: ") + m_errorMessage;
|
||||
return CStringUtil::print("%s: Not connected: %s",
|
||||
kAppVersion, m_errorMessage.c_str());
|
||||
|
||||
case kConnecting:
|
||||
return "Synergy: Connecting...";
|
||||
return CStringUtil::print("%s: Connecting to %s...",
|
||||
kAppVersion, m_server.c_str());
|
||||
|
||||
case kConnected:
|
||||
return "Synergy: Connected";
|
||||
return CStringUtil::print("%s: Connected to %s",
|
||||
kAppVersion, m_server.c_str());
|
||||
|
||||
default:
|
||||
return "";
|
||||
|
||||
@@ -77,6 +77,7 @@ protected:
|
||||
private:
|
||||
EState m_state;
|
||||
CString m_errorMessage;
|
||||
CString m_server;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -139,6 +139,9 @@ CMSWindowsClientTaskBarReceiver::runMenu(int x, int y)
|
||||
SetForegroundWindow(m_window);
|
||||
HMENU menu = GetSubMenu(m_menu, 0);
|
||||
SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
|
||||
HMENU logLevelMenu = GetSubMenu(menu, 3);
|
||||
CheckMenuRadioItem(logLevelMenu, 0, 6,
|
||||
CLOG->getFilter() - CLog::kERROR, MF_BYPOSITION);
|
||||
int n = TrackPopupMenu(menu,
|
||||
TPM_NONOTIFY |
|
||||
TPM_RETURNCMD |
|
||||
@@ -157,6 +160,38 @@ CMSWindowsClientTaskBarReceiver::runMenu(int x, int y)
|
||||
copyLog();
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_SHOW_LOG:
|
||||
ARCH->showConsole(true);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_ERROR:
|
||||
CLOG->setFilter(CLog::kERROR);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_WARNING:
|
||||
CLOG->setFilter(CLog::kWARNING);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_NOTE:
|
||||
CLOG->setFilter(CLog::kNOTE);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_INFO:
|
||||
CLOG->setFilter(CLog::kINFO);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG:
|
||||
CLOG->setFilter(CLog::kDEBUG);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
|
||||
CLOG->setFilter(CLog::kDEBUG1);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
|
||||
CLOG->setFilter(CLog::kDEBUG2);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_QUIT:
|
||||
quit();
|
||||
break;
|
||||
|
||||
@@ -67,6 +67,12 @@ synergyc_SOURCES = \
|
||||
$(COMMON_SOURCE_FILES) \
|
||||
$(CARBON_SOURCE_FILES) \
|
||||
$(NULL)
|
||||
synergyc_LDFLAGS = \
|
||||
-framework ScreenSaver \
|
||||
-framework IOKit \
|
||||
-framework ApplicationServices \
|
||||
-framework Foundation \
|
||||
$(NULL)
|
||||
endif
|
||||
synergyc_LDADD = \
|
||||
$(top_builddir)/lib/client/libclient.a \
|
||||
|
||||
@@ -16,13 +16,21 @@
|
||||
#define IDC_TASKBAR_QUIT 40001
|
||||
#define IDC_TASKBAR_STATUS 40002
|
||||
#define IDC_TASKBAR_LOG 40003
|
||||
#define IDC_TASKBAR_SHOW_LOG 40004
|
||||
#define IDC_TASKBAR_LOG_LEVEL_ERROR 40009
|
||||
#define IDC_TASKBAR_LOG_LEVEL_WARNING 40010
|
||||
#define IDC_TASKBAR_LOG_LEVEL_NOTE 40011
|
||||
#define IDC_TASKBAR_LOG_LEVEL_INFO 40012
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG 40013
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG1 40014
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG2 40015
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 109
|
||||
#define _APS_NEXT_COMMAND_VALUE 40004
|
||||
#define _APS_NEXT_COMMAND_VALUE 40016
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
||||
@@ -60,10 +60,6 @@
|
||||
typedef int (*StartupFunc)(int, char**);
|
||||
static bool startClient();
|
||||
static void parse(int argc, const char* const* argv);
|
||||
#if WINAPI_MSWINDOWS
|
||||
static void handleSystemSuspend(void*);
|
||||
static void handleSystemResume(void*);
|
||||
#endif
|
||||
|
||||
//
|
||||
// program arguments
|
||||
@@ -108,9 +104,7 @@ CScreen*
|
||||
createScreen()
|
||||
{
|
||||
#if WINAPI_MSWINDOWS
|
||||
return new CScreen(new CMSWindowsScreen(false,
|
||||
new CFunctionJob(&handleSystemSuspend),
|
||||
new CFunctionJob(&handleSystemResume)));
|
||||
return new CScreen(new CMSWindowsScreen(false));
|
||||
#elif WINAPI_XWINDOWS
|
||||
return new CScreen(new CXWindowsScreen(ARG->m_display, false));
|
||||
#elif WINAPI_CARBON
|
||||
@@ -199,26 +193,6 @@ handleScreenError(const CEvent&, void*)
|
||||
EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
|
||||
}
|
||||
|
||||
#if WINAPI_MSWINDOWS
|
||||
static
|
||||
void
|
||||
handleSystemSuspend(void*)
|
||||
{
|
||||
LOG((CLOG_NOTE "system suspending"));
|
||||
s_suspened = true;
|
||||
s_client->disconnect(NULL);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
handleSystemResume(void*)
|
||||
{
|
||||
LOG((CLOG_NOTE "system resuming"));
|
||||
s_suspened = false;
|
||||
startClient();
|
||||
}
|
||||
#endif
|
||||
|
||||
static
|
||||
CScreen*
|
||||
openClientScreen()
|
||||
@@ -252,9 +226,7 @@ handleClientRestart(const CEvent&, void* vtimer)
|
||||
EVENTQUEUE->removeHandler(CEvent::kTimer, timer);
|
||||
|
||||
// reconnect
|
||||
if (!s_suspened) {
|
||||
startClient();
|
||||
}
|
||||
startClient();
|
||||
}
|
||||
|
||||
static
|
||||
@@ -287,6 +259,7 @@ handleClientFailed(const CEvent& e, void*)
|
||||
updateStatus(CString("Failed to connect to server: ") + info->m_what);
|
||||
if (!ARG->m_restartable || !info->m_retry) {
|
||||
LOG((CLOG_ERR "failed to connect to server: %s", info->m_what));
|
||||
EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
|
||||
}
|
||||
else {
|
||||
LOG((CLOG_WARN "failed to connect to server: %s", info->m_what));
|
||||
@@ -441,7 +414,11 @@ static
|
||||
int
|
||||
daemonMainLoop(int, const char**)
|
||||
{
|
||||
CSystemLogger sysLogger(DAEMON_NAME);
|
||||
#if SYSAPI_WIN32
|
||||
CSystemLogger sysLogger(DAEMON_NAME, false);
|
||||
#else
|
||||
CSystemLogger sysLogger(DAEMON_NAME, true);
|
||||
#endif
|
||||
return mainLoop();
|
||||
}
|
||||
|
||||
@@ -449,6 +426,10 @@ static
|
||||
int
|
||||
standardStartup(int argc, char** argv)
|
||||
{
|
||||
if (!ARG->m_daemon) {
|
||||
ARCH->showConsole(false);
|
||||
}
|
||||
|
||||
// parse command line
|
||||
parse(argc, argv);
|
||||
|
||||
@@ -758,6 +739,7 @@ public:
|
||||
// ILogOutputter overrides
|
||||
virtual void open(const char*) { }
|
||||
virtual void close() { }
|
||||
virtual void show(bool) { }
|
||||
virtual bool write(ELevel level, const char* message);
|
||||
virtual const char* getNewline() const { return ""; }
|
||||
};
|
||||
@@ -802,11 +784,24 @@ static
|
||||
int
|
||||
daemonNTStartup(int, char**)
|
||||
{
|
||||
CSystemLogger sysLogger(DAEMON_NAME);
|
||||
CSystemLogger sysLogger(DAEMON_NAME, false);
|
||||
bye = &byeThrow;
|
||||
return ARCH->daemonize(DAEMON_NAME, &daemonNTMainLoop);
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
foregroundStartup(int argc, char** argv)
|
||||
{
|
||||
ARCH->showConsole(false);
|
||||
|
||||
// parse command line
|
||||
parse(argc, argv);
|
||||
|
||||
// never daemonize
|
||||
return mainLoop();
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
showError(HINSTANCE instance, const char* title, UINT id, const char* arg)
|
||||
@@ -820,12 +815,23 @@ int WINAPI
|
||||
WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
try {
|
||||
CArchMiscWindows::setIcons((HICON)LoadImage(instance,
|
||||
MAKEINTRESOURCE(IDI_SYNERGY),
|
||||
IMAGE_ICON,
|
||||
32, 32, LR_SHARED),
|
||||
(HICON)LoadImage(instance,
|
||||
MAKEINTRESOURCE(IDI_SYNERGY),
|
||||
IMAGE_ICON,
|
||||
16, 16, LR_SHARED));
|
||||
CArch arch(instance);
|
||||
CMSWindowsScreen::init(instance);
|
||||
CLOG;
|
||||
CThread::getCurrentThread().setPriority(-14);
|
||||
CArgs args;
|
||||
|
||||
// set title on log window
|
||||
ARCH->openConsole((CString(kAppVersion) + " " + "Client").c_str());
|
||||
|
||||
// windows NT family starts services using no command line options.
|
||||
// since i'm not sure how to tell the difference between that and
|
||||
// a user providing no options we'll assume that if there are no
|
||||
@@ -833,8 +839,13 @@ WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int)
|
||||
// users on NT can use `--daemon' or `--no-daemon' to force us out
|
||||
// of the service code path.
|
||||
StartupFunc startup = &standardStartup;
|
||||
if (__argc <= 1 && !CArchMiscWindows::isWindows95Family()) {
|
||||
startup = &daemonNTStartup;
|
||||
if (!CArchMiscWindows::isWindows95Family()) {
|
||||
if (__argc <= 1) {
|
||||
startup = &daemonNTStartup;
|
||||
}
|
||||
else {
|
||||
startup = &foregroundStartup;
|
||||
}
|
||||
}
|
||||
|
||||
// send PRINT and FATAL output to a message box
|
||||
|
||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# 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\common" /I "..\..\lib\arch" /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 /Fd..\..\gen\build\synergyc.pdb
|
||||
# ADD CPP /nologo /MT /W4 /GR /GX /O2 /I "..\..\lib\common" /I "..\..\lib\arch" /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"..\..\gen\build\synergyc.pdb" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# 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\common" /I "..\..\lib\arch" /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 /Fd..\..\gen\debug\synergyc.pdb
|
||||
# ADD CPP /nologo /MTd /W4 /Gm /GR /GX /ZI /Od /I "..\..\lib\common" /I "..\..\lib\arch" /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"..\..\gen\debug\synergyc.pdb" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -87,7 +87,25 @@ BEGIN
|
||||
POPUP "Synergy"
|
||||
BEGIN
|
||||
MENUITEM "Show Status", IDC_TASKBAR_STATUS
|
||||
MENUITEM "Show Log", IDC_TASKBAR_SHOW_LOG
|
||||
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
|
||||
POPUP "Set Log Level"
|
||||
BEGIN
|
||||
MENUITEM "Error", IDC_TASKBAR_LOG_LEVEL_ERROR
|
||||
|
||||
MENUITEM "Warning", IDC_TASKBAR_LOG_LEVEL_WARNING
|
||||
|
||||
MENUITEM "Note", IDC_TASKBAR_LOG_LEVEL_NOTE
|
||||
|
||||
MENUITEM "Info", IDC_TASKBAR_LOG_LEVEL_INFO
|
||||
|
||||
MENUITEM "Debug", IDC_TASKBAR_LOG_LEVEL_DEBUG
|
||||
|
||||
MENUITEM "Debug1", IDC_TASKBAR_LOG_LEVEL_DEBUG1
|
||||
|
||||
MENUITEM "Debug2", IDC_TASKBAR_LOG_LEVEL_DEBUG2
|
||||
|
||||
END
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Quit", IDC_TASKBAR_QUIT
|
||||
END
|
||||
|
||||
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
@@ -157,6 +157,9 @@ CMSWindowsServerTaskBarReceiver::runMenu(int x, int y)
|
||||
SetForegroundWindow(m_window);
|
||||
HMENU menu = GetSubMenu(m_menu, 0);
|
||||
SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
|
||||
HMENU logLevelMenu = GetSubMenu(menu, 3);
|
||||
CheckMenuRadioItem(logLevelMenu, 0, 6,
|
||||
CLOG->getFilter() - CLog::kERROR, MF_BYPOSITION);
|
||||
int n = TrackPopupMenu(menu,
|
||||
TPM_NONOTIFY |
|
||||
TPM_RETURNCMD |
|
||||
@@ -175,6 +178,10 @@ CMSWindowsServerTaskBarReceiver::runMenu(int x, int y)
|
||||
copyLog();
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_SHOW_LOG:
|
||||
ARCH->showConsole(true);
|
||||
break;
|
||||
|
||||
case IDC_RELOAD_CONFIG:
|
||||
EVENTQUEUE->addEvent(CEvent(getReloadConfigEvent(),
|
||||
IEventQueue::getSystemTarget()));
|
||||
@@ -185,6 +192,34 @@ CMSWindowsServerTaskBarReceiver::runMenu(int x, int y)
|
||||
IEventQueue::getSystemTarget()));
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_ERROR:
|
||||
CLOG->setFilter(CLog::kERROR);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_WARNING:
|
||||
CLOG->setFilter(CLog::kWARNING);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_NOTE:
|
||||
CLOG->setFilter(CLog::kNOTE);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_INFO:
|
||||
CLOG->setFilter(CLog::kINFO);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG:
|
||||
CLOG->setFilter(CLog::kDEBUG);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
|
||||
CLOG->setFilter(CLog::kDEBUG1);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
|
||||
CLOG->setFilter(CLog::kDEBUG2);
|
||||
break;
|
||||
|
||||
case IDC_TASKBAR_QUIT:
|
||||
quit();
|
||||
break;
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
#include "CServerTaskBarReceiver.h"
|
||||
#include "CServer.h"
|
||||
#include "CLock.h"
|
||||
#include "CStringUtil.h"
|
||||
#include "IEventQueue.h"
|
||||
#include "CArch.h"
|
||||
#include "Version.h"
|
||||
|
||||
//
|
||||
// CServerTaskBarReceiver
|
||||
@@ -113,16 +115,17 @@ CServerTaskBarReceiver::getToolTip() const
|
||||
{
|
||||
switch (m_state) {
|
||||
case kNotRunning:
|
||||
return "Synergy: Not running";
|
||||
return CStringUtil::print("%s: Not running", kAppVersion);
|
||||
|
||||
case kNotWorking:
|
||||
return std::string("Synergy: ") + m_errorMessage;
|
||||
|
||||
return CStringUtil::print("%s: %s",
|
||||
kAppVersion, m_errorMessage.c_str());
|
||||
|
||||
case kNotConnected:
|
||||
return "Synergy: Waiting for clients";
|
||||
return CStringUtil::print("%s: Waiting for clients", kAppVersion);
|
||||
|
||||
case kConnected:
|
||||
return "Synergy: Connected";
|
||||
return CStringUtil::print("%s: Connected", kAppVersion);
|
||||
|
||||
default:
|
||||
return "";
|
||||
|
||||
@@ -67,6 +67,12 @@ synergys_SOURCES = \
|
||||
$(COMMON_SOURCE_FILES) \
|
||||
$(CARBON_SOURCE_FILES) \
|
||||
$(NULL)
|
||||
synergys_LDFLAGS = \
|
||||
-framework ScreenSaver \
|
||||
-framework IOKit \
|
||||
-framework ApplicationServices \
|
||||
-framework Foundation \
|
||||
$(NULL)
|
||||
endif
|
||||
synergys_LDADD = \
|
||||
$(top_builddir)/lib/server/libserver.a \
|
||||
|
||||
@@ -19,13 +19,21 @@
|
||||
#define IDC_TASKBAR_LOG 40005
|
||||
#define IDC_RELOAD_CONFIG 40006
|
||||
#define IDC_FORCE_RECONNECT 40007
|
||||
#define IDC_TASKBAR_SHOW_LOG 40008
|
||||
#define IDC_TASKBAR_LOG_LEVEL_ERROR 40009
|
||||
#define IDC_TASKBAR_LOG_LEVEL_WARNING 40010
|
||||
#define IDC_TASKBAR_LOG_LEVEL_NOTE 40011
|
||||
#define IDC_TASKBAR_LOG_LEVEL_INFO 40012
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG 40013
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG1 40014
|
||||
#define IDC_TASKBAR_LOG_LEVEL_DEBUG2 40015
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 109
|
||||
#define _APS_NEXT_COMMAND_VALUE 40008
|
||||
#define _APS_NEXT_COMMAND_VALUE 40016
|
||||
#define _APS_NEXT_CONTROL_VALUE 1003
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
||||
@@ -121,7 +121,7 @@ CScreen*
|
||||
createScreen()
|
||||
{
|
||||
#if WINAPI_MSWINDOWS
|
||||
return new CScreen(new CMSWindowsScreen(true, NULL, NULL));
|
||||
return new CScreen(new CMSWindowsScreen(true));
|
||||
#elif WINAPI_XWINDOWS
|
||||
return new CScreen(new CXWindowsScreen(ARG->m_display, true));
|
||||
#elif WINAPI_CARBON
|
||||
@@ -148,6 +148,16 @@ createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
|
||||
// platform independent main
|
||||
//
|
||||
|
||||
enum EServerState {
|
||||
kUninitialized,
|
||||
kInitializing,
|
||||
kInitializingToStart,
|
||||
kInitialized,
|
||||
kStarting,
|
||||
kStarted
|
||||
};
|
||||
|
||||
static EServerState s_serverState = kUninitialized;
|
||||
static CServer* s_server = NULL;
|
||||
static CScreen* s_serverScreen = NULL;
|
||||
static CPrimaryClient* s_primaryClient = NULL;
|
||||
@@ -155,6 +165,8 @@ static CClientListener* s_listener = NULL;
|
||||
static CServerTaskBarReceiver* s_taskBarReceiver = NULL;
|
||||
static CEvent::Type s_reloadConfigEvent = CEvent::kUnknown;
|
||||
static CEvent::Type s_forceReconnectEvent = CEvent::kUnknown;
|
||||
static bool s_suspended = false;
|
||||
static CEventQueueTimer* s_timer = NULL;
|
||||
|
||||
CEvent::Type
|
||||
getReloadConfigEvent()
|
||||
@@ -224,6 +236,10 @@ handleScreenError(const CEvent&, void*)
|
||||
EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
|
||||
}
|
||||
|
||||
|
||||
static void handleSuspend(const CEvent& event, void*);
|
||||
static void handleResume(const CEvent& event, void*);
|
||||
|
||||
static
|
||||
CScreen*
|
||||
openServerScreen()
|
||||
@@ -233,6 +249,14 @@ openServerScreen()
|
||||
screen->getEventTarget(),
|
||||
new CFunctionEventJob(
|
||||
&handleScreenError));
|
||||
EVENTQUEUE->adoptHandler(IScreen::getSuspendEvent(),
|
||||
screen->getEventTarget(),
|
||||
new CFunctionEventJob(
|
||||
&handleSuspend));
|
||||
EVENTQUEUE->adoptHandler(IScreen::getResumeEvent(),
|
||||
screen->getEventTarget(),
|
||||
new CFunctionEventJob(
|
||||
&handleResume));
|
||||
return screen;
|
||||
}
|
||||
|
||||
@@ -243,6 +267,10 @@ closeServerScreen(CScreen* screen)
|
||||
if (screen != NULL) {
|
||||
EVENTQUEUE->removeHandler(IScreen::getErrorEvent(),
|
||||
screen->getEventTarget());
|
||||
EVENTQUEUE->removeHandler(IScreen::getSuspendEvent(),
|
||||
screen->getEventTarget());
|
||||
EVENTQUEUE->removeHandler(IScreen::getResumeEvent(),
|
||||
screen->getEventTarget());
|
||||
delete screen;
|
||||
}
|
||||
}
|
||||
@@ -319,80 +347,180 @@ closeServer(CServer* server)
|
||||
delete server;
|
||||
}
|
||||
|
||||
static bool initServer();
|
||||
static bool startServer();
|
||||
|
||||
static
|
||||
void
|
||||
retryStartHandler(const CEvent&, void* vtimer)
|
||||
stopRetryTimer()
|
||||
{
|
||||
if (s_timer != NULL) {
|
||||
EVENTQUEUE->deleteTimer(s_timer);
|
||||
EVENTQUEUE->removeHandler(CEvent::kTimer, NULL);
|
||||
s_timer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
retryHandler(const CEvent&, void*)
|
||||
{
|
||||
// discard old timer
|
||||
CEventQueueTimer* timer = reinterpret_cast<CEventQueueTimer*>(vtimer);
|
||||
EVENTQUEUE->deleteTimer(timer);
|
||||
EVENTQUEUE->removeHandler(CEvent::kTimer, NULL);
|
||||
assert(s_timer != NULL);
|
||||
stopRetryTimer();
|
||||
|
||||
// try starting the server again
|
||||
LOG((CLOG_DEBUG1 "retry starting server"));
|
||||
startServer();
|
||||
// try initializing/starting the server again
|
||||
switch (s_serverState) {
|
||||
case kUninitialized:
|
||||
case kInitialized:
|
||||
case kStarted:
|
||||
assert(0 && "bad internal server state");
|
||||
break;
|
||||
|
||||
case kInitializing:
|
||||
LOG((CLOG_DEBUG1 "retry server initialization"));
|
||||
s_serverState = kUninitialized;
|
||||
if (!initServer()) {
|
||||
EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
|
||||
}
|
||||
break;
|
||||
|
||||
case kInitializingToStart:
|
||||
LOG((CLOG_DEBUG1 "retry server initialization"));
|
||||
s_serverState = kUninitialized;
|
||||
if (!initServer()) {
|
||||
EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
|
||||
}
|
||||
else if (s_serverState == kInitialized) {
|
||||
LOG((CLOG_DEBUG1 "starting server"));
|
||||
if (!startServer()) {
|
||||
EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case kStarting:
|
||||
LOG((CLOG_DEBUG1 "retry starting server"));
|
||||
s_serverState = kInitialized;
|
||||
if (!startServer()) {
|
||||
EVENTQUEUE->addEvent(CEvent(CEvent::kQuit));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
bool
|
||||
startServer()
|
||||
initServer()
|
||||
{
|
||||
// skip if already initialized or initializing
|
||||
if (s_serverState != kUninitialized) {
|
||||
return true;
|
||||
}
|
||||
|
||||
double retryTime;
|
||||
CScreen* serverScreen = NULL;
|
||||
CPrimaryClient* primaryClient = NULL;
|
||||
CClientListener* listener = NULL;
|
||||
try {
|
||||
CString name = ARG->m_config->getCanonicalName(ARG->m_name);
|
||||
serverScreen = openServerScreen();
|
||||
primaryClient = openPrimaryClient(name, serverScreen);
|
||||
listener = openClientListener(ARG->m_config->getSynergyAddress());
|
||||
s_server = openServer(*ARG->m_config, primaryClient);
|
||||
s_serverScreen = serverScreen;
|
||||
s_primaryClient = primaryClient;
|
||||
s_listener = listener;
|
||||
s_serverState = kInitialized;
|
||||
updateStatus();
|
||||
LOG((CLOG_NOTE "started server"));
|
||||
return true;
|
||||
}
|
||||
catch (XScreenUnavailable& e) {
|
||||
LOG((CLOG_WARN "cannot open primary screen: %s", e.what()));
|
||||
closeClientListener(listener);
|
||||
closePrimaryClient(primaryClient);
|
||||
closeServerScreen(serverScreen);
|
||||
updateStatus(CString("cannot open primary screen: ") + e.what());
|
||||
retryTime = e.getRetryTime();
|
||||
}
|
||||
catch (XSocketAddressInUse& e) {
|
||||
LOG((CLOG_WARN "cannot listen for clients: %s", e.what()));
|
||||
closeClientListener(listener);
|
||||
closePrimaryClient(primaryClient);
|
||||
closeServerScreen(serverScreen);
|
||||
updateStatus(CString("cannot listen for clients: ") + e.what());
|
||||
retryTime = 10.0;
|
||||
}
|
||||
catch (XScreenOpenFailure& e) {
|
||||
LOG((CLOG_CRIT "cannot open primary screen: %s", e.what()));
|
||||
closeClientListener(listener);
|
||||
closePrimaryClient(primaryClient);
|
||||
closeServerScreen(serverScreen);
|
||||
return false;
|
||||
}
|
||||
catch (XBase& e) {
|
||||
LOG((CLOG_CRIT "failed to start server: %s", e.what()));
|
||||
closeClientListener(listener);
|
||||
closePrimaryClient(primaryClient);
|
||||
closeServerScreen(serverScreen);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ARG->m_restartable) {
|
||||
// install a timer and handler to retry later
|
||||
assert(s_timer == NULL);
|
||||
LOG((CLOG_DEBUG "retry in %.0f seconds", retryTime));
|
||||
s_timer = EVENTQUEUE->newOneShotTimer(retryTime, NULL);
|
||||
EVENTQUEUE->adoptHandler(CEvent::kTimer, s_timer,
|
||||
new CFunctionEventJob(&retryHandler, NULL));
|
||||
s_serverState = kInitializing;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
// don't try again
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
bool
|
||||
startServer()
|
||||
{
|
||||
// skip if already started or starting
|
||||
if (s_serverState == kStarting || s_serverState == kStarted) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// initialize if necessary
|
||||
if (s_serverState != kInitialized) {
|
||||
if (!initServer()) {
|
||||
// hard initialization failure
|
||||
return false;
|
||||
}
|
||||
if (s_serverState == kInitializing) {
|
||||
// not ready to start
|
||||
s_serverState = kInitializingToStart;
|
||||
return true;
|
||||
}
|
||||
assert(s_serverState == kInitialized);
|
||||
}
|
||||
|
||||
double retryTime;
|
||||
CClientListener* listener = NULL;
|
||||
try {
|
||||
listener = openClientListener(ARG->m_config->getSynergyAddress());
|
||||
s_server = openServer(*ARG->m_config, s_primaryClient);
|
||||
s_listener = listener;
|
||||
updateStatus();
|
||||
LOG((CLOG_NOTE "started server"));
|
||||
s_serverState = kStarted;
|
||||
return true;
|
||||
}
|
||||
catch (XSocketAddressInUse& e) {
|
||||
LOG((CLOG_WARN "cannot listen for clients: %s", e.what()));
|
||||
closeClientListener(listener);
|
||||
updateStatus(CString("cannot listen for clients: ") + e.what());
|
||||
retryTime = 10.0;
|
||||
}
|
||||
catch (XBase& e) {
|
||||
LOG((CLOG_CRIT "failed to start server: %s", e.what()));
|
||||
closeClientListener(listener);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ARG->m_restartable) {
|
||||
// install a timer and handler to retry later
|
||||
assert(s_timer == NULL);
|
||||
LOG((CLOG_DEBUG "retry in %.0f seconds", retryTime));
|
||||
CEventQueueTimer* timer = EVENTQUEUE->newOneShotTimer(retryTime, NULL);
|
||||
EVENTQUEUE->adoptHandler(CEvent::kTimer, timer,
|
||||
new CFunctionEventJob(&retryStartHandler, timer));
|
||||
s_timer = EVENTQUEUE->newOneShotTimer(retryTime, NULL);
|
||||
EVENTQUEUE->adoptHandler(CEvent::kTimer, s_timer,
|
||||
new CFunctionEventJob(&retryHandler, NULL));
|
||||
s_serverState = kStarting;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -405,14 +533,63 @@ static
|
||||
void
|
||||
stopServer()
|
||||
{
|
||||
closeClientListener(s_listener);
|
||||
closeServer(s_server);
|
||||
closePrimaryClient(s_primaryClient);
|
||||
closeServerScreen(s_serverScreen);
|
||||
s_server = NULL;
|
||||
s_listener = NULL;
|
||||
s_primaryClient = NULL;
|
||||
s_serverScreen = NULL;
|
||||
if (s_serverState == kStarted) {
|
||||
closeClientListener(s_listener);
|
||||
closeServer(s_server);
|
||||
s_server = NULL;
|
||||
s_listener = NULL;
|
||||
s_serverState = kInitialized;
|
||||
}
|
||||
else if (s_serverState == kStarting) {
|
||||
stopRetryTimer();
|
||||
s_serverState = kInitialized;
|
||||
}
|
||||
assert(s_server == NULL);
|
||||
assert(s_listener == NULL);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
cleanupServer()
|
||||
{
|
||||
stopServer();
|
||||
if (s_serverState == kInitialized) {
|
||||
closePrimaryClient(s_primaryClient);
|
||||
closeServerScreen(s_serverScreen);
|
||||
s_primaryClient = NULL;
|
||||
s_serverScreen = NULL;
|
||||
s_serverState = kUninitialized;
|
||||
}
|
||||
else if (s_serverState == kInitializing ||
|
||||
s_serverState == kInitializingToStart) {
|
||||
stopRetryTimer();
|
||||
s_serverState = kUninitialized;
|
||||
}
|
||||
assert(s_primaryClient == NULL);
|
||||
assert(s_serverScreen == NULL);
|
||||
assert(s_serverState == kUninitialized);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
handleSuspend(const CEvent&, void*)
|
||||
{
|
||||
if (!s_suspended) {
|
||||
LOG((CLOG_INFO "suspend"));
|
||||
stopServer();
|
||||
s_suspended = true;
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
handleResume(const CEvent&, void*)
|
||||
{
|
||||
if (s_suspended) {
|
||||
LOG((CLOG_INFO "resume"));
|
||||
startServer();
|
||||
s_suspended = false;
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
@@ -517,7 +694,7 @@ mainLoop()
|
||||
IEventQueue::getSystemTarget());
|
||||
EVENTQUEUE->removeHandler(getReloadConfigEvent(),
|
||||
IEventQueue::getSystemTarget());
|
||||
stopServer();
|
||||
cleanupServer();
|
||||
updateStatus();
|
||||
LOG((CLOG_NOTE "stopped server"));
|
||||
|
||||
@@ -528,7 +705,11 @@ static
|
||||
int
|
||||
daemonMainLoop(int, const char**)
|
||||
{
|
||||
CSystemLogger sysLogger(DAEMON_NAME);
|
||||
#if SYSAPI_WIN32
|
||||
CSystemLogger sysLogger(DAEMON_NAME, false);
|
||||
#else
|
||||
CSystemLogger sysLogger(DAEMON_NAME, true);
|
||||
#endif
|
||||
return mainLoop();
|
||||
}
|
||||
|
||||
@@ -536,6 +717,10 @@ static
|
||||
int
|
||||
standardStartup(int argc, char** argv)
|
||||
{
|
||||
if (!ARG->m_daemon) {
|
||||
ARCH->showConsole(false);
|
||||
}
|
||||
|
||||
// parse command line
|
||||
parse(argc, argv);
|
||||
|
||||
@@ -952,6 +1137,7 @@ public:
|
||||
// ILogOutputter overrides
|
||||
virtual void open(const char*) { }
|
||||
virtual void close() { }
|
||||
virtual void show(bool) { }
|
||||
virtual bool write(ELevel level, const char* message);
|
||||
virtual const char* getNewline() const { return ""; }
|
||||
};
|
||||
@@ -997,11 +1183,27 @@ static
|
||||
int
|
||||
daemonNTStartup(int, char**)
|
||||
{
|
||||
CSystemLogger sysLogger(DAEMON_NAME);
|
||||
CSystemLogger sysLogger(DAEMON_NAME, false);
|
||||
bye = &byeThrow;
|
||||
return ARCH->daemonize(DAEMON_NAME, &daemonNTMainLoop);
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
foregroundStartup(int argc, char** argv)
|
||||
{
|
||||
ARCH->showConsole(false);
|
||||
|
||||
// parse command line
|
||||
parse(argc, argv);
|
||||
|
||||
// load configuration
|
||||
loadConfig();
|
||||
|
||||
// never daemonize
|
||||
return mainLoop();
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
showError(HINSTANCE instance, const char* title, UINT id, const char* arg)
|
||||
@@ -1015,12 +1217,23 @@ int WINAPI
|
||||
WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
try {
|
||||
CArchMiscWindows::setIcons((HICON)LoadImage(instance,
|
||||
MAKEINTRESOURCE(IDI_SYNERGY),
|
||||
IMAGE_ICON,
|
||||
32, 32, LR_SHARED),
|
||||
(HICON)LoadImage(instance,
|
||||
MAKEINTRESOURCE(IDI_SYNERGY),
|
||||
IMAGE_ICON,
|
||||
16, 16, LR_SHARED));
|
||||
CArch arch(instance);
|
||||
CMSWindowsScreen::init(instance);
|
||||
CLOG;
|
||||
CThread::getCurrentThread().setPriority(-14);
|
||||
CArgs args;
|
||||
|
||||
// set title on log window
|
||||
ARCH->openConsole((CString(kAppVersion) + " " + "Server").c_str());
|
||||
|
||||
// windows NT family starts services using no command line options.
|
||||
// since i'm not sure how to tell the difference between that and
|
||||
// a user providing no options we'll assume that if there are no
|
||||
@@ -1028,8 +1241,13 @@ WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int)
|
||||
// users on NT can use `--daemon' or `--no-daemon' to force us out
|
||||
// of the service code path.
|
||||
StartupFunc startup = &standardStartup;
|
||||
if (__argc <= 1 && !CArchMiscWindows::isWindows95Family()) {
|
||||
startup = &daemonNTStartup;
|
||||
if (!CArchMiscWindows::isWindows95Family()) {
|
||||
if (__argc <= 1) {
|
||||
startup = &daemonNTStartup;
|
||||
}
|
||||
else {
|
||||
startup = &foregroundStartup;
|
||||
}
|
||||
}
|
||||
|
||||
// send PRINT and FATAL output to a message box
|
||||
|
||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# 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\common" /I "..\..\lib\arch" /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fd"..\..\gen\build\synergys.pdb" /FD /c
|
||||
# ADD CPP /nologo /MT /W4 /GR /GX /O2 /I "..\..\lib\common" /I "..\..\lib\arch" /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fd"..\..\gen\build\synergys.pdb" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# 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\common" /I "..\..\lib\arch" /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fd"..\..\gen\debug\synergys.pdb" /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W4 /Gm /GR /GX /ZI /Od /I "..\..\lib\common" /I "..\..\lib\arch" /I "..\..\lib\base" /I "..\..\lib\mt" /I "..\..\lib\io" /I "..\..\lib\net" /I "..\..\lib\synergy" /I "..\..\lib\platform" /I "..\..\lib\server" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fd"..\..\gen\debug\synergys.pdb" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -73,7 +73,25 @@ BEGIN
|
||||
POPUP "Synergy"
|
||||
BEGIN
|
||||
MENUITEM "Show Status", IDC_TASKBAR_STATUS
|
||||
MENUITEM "Show Log", IDC_TASKBAR_SHOW_LOG
|
||||
MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
|
||||
POPUP "Set Log Level"
|
||||
BEGIN
|
||||
MENUITEM "Error", IDC_TASKBAR_LOG_LEVEL_ERROR
|
||||
|
||||
MENUITEM "Warning", IDC_TASKBAR_LOG_LEVEL_WARNING
|
||||
|
||||
MENUITEM "Note", IDC_TASKBAR_LOG_LEVEL_NOTE
|
||||
|
||||
MENUITEM "Info", IDC_TASKBAR_LOG_LEVEL_INFO
|
||||
|
||||
MENUITEM "Debug", IDC_TASKBAR_LOG_LEVEL_DEBUG
|
||||
|
||||
MENUITEM "Debug1", IDC_TASKBAR_LOG_LEVEL_DEBUG1
|
||||
|
||||
MENUITEM "Debug2", IDC_TASKBAR_LOG_LEVEL_DEBUG2
|
||||
|
||||
END
|
||||
MENUITEM "Reload Configuration", IDC_RELOAD_CONFIG
|
||||
MENUITEM "Force Reconnect", IDC_FORCE_RECONNECT
|
||||
MENUITEM SEPARATOR
|
||||
|
||||
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |