diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 4ede83065..000000000
--- a/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-#Vim backup files
-*~
-#Python compiled files
-*.pyc
-
-#Git-svn created .gitignore
-/Release
-/Debug
-/vc90.pdb
-/synergy.ncb
-/synergy.vcproj.ADOBENET.ssbarnea.user
-/bin
-/tool
-/config.h
-/tags
-
-#doxygen
-/doc/doxygen
-/doc/doxygen.cfg
diff --git a/.lvimrc b/.lvimrc
deleted file mode 100644
index 5fabcddf6..000000000
--- a/.lvimrc
+++ /dev/null
@@ -1,13 +0,0 @@
-"Instructions
-"Download vim script 411
-"http://www.vim.org/scripts/script.php?script_id=441
-"Install localvimrc.vim to .vim/plugin
-"
-" Hint: You can disable it asking before sourcing a file by adding this to
-" your .vimrc: let g:localvimrc_ask=0
-
-set nosmarttab
-set noexpandtab
-set shiftwidth=8
-set softtabstop=0
-set tabstop=4
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index b06c2c37d..000000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,346 +0,0 @@
-# synergy -- mouse and keyboard sharing utility
-# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-# Version number for Synergy
-set(VERSION_MAJOR 1)
-set(VERSION_MINOR 5)
-set(VERSION_REV 0)
-set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}")
-
-# The check for 2.6 may be too strict (consider lowering).
-cmake_minimum_required(VERSION 2.4.7)
-
-# CMake complains if we don't have this.
-if (COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-endif()
-
-# We're escaping quotes in the Windows version number, because
-# for some reason CMake won't do it at config version 2.4.7
-# It seems that this restores the newer behaviour where define
-# args are not auto-escaped.
-if (COMMAND cmake_policy)
- cmake_policy(SET CMP0005 NEW)
-endif()
-
-# First, declare project (important for prerequisite checks).
-project(synergy C CXX)
-
-# put binaries in a different dir to make them easier to find.
-set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
-set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
-
-# for unix, put debug files in a separate bin "debug" dir.
-# release bin files should stay in the root of the bin dir.
-if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
- if (CMAKE_BUILD_TYPE STREQUAL Debug)
- set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/debug)
- set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/debug)
- endif()
-endif()
-
-# Set some easy to type variables.
-set(root_dir ${CMAKE_SOURCE_DIR})
-set(cmake_dir ${root_dir}/res)
-set(bin_dir ${root_dir}/bin)
-set(doc_dir ${root_dir}/doc)
-set(doc_dir ${root_dir}/doc)
-
-# Declare libs, so we can use list in linker later. There's probably
-# a more elegant way of doing this; with SCons, when you check for the
-# lib, it is automatically passed to the linker.
-set(libs)
-
-# Depending on the platform, pass in the required defines.
-if (UNIX)
-
- # For config.h, detect the libraries, functions, etc.
- include(CheckIncludeFiles)
- include(CheckLibraryExists)
- include(CheckFunctionExists)
- include(CheckTypeSize)
- include(CheckIncludeFileCXX)
- include(CheckSymbolExists)
- include(CheckCSourceCompiles)
-
- check_include_file_cxx(istream HAVE_ISTREAM)
- check_include_file_cxx(ostream HAVE_OSTREAM)
- check_include_file_cxx(sstream HAVE_SSTREAM)
-
- check_include_files(inttypes.h HAVE_INTTYPES_H)
- check_include_files(locale.h HAVE_LOCALE_H)
- check_include_files(memory.h HAVE_MEMORY_H)
- check_include_files(stdlib.h HAVE_STDLIB_H)
- check_include_files(strings.h HAVE_STRINGS_H)
- check_include_files(string.h HAVE_STRING_H)
- check_include_files(sys/select.h HAVE_SYS_SELECT_H)
- check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
- check_include_files(sys/stat.h HAVE_SYS_STAT_H)
- check_include_files(sys/time.h HAVE_SYS_TIME_H)
- check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
- check_include_files(unistd.h HAVE_UNISTD_H)
- check_include_files(wchar.h HAVE_WCHAR_H)
-
- check_function_exists(getpwuid_r HAVE_GETPWUID_R)
- check_function_exists(gmtime_r HAVE_GMTIME_R)
- check_function_exists(nanosleep HAVE_NANOSLEEP)
- check_function_exists(poll HAVE_POLL)
- check_function_exists(sigwait HAVE_POSIX_SIGWAIT)
- check_function_exists(strftime HAVE_STRFTIME)
- check_function_exists(vsnprintf HAVE_VSNPRINTF)
- check_function_exists(inet_aton HAVE_INET_ATON)
-
- # For some reason, the check_function_exists macro doesn't detect
- # the inet_aton on some pure Unix platforms (e.g. sunos5). So we
- # need to do a more detailed check and also include some extra libs.
- if (NOT HAVE_INET_ATON)
-
- set(CMAKE_REQUIRED_LIBRARIES nsl)
- check_c_source_compiles(
- "#include \n int main() { inet_aton(0, 0); }"
- HAVE_INET_ATON_ADV)
- set(CMAKE_REQUIRED_LIBRARIES)
-
- if (HAVE_INET_ATON_ADV)
-
- # Override the previous fail.
- set(HAVE_INET_ATON 1)
-
- # Assume that both nsl and socket will be needed,
- # it seems safe to add socket on the back of nsl,
- # since socket only ever needed when nsl is needed.
- list(APPEND libs nsl socket)
-
- endif()
-
- endif()
-
- check_type_size(char SIZEOF_CHAR)
- check_type_size(int SIZEOF_INT)
- check_type_size(long SIZEOF_LONG)
- check_type_size(short SIZEOF_SHORT)
-
- # pthread is used on both Linux and Mac
- check_library_exists("pthread" pthread_create "" HAVE_PTHREAD)
- if (HAVE_PTHREAD)
- list(APPEND libs pthread)
- else (HAVE_PTHREAD)
- message(FATAL_ERROR "Missing library: pthread")
- endif()
-
- if (APPLE)
-
- # build mac os x universal
- set(CMAKE_OSX_ARCHITECTURES "ppc;i386"
- CACHE STRING "Build architectures for OSX" FORCE)
-
- find_library(lib_ScreenSaver ScreenSaver)
- find_library(lib_IOKit IOKit)
- find_library(lib_ApplicationServices ApplicationServices)
- find_library(lib_Foundation Foundation)
- find_library(lib_Carbon Carbon)
-
- list(APPEND libs
- ${lib_ScreenSaver}
- ${lib_IOKit}
- ${lib_ApplicationServices}
- ${lib_Foundation}
- ${lib_Carbon}
- )
-
- else()
-
- set(XKBlib "X11/XKBlib.h")
- check_include_files("${XKBlib};X11/extensions/dpms.h" HAVE_X11_EXTENSIONS_DPMS_H)
- check_include_files("X11/extensions/Xinerama.h" HAVE_X11_EXTENSIONS_XINERAMA_H)
- check_include_files("${XKBlib};X11/extensions/XKBstr.h" HAVE_X11_EXTENSIONS_XKBSTR_H)
- check_include_files("X11/extensions/XKB.h" HAVE_XKB_EXTENSION)
- check_include_files("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
- check_include_files(${XKBlib} HAVE_X11_XKBLIB_H)
-
- if (HAVE_X11_EXTENSIONS_DPMS_H)
- # Assume that function prototypes declared, when include exists.
- set(HAVE_DPMS_PROTOTYPES 1)
- endif()
-
- if (NOT HAVE_X11_XKBLIB_H)
- message(FATAL_ERROR "Missing header: " ${XKBlib})
- endif()
-
- check_library_exists("SM;ICE" IceConnectionNumber "" HAVE_ICE)
- check_library_exists("X11;Xext" DPMSQueryExtension "" HAVE_Xext)
- check_library_exists("X11;Xext;Xtst" XTestQueryExtension "" HAVE_Xtst)
- check_library_exists("Xinerama" XineramaQueryExtension "" HAVE_Xinerama)
-
- if (HAVE_ICE)
-
- # Assume we have SM if we have ICE.
- set(HAVE_SM 1)
- list(APPEND libs SM ICE)
-
- endif()
-
- if (HAVE_Xtst)
-
- # Xtxt depends on X11.
- set(HAVE_X11)
- list(APPEND libs X11 Xtst)
-
- else()
-
- message(FATAL_ERROR "Missing library: Xtst")
-
- endif()
-
- if (HAVE_Xext)
- list(APPEND libs Xext)
- endif()
-
- if (HAVE_Xinerama)
- list(APPEND libs Xinerama)
- else (HAVE_Xinerama)
- if (HAVE_X11_EXTENSIONS_XINERAMA_H)
- message(FATAL_ERROR "Missing library: Xinerama")
- endif()
- endif()
-
- endif()
-
- # For config.h, set some static values; it may be a good idea to make
- # these values dynamic for non-standard UNIX compilers.
- set(ACCEPT_TYPE_ARG3 socklen_t)
- set(HAVE_CXX_BOOL 1)
- set(HAVE_CXX_CASTS 1)
- set(HAVE_CXX_EXCEPTIONS 1)
- set(HAVE_CXX_MUTABLE 1)
- set(HAVE_CXX_STDLIB 1)
- set(HAVE_PTHREAD_SIGNAL 1)
- set(SELECT_TYPE_ARG1 int)
- set(SELECT_TYPE_ARG234 "(fd_set *)")
- set(SELECT_TYPE_ARG5 "(struct timeval *)")
- set(STDC_HEADERS 1)
- set(TIME_WITH_SYS_TIME 1)
- set(HAVE_SOCKLEN_T 1)
-
- # For config.h, save the results based on a template (config.h.in).
- configure_file(res/config.h.in ${root_dir}/config.h)
-
- add_definitions(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H)
-
- if (APPLE)
- add_definitions(-DWINAPI_CARBON=1 -D_THREAD_SAFE -DMACOSX_DEPLOYMENT_TARGET=10.4)
- else (APPLE)
- add_definitions(-DWINAPI_XWINDOWS=1)
- endif()
-
-else (UNIX)
-
- list(APPEND libs Wtsapi32 Userenv)
-
- add_definitions(
- /DWIN32
- /D_WINDOWS
- /D_CRT_SECURE_NO_WARNINGS
- /DVERSION=\"${VERSION}\"
- )
-
-endif()
-
-add_subdirectory(src)
-
-if (WIN32)
- # add /analyze in order to unconver potential bugs in the source code
- # Details: http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx
- # add /FR to generate browse information (ncb files) usefull for using IDE
-
- #define _BIND_TO_CURRENT_CRT_VERSION 1
- #define _BIND_TO_CURRENT_ATL_VERSION 1
- #define _BIND_TO_CURRENT_MFC_VERSION 1
- #define _BIND_TO_CURRENT_OPENMP_VERSION 1
- # next line replaced the previous 4 ones:
- #define _BIND_TO_CURRENT_VCLIBS_VERSION 1;
-
- # compiler: /MP - use multi cores to compile
- # added _SECURE_SCL=1 for finding bugs with iterators - http://msdn.microsoft.com/en-us/library/aa985965.aspx
-
- # common args between all vs builds
- set(VS_ARGS "/FR /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1 /D _SECURE_SCL=1 ${VS_ARGS_EXTRA}")
-
- # we may use `cmake -D VS_ARGS_EXTRA="/analyze"` for example to specify
- # analyze mode (since we don't always want to use it; e.g. on non-team
- # or non-x86 compiler editions where there's no support)
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${VS_ARGS}")
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${VS_ARGS}")
-
- # this line removes "/D NDEBUG" from release, we want them in order to
- # find bugs even on release builds.
- set(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2")
-
-endif()
-
-if (CONF_CPACK)
-
- if (WIN32)
- message(FATAL_ERROR "CPack support for Windows has been removed.")
- endif()
-
- if (UNIX)
- if (APPLE)
- message(FATAL_ERROR "CPack support for Apple has been removed.")
- else ()
- install(FILES bin/qsynergy
- DESTINATION bin
- PERMISSIONS
- OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE)
-
- # install gnome menu item
- install(FILES res/synergy.desktop
- DESTINATION share/applications)
- install(FILES res/synergy.ico
- DESTINATION share/icons)
- endif()
- endif()
-
- # The default CPack behaviour is not to append the system processor
- # type, which is undesirable in our case, since we want to support
- # both 32-bit and 64-bit processors.
- set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
-
- set(CPACK_PACKAGE_NAME "synergy")
- set(CPACK_PACKAGE_VENDOR "The Synergy Project")
- set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Synergy server and client")
- set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
- set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
- set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_REV})
- set(CPACK_PACKAGE_VERSION ${VERSION})
- set(CPACK_PACKAGE_CONTACT http://synergy-foss.org/)
- set(CPACK_RESOURCE_FILE_LICENSE "${cmake_dir}/License.rtf")
- set(CPACK_RESOURCE_FILE_README "${cmake_dir}/Readme.txt")
-
- # Must be last (since it relies of CPACK_ vars).
- include(CPack)
-
-endif()
-
-if (CONF_DOXYGEN)
-
- set(VERSION, "${VERSION}")
-
- # For doxygen.cfg, save the results based on a template (doxygen.cfg.in).
- configure_file(${cmake_dir}/doxygen.cfg.in ${doc_dir}/doxygen.cfg)
-
-endif()
diff --git a/COMPILE b/COMPILE
deleted file mode 100644
index f5209e310..000000000
--- a/COMPILE
+++ /dev/null
@@ -1 +0,0 @@
-See: http://synergy-foss.org/pm/projects/synergy/wiki/Compiling
diff --git a/COPYING b/COPYING
deleted file mode 100644
index ce0fb161d..000000000
--- a/COPYING
+++ /dev/null
@@ -1,286 +0,0 @@
-Synergy is copyright (C) 2002-2007 Chris Schoeneman.
-Synergy is distributed under the following license.
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE
-IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
-COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
-"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
-IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
-ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
-TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY
-WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED
-ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
-SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
-THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT
-LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
-LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
-PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
-HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 8c155a282..000000000
--- a/ChangeLog
+++ /dev/null
@@ -1 +0,0 @@
-See: http://synergy-foss.org/pm/projects/synergy/wiki/ChangeLog
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 948055883..000000000
--- a/INSTALL
+++ /dev/null
@@ -1 +0,0 @@
-See: http://synergy-foss.org/pm/projects/synergy/wiki/Setup
diff --git a/README b/README
index 9b20263ec..066c58e22 100644
--- a/README
+++ b/README
@@ -1,17 +1,7 @@
-See: http://synergy-foss.org/pm/projects/synergy/wiki/Readme
-
-Announcement | 2009-08-04
-=========================
-We have recently switched to CMake, to replace Automake.
-Plese read the Compiling wiki page for help with CMake:
-http://synergy-foss.org/pm/projects/synergy/wiki/Compiling
-
-Linux/Mac
----------
-Instead of using the traditional GNU style `./configure; make`
-commands, you will now need to use CMake.
-
-Windows
--------
-Instead of using the VS2005 and VS2008 directories, you now need
-to generate the Visual Studio project files using CMake.
+Synergy
+=======
+
+We commit directly to release branches. The trunk was becoming a dead weight (as it was always the same as the latest release branch), so we deleted it. Please commit to (and build patches against) the a release branch, e.g. /branches/1.4
+
+If you have any questions, please email the dev mailing list.
+ http://groups.google.com/group/synergy-plus-dev
diff --git a/configure b/configure
deleted file mode 100644
index d2cd98a12..000000000
--- a/configure
+++ /dev/null
@@ -1,2 +0,0 @@
-cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
-
diff --git a/doc/MacReadme.txt b/doc/MacReadme.txt
deleted file mode 100755
index 38dfe2467..000000000
--- a/doc/MacReadme.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-Mac OS X Readme
-===============
-
-To install on Mac OS X with the .zip distribution (first seen in 1.3.6) you must follow these steps:
-
- 1. Extract the zip file to any location (usually double click will do this)
- 2. Open Terminal, and cd to the extracted directory (e.g. /Users/my-name/Downloads/extracted-dir/)
- 3. Change to super user (use the su command)
- 4. Copy the binaries to /usr/bin using: cp synergy* /usr/bin
-
-How to enable the root user in Mac OS X:
- http://support.apple.com/kb/ht1528
-
-Once the binaries have been copied to /usr/bin, you should follow the configuration guide:
- http://synergy2.sourceforge.net/configuration.html
-
-If you have any problems, see the [[Support]] page:
- http://synergy-foss.org/support
diff --git a/doc/org.synergy-foss.org.synergyc.plist b/doc/org.synergy-foss.org.synergyc.plist
deleted file mode 100644
index b6c734424..000000000
--- a/doc/org.synergy-foss.org.synergyc.plist
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- Label
- org.synergy-foss.org.synergyc.plist
- OnDemand
-
- ProgramArguments
-
- /usr/bin/synergys
-
- 192.168.0.2
-
- RunAtLoad
-
-
-
diff --git a/doc/org.synergy-foss.org.synergys.plist b/doc/org.synergy-foss.org.synergys.plist
deleted file mode 100644
index 94cbb633a..000000000
--- a/doc/org.synergy-foss.org.synergys.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
- Label
- org.synergy-foss.org.synergys.plist
- OnDemand
-
- ProgramArguments
-
- /usr/bin/synergys
- --no-daemon
- --config
-
- /Users/snorp/.synergy.conf
-
- RunAtLoad
-
-
-
diff --git a/doc/synergy.conf.example b/doc/synergy.conf.example
deleted file mode 100644
index 2586dfafa..000000000
--- a/doc/synergy.conf.example
+++ /dev/null
@@ -1,37 +0,0 @@
-# sample synergy configuration file
-#
-# comments begin with the # character and continue to the end of
-# line. comments may appear anywhere the syntax permits.
-
-section: screens
- # three hosts named: moe, larry, and curly
- moe:
- larry:
- curly:
-end
-
-section: links
- # larry is to the right of moe and curly is above moe
- moe:
- right = larry
- up = curly
-
- # moe is to the left of larry and curly is above larry.
- # note that curly is above both moe and larry and moe
- # and larry have a symmetric connection (they're in
- # opposite directions of each other).
- larry:
- left = moe
- up = curly
-
- # larry is below curly. if you move up from moe and then
- # down, you'll end up on larry.
- curly:
- down = larry
-end
-
-section: aliases
- # curly is also known as shemp
- curly:
- shemp
-end
diff --git a/doc/synergy.conf.example-advanced b/doc/synergy.conf.example-advanced
deleted file mode 100644
index 771cf5347..000000000
--- a/doc/synergy.conf.example-advanced
+++ /dev/null
@@ -1,55 +0,0 @@
-# sample synergy configuration file
-#
-# comments begin with the # character and continue to the end of
-# line. comments may appear anywhere the syntax permits.
-
-# This example uses 3 computers. A laptop and two desktops (one a mac)
-# They are arranged in the following configuration with Desktop1 acting as the server
-# Desktop 2 has 3 screens arranged around desktop1
-#
-# +--------+ +---------+
-# |Desktop2| |Desktop2 |
-# | | | |
-# +--------+ +---------+
-# +-------+ +--------+ +---------+
-# |Laptop | |Desktop1| |Desktop2 |
-# | | | | | |
-# +-------+ +--------+ +---------+
-#
-# The laptop comes and goes but that doesn't really affect this configuration
-
-# The screens section is for the logical or short name of the computers
-section: screens
- # three computers that are logically named: desktop1, desktop2, and laptop
- desktop1:
- desktop2:
- laptop:
-end
-
-section: links
- # larry is to the right of moe and curly is above moe
- moe:
- right = larry
- up = curly
-
- # moe is to the left of larry and curly is above larry.
- # note that curly is above both moe and larry and moe
- # and larry have a symmetric connection (they're in
- # opposite directions of each other).
- larry:
- left = moe
- up = curly
-
- # larry is below curly. if you move up from moe and then
- # down, you'll end up on larry.
- curly:
- down = larry
-end
-
-# The aliases section is to map the full names of the computers to their logical names used in the screens section
-# One way to find the actual name of a comptuer is to run hostname from a command window
-section: aliases
- # Laptop is actually known as John-Smiths-MacBook-3.local
- desktop2:
- John-Smiths-MacBook-3.local
-end
diff --git a/doc/synergy.conf.example-basic b/doc/synergy.conf.example-basic
deleted file mode 100644
index 6f3c20d90..000000000
--- a/doc/synergy.conf.example-basic
+++ /dev/null
@@ -1,39 +0,0 @@
-# sample synergy configuration file
-#
-# comments begin with the # character and continue to the end of
-# line. comments may appear anywhere the syntax permits.
-# +-------+ +--------+ +---------+
-# |Laptop | |Desktop1| |iMac |
-# | | | | | |
-# +-------+ +--------+ +---------+
-
-section: screens
- # three hosts named: Laptop, Desktop1, and iMac
- # These are the nice names of the hosts to make it easy to write the config file
- # The aliases section below contain the "actual" names of the hosts (their hostnames)
- Laptop:
- Desktop1:
- iMac:
-end
-
-section: links
- # iMac is to the right of Desktop1
- # Laptop is to the left of Desktop1
- Desktop1:
- right = iMac
- left = Laptop
-
- # Desktop1 is to the right of Laptop
- Laptop:
- right = Desktop1
-
- # Desktop1 is to the left of iMac
- iMac:
- left = Desktop1
-end
-
-section: aliases
- # The "real" name of iMac is John-Smiths-iMac-3.local. If we wanted we could remove this alias and instead use John-Smiths-iMac-3.local everywhere iMac is above. Hopefully it should be easy to see why using an alias is nicer
- iMac:
- John-Smiths-iMac-3.local
-end
diff --git a/doc/synergyc.man b/doc/synergyc.man
deleted file mode 100644
index de165a88a..000000000
--- a/doc/synergyc.man
+++ /dev/null
@@ -1,47 +0,0 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2.
-.TH SYNERGYC "1" "June 2010" "synergyc 1.5.0, protocol version 1.3" "User Commands"
-.SH NAME
-synergyc \- manual page for synergyc 1.5.0, protocol version 1.3
-.SH SYNOPSIS
-.B synergyc
-[\fI--yscroll \fR] [\fI--daemon|--no-daemon\fR] [\fI--name \fR] [\fI--restart|--no-restart\fR] [\fI--debug \fR] \fI\fR
-.SH DESCRIPTION
-Connect to a synergy mouse/keyboard sharing server.
-.TP
-\fB\-d\fR, \fB\-\-debug\fR
-filter out log messages with priority below level.
-level may be: FATAL, ERROR, WARNING, NOTE, INFO,
-DEBUG, DEBUGn (1\-5).
-.TP
-\fB\-n\fR, \fB\-\-name\fR use screen\-name instead the hostname to identify
-this screen in the configuration.
-.TP
-\fB\-1\fR, \fB\-\-no\-restart\fR
-do not try to restart on failure.
-.PP
-* \fB\-\-restart\fR restart the server automatically if it fails.
-.TP
-\fB\-l\fR \fB\-\-log\fR
-write log messages to file.
-.TP
-\fB\-f\fR, \fB\-\-no\-daemon\fR
-run in the foreground.
-.PP
-* \fB\-\-daemon\fR run as a daemon.
-.TP
-\fB\-\-yscroll\fR
-defines the vertical scrolling delta, which is
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-display this help and exit.
-.TP
-\fB\-\-version\fR
-display version information and exit.
-.PP
-* marks defaults.
-.PP
-The server address is of the form: [][:]. The hostname
-must be the address or hostname of the server. The port overrides the
-default port, 24800.
-.SH COPYRIGHT
-Copyright \(co 2010 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
diff --git a/doc/synergys.man b/doc/synergys.man
deleted file mode 100644
index 1543ffddf..000000000
--- a/doc/synergys.man
+++ /dev/null
@@ -1,57 +0,0 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2.
-.TH SYNERGYS "1" "June 2010" "synergys 1.5.0, protocol version 1.3" "User Commands"
-.SH NAME
-synergys \- manual page for synergys 1.5.0, protocol version 1.3
-.SH SYNOPSIS
-.B synergys
-[\fI--address \fR] [\fI--config \fR] [\fI--daemon|--no-daemon\fR] [\fI--name \fR] [\fI--restart|--no-restart\fR] [\fI--debug \fR]
-.SH DESCRIPTION
-Start the synergy mouse/keyboard sharing server.
-.TP
-\fB\-a\fR, \fB\-\-address\fR
-listen for clients on the given address.
-.TP
-\fB\-c\fR, \fB\-\-config\fR
-use the named configuration file instead.
-.TP
-\fB\-d\fR, \fB\-\-debug\fR
-filter out log messages with priority below level.
-level may be: FATAL, ERROR, WARNING, NOTE, INFO,
-DEBUG, DEBUGn (1\-5).
-.TP
-\fB\-n\fR, \fB\-\-name\fR use screen\-name instead the hostname to identify
-this screen in the configuration.
-.TP
-\fB\-1\fR, \fB\-\-no\-restart\fR
-do not try to restart on failure.
-.PP
-* \fB\-\-restart\fR restart the server automatically if it fails.
-.TP
-\fB\-l\fR \fB\-\-log\fR
-write log messages to file.
-.TP
-\fB\-f\fR, \fB\-\-no\-daemon\fR
-run in the foreground.
-.PP
-* \fB\-\-daemon\fR run as a daemon.
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-display this help and exit.
-.TP
-\fB\-\-version\fR
-display version information and exit.
-.PP
-* marks defaults.
-.PP
-The argument for \fB\-\-address\fR is of the form: [][:]. The
-hostname must be the address or hostname of an interface on the system.
-The default is to listen on all interfaces. The port overrides the
-default port, 24800.
-.PP
-If no configuration file pathname is provided then the first of the
-following to load successfully sets the configuration:
-.IP
-$HOME/.synergy.conf
-/etc/synergy.conf
-.SH COPYRIGHT
-Copyright \(co 2010 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
diff --git a/hm.cmd b/hm.cmd
deleted file mode 100644
index 60596e2aa..000000000
--- a/hm.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-python hm.py %*
-exit /b %errorlevel%
\ No newline at end of file
diff --git a/hm.py b/hm.py
deleted file mode 100644
index 87c2dc058..000000000
--- a/hm.py
+++ /dev/null
@@ -1,213 +0,0 @@
-#! /usr/bin/env python
-
-# synergy -- mouse and keyboard sharing utility
-# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-# hm.py: 'Help Me', is a simple wrapper for all build tools.
-#
-# This script was created for the Synergy project.
-# http://synergy-foss.org/
-#
-# The idea behind this is to simplify the build system,
-# however, it's not a dependancy of building Synergy.
-# In other words, you don't need to use this script!
-#
-# If you don't wish to run this script, simply run:
-# cmake .
-# make
-# This will create an in-source UNIX Makefile.
-
-import sys, os
-sys.path.append('tools')
-
-# if old build src dir exists, move it, as this will now be used for build
-# output.
-if os.path.exists('build/toolchain.py'):
- print "Removing legacy build dir."
- os.rename('build', 'build.old')
-
-from build import toolchain
-from getopt import gnu_getopt
-
-# minimum required version
-requiredMajor = 2
-requiredMinor = 3
-
-# options used by all commands
-globalOptions = 'v'
-globalOptionsLong = ['no-prompts', 'generator=', 'verbose', 'make-gui']
-
-# list of valid commands as keys. the values are optarg strings, but most
-# are None for now (this is mainly for extensibility)
-cmd_opt_dict = {
- 'about' : ['', []],
- 'setup' : ['g:', []],
- 'configure' : ['g:dr', ['debug', 'release']],
- 'build' : ['dr', ['debug', 'release']],
- 'clean' : ['dr', ['debug', 'release']],
- 'update' : ['', []],
- 'install' : ['', []],
- 'doxygen' : ['', []],
- 'dist' : ['', ['vcredist-dir=', 'qt-dir=']],
- 'distftp' : ['', ['host=', 'user=', 'pass=', 'dir=']],
- 'kill' : ['', []],
- 'usage' : ['', []],
- 'revision' : ['', []],
- 'reformat' : ['', []],
- 'open' : ['', []],
- 'genlist' : ['', []]
-}
-
-# aliases to valid commands
-cmd_alias_dict = {
- 'info' : 'about',
- 'help' : 'usage',
- 'package' : 'dist',
- 'docs' : 'doxygen',
- 'make' : 'build',
- 'cmake' : 'configure',
-}
-
-def complete_command(arg):
- completions = []
-
- for cmd, optarg in cmd_opt_dict.iteritems():
- # if command was matched fully, return only this, so that
- # if `dist` is typed, it will return only `dist` and not
- # `dist` and `distftp` for example.
- if cmd == arg:
- return [cmd,]
- if cmd.startswith(arg):
- completions.append(cmd)
-
- for alias, cmd in cmd_alias_dict.iteritems():
- # don't know if this will work just like above, but it's
- # probably worth adding.
- if alias == arg:
- return [alias,]
- if alias.startswith(arg):
- completions.append(alias)
-
- return completions
-
-def start_cmd(argv):
-
- cmd_arg = ''
- if len(argv) > 1:
- cmd_arg = argv[1]
-
- # change common help args to help command
- if cmd_arg in ('--help', '-h', '--usage', '-u', '/?'):
- cmd_arg = 'usage'
-
- completions = complete_command(cmd_arg)
-
- if cmd_arg and len(completions) > 0:
-
- if len(completions) == 1:
-
- # get the only completion (since in this case we have 1)
- cmd = completions[0]
-
- # build up the first part of the map (for illustrative purposes)
- cmd_map = list()
- if cmd_arg != cmd:
- cmd_map.append(cmd_arg)
- cmd_map.append(cmd)
-
- # map an alias to the command, and build up the map
- if cmd in cmd_alias_dict.keys():
- alias = cmd
- if cmd_arg == cmd:
- cmd_map.append(alias)
- cmd = cmd_alias_dict[cmd]
- cmd_map.append(cmd)
-
- # show command map to avoid confusion
- if len(cmd_map) != 0:
- print 'Mapping command: %s' % ' -> '.join(cmd_map)
-
- run_cmd(cmd, argv[2:])
-
- return 0
-
- else:
- print (
- 'Command `%s` too ambiguous, '
- 'could mean any of: %s'
- ) % (cmd_arg, ', '.join(completions))
- else:
-
- if len(argv) == 1:
- print 'No command specified, showing usage.\n'
- else:
- print 'Command not recognised: %s\n' % cmd_arg
-
- run_cmd('usage')
-
- # generic error code if not returned sooner
- return 1
-
-def run_cmd(cmd, argv = []):
-
- verbose = False
- try:
- options_pair = cmd_opt_dict[cmd]
-
- options = globalOptions + options_pair[0]
-
- options_long = []
- options_long.extend(globalOptionsLong)
- options_long.extend(options_pair[1])
-
- opts, args = gnu_getopt(argv, options, options_long)
-
- for o, a in opts:
- if o in ('-v', '--verbose'):
- verbose = True
-
- # pass args and optarg data to command handler, which figures out
- # how to handle the arguments
- handler = toolchain.CommandHandler(argv, opts, args, verbose)
-
- # use reflection to get the function pointer
- cmd_func = getattr(handler, cmd)
-
- cmd_func()
- except:
- if not verbose:
- # print friendly error for users
- sys.stderr.write('Error: ' + sys.exc_info()[1].__str__() + '\n')
- sys.exit(1)
- else:
- # if user wants to be verbose let python do it's thing
- raise
-
-def main(argv):
-
- if sys.version_info < (requiredMajor, requiredMinor):
- print ('Python version must be at least ' +
- str(requiredMajor) + '.' + str(requiredMinor) + ', but is ' +
- str(sys.version_info[0]) + '.' + str(sys.version_info[1]))
- sys.exit(1)
-
- try:
- start_cmd(argv)
- except KeyboardInterrupt:
- print '\n\nUser aborted, exiting.'
-
-# Start the program.
-main(sys.argv)
-
diff --git a/hm.sh b/hm.sh
deleted file mode 100755
index eb7da8b45..000000000
--- a/hm.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /bin/bash
-
-python hm.py "$@"
diff --git a/res/Installer.nsi.in b/res/Installer.nsi.in
deleted file mode 100644
index 6961ea25b..000000000
--- a/res/Installer.nsi.in
+++ /dev/null
@@ -1,170 +0,0 @@
-; template variables
-!define version ${in:version}
-!define arch ${in:arch}
-!define vcRedistDir ${in:vcRedistDir}
-!define qtDir ${in:qtDir}
-!define installDirVar ${in:installDirVar}
-
-; normal variables
-!define product "Synergy"
-!define productOld "Synergy+"
-!define packageName "synergy"
-!define packageNameOld "synergy-plus"
-!define platform "Windows"
-!define publisher "The Synergy Project"
-!define publisherOld "The Synergy+ Project"
-!define helpUrl "http://synergy-foss.org/support"
-!define vcRedistFile "vcredist_${arch}.exe"
-!define startMenuApp "qsynergy.exe"
-!define binDir "..\bin"
-!define uninstall "uninstall.exe"
-!define icon "..\src\gui\res\win\QSynergy.ico"
-!define controlPanelReg "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
-
-!define MUI_ICON ${icon}
-!define MUI_UNICON ${icon}
-
-!include "MUI2.nsh"
-
-!insertmacro MUI_PAGE_LICENSE "..\\res\\License.rtf"
-!insertmacro MUI_PAGE_DIRECTORY
-!insertmacro MUI_PAGE_INSTFILES
-
-!insertmacro MUI_UNPAGE_WELCOME
-!insertmacro MUI_UNPAGE_INSTFILES
-
-!insertmacro MUI_LANGUAGE "English"
-
-Name ${product}
-OutFile "..\bin\${packageName}-${version}-${platform}-${arch}.exe"
-InstallDir "${installDirVar}\${product}"
-InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${product}" ""
-
-; delete files we installed, and then dir if it's empty
-!macro DeleteFiles dir
-
- Delete "${dir}\synergyc.exe"
- Delete "${dir}\synergys.exe"
- Delete "${dir}\launcher.exe"
- Delete "${dir}\synrgyhk.dll"
- Delete "${dir}\libgcc_s_dw2-1.dll"
- Delete "${dir}\mingwm10.dll"
- Delete "${dir}\qsynergy.exe"
- Delete "${dir}\QtCore4.dll"
- Delete "${dir}\QtGui4.dll"
- Delete "${dir}\QtNetwork4.dll"
- Delete "${dir}\Uninstall.exe"
- Delete "${dir}\uninstall.exe"
- RMDir "${dir}"
-
-!macroend
-
-Section
-
- SetShellVarContext all
- SetOutPath "$INSTDIR"
-
- ; force kill all synergy processes
- nsExec::Exec "taskkill /f /im qsynergy.exe"
- nsExec::Exec "taskkill /f /im launcher.exe"
- nsExec::Exec "taskkill /f /im synergys.exe"
- nsExec::Exec "taskkill /f /im synergyc.exe"
-
- ; clean up legacy files that may exist (but leave user files)
- !insertmacro DeleteFiles "$PROGRAMFILES32\${product}\bin"
- !insertmacro DeleteFiles "$PROGRAMFILES64\${product}\bin"
- !insertmacro DeleteFiles "$PROGRAMFILES32\${productOld}\bin"
- !insertmacro DeleteFiles "$PROGRAMFILES64\${productOld}\bin"
- !insertmacro DeleteFiles "$PROGRAMFILES32\${product}"
- !insertmacro DeleteFiles "$PROGRAMFILES64\${product}"
- !insertmacro DeleteFiles "$PROGRAMFILES32\${productOld}"
- !insertmacro DeleteFiles "$PROGRAMFILES64\${productOld}"
-
- ; clean up legacy start menu entries
- RMDir /R "$SMPROGRAMS\${product}"
- RMDir /R "$SMPROGRAMS\${productOld}"
-
- ; always delete any existing uninstall info
- DeleteRegKey HKLM "${controlPanelReg}\${product}"
- DeleteRegKey HKLM "${controlPanelReg}\${productOld}"
- DeleteRegKey HKLM "${controlPanelReg}\${publisher}"
- DeleteRegKey HKLM "${controlPanelReg}\${publisherOld}"
- DeleteRegKey HKLM "${controlPanelReg}\${packageNameOld}"
- DeleteRegKey HKLM "SOFTWARE\${product}"
- DeleteRegKey HKLM "SOFTWARE\${productOld}"
- DeleteRegKey HKLM "SOFTWARE\${publisher}"
- DeleteRegKey HKLM "SOFTWARE\${publisherOld}"
-
- ; create uninstaller (used for control panel icon)
- WriteUninstaller "$INSTDIR\${uninstall}"
-
- ; add new uninstall info
- WriteRegStr HKLM "${controlPanelReg}\${product}" "" $INSTDIR
- WriteRegStr HKLM "${controlPanelReg}\${product}" "DisplayName" "${product}"
- WriteRegStr HKLM "${controlPanelReg}\${product}" "DisplayVersion" "${version}"
- WriteRegStr HKLM "${controlPanelReg}\${product}" "DisplayIcon" "$INSTDIR\uninstall.exe"
- WriteRegStr HKLM "${controlPanelReg}\${product}" "Publisher" "${publisher}"
- WriteRegStr HKLM "${controlPanelReg}\${product}" "UninstallString" "$INSTDIR\uninstall.exe"
- WriteRegStr HKLM "${controlPanelReg}\${product}" "URLInfoAbout" "${helpUrl}"
-
-SectionEnd
-
-Section "Server and Client" core
-
- ; client and server files
- File "${binDir}\Release\synergys.exe"
- File "${binDir}\Release\synergyc.exe"
- File "${binDir}\Release\synrgyhk.dll"
-
-SectionEnd
-
-Section "Graphical User Interface" gui
-
- ; gui and qt libs
- File "${binDir}\Release\qsynergy.exe"
- File "${qtDir}\qt\bin\libgcc_s_dw2-1.dll"
- File "${qtDir}\qt\bin\mingwm10.dll"
- File "${qtDir}\qt\bin\QtGui4.dll"
- File "${qtDir}\qt\bin\QtCore4.dll"
- File "${qtDir}\qt\bin\QtNetwork4.dll"
-
- ; gui start menu shortcut
- SetShellVarContext all
- CreateShortCut "$SMPROGRAMS\${product}.lnk" "$INSTDIR\${startMenuApp}"
-
-SectionEnd
-
-Section "Visual C++ Redistributable" vcredist
-
- ; copy redist file, run it, then delete when done
- File "${vcRedistDir}\${vcRedistFile}"
- ExecWait "$INSTDIR\${vcRedistFile} /install /q"
- Delete $INSTDIR\${vcRedistFile}
-
-SectionEnd
-
-Section Uninstall
-
- SetShellVarContext all
-
- ; force kill all synergy processes
- nsExec::Exec "taskkill /f /im qsynergy.exe"
- nsExec::Exec "taskkill /f /im launcher.exe"
- nsExec::Exec "taskkill /f /im synergys.exe"
- nsExec::Exec "taskkill /f /im synergyc.exe"
-
- ; delete start menu shortcut
- Delete "$SMPROGRAMS\${product}.lnk"
-
- ; delete all registry keys
- DeleteRegKey HKLM "SOFTWARE\${product}"
- DeleteRegKey HKLM "${controlPanelReg}\${product}"
-
- ; delete only the files that we put there
- !insertmacro DeleteFiles $INSTDIR
- Delete "$INSTDIR\${uninstall}"
-
- ; delete (only if empty, so we don't delete user files)
- RMDir "$INSTDIR"
-
-SectionEnd
diff --git a/res/License.rtf b/res/License.rtf
deleted file mode 100644
index ea1602df4..000000000
--- a/res/License.rtf
+++ /dev/null
@@ -1,102 +0,0 @@
-{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\froman\fcharset0 Times-Roman;}
-{\colortbl;\red255\green255\blue255;}
-{\info
-{\title Original file was gpl-2.0.tex}
-{\doccomm Created using latex2rtf 1.9.19a on Sun Jul 12 19:21:22 2009}}\paperw12280\paperh15900\margl2680\margr2700\margb1760\margt2540\vieww12280\viewh15900\viewkind1
-\deftab720
-\pard\pardeftab720\ri0\qj
-
-\f0\fs24 \cf0 \
-\pard\pardeftab720\ri0\qc
-
-\f1\fs30 \cf0 GNU GENERAL PUBLIC LICENSE
-\f0\fs24 \
-\
-\
-\pard\pardeftab720\ri0\qc
-
-\f1 \cf0 Version 2, June 1991\
-\
-\
-Copyright \'a9 1989, 1991 Free Software Foundation, Inc.\
-\pard\pardeftab720\ri0\sb240\qc
-\cf0 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\
-\pard\pardeftab720\ri0\qc
-\cf0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. \
-\pard\pardeftab720\ri0\qc
-
-\b\fs26 \cf0 Preamble
-\b0\fs24 \
-\pard\pardeftab720\ri0\qj
-\cf0 The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software\'97to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation\'92s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.\
-When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.\
-To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.\
-For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\
-We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.\
-Also, for each author\'92s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors\'92 reputations.\
-Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone\'92s free use or not licensed at all.\
-The precise terms and conditions for copying, distribution and modification follow.\
-\pard\pardeftab720\ri0\qc
-
-\fs31 \cf0 Terms and Conditions For Copying, Distribution and Modification
-\fs24 \
-\pard\pardeftab720\li600\fi-300\ri0\sb50\qj
-\cf0 1. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The \'93Program\'94, below, refers to any such program or work, and a \'93work based on the Program\'94 means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term \'93modification\'94.) Each licensee is addressed as \'93you\'94.\
-\pard\pardeftab720\li600\ri0\qj
-\cf0 Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.\
-\pard\pardeftab720\li600\fi-300\ri0\sb50\qj
-\cf0 2. You may copy and distribute verbatim copies of the Program\'92s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.\
-\pard\pardeftab720\li600\ri0\qj
-\cf0 You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\
-\pard\pardeftab720\li600\fi-300\ri0\sb50\qj
-\cf0 3. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\
-\pard\pardeftab720\li1200\fi-300\ri0\sb50\qj
-\cf0 (a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.\
-(b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.\
-(c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)\
-\pard\pardeftab720\li600\ri0\sb100\qj
-\cf0 These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\
-\pard\pardeftab720\li600\fi-300\ri0\qj
-\cf0 Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.\
-In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\
-\pard\pardeftab720\li600\fi-300\ri0\sb50\qj
-\cf0 4. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:\
-\pard\pardeftab720\li1200\fi-300\ri0\sb50\qj
-\cf0 (a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,\
-(b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,\
-(c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)\
-\pard\pardeftab720\li600\ri0\sb100\qj
-\cf0 The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.\
-\pard\pardeftab720\li600\fi-300\ri0\qj
-\cf0 If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.\
-\pard\pardeftab720\li600\fi-300\ri0\sb50\qj
-\cf0 5. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\
-6. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.\
-7. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients\'92 exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.\
-8. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.\
-\pard\pardeftab720\li600\ri0\qj
-\cf0 If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.\
-It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.\
-This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\
-\pard\pardeftab720\li600\fi-300\ri0\sb50\qj
-\cf0 9. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.\
-10. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\
-\pard\pardeftab720\li600\ri0\qj
-\cf0 Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and \'93any later version\'94, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.\
-\pard\pardeftab720\li600\fi-300\ri0\sb50\qj
-\cf0 11. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\
-\pard\pardeftab720\li600\ri0\qc
-
-\fs31 \cf0 No Warranty
-\fs24 \
-\pard\pardeftab720\li600\fi-300\ri0\sb50\qj
-\cf0 12. Because the program is licensed free of charge, there is no warranty for the program, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the program \'93as is\'94 without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair or correction.
-\f0 \
-
-\f1 13. In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute the program as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.
-\f0 \
-\pard\pardeftab720\ri0\sb100\qc
-
-\f1\fs31 \cf0 End of Terms and Conditions
-\fs24 }
\ No newline at end of file
diff --git a/res/License.tex b/res/License.tex
deleted file mode 100644
index 560aa9c3d..000000000
--- a/res/License.tex
+++ /dev/null
@@ -1,422 +0,0 @@
-\documentclass[11pt]{article}
-
-\title{GNU GENERAL PUBLIC LICENSE}
-\date{Version 2, June 1991}
-
-\begin{document}
-\maketitle
-
-\begin{center}
-{\parindent 0in
-
-Copyright \copyright\ 1989, 1991 Free Software Foundation, Inc.
-
-\bigskip
-
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-
-\bigskip
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-}
-\end{center}
-
-\begin{center}
-{\bf\large Preamble}
-\end{center}
-
-
-The licenses for most software are designed to take away your freedom to
-share and change it. By contrast, the GNU General Public License is
-intended to guarantee your freedom to share and change free software---to
-make sure the software is free for all its users. This General Public
-License applies to most of the Free Software Foundation's software and to
-any other program whose authors commit to using it. (Some other Free
-Software Foundation software is covered by the GNU Library General Public
-License instead.) You can apply it to your programs, too.
-
-When we speak of free software, we are referring to freedom, not price.
-Our General Public Licenses are designed to make sure that you have the
-freedom to distribute copies of free software (and charge for this service
-if you wish), that you receive source code or can get it if you want it,
-that you can change the software or use pieces of it in new free programs;
-and that you know you can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone to
-deny you these rights or to ask you to surrender the rights. These
-restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or
-for a fee, you must give the recipients all the rights that you have. You
-must make sure that they, too, receive or can get the source code. And
-you must show them these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software. If
-the software is modified by someone else and passed on, we want its
-recipients to know that what they have is not the original, so that any
-problems introduced by others will not reflect on the original authors'
-reputations.
-
-Finally, any free program is threatened constantly by software patents.
-We wish to avoid the danger that redistributors of a free program will
-individually obtain patent licenses, in effect making the program
-proprietary. To prevent this, we have made it clear that any patent must
-be licensed for everyone's free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and
-modification follow.
-
-\begin{center}
-{\Large \sc Terms and Conditions For Copying, Distribution and
- Modification}
-\end{center}
-
-
-%\renewcommand{\theenumi}{\alpha{enumi}}
-\begin{enumerate}
-
-\addtocounter{enumi}{-1}
-
-\item
-
-This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the
-terms of this General Public License. The ``Program'', below, refers to
-any such program or work, and a ``work based on the Program'' means either
-the Program or any derivative work under copyright law: that is to say, a
-work containing the Program or a portion of it, either verbatim or with
-modifications and/or translated into another language. (Hereinafter,
-translation is included without limitation in the term ``modification''.)
-Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-\item You may copy and distribute verbatim copies of the Program's source
- code as you receive it, in any medium, provided that you conspicuously
- and appropriately publish on each copy an appropriate copyright notice
- and disclaimer of warranty; keep intact all the notices that refer to
- this License and to the absence of any warranty; and give any other
- recipients of the Program a copy of this License along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and you
-may at your option offer warranty protection in exchange for a fee.
-
-\item
-
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-\begin{enumerate}
-
-\item
-
-You must cause the modified files to carry prominent notices stating that
-you changed the files and the date of any change.
-
-\item
-
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-\item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License. (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-
-\end{enumerate}
-
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-\item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-\begin{enumerate}
-
-\item
-
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-\item
-
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-\item
-
-Accompany it with the information you received as to the offer
-to distribute corresponding source code. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsection b above.)
-
-\end{enumerate}
-
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-\item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-\item
-You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-\item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-\item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-\item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-\item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-\item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-\begin{center}
-{\Large\sc
-No Warranty
-}
-\end{center}
-
-\item
-{\sc Because the program is licensed free of charge, there is no warranty
-for the program, to the extent permitted by applicable law. Except when
-otherwise stated in writing the copyright holders and/or other parties
-provide the program ``as is'' without warranty of any kind, either expressed
-or implied, including, but not limited to, the implied warranties of
-merchantability and fitness for a particular purpose. The entire risk as
-to the quality and performance of the program is with you. Should the
-program prove defective, you assume the cost of all necessary servicing,
-repair or correction.}
-
-\item
-{\sc In no event unless required by applicable law or agreed to in writing
-will any copyright holder, or any other party who may modify and/or
-redistribute the program as permitted above, be liable to you for damages,
-including any general, special, incidental or consequential damages arising
-out of the use or inability to use the program (including but not limited
-to loss of data or data being rendered inaccurate or losses sustained by
-you or third parties or a failure of the program to operate with any other
-programs), even if such holder or other party has been advised of the
-possibility of such damages.}
-
-\end{enumerate}
-
-
-\begin{center}
-{\Large\sc End of Terms and Conditions}
-\end{center}
-
-
-\pagebreak[2]
-
-\section*{Appendix: How to Apply These Terms to Your New Programs}
-
-If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these
-terms.
-
- To do so, attach the following notices to the program. It is safest to
- attach them to the start of each source file to most effectively convey
- the exclusion of warranty; and each file should have at least the
- ``copyright'' line and a pointer to where the full notice is found.
-
-\begin{quote}
-one line to give the program's name and a brief idea of what it does. \\
-Copyright (C) yyyy name of author \\
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-\end{quote}
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-\begin{quote}
-Gnomovision version 69, Copyright (C) yyyy name of author \\
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. \\
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-\end{quote}
-
-
-The hypothetical commands {\tt show w} and {\tt show c} should show the
-appropriate parts of the General Public License. Of course, the commands
-you use may be called something other than {\tt show w} and {\tt show c};
-they could even be mouse-clicks or menu items---whatever suits your
-program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary. Here is a sample; alter the names:
-
-\begin{quote}
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program \\
-`Gnomovision' (which makes passes at compilers) written by James Hacker. \\
-
-signature of Ty Coon, 1 April 1989 \\
-Ty Coon, President of Vice
-\end{quote}
-
-
-This General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications
-with the library. If this is what you want to do, use the GNU Library
-General Public License instead of this License.
-
-\end{document}
diff --git a/res/Readme.txt b/res/Readme.txt
deleted file mode 100644
index 865453171..000000000
--- a/res/Readme.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Thank you for chosing Synergy!
-http://synergy-foss.org/
-
-Synergy allows you to share your keyboard and mouse between computers over a network.
-
-For FAQ, setup, and usage instructions, please visit our online Readme:
-http://synergy-foss.org/pm/projects/synergy/wiki/Readme
-
-Have fun!
-
-Thanks,
-The Synergy Team
diff --git a/res/config.h.in b/res/config.h.in
deleted file mode 100644
index 404adc087..000000000
--- a/res/config.h.in
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Define version here for Unix, but using /D for Windows. */
-#cmakedefine VERSION "${VERSION}"
-
-/* Define to the base type of arg 3 for `accept`. */
-#cmakedefine ACCEPT_TYPE_ARG3 ${ACCEPT_TYPE_ARG3}
-
-/* Define if your compiler has bool support. */
-#cmakedefine HAVE_CXX_BOOL ${HAVE_CXX_BOOL}
-
-/* Define if your compiler has C++ cast support. */
-#cmakedefine HAVE_CXX_CASTS ${HAVE_CXX_CASTS}
-
-/* Define if your compiler has exceptions support. */
-#cmakedefine HAVE_CXX_EXCEPTIONS ${HAVE_CXX_EXCEPTIONS}
-
-/* Define if your compiler has mutable support. */
-#cmakedefine HAVE_CXX_MUTABLE ${HAVE_CXX_MUTABLE}
-
-/* Define if your compiler has standard C++ library support. */
-#cmakedefine HAVE_CXX_STDLIB ${HAVE_CXX_STDLIB}
-
-/* Define if the header file declares function prototypes. */
-#cmakedefine HAVE_DPMS_PROTOTYPES ${HAVE_DPMS_PROTOTYPES}
-
-/* Define if you have a working `getpwuid_r` function. */
-#cmakedefine HAVE_GETPWUID_R ${HAVE_GETPWUID_R}
-
-/* Define to 1 if you have the `gmtime_r` function. */
-#cmakedefine HAVE_GMTIME_R ${HAVE_GMTIME_R}
-
-/* Define if you have the `inet_aton` function. */
-#cmakedefine HAVE_INET_ATON ${HAVE_INET_ATON}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_ISTREAM ${HAVE_ISTREAM}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_LOCALE_H ${HAVE_LOCALE_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_MEMORY_H ${HAVE_MEMORY_H}
-
-/* Define if you have the `nanosleep` function. */
-#cmakedefine HAVE_NANOSLEEP ${HAVE_NANOSLEEP}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_OSTREAM ${HAVE_OSTREAM}
-
-/* Define if you have the `poll` function. */
-#cmakedefine HAVE_POLL ${HAVE_POLL}
-
-/* Define if you have a POSIX `sigwait` function. */
-#cmakedefine HAVE_POSIX_SIGWAIT ${HAVE_POSIX_SIGWAIT}
-
-/* Define if you have POSIX threads libraries and header files. */
-#cmakedefine HAVE_PTHREAD ${HAVE_PTHREAD}
-
-/* Define if you have `pthread_sigmask` and `pthread_kill` functions. */
-#cmakedefine HAVE_PTHREAD_SIGNAL ${HAVE_PTHREAD_SIGNAL}
-
-/* Define if your compiler defines socklen_t. */
-#cmakedefine HAVE_SOCKLEN_T ${HAVE_SOCKLEN_T}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_SSTREAM ${HAVE_SSTREAM}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_STDLIB_H ${HAVE_STDLIB_H}
-
-/* Define to 1 if you have the `strftime` function. */
-#cmakedefine HAVE_STRFTIME ${HAVE_STRFTIME}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_STRINGS_H ${HAVE_STRINGS_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_STRING_H ${HAVE_STRING_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_SYS_SELECT_H ${HAVE_SYS_SELECT_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_SYS_SOCKET_H ${HAVE_SYS_SOCKET_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_SYS_STAT_H ${HAVE_SYS_STAT_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_SYS_TIME_H ${HAVE_SYS_TIME_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_SYS_UTSNAME_H ${HAVE_SYS_UTSNAME_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H}
-
-/* Define to 1 if you have the `vsnprintf` function. */
-#cmakedefine HAVE_VSNPRINTF ${HAVE_VSNPRINTF}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_WCHAR_H ${HAVE_WCHAR_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_X11_EXTENSIONS_DPMS_H ${HAVE_X11_EXTENSIONS_DPMS_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_X11_EXTENSIONS_XINERAMA_H ${HAVE_X11_EXTENSIONS_XINERAMA_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_X11_EXTENSIONS_XKBSTR_H ${HAVE_X11_EXTENSIONS_XKBSTR_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_X11_EXTENSIONS_XTEST_H ${HAVE_X11_EXTENSIONS_XTEST_H}
-
-/* Define to 1 if you have the header file. */
-#cmakedefine HAVE_X11_XKBLIB_H ${HAVE_X11_XKBLIB_H}
-
-/* Define this if the XKB extension is available. */
-#cmakedefine HAVE_XKB_EXTENSION ${HAVE_XKB_EXTENSION}
-
-/* Define to necessary symbol if this constant uses a non-standard name on your system. */
-#cmakedefine PTHREAD_CREATE_JOINABLE ${PTHREAD_CREATE_JOINABLE}
-
-/* Define to the type of arg 1 for `select`. */
-#cmakedefine SELECT_TYPE_ARG1 ${SELECT_TYPE_ARG1}
-
-/* Define to the type of args 2, 3 and 4 for `select`. */
-#cmakedefine SELECT_TYPE_ARG234 ${SELECT_TYPE_ARG234}
-
-/* Define to the type of arg 5 for `select`. */
-#cmakedefine SELECT_TYPE_ARG5 ${SELECT_TYPE_ARG5}
-
-/* The size of `char`, as computed by sizeof. */
-#cmakedefine SIZEOF_CHAR ${SIZEOF_CHAR}
-
-/* The size of `int`, as computed by sizeof. */
-#cmakedefine SIZEOF_INT ${SIZEOF_INT}
-
-/* The size of `long`, as computed by sizeof. */
-#cmakedefine SIZEOF_LONG ${SIZEOF_LONG}
-
-/* The size of `short`, as computed by sizeof. */
-#cmakedefine SIZEOF_SHORT ${SIZEOF_SHORT}
-
-/* Define to 1 if you have the ANSI C header files. */
-#cmakedefine STDC_HEADERS ${STDC_HEADERS}
-
-/* Define to 1 if you can safely include both and . */
-#cmakedefine TIME_WITH_SYS_TIME ${TIME_WITH_SYS_TIME}
-
-/* Define to 1 if your declares `struct tm`. */
-#cmakedefine TM_IN_SYS_TIME ${TM_IN_SYS_TIME}
-
-/* Define to 1 if the X Window System is missing or not being used. */
-#cmakedefine X_DISPLAY_MISSING ${X_DISPLAY_MISSING}
-
-/* Define to `unsigned int` if does not define. */
-#cmakedefine size_t ${size_t}
diff --git a/res/doxygen.cfg.in b/res/doxygen.cfg.in
deleted file mode 100644
index d18ce6e8f..000000000
--- a/res/doxygen.cfg.in
+++ /dev/null
@@ -1,1632 +0,0 @@
-# Doxyfile 1.7.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = "Synergy"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = "${VERSION}"
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = doc/doxygen
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 4
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this
-# tag. The format is ext=language, where ext is a file extension, and language
-# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
-# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command , where is the value of
-# the FILE_VERSION_FILTER tag, and is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. The create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
-
-LAYOUT_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = YES
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = NO
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT =
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = .
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS = *.cpp \
- *.h
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS = */.svn/* \
- */.git/*
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command , where
-# is the value of the INPUT_FILTER tag, and is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 3
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT =
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the stylesheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
-
-HTML_COLORSTYLE_HUE = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
-
-HTML_COLORSTYLE_SAT = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
-
-HTML_COLORSTYLE_GAMMA = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-#
-# Qt Help Project / Custom Filters.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-#
-# Qt Help Project / Filter Attributes.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
-
-FORMULA_TRANSPARENT = YES
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE = NO
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a PHP enabled web server instead of at the web client
-# using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server
-# based approach is that it scales better to large projects and allows
-# full text search. The disadvances is that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT =
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT =
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT =
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION =
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = NO
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = @HAVE_DOT@
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
-
-DOT_NUM_THREADS = 0
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME = FreeSans.ttf
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
diff --git a/res/synergy.desktop b/res/synergy.desktop
deleted file mode 100644
index 563ce64c5..000000000
--- a/res/synergy.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Name=Synergy
-Comment=Share your keyboard and mouse over a network
-Exec=qsynergy
-Icon=/usr/share/icons/synergy.ico
-Type=Application
-Categories=Utility
diff --git a/res/synergy.ico b/res/synergy.ico
deleted file mode 100644
index fc2e41468..000000000
Binary files a/res/synergy.ico and /dev/null differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
deleted file mode 100644
index 5c41556b4..000000000
--- a/src/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-# synergy -- mouse and keyboard sharing utility
-# Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-add_subdirectory(lib)
-add_subdirectory(cmd)
-add_subdirectory(test)
diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt
deleted file mode 100644
index 822ce1f24..000000000
--- a/src/cmd/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# synergy -- mouse and keyboard sharing utility
-# Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-add_subdirectory(synergyc)
-add_subdirectory(synergys)
diff --git a/src/cmd/synergyc/.gitignore b/src/cmd/synergyc/.gitignore
deleted file mode 100644
index 41a58c4c4..000000000
--- a/src/cmd/synergyc/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/*.aps
diff --git a/src/cmd/synergyc/CMSWindowsClientTaskBarReceiver.cpp b/src/cmd/synergyc/CMSWindowsClientTaskBarReceiver.cpp
deleted file mode 100644
index d84ac3092..000000000
--- a/src/cmd/synergyc/CMSWindowsClientTaskBarReceiver.cpp
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CMSWindowsClientTaskBarReceiver.h"
-#include "CClient.h"
-#include "CMSWindowsClipboard.h"
-#include "LogOutputters.h"
-#include "BasicTypes.h"
-#include "CArch.h"
-#include "CArchTaskBarWindows.h"
-#include "CArchMiscWindows.h"
-#include "resource.h"
-#include "CMSWindowsScreen.h"
-
-//
-// CMSWindowsClientTaskBarReceiver
-//
-
-const UINT CMSWindowsClientTaskBarReceiver::s_stateToIconID[kMaxState] =
-{
- IDI_TASKBAR_NOT_RUNNING,
- IDI_TASKBAR_NOT_WORKING,
- IDI_TASKBAR_NOT_CONNECTED,
- IDI_TASKBAR_NOT_CONNECTED,
- IDI_TASKBAR_CONNECTED
-};
-
-CMSWindowsClientTaskBarReceiver::CMSWindowsClientTaskBarReceiver(
- HINSTANCE appInstance, const CBufferedLogOutputter* logBuffer) :
- CClientTaskBarReceiver(),
- m_appInstance(appInstance),
- m_window(NULL),
- m_logBuffer(logBuffer)
-{
- for (UInt32 i = 0; i < kMaxState; ++i) {
- m_icon[i] = loadIcon(s_stateToIconID[i]);
- }
- m_menu = LoadMenu(m_appInstance, MAKEINTRESOURCE(IDR_TASKBAR));
-
- // don't create the window yet. we'll create it on demand. this
- // has the side benefit of being created in the thread used for
- // the task bar. that's good because it means the existence of
- // the window won't prevent changing the main thread's desktop.
-
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-CMSWindowsClientTaskBarReceiver::~CMSWindowsClientTaskBarReceiver()
-{
- cleanup();
-}
-
-void
-CMSWindowsClientTaskBarReceiver::cleanup()
-{
- ARCH->removeReceiver(this);
- for (UInt32 i = 0; i < kMaxState; ++i) {
- deleteIcon(m_icon[i]);
- }
- DestroyMenu(m_menu);
- destroyWindow();
-}
-
-void
-CMSWindowsClientTaskBarReceiver::showStatus()
-{
- // create the window
- createWindow();
-
- // lock self while getting status
- lock();
-
- // get the current status
- std::string status = getToolTip();
-
- // done getting status
- unlock();
-
- // update dialog
- HWND child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_STATUS);
- SendMessage(child, WM_SETTEXT, 0, (LPARAM)status.c_str());
-
- if (!IsWindowVisible(m_window)) {
- // position it by the mouse
- POINT cursorPos;
- GetCursorPos(&cursorPos);
- RECT windowRect;
- GetWindowRect(m_window, &windowRect);
- int x = cursorPos.x;
- int y = cursorPos.y;
- int fw = GetSystemMetrics(SM_CXDLGFRAME);
- int fh = GetSystemMetrics(SM_CYDLGFRAME);
- int ww = windowRect.right - windowRect.left;
- int wh = windowRect.bottom - windowRect.top;
- int sw = GetSystemMetrics(SM_CXFULLSCREEN);
- int sh = GetSystemMetrics(SM_CYFULLSCREEN);
- if (fw < 1) {
- fw = 1;
- }
- if (fh < 1) {
- fh = 1;
- }
- if (x + ww - fw > sw) {
- x -= ww - fw;
- }
- else {
- x -= fw;
- }
- if (x < 0) {
- x = 0;
- }
- if (y + wh - fh > sh) {
- y -= wh - fh;
- }
- else {
- y -= fh;
- }
- if (y < 0) {
- y = 0;
- }
- SetWindowPos(m_window, HWND_TOPMOST, x, y, ww, wh,
- SWP_SHOWWINDOW);
- }
-}
-
-void
-CMSWindowsClientTaskBarReceiver::runMenu(int x, int y)
-{
- // do popup menu. we need a window to pass to TrackPopupMenu().
- // the SetForegroundWindow() and SendMessage() calls around
- // TrackPopupMenu() are to get the menu to be dismissed when
- // another window gets activated and are just one of those
- // win32 weirdnesses.
- createWindow();
- SetForegroundWindow(m_window);
- HMENU menu = GetSubMenu(m_menu, 0);
- SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
- HMENU logLevelMenu = GetSubMenu(menu, 3);
- CheckMenuRadioItem(logLevelMenu, 0, 6,
- CLOG->getFilter() - kERROR, MF_BYPOSITION);
- int n = TrackPopupMenu(menu,
- TPM_NONOTIFY |
- TPM_RETURNCMD |
- TPM_LEFTBUTTON |
- TPM_RIGHTBUTTON,
- x, y, 0, m_window, NULL);
- SendMessage(m_window, WM_NULL, 0, 0);
-
- // perform the requested operation
- switch (n) {
- case IDC_TASKBAR_STATUS:
- showStatus();
- break;
-
- case IDC_TASKBAR_LOG:
- copyLog();
- break;
-
- case IDC_TASKBAR_SHOW_LOG:
- ARCH->showConsole(true);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_ERROR:
- CLOG->setFilter(kERROR);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_WARNING:
- CLOG->setFilter(kWARNING);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_NOTE:
- CLOG->setFilter(kNOTE);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_INFO:
- CLOG->setFilter(kINFO);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG:
- CLOG->setFilter(kDEBUG);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
- CLOG->setFilter(kDEBUG1);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
- CLOG->setFilter(kDEBUG2);
- break;
-
- case IDC_TASKBAR_QUIT:
- quit();
- break;
- }
-}
-
-void
-CMSWindowsClientTaskBarReceiver::primaryAction()
-{
- showStatus();
-}
-
-const IArchTaskBarReceiver::Icon
-CMSWindowsClientTaskBarReceiver::getIcon() const
-{
- return reinterpret_cast(m_icon[getStatus()]);
-}
-
-void
-CMSWindowsClientTaskBarReceiver::copyLog() const
-{
- if (m_logBuffer != NULL) {
- // collect log buffer
- CString data;
- for (CBufferedLogOutputter::const_iterator index = m_logBuffer->begin();
- index != m_logBuffer->end(); ++index) {
- data += *index;
- data += "\n";
- }
-
- // copy log to clipboard
- if (!data.empty()) {
- CMSWindowsClipboard clipboard(m_window);
- clipboard.open(0);
- clipboard.emptyUnowned();
- clipboard.add(IClipboard::kText, data);
- clipboard.close();
- }
- }
-}
-
-void
-CMSWindowsClientTaskBarReceiver::onStatusChanged()
-{
- if (IsWindowVisible(m_window)) {
- showStatus();
- }
-}
-
-HICON
-CMSWindowsClientTaskBarReceiver::loadIcon(UINT id)
-{
- HANDLE icon = LoadImage(m_appInstance,
- MAKEINTRESOURCE(id),
- IMAGE_ICON,
- 0, 0,
- LR_DEFAULTCOLOR);
- return reinterpret_cast(icon);
-}
-
-void
-CMSWindowsClientTaskBarReceiver::deleteIcon(HICON icon)
-{
- if (icon != NULL) {
- DestroyIcon(icon);
- }
-}
-
-void
-CMSWindowsClientTaskBarReceiver::createWindow()
-{
- // ignore if already created
- if (m_window != NULL) {
- return;
- }
-
- // get the status dialog
- m_window = CreateDialogParam(m_appInstance,
- MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
- NULL,
- (DLGPROC)&CMSWindowsClientTaskBarReceiver::staticDlgProc,
- reinterpret_cast(
- reinterpret_cast(this)));
-
- // window should appear on top of everything, including (especially)
- // the task bar.
- LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE);
- style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
- SetWindowLongPtr(m_window, GWL_EXSTYLE, style);
-
- // tell the task bar about this dialog
- CArchTaskBarWindows::addDialog(m_window);
-}
-
-void
-CMSWindowsClientTaskBarReceiver::destroyWindow()
-{
- if (m_window != NULL) {
- CArchTaskBarWindows::removeDialog(m_window);
- DestroyWindow(m_window);
- m_window = NULL;
- }
-}
-
-BOOL
-CMSWindowsClientTaskBarReceiver::dlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM)
-{
- switch (msg) {
- case WM_INITDIALOG:
- // use default focus
- return TRUE;
-
- case WM_ACTIVATE:
- // hide when another window is activated
- if (LOWORD(wParam) == WA_INACTIVE) {
- ShowWindow(hwnd, SW_HIDE);
- }
- break;
- }
- return FALSE;
-}
-
-BOOL CALLBACK
-CMSWindowsClientTaskBarReceiver::staticDlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam)
-{
- // if msg is WM_INITDIALOG, extract the CMSWindowsClientTaskBarReceiver*
- // and put it in the extra window data then forward the call.
- CMSWindowsClientTaskBarReceiver* self = NULL;
- if (msg == WM_INITDIALOG) {
- self = reinterpret_cast(
- reinterpret_cast(lParam));
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) lParam);
- }
- else {
- // get the extra window data and forward the call
- LONG_PTR data = GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (data != 0) {
- self = (CMSWindowsClientTaskBarReceiver*) data;
- }
- }
-
- // forward the message
- if (self != NULL) {
- return self->dlgProc(hwnd, msg, wParam, lParam);
- }
- else {
- return (msg == WM_INITDIALOG) ? TRUE : FALSE;
- }
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
-{
- CArchMiscWindows::setIcons(
- (HICON)LoadImage(CArchMiscWindows::instanceWin32(),
- MAKEINTRESOURCE(IDI_SYNERGY),
- IMAGE_ICON,
- 32, 32, LR_SHARED),
- (HICON)LoadImage(CArchMiscWindows::instanceWin32(),
- MAKEINTRESOURCE(IDI_SYNERGY),
- IMAGE_ICON,
- 16, 16, LR_SHARED));
-
- return new CMSWindowsClientTaskBarReceiver(
- CMSWindowsScreen::getInstance(), logBuffer);
-}
diff --git a/src/cmd/synergyc/CMSWindowsClientTaskBarReceiver.h b/src/cmd/synergyc/CMSWindowsClientTaskBarReceiver.h
deleted file mode 100644
index 3619bb03c..000000000
--- a/src/cmd/synergyc/CMSWindowsClientTaskBarReceiver.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CMSWINDOWSCLIENTTASKBARRECEIVER_H
-#define CMSWINDOWSCLIENTTASKBARRECEIVER_H
-
-#define WIN32_LEAN_AND_MEAN
-
-#include "CClientTaskBarReceiver.h"
-#include
-
-class CBufferedLogOutputter;
-
-//! Implementation of CClientTaskBarReceiver for Microsoft Windows
-class CMSWindowsClientTaskBarReceiver : public CClientTaskBarReceiver {
-public:
- CMSWindowsClientTaskBarReceiver(HINSTANCE, const CBufferedLogOutputter*);
- virtual ~CMSWindowsClientTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
- void cleanup();
-
-protected:
- void copyLog() const;
-
- // CClientTaskBarReceiver overrides
- virtual void onStatusChanged();
-
-private:
- HICON loadIcon(UINT);
- void deleteIcon(HICON);
- void createWindow();
- void destroyWindow();
-
- BOOL dlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam);
- static BOOL CALLBACK
- staticDlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam);
-
-private:
- HINSTANCE m_appInstance;
- HWND m_window;
- HMENU m_menu;
- HICON m_icon[kMaxState];
- const CBufferedLogOutputter* m_logBuffer;
- static const UINT s_stateToIconID[];
-};
-
-#endif
diff --git a/src/cmd/synergyc/CMakeLists.txt b/src/cmd/synergyc/CMakeLists.txt
deleted file mode 100644
index 29ef22953..000000000
--- a/src/cmd/synergyc/CMakeLists.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-# synergy -- mouse and keyboard sharing utility
-# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-set(src
- synergyc.cpp
-)
-
-if (WIN32)
- list(APPEND src
- CMSWindowsClientTaskBarReceiver.cpp
- CMSWindowsClientTaskBarReceiver.h
- resource.h
- synergyc.ico
- synergyc.rc
- tb_error.ico
- tb_idle.ico
- tb_run.ico
- tb_wait.ico
- )
-elseif (APPLE)
- list(APPEND src COSXClientTaskBarReceiver.cpp)
-elseif (UNIX)
- list(APPEND src CXWindowsClientTaskBarReceiver.cpp)
-endif()
-
-set(inc
- ../../lib/arch
- ../../lib/base
- ../../lib/client
- ../../lib/common
- ../../lib/io
- ../../lib/mt
- ../../lib/net
- ../../lib/platform
- ../../lib/synergy
-)
-
-if (UNIX)
- list(APPEND inc
- ../../..
- )
-endif()
-
-include_directories(${inc})
-add_executable(synergyc ${src})
-target_link_libraries(synergyc
- arch base client common io mt net platform server synergy ${libs})
-
-if (CONF_CPACK)
- install(TARGETS
- synergyc
- COMPONENT core
- DESTINATION bin)
-endif()
diff --git a/src/cmd/synergyc/COSXClientTaskBarReceiver.cpp b/src/cmd/synergyc/COSXClientTaskBarReceiver.cpp
deleted file mode 100644
index f0cfbca19..000000000
--- a/src/cmd/synergyc/COSXClientTaskBarReceiver.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2004 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "COSXClientTaskBarReceiver.h"
-#include "CArch.h"
-
-//
-// COSXClientTaskBarReceiver
-//
-
-COSXClientTaskBarReceiver::COSXClientTaskBarReceiver(
- const CBufferedLogOutputter*)
-{
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-COSXClientTaskBarReceiver::~COSXClientTaskBarReceiver()
-{
- ARCH->removeReceiver(this);
-}
-
-void
-COSXClientTaskBarReceiver::showStatus()
-{
- // do nothing
-}
-
-void
-COSXClientTaskBarReceiver::runMenu(int, int)
-{
- // do nothing
-}
-
-void
-COSXClientTaskBarReceiver::primaryAction()
-{
- // do nothing
-}
-
-const IArchTaskBarReceiver::Icon
-COSXClientTaskBarReceiver::getIcon() const
-{
- return NULL;
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
-{
- return new COSXClientTaskBarReceiver(logBuffer);
-}
-
diff --git a/src/cmd/synergyc/COSXClientTaskBarReceiver.h b/src/cmd/synergyc/COSXClientTaskBarReceiver.h
deleted file mode 100644
index 147a6d9e1..000000000
--- a/src/cmd/synergyc/COSXClientTaskBarReceiver.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2004 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef COSXCLIENTTASKBARRECEIVER_H
-#define COSXCLIENTTASKBARRECEIVER_H
-
-#include "CClientTaskBarReceiver.h"
-
-class CBufferedLogOutputter;
-
-//! Implementation of CClientTaskBarReceiver for OS X
-class COSXClientTaskBarReceiver : public CClientTaskBarReceiver {
-public:
- COSXClientTaskBarReceiver(const CBufferedLogOutputter*);
- virtual ~COSXClientTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
-};
-
-#endif
diff --git a/src/cmd/synergyc/CXWindowsClientTaskBarReceiver.cpp b/src/cmd/synergyc/CXWindowsClientTaskBarReceiver.cpp
deleted file mode 100644
index 64f28a187..000000000
--- a/src/cmd/synergyc/CXWindowsClientTaskBarReceiver.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CXWindowsClientTaskBarReceiver.h"
-#include "CArch.h"
-
-//
-// CXWindowsClientTaskBarReceiver
-//
-
-CXWindowsClientTaskBarReceiver::CXWindowsClientTaskBarReceiver(
- const CBufferedLogOutputter*)
-{
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-CXWindowsClientTaskBarReceiver::~CXWindowsClientTaskBarReceiver()
-{
- ARCH->removeReceiver(this);
-}
-
-void
-CXWindowsClientTaskBarReceiver::showStatus()
-{
- // do nothing
-}
-
-void
-CXWindowsClientTaskBarReceiver::runMenu(int, int)
-{
- // do nothing
-}
-
-void
-CXWindowsClientTaskBarReceiver::primaryAction()
-{
- // do nothing
-}
-
-const IArchTaskBarReceiver::Icon
-CXWindowsClientTaskBarReceiver::getIcon() const
-{
- return NULL;
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
-{
- return new CXWindowsClientTaskBarReceiver(logBuffer);
-}
diff --git a/src/cmd/synergyc/CXWindowsClientTaskBarReceiver.h b/src/cmd/synergyc/CXWindowsClientTaskBarReceiver.h
deleted file mode 100644
index 4cad4d0bf..000000000
--- a/src/cmd/synergyc/CXWindowsClientTaskBarReceiver.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CXWINDOWSCLIENTTASKBARRECEIVER_H
-#define CXWINDOWSCLIENTTASKBARRECEIVER_H
-
-#include "CClientTaskBarReceiver.h"
-
-class CBufferedLogOutputter;
-
-//! Implementation of CClientTaskBarReceiver for X Windows
-class CXWindowsClientTaskBarReceiver : public CClientTaskBarReceiver {
-public:
- CXWindowsClientTaskBarReceiver(const CBufferedLogOutputter*);
- virtual ~CXWindowsClientTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
-};
-
-#endif
diff --git a/src/cmd/synergyc/resource.h b/src/cmd/synergyc/resource.h
deleted file mode 100644
index eeee6e1ec..000000000
--- a/src/cmd/synergyc/resource.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by synergyc.rc
-//
-#define IDS_FAILED 1
-#define IDS_INIT_FAILED 2
-#define IDS_UNCAUGHT_EXCEPTION 3
-#define IDI_SYNERGY 101
-#define IDI_TASKBAR_NOT_RUNNING 102
-#define IDI_TASKBAR_NOT_WORKING 103
-#define IDI_TASKBAR_NOT_CONNECTED 104
-#define IDI_TASKBAR_CONNECTED 105
-#define IDR_TASKBAR 107
-#define IDD_TASKBAR_STATUS 108
-#define IDC_TASKBAR_STATUS_STATUS 1000
-#define IDC_TASKBAR_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 40016
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/src/cmd/synergyc/synergyc.cpp b/src/cmd/synergyc/synergyc.cpp
deleted file mode 100644
index f7eb4b501..000000000
--- a/src/cmd/synergyc/synergyc.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CClientApp.h"
-
-#if WINAPI_MSWINDOWS
-#include "CMSWindowsClientTaskBarReceiver.h"
-#elif WINAPI_XWINDOWS
-#include "CXWindowsClientTaskBarReceiver.h"
-#elif WINAPI_CARBON
-#include "COSXClientTaskBarReceiver.h"
-#else
-#error Platform not supported.
-#endif
-
-int
-main(int argc, char** argv)
-{
- CClientApp app(createTaskBarReceiver);
- return app.run(argc, argv);
-}
diff --git a/src/cmd/synergyc/synergyc.ico b/src/cmd/synergyc/synergyc.ico
deleted file mode 100644
index fc2e41468..000000000
Binary files a/src/cmd/synergyc/synergyc.ico and /dev/null differ
diff --git a/src/cmd/synergyc/synergyc.rc b/src/cmd/synergyc/synergyc.rc
deleted file mode 100644
index 7f2a5dc1c..000000000
--- a/src/cmd/synergyc/synergyc.rc
+++ /dev/null
@@ -1,141 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include
-#if !defined(IDC_STATIC)
-#define IDC_STATIC (-1)
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include \r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_SYNERGY ICON DISCARDABLE "synergyc.ico"
-IDI_TASKBAR_NOT_RUNNING ICON DISCARDABLE "tb_idle.ico"
-IDI_TASKBAR_NOT_WORKING ICON DISCARDABLE "tb_error.ico"
-IDI_TASKBAR_NOT_CONNECTED ICON DISCARDABLE "tb_wait.ico"
-IDI_TASKBAR_CONNECTED ICON DISCARDABLE "tb_run.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_TASKBAR_STATUS DIALOG DISCARDABLE 0, 0, 145, 18
-STYLE DS_MODALFRAME | WS_POPUP
-FONT 8, "MS Sans Serif"
-BEGIN
- EDITTEXT IDC_TASKBAR_STATUS_STATUS,3,3,139,12,ES_AUTOHSCROLL |
- ES_READONLY | NOT WS_BORDER
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_TASKBAR MENU DISCARDABLE
-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
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_FAILED "Synergy is about to quit with errors or warnings. Please check the log then click OK."
- IDS_INIT_FAILED "Synergy failed to initialize: %{1}"
- IDS_UNCAUGHT_EXCEPTION "Uncaught exception: %{1}"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/src/cmd/synergyc/tb_error.ico b/src/cmd/synergyc/tb_error.ico
deleted file mode 100644
index 746a87c9e..000000000
Binary files a/src/cmd/synergyc/tb_error.ico and /dev/null differ
diff --git a/src/cmd/synergyc/tb_idle.ico b/src/cmd/synergyc/tb_idle.ico
deleted file mode 100644
index 4e13a264b..000000000
Binary files a/src/cmd/synergyc/tb_idle.ico and /dev/null differ
diff --git a/src/cmd/synergyc/tb_run.ico b/src/cmd/synergyc/tb_run.ico
deleted file mode 100644
index 88e160cbf..000000000
Binary files a/src/cmd/synergyc/tb_run.ico and /dev/null differ
diff --git a/src/cmd/synergyc/tb_wait.ico b/src/cmd/synergyc/tb_wait.ico
deleted file mode 100644
index 257be0a1d..000000000
Binary files a/src/cmd/synergyc/tb_wait.ico and /dev/null differ
diff --git a/src/cmd/synergys/.gitignore b/src/cmd/synergys/.gitignore
deleted file mode 100644
index 41a58c4c4..000000000
--- a/src/cmd/synergys/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/*.aps
diff --git a/src/cmd/synergys/CMSWindowsServerTaskBarReceiver.cpp b/src/cmd/synergys/CMSWindowsServerTaskBarReceiver.cpp
deleted file mode 100644
index 1e9c8d749..000000000
--- a/src/cmd/synergys/CMSWindowsServerTaskBarReceiver.cpp
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CMSWindowsServerTaskBarReceiver.h"
-#include "CServer.h"
-#include "CMSWindowsClipboard.h"
-#include "IEventQueue.h"
-#include "LogOutputters.h"
-#include "BasicTypes.h"
-#include "CArch.h"
-#include "CArchTaskBarWindows.h"
-#include "resource.h"
-#include "CArchMiscWindows.h"
-#include "CMSWindowsScreen.h"
-
-//
-// CMSWindowsServerTaskBarReceiver
-//
-
-const UINT CMSWindowsServerTaskBarReceiver::s_stateToIconID[kMaxState] =
-{
- IDI_TASKBAR_NOT_RUNNING,
- IDI_TASKBAR_NOT_WORKING,
- IDI_TASKBAR_NOT_CONNECTED,
- IDI_TASKBAR_CONNECTED
-};
-
-CMSWindowsServerTaskBarReceiver::CMSWindowsServerTaskBarReceiver(
- HINSTANCE appInstance, const CBufferedLogOutputter* logBuffer) :
- CServerTaskBarReceiver(),
- m_appInstance(appInstance),
- m_window(NULL),
- m_logBuffer(logBuffer)
-{
- for (UInt32 i = 0; i < kMaxState; ++i) {
- m_icon[i] = loadIcon(s_stateToIconID[i]);
- }
- m_menu = LoadMenu(m_appInstance, MAKEINTRESOURCE(IDR_TASKBAR));
-
- // don't create the window yet. we'll create it on demand. this
- // has the side benefit of being created in the thread used for
- // the task bar. that's good because it means the existence of
- // the window won't prevent changing the main thread's desktop.
-
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-void
-CMSWindowsServerTaskBarReceiver::cleanup()
-{
- ARCH->removeReceiver(this);
- for (UInt32 i = 0; i < kMaxState; ++i) {
- deleteIcon(m_icon[i]);
- }
- DestroyMenu(m_menu);
- destroyWindow();
-}
-
-CMSWindowsServerTaskBarReceiver::~CMSWindowsServerTaskBarReceiver()
-{
- cleanup();
-}
-
-void
-CMSWindowsServerTaskBarReceiver::showStatus()
-{
- // create the window
- createWindow();
-
- // lock self while getting status
- lock();
-
- // get the current status
- std::string status = getToolTip();
-
- // get the connect clients, if any
- const CClients& clients = getClients();
-
- // done getting status
- unlock();
-
- // update dialog
- HWND child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_STATUS);
- SendMessage(child, WM_SETTEXT, 0, (LPARAM)status.c_str());
- child = GetDlgItem(m_window, IDC_TASKBAR_STATUS_CLIENTS);
- SendMessage(child, LB_RESETCONTENT, 0, 0);
- for (CClients::const_iterator index = clients.begin();
- index != clients.end(); ) {
- const char* client = index->c_str();
- if (++index == clients.end()) {
- SendMessage(child, LB_ADDSTRING, 0, (LPARAM)client);
- }
- else {
- SendMessage(child, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)client);
- }
- }
-
- if (!IsWindowVisible(m_window)) {
- // position it by the mouse
- POINT cursorPos;
- GetCursorPos(&cursorPos);
- RECT windowRect;
- GetWindowRect(m_window, &windowRect);
- int x = cursorPos.x;
- int y = cursorPos.y;
- int fw = GetSystemMetrics(SM_CXDLGFRAME);
- int fh = GetSystemMetrics(SM_CYDLGFRAME);
- int ww = windowRect.right - windowRect.left;
- int wh = windowRect.bottom - windowRect.top;
- int sw = GetSystemMetrics(SM_CXFULLSCREEN);
- int sh = GetSystemMetrics(SM_CYFULLSCREEN);
- if (fw < 1) {
- fw = 1;
- }
- if (fh < 1) {
- fh = 1;
- }
- if (x + ww - fw > sw) {
- x -= ww - fw;
- }
- else {
- x -= fw;
- }
- if (x < 0) {
- x = 0;
- }
- if (y + wh - fh > sh) {
- y -= wh - fh;
- }
- else {
- y -= fh;
- }
- if (y < 0) {
- y = 0;
- }
- SetWindowPos(m_window, HWND_TOPMOST, x, y, ww, wh,
- SWP_SHOWWINDOW);
- }
-}
-
-void
-CMSWindowsServerTaskBarReceiver::runMenu(int x, int y)
-{
- // do popup menu. we need a window to pass to TrackPopupMenu().
- // the SetForegroundWindow() and SendMessage() calls around
- // TrackPopupMenu() are to get the menu to be dismissed when
- // another window gets activated and are just one of those
- // win32 weirdnesses.
- createWindow();
- SetForegroundWindow(m_window);
- HMENU menu = GetSubMenu(m_menu, 0);
- SetMenuDefaultItem(menu, IDC_TASKBAR_STATUS, FALSE);
- HMENU logLevelMenu = GetSubMenu(menu, 3);
- CheckMenuRadioItem(logLevelMenu, 0, 6,
- CLOG->getFilter() - kERROR, MF_BYPOSITION);
- int n = TrackPopupMenu(menu,
- TPM_NONOTIFY |
- TPM_RETURNCMD |
- TPM_LEFTBUTTON |
- TPM_RIGHTBUTTON,
- x, y, 0, m_window, NULL);
- SendMessage(m_window, WM_NULL, 0, 0);
-
- // perform the requested operation
- switch (n) {
- case IDC_TASKBAR_STATUS:
- showStatus();
- break;
-
- case IDC_TASKBAR_LOG:
- copyLog();
- break;
-
- case IDC_TASKBAR_SHOW_LOG:
- ARCH->showConsole(true);
- break;
-
- case IDC_RELOAD_CONFIG:
- EVENTQUEUE->addEvent(CEvent(getReloadConfigEvent(),
- IEventQueue::getSystemTarget()));
- break;
-
- case IDC_FORCE_RECONNECT:
- EVENTQUEUE->addEvent(CEvent(getForceReconnectEvent(),
- IEventQueue::getSystemTarget()));
- break;
-
- case ID_SYNERGY_RESETSERVER:
- EVENTQUEUE->addEvent(CEvent(getResetServerEvent(),
- IEventQueue::getSystemTarget()));
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_ERROR:
- CLOG->setFilter(kERROR);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_WARNING:
- CLOG->setFilter(kWARNING);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_NOTE:
- CLOG->setFilter(kNOTE);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_INFO:
- CLOG->setFilter(kINFO);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG:
- CLOG->setFilter(kDEBUG);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG1:
- CLOG->setFilter(kDEBUG1);
- break;
-
- case IDC_TASKBAR_LOG_LEVEL_DEBUG2:
- CLOG->setFilter(kDEBUG2);
- break;
-
- case IDC_TASKBAR_QUIT:
- quit();
- break;
- }
-}
-
-void
-CMSWindowsServerTaskBarReceiver::primaryAction()
-{
- showStatus();
-}
-
-const IArchTaskBarReceiver::Icon
-CMSWindowsServerTaskBarReceiver::getIcon() const
-{
- return reinterpret_cast(m_icon[getStatus()]);
-}
-
-void
-CMSWindowsServerTaskBarReceiver::copyLog() const
-{
- if (m_logBuffer != NULL) {
- // collect log buffer
- CString data;
- for (CBufferedLogOutputter::const_iterator index = m_logBuffer->begin();
- index != m_logBuffer->end(); ++index) {
- data += *index;
- data += "\n";
- }
-
- // copy log to clipboard
- if (!data.empty()) {
- CMSWindowsClipboard clipboard(m_window);
- clipboard.open(0);
- clipboard.emptyUnowned();
- clipboard.add(IClipboard::kText, data);
- clipboard.close();
- }
- }
-}
-
-void
-CMSWindowsServerTaskBarReceiver::onStatusChanged()
-{
- if (IsWindowVisible(m_window)) {
- showStatus();
- }
-}
-
-HICON
-CMSWindowsServerTaskBarReceiver::loadIcon(UINT id)
-{
- HANDLE icon = LoadImage(m_appInstance,
- MAKEINTRESOURCE(id),
- IMAGE_ICON,
- 0, 0,
- LR_DEFAULTCOLOR);
- return reinterpret_cast(icon);
-}
-
-void
-CMSWindowsServerTaskBarReceiver::deleteIcon(HICON icon)
-{
- if (icon != NULL) {
- DestroyIcon(icon);
- }
-}
-
-void
-CMSWindowsServerTaskBarReceiver::createWindow()
-{
- // ignore if already created
- if (m_window != NULL) {
- return;
- }
-
- // get the status dialog
- m_window = CreateDialogParam(m_appInstance,
- MAKEINTRESOURCE(IDD_TASKBAR_STATUS),
- NULL,
- (DLGPROC)&CMSWindowsServerTaskBarReceiver::staticDlgProc,
- reinterpret_cast(
- reinterpret_cast(this)));
-
- // window should appear on top of everything, including (especially)
- // the task bar.
- LONG_PTR style = GetWindowLongPtr(m_window, GWL_EXSTYLE);
- style |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
- SetWindowLongPtr(m_window, GWL_EXSTYLE, style);
-
- // tell the task bar about this dialog
- CArchTaskBarWindows::addDialog(m_window);
-}
-
-void
-CMSWindowsServerTaskBarReceiver::destroyWindow()
-{
- if (m_window != NULL) {
- CArchTaskBarWindows::removeDialog(m_window);
- DestroyWindow(m_window);
- m_window = NULL;
- }
-}
-
-BOOL
-CMSWindowsServerTaskBarReceiver::dlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM)
-{
- switch (msg) {
- case WM_INITDIALOG:
- // use default focus
- return TRUE;
-
- case WM_ACTIVATE:
- // hide when another window is activated
- if (LOWORD(wParam) == WA_INACTIVE) {
- ShowWindow(hwnd, SW_HIDE);
- }
- break;
- }
- return FALSE;
-}
-
-BOOL CALLBACK
-CMSWindowsServerTaskBarReceiver::staticDlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam)
-{
- // if msg is WM_INITDIALOG, extract the CMSWindowsServerTaskBarReceiver*
- // and put it in the extra window data then forward the call.
- CMSWindowsServerTaskBarReceiver* self = NULL;
- if (msg == WM_INITDIALOG) {
- self = reinterpret_cast(
- reinterpret_cast(lParam));
- SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
- }
- else {
- // get the extra window data and forward the call
- LONG data = (LONG)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (data != 0) {
- self = reinterpret_cast(
- reinterpret_cast(data));
- }
- }
-
- // forward the message
- if (self != NULL) {
- return self->dlgProc(hwnd, msg, wParam, lParam);
- }
- else {
- return (msg == WM_INITDIALOG) ? TRUE : FALSE;
- }
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
-{
- CArchMiscWindows::setIcons(
- (HICON)LoadImage(CArchMiscWindows::instanceWin32(),
- MAKEINTRESOURCE(IDI_SYNERGY),
- IMAGE_ICON,
- 32, 32, LR_SHARED),
- (HICON)LoadImage(CArchMiscWindows::instanceWin32(),
- MAKEINTRESOURCE(IDI_SYNERGY),
- IMAGE_ICON,
- 16, 16, LR_SHARED));
-
- return new CMSWindowsServerTaskBarReceiver(
- CMSWindowsScreen::getInstance(), logBuffer);
-}
diff --git a/src/cmd/synergys/CMSWindowsServerTaskBarReceiver.h b/src/cmd/synergys/CMSWindowsServerTaskBarReceiver.h
deleted file mode 100644
index 7d8637b24..000000000
--- a/src/cmd/synergys/CMSWindowsServerTaskBarReceiver.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CMSWINDOWSSERVERTASKBARRECEIVER_H
-#define CMSWINDOWSSERVERTASKBARRECEIVER_H
-
-#define WIN32_LEAN_AND_MEAN
-
-#include "CServerTaskBarReceiver.h"
-#include
-
-class CBufferedLogOutputter;
-
-//! Implementation of CServerTaskBarReceiver for Microsoft Windows
-class CMSWindowsServerTaskBarReceiver : public CServerTaskBarReceiver {
-public:
- CMSWindowsServerTaskBarReceiver(HINSTANCE, const CBufferedLogOutputter*);
- virtual ~CMSWindowsServerTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
- void cleanup();
-
-protected:
- void copyLog() const;
-
- // CServerTaskBarReceiver overrides
- virtual void onStatusChanged();
-
-private:
- HICON loadIcon(UINT);
- void deleteIcon(HICON);
- void createWindow();
- void destroyWindow();
-
- BOOL dlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam);
- static BOOL CALLBACK
- staticDlgProc(HWND hwnd,
- UINT msg, WPARAM wParam, LPARAM lParam);
-
-private:
- HINSTANCE m_appInstance;
- HWND m_window;
- HMENU m_menu;
- HICON m_icon[kMaxState];
- const CBufferedLogOutputter* m_logBuffer;
- static const UINT s_stateToIconID[];
-};
-
-#endif
diff --git a/src/cmd/synergys/CMakeLists.txt b/src/cmd/synergys/CMakeLists.txt
deleted file mode 100644
index 28b64c82b..000000000
--- a/src/cmd/synergys/CMakeLists.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-# synergy -- mouse and keyboard sharing utility
-# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-set(src
- synergys.cpp
-)
-
-if (WIN32)
- list(APPEND src
- CMSWindowsServerTaskBarReceiver.cpp
- CMSWindowsServerTaskBarReceiver.h
- resource.h
- synergys.ico
- synergys.rc
- tb_error.ico
- tb_idle.ico
- tb_run.ico
- tb_wait.ico
- )
-elseif (APPLE)
- list(APPEND src COSXServerTaskBarReceiver.cpp)
-elseif (UNIX)
- list(APPEND src CXWindowsServerTaskBarReceiver.cpp)
-endif()
-
-set(inc
- ../../lib/arch
- ../../lib/base
- ../../lib/common
- ../../lib/io
- ../../lib/mt
- ../../lib/net
- ../../lib/platform
- ../../lib/synergy
- ../../lib/server
-)
-
-if (UNIX)
- list(APPEND inc
- ../../..
- )
-endif()
-
-include_directories(${inc})
-add_executable(synergys ${src})
-target_link_libraries(synergys
- arch base client common io mt net platform server synergy ${libs})
-
-if (CONF_CPACK)
- install(TARGETS
- synergys
- COMPONENT core
- DESTINATION bin)
-endif()
diff --git a/src/cmd/synergys/COSXServerTaskBarReceiver.cpp b/src/cmd/synergys/COSXServerTaskBarReceiver.cpp
deleted file mode 100644
index 17d2a39ae..000000000
--- a/src/cmd/synergys/COSXServerTaskBarReceiver.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2004 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "COSXServerTaskBarReceiver.h"
-#include "CArch.h"
-
-//
-// COSXServerTaskBarReceiver
-//
-
-COSXServerTaskBarReceiver::COSXServerTaskBarReceiver(
- const CBufferedLogOutputter*)
-{
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-COSXServerTaskBarReceiver::~COSXServerTaskBarReceiver()
-{
- ARCH->removeReceiver(this);
-}
-
-void
-COSXServerTaskBarReceiver::showStatus()
-{
- // do nothing
-}
-
-void
-COSXServerTaskBarReceiver::runMenu(int, int)
-{
- // do nothing
-}
-
-void
-COSXServerTaskBarReceiver::primaryAction()
-{
- // do nothing
-}
-
-const IArchTaskBarReceiver::Icon
-COSXServerTaskBarReceiver::getIcon() const
-{
- return NULL;
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
-{
- return new COSXServerTaskBarReceiver(logBuffer);
-}
diff --git a/src/cmd/synergys/COSXServerTaskBarReceiver.h b/src/cmd/synergys/COSXServerTaskBarReceiver.h
deleted file mode 100644
index 967f5b5c8..000000000
--- a/src/cmd/synergys/COSXServerTaskBarReceiver.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2004 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef COSXSERVERTASKBARRECEIVER_H
-#define COSXSERVERTASKBARRECEIVER_H
-
-#include "CServerTaskBarReceiver.h"
-
-class CBufferedLogOutputter;
-
-//! Implementation of CServerTaskBarReceiver for OS X
-class COSXServerTaskBarReceiver : public CServerTaskBarReceiver {
-public:
- COSXServerTaskBarReceiver(const CBufferedLogOutputter*);
- virtual ~COSXServerTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
-};
-
-#endif
diff --git a/src/cmd/synergys/CXWindowsServerTaskBarReceiver.cpp b/src/cmd/synergys/CXWindowsServerTaskBarReceiver.cpp
deleted file mode 100644
index 60a81eff7..000000000
--- a/src/cmd/synergys/CXWindowsServerTaskBarReceiver.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CXWindowsServerTaskBarReceiver.h"
-#include "CArch.h"
-
-//
-// CXWindowsServerTaskBarReceiver
-//
-
-CXWindowsServerTaskBarReceiver::CXWindowsServerTaskBarReceiver(
- const CBufferedLogOutputter*)
-{
- // add ourself to the task bar
- ARCH->addReceiver(this);
-}
-
-CXWindowsServerTaskBarReceiver::~CXWindowsServerTaskBarReceiver()
-{
- ARCH->removeReceiver(this);
-}
-
-void
-CXWindowsServerTaskBarReceiver::showStatus()
-{
- // do nothing
-}
-
-void
-CXWindowsServerTaskBarReceiver::runMenu(int, int)
-{
- // do nothing
-}
-
-void
-CXWindowsServerTaskBarReceiver::primaryAction()
-{
- // do nothing
-}
-
-const IArchTaskBarReceiver::Icon
-CXWindowsServerTaskBarReceiver::getIcon() const
-{
- return NULL;
-}
-
-IArchTaskBarReceiver*
-createTaskBarReceiver(const CBufferedLogOutputter* logBuffer)
-{
- return new CXWindowsServerTaskBarReceiver(logBuffer);
-}
diff --git a/src/cmd/synergys/CXWindowsServerTaskBarReceiver.h b/src/cmd/synergys/CXWindowsServerTaskBarReceiver.h
deleted file mode 100644
index 1220bed1c..000000000
--- a/src/cmd/synergys/CXWindowsServerTaskBarReceiver.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CXWINDOWSSERVERTASKBARRECEIVER_H
-#define CXWINDOWSSERVERTASKBARRECEIVER_H
-
-#include "CServerTaskBarReceiver.h"
-
-class CBufferedLogOutputter;
-
-//! Implementation of CServerTaskBarReceiver for X Windows
-class CXWindowsServerTaskBarReceiver : public CServerTaskBarReceiver {
-public:
- CXWindowsServerTaskBarReceiver(const CBufferedLogOutputter*);
- virtual ~CXWindowsServerTaskBarReceiver();
-
- // IArchTaskBarReceiver overrides
- virtual void showStatus();
- virtual void runMenu(int x, int y);
- virtual void primaryAction();
- virtual const Icon getIcon() const;
-};
-
-#endif
diff --git a/src/cmd/synergys/resource.h b/src/cmd/synergys/resource.h
deleted file mode 100644
index 1cc1e8b99..000000000
--- a/src/cmd/synergys/resource.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by synergys.rc
-//
-#define IDS_FAILED 1
-#define IDS_INIT_FAILED 2
-#define IDS_UNCAUGHT_EXCEPTION 3
-#define IDI_SYNERGY 101
-#define IDI_TASKBAR_NOT_RUNNING 102
-#define IDI_TASKBAR_NOT_WORKING 103
-#define IDI_TASKBAR_NOT_CONNECTED 104
-#define IDI_TASKBAR_CONNECTED 105
-#define IDR_TASKBAR 107
-#define IDD_TASKBAR_STATUS 108
-#define IDC_TASKBAR_STATUS_STATUS 1000
-#define IDC_TASKBAR_STATUS_CLIENTS 1001
-#define IDC_TASKBAR_QUIT 40003
-#define IDC_TASKBAR_STATUS 40004
-#define IDC_TASKBAR_LOG 40005
-#define IDC_RELOAD_CONFIG 40006
-#define IDC_FORCE_RECONNECT 40007
-#define IDC_TASKBAR_SHOW_LOG 40008
-#define IDC_TASKBAR_LOG_LEVEL_ERROR 40009
-#define IDC_TASKBAR_LOG_LEVEL_WARNING 40010
-#define IDC_TASKBAR_LOG_LEVEL_NOTE 40011
-#define IDC_TASKBAR_LOG_LEVEL_INFO 40012
-#define IDC_TASKBAR_LOG_LEVEL_DEBUG 40013
-#define IDC_TASKBAR_LOG_LEVEL_DEBUG1 40014
-#define IDC_TASKBAR_LOG_LEVEL_DEBUG2 40015
-#define ID_SYNERGY_RELOADSYSTEM 40016
-#define ID_SYNERGY_RESETSERVER 40017
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 109
-#define _APS_NEXT_COMMAND_VALUE 40018
-#define _APS_NEXT_CONTROL_VALUE 1003
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/src/cmd/synergys/synergys.cpp b/src/cmd/synergys/synergys.cpp
deleted file mode 100644
index b56c19f17..000000000
--- a/src/cmd/synergys/synergys.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CServerApp.h"
-
-#if WINAPI_MSWINDOWS
-#include "CMSWindowsServerTaskBarReceiver.h"
-#elif WINAPI_XWINDOWS
-#include "CXWindowsServerTaskBarReceiver.h"
-#elif WINAPI_CARBON
-#include "COSXServerTaskBarReceiver.h"
-#else
-#error Platform not supported.
-#endif
-
-int
-main(int argc, char** argv)
-{
- CServerApp app(createTaskBarReceiver);
- return app.run(argc, argv);
-}
diff --git a/src/cmd/synergys/synergys.ico b/src/cmd/synergys/synergys.ico
deleted file mode 100644
index fc2e41468..000000000
Binary files a/src/cmd/synergys/synergys.ico and /dev/null differ
diff --git a/src/cmd/synergys/synergys.rc b/src/cmd/synergys/synergys.rc
deleted file mode 100644
index 860d6f548..000000000
--- a/src/cmd/synergys/synergys.rc
+++ /dev/null
@@ -1,134 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include \r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_SYNERGY ICON "synergys.ico"
-IDI_TASKBAR_NOT_RUNNING ICON "tb_idle.ico"
-IDI_TASKBAR_NOT_WORKING ICON "tb_error.ico"
-IDI_TASKBAR_NOT_CONNECTED ICON "tb_wait.ico"
-IDI_TASKBAR_CONNECTED ICON "tb_run.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_TASKBAR MENU
-BEGIN
- POPUP "Synergy"
- BEGIN
- MENUITEM "Show Status", IDC_TASKBAR_STATUS
- MENUITEM "Show Log", IDC_TASKBAR_SHOW_LOG
- MENUITEM "Copy Log To Clipboard", IDC_TASKBAR_LOG
- POPUP "Set Log Level"
- BEGIN
- MENUITEM "Error", IDC_TASKBAR_LOG_LEVEL_ERROR
- MENUITEM "Warning", IDC_TASKBAR_LOG_LEVEL_WARNING
- MENUITEM "Note", IDC_TASKBAR_LOG_LEVEL_NOTE
- MENUITEM "Info", IDC_TASKBAR_LOG_LEVEL_INFO
- MENUITEM "Debug", IDC_TASKBAR_LOG_LEVEL_DEBUG
- MENUITEM "Debug1", IDC_TASKBAR_LOG_LEVEL_DEBUG1
- MENUITEM "Debug2", IDC_TASKBAR_LOG_LEVEL_DEBUG2
- END
- MENUITEM "Reload Configuration", IDC_RELOAD_CONFIG
- MENUITEM "Force Reconnect", IDC_FORCE_RECONNECT
- MENUITEM "Reset Server", ID_SYNERGY_RESETSERVER
- MENUITEM SEPARATOR
- MENUITEM "Quit", IDC_TASKBAR_QUIT
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_TASKBAR_STATUS DIALOG 0, 0, 145, 60
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP
-FONT 8, "MS Sans Serif"
-BEGIN
- EDITTEXT IDC_TASKBAR_STATUS_STATUS,3,3,139,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LISTBOX IDC_TASKBAR_STATUS_CLIENTS,3,17,139,40,NOT LBS_NOTIFY | LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_NOSEL | WS_VSCROLL | WS_TABSTOP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDS_FAILED "Synergy is about to quit with errors or warnings. Please check the log then click OK."
- IDS_INIT_FAILED "Synergy failed to initialize: %{1}"
- IDS_UNCAUGHT_EXCEPTION "Uncaught exception: %{1}"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/src/cmd/synergys/tb_error.ico b/src/cmd/synergys/tb_error.ico
deleted file mode 100644
index 746a87c9e..000000000
Binary files a/src/cmd/synergys/tb_error.ico and /dev/null differ
diff --git a/src/cmd/synergys/tb_idle.ico b/src/cmd/synergys/tb_idle.ico
deleted file mode 100644
index 4e13a264b..000000000
Binary files a/src/cmd/synergys/tb_idle.ico and /dev/null differ
diff --git a/src/cmd/synergys/tb_run.ico b/src/cmd/synergys/tb_run.ico
deleted file mode 100644
index 88e160cbf..000000000
Binary files a/src/cmd/synergys/tb_run.ico and /dev/null differ
diff --git a/src/cmd/synergys/tb_wait.ico b/src/cmd/synergys/tb_wait.ico
deleted file mode 100644
index 257be0a1d..000000000
Binary files a/src/cmd/synergys/tb_wait.ico and /dev/null differ
diff --git a/src/gui/COPYING b/src/gui/COPYING
deleted file mode 100644
index 7941e42ce..000000000
--- a/src/gui/COPYING
+++ /dev/null
@@ -1,283 +0,0 @@
-QSynergy is free software and published under the following
-license:
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
diff --git a/src/gui/INSTALL b/src/gui/INSTALL
deleted file mode 100644
index 1d5d75a81..000000000
--- a/src/gui/INSTALL
+++ /dev/null
@@ -1,45 +0,0 @@
-QSynergy for Unix build instructions
-====================================
-
-
-Requirements:
--------------
-Qt 4.3 or newer. QSynergy can not be built or used with earlier versions. Get
-it from http://trolltech.com/downloads/opensource
-
-If you install from your distributions's package repository, don't forget to
-install the development packages as well.
-
-
-Compilation:
-------------
-1. Unpack the sources to a directory.
-
-2. Run qmake for your Qt4 installtion in that directory (make sure you do not
-accidentally run the Qt3-qmake if your Linux distribution installs both, like
-Ubuntu seems to do). See the qmake documentation for available command line
-options. You might want to enable a release build by passing CONFIG="-debug
-+release" to qmake.
-
-3. qmake will have generated a Makefile now, so just run make in that directory
-and wait for the build to finish.
-
-
-Installation:
--------------
-There is no installation required. Just copy the qsynergy binary to somewhere
-in your path. The binary does not depend on any other files.
-
-
-Building a Debian package
--------------------------
-The source tarball comes with a fully configured debian subdir, so it's easy to
-build a Debian package. A script is available in the dist subdir, deb.sh, that
-will do this automatically. Just run this script. If you have all the tools and
-helper programs installed to build a Debian package, you should get a package
-for your platform in tmp/debian.
-
-Please contact QSynergy's author to contribute your newly built package for
-download on the QSynergy website: vl@fidra.de
-
-
diff --git a/src/gui/README b/src/gui/README
deleted file mode 100644
index 0f0de0c22..000000000
--- a/src/gui/README
+++ /dev/null
@@ -1,97 +0,0 @@
-QSynergy
-========
-
-Version 0.9.0
-http://www.volker-lanz.de/en/software/qsynergy/
-
-
-About QSynergy
---------------
-QSynergy is a graphical front end for Synergy. Synergy lets a user control more
-than one computer with a single mouse and keyboard (and has lots and lots of
-extra features on top of that). Learn more about Synergy itself or get it from:
-http://synergy2.sourceforge.net
-
-Synergy only has a GUI for MS Windows. QSynergy was written to step in and fill
-this gap for users on Mac and Unix platforms. Of course, QSynergy can also be
-used on MS Windows.
-
-
-Running and using QSynergy
---------------------------
-- Because QSynergy is a graphical frontend for Synergy, it does not make much
- sense to run it without having Synergy installed. So if you have not done so
- already, get it from http://synergy2.sourceforge.net and install it.
-
-- See the Synergy documentation (http://synergy2.sourceforge.net/) for all
- topics concerning what you can do with Synergy.
-
-- In QSynergy, first, go to Edit -> Settings and check if the path names for
- synergys (the Synergy server binary) and synergyc (the client) are correct.
- If they are not, set them by hand or browse to their locations.
-
-- QSynergy knows three modes:
-
- 1. Run Synergy as a client (so the computer QSynergy runs on will be
- controlled from another computer).
-
- 2. Run Synergy as a server with an existing configuration you have written
- already (that's just like running Synergy from the command line with the "-c"
- option).
-
- 3. Interactively and graphically create a server configuration and run
- Synergy with this configuration. Herein lies the main benefit of using
- QSynergy instead of the command line Synergy version for Unix and Mac.
-
-- Running as a client: Simply tick the "be a client" checkbox, enter the name
- of the computer to connect to and push the "Start" button.
-
-- Running as a server with an existing configuration: Tick the "be a server"
- checkbox and the radio button that says you would like to use your own
- configuration file. Then enter the path to this configuration file (or browse
- for it). Finally, push the "Start" button.
-
-- Using QSynergy to configure the Synergy server: Tick the "be a server"
- checkbox and the radio button that says you would like to interactively
- configure Synergy. Then push the "Configure server" button. After you have
- finished setting up your configuration, push the "Start" button. QSynergy
- will remember your configuration across restarts, so there is no need to
- configure again the next time you run QSynergy -- unless you change your
- computer setup, of course.
-
-- On MS Windows and X11, QSynergy will minimize to the tray if you close the
- main window or pick the Window -> Minimize menu entry. Double click on the
- icon in the tray or right click on this icon and pick Restore to restore the
- window.
-
-- On X11, QSynergy will be restarted with X11 if your X11 server correctly
- implements session handling. On MS Windows, you will have to add QSynergy to
- your Autostart folder. On the Mac, set it to automatically run when the
- Finder starts.
-
-
-Known bugs and limitations
---------------------------
-- It is not possible to configure partial links (e.g., only 50% of a screen's
- edge linking to another screen)
-
-- If you configure a hotkey for a specific screen and later delete this screen,
- QSynergy does not warn you that this will lead to an invalid configuration.
-
-- Importing existing synery server configuration files is not possible.
-
-- There is no true communication channel between Synergy itself and QSynergy.
- This means that QSynergy cannot really know if Synergy itself is working or
- has encountered any problems. QSynergy only knows "Synergy is running" or
- "Synergy has quit with an error".
-
-- Mac OS X only: The look and feel of QSynergy is not quite right for the
- platform. This is due to limitations in Qt.
-
-
-License
--------
-QSynergy is written using the Qt Toolkit. It is free software released under
-the GPLv2.
-
-
diff --git a/src/gui/qsynergy.pro b/src/gui/qsynergy.pro
deleted file mode 100644
index 925bf965b..000000000
--- a/src/gui/qsynergy.pro
+++ /dev/null
@@ -1,87 +0,0 @@
-QT += network
-TEMPLATE = app
-TARGET = qsynergy
-DEPENDPATH += . \
- res
-INCLUDEPATH += . \
- src
-FORMS += res/MainWindowBase.ui \
- res/AboutDialogBase.ui \
- res/ServerConfigDialogBase.ui \
- res/ScreenSettingsDialogBase.ui \
- res/ActionDialogBase.ui \
- res/HotkeyDialogBase.ui \
- res/SettingsDialogBase.ui \
- res/LogDialogBase.ui \
- res/WindowsServicesBase.ui
-SOURCES += src/main.cpp \
- src/MainWindow.cpp \
- src/AboutDialog.cpp \
- src/ServerConfig.cpp \
- src/ServerConfigDialog.cpp \
- src/ScreenSetupView.cpp \
- src/Screen.cpp \
- src/ScreenSetupModel.cpp \
- src/NewScreenWidget.cpp \
- src/TrashScreenWidget.cpp \
- src/ScreenSettingsDialog.cpp \
- src/BaseConfig.cpp \
- src/HotkeyDialog.cpp \
- src/ActionDialog.cpp \
- src/Hotkey.cpp \
- src/Action.cpp \
- src/KeySequence.cpp \
- src/KeySequenceWidget.cpp \
- src/LogDialog.cpp \
- src/SettingsDialog.cpp \
- src/AppConfig.cpp \
- src/QSynergyApplication.cpp \
- src/WindowsServices.cpp
-HEADERS += src/MainWindow.h \
- src/AboutDialog.h \
- src/ServerConfig.h \
- src/ServerConfigDialog.h \
- src/ScreenSetupView.h \
- src/Screen.h \
- src/ScreenSetupModel.h \
- src/NewScreenWidget.h \
- src/TrashScreenWidget.h \
- src/ScreenSettingsDialog.h \
- src/BaseConfig.h \
- src/HotkeyDialog.h \
- src/ActionDialog.h \
- src/Hotkey.h \
- src/Action.h \
- src/KeySequence.h \
- src/KeySequenceWidget.h \
- src/LogDialog.h \
- src/SettingsDialog.h \
- src/AppConfig.h \
- src/QSynergyApplication.h \
- src/WindowsServices.h
-RESOURCES += res/QSynergy.qrc
-RC_FILE = res/win/QSynergy.rc
-macx {
- QMAKE_INFO_PLIST = res/mac/QSynergy.plist
- QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
- TARGET = QSynergy
- QSYNERGY_ICON.files = res/mac/QSynergy.icns
- QSYNERGY_ICON.path = Contents/Resources
- QMAKE_BUNDLE_DATA += QSYNERGY_ICON
-}
-debug {
- OBJECTS_DIR = tmp/debug
- MOC_DIR = tmp/debug
- RCC_DIR = tmp/debug
-}
-release {
- OBJECTS_DIR = tmp/release
- MOC_DIR = tmp/release
- RCC_DIR = tmp/release
-}
-win32 {
- Debug:DESTDIR = ../../bin/Debug
- Release:DESTDIR = ../../bin/Release
-} else {
- DESTDIR = ../../bin
-}
diff --git a/src/gui/res/AboutDialogBase.ui b/src/gui/res/AboutDialogBase.ui
deleted file mode 100644
index 5e6ff72fb..000000000
--- a/src/gui/res/AboutDialogBase.ui
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
- AboutDialogBase
-
-
- Qt::ApplicationModal
-
-
- true
-
-
-
- 0
- 0
-
-
-
-
- 400
- 250
-
-
-
-
- 400
- 250
-
-
-
- About Synergy
-
-
- true
-
-
- -
-
-
- <html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:x-large; font-weight:600;"><span style=" font-size:x-large;">Synergy</span></p></body></html>
-
-
- true
-
-
- true
-
-
- Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
-
-
-
-
- 1
- 0
-
-
-
- Version:
-
-
-
- -
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 1
- 0
-
-
-
- Hostname:
-
-
-
- -
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 1
- 0
-
-
-
- IP-Address:
-
-
-
- -
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 78
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 131
- 20
-
-
-
-
- -
-
-
- &Ok
-
-
-
- -
-
-
- The Synergy GUI is based on QSynergy by Volker Lanz
-
-Copyright © 2008 Volker Lanz (vl@fidra.de)
-Copyright © 2010 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-
-
- true
-
-
-
-
-
-
-
-
- buttonOk
- clicked()
- AboutDialogBase
- accept()
-
-
- 315
- 374
-
-
- 301
- 3
-
-
-
-
-
diff --git a/src/gui/res/ActionDialogBase.ui b/src/gui/res/ActionDialogBase.ui
deleted file mode 100644
index 0bf3deb65..000000000
--- a/src/gui/res/ActionDialogBase.ui
+++ /dev/null
@@ -1,581 +0,0 @@
-
-
- ActionDialogBase
-
-
-
- 0
- 0
- 372
- 484
-
-
-
- Configure Action
-
-
- -
-
-
- Choose the action to perform
-
-
-
-
-
-
- Press a hotkey
-
-
- true
-
-
-
- -
-
-
- Release a hotkey
-
-
-
- -
-
-
- Press and release a hotkey
-
-
-
- -
-
-
-
- 1
- 0
-
-
-
-
- 256
- 0
-
-
-
- dfgsfgsdfgsdfgsd
-
-
-
- -
-
-
- only on these screens
-
-
- true
-
-
- true
-
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 128
- 64
-
-
-
- QAbstractItemView::ExtendedSelection
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
-
-
-
- Switch to screen
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- false
-
-
-
-
-
- -
-
-
-
-
-
- Switch in direction
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- false
-
-
-
-
- left
-
-
- -
-
- right
-
-
- -
-
- up
-
-
- -
-
- down
-
-
-
-
-
-
- -
-
-
-
-
-
- Lock cursor to screen
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- false
-
-
-
-
- toggle
-
-
- -
-
- on
-
-
- -
-
- off
-
-
-
-
-
-
-
-
-
- -
-
-
- This action is performed when
-
-
-
-
-
-
- the hotkey is pressed
-
-
- true
-
-
-
- -
-
-
- the hotkey is released
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
-
-
-
-
-
-
-
- KeySequenceWidget
- QLineEdit
-
-
-
-
-
-
- buttonBox
- accepted()
- ActionDialogBase
- accept()
-
-
- 245
- 474
-
-
- 157
- 274
-
-
-
-
- buttonBox
- rejected()
- ActionDialogBase
- reject()
-
-
- 313
- 474
-
-
- 286
- 274
-
-
-
-
- m_pGroupType
- toggled(bool)
- m_pKeySequenceWidgetHotkey
- setDisabled(bool)
-
-
- 104
- 194
-
-
- 110
- 132
-
-
-
-
- m_pRadioSwitchInDirection
- toggled(bool)
- m_pKeySequenceWidgetHotkey
- setDisabled(bool)
-
-
- 118
- 322
-
-
- 81
- 129
-
-
-
-
- m_pRadioLockCursorToScreen
- toggled(bool)
- m_pKeySequenceWidgetHotkey
- setDisabled(bool)
-
-
- 101
- 353
-
-
- 68
- 126
-
-
-
-
- m_pRadioPress
- toggled(bool)
- m_pKeySequenceWidgetHotkey
- setEnabled(bool)
-
-
- 48
- 48
-
-
- 45
- 129
-
-
-
-
- m_pRadioRelease
- toggled(bool)
- m_pKeySequenceWidgetHotkey
- setEnabled(bool)
-
-
- 135
- 70
-
-
- 148
- 125
-
-
-
-
- m_pRadioPressAndRelease
- toggled(bool)
- m_pKeySequenceWidgetHotkey
- setEnabled(bool)
-
-
- 194
- 100
-
-
- 201
- 125
-
-
-
-
- m_pRadioSwitchToScreen
- toggled(bool)
- m_pComboSwitchToScreen
- setEnabled(bool)
-
-
- 148
- 291
-
-
- 350
- 290
-
-
-
-
- m_pRadioSwitchInDirection
- toggled(bool)
- m_pComboSwitchInDirection
- setEnabled(bool)
-
-
- 158
- 322
-
-
- 350
- 321
-
-
-
-
- m_pRadioLockCursorToScreen
- toggled(bool)
- m_pComboLockCursorToScreen
- setEnabled(bool)
-
-
- 180
- 353
-
-
- 350
- 352
-
-
-
-
- m_pRadioPress
- toggled(bool)
- m_pGroupBoxScreens
- setEnabled(bool)
-
-
- 25
- 47
-
-
- 33
- 155
-
-
-
-
- m_pRadioSwitchToScreen
- toggled(bool)
- m_pGroupBoxScreens
- setDisabled(bool)
-
-
- 48
- 278
-
-
- 98
- 153
-
-
-
-
- m_pRadioRelease
- toggled(bool)
- m_pGroupBoxScreens
- setEnabled(bool)
-
-
- 264
- 67
-
-
- 241
- 158
-
-
-
-
- m_pRadioPressAndRelease
- toggled(bool)
- m_pGroupBoxScreens
- setEnabled(bool)
-
-
- 286
- 98
-
-
- 290
- 156
-
-
-
-
- m_pRadioSwitchInDirection
- toggled(bool)
- m_pGroupBoxScreens
- setDisabled(bool)
-
-
- 38
- 313
-
-
- 64
- 195
-
-
-
-
- m_pRadioLockCursorToScreen
- toggled(bool)
- m_pGroupBoxScreens
- setDisabled(bool)
-
-
- 48
- 339
-
-
- 79
- 234
-
-
-
-
- m_pRadioSwitchToScreen
- toggled(bool)
- m_pKeySequenceWidgetHotkey
- setDisabled(bool)
-
-
- 84
- 280
-
-
- 185
- 123
-
-
-
-
-
diff --git a/src/gui/res/HotkeyDialogBase.ui b/src/gui/res/HotkeyDialogBase.ui
deleted file mode 100644
index cccccf226..000000000
--- a/src/gui/res/HotkeyDialogBase.ui
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
- HotkeyDialogBase
-
-
-
- 0
- 0
- 344
- 86
-
-
-
- Hotkey
-
-
- -
-
-
- Enter the specification for the hotkey:
-
-
-
- -
-
-
- -
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
-
-
-
-
-
-
-
- KeySequenceWidget
- QLineEdit
-
-
-
-
-
-
- buttonBox
- accepted()
- HotkeyDialogBase
- accept()
-
-
- 248
- 254
-
-
- 157
- 274
-
-
-
-
- buttonBox
- rejected()
- HotkeyDialogBase
- reject()
-
-
- 316
- 260
-
-
- 286
- 274
-
-
-
-
-
diff --git a/src/gui/res/LogDialogBase.ui b/src/gui/res/LogDialogBase.ui
deleted file mode 100644
index e65fcc1cb..000000000
--- a/src/gui/res/LogDialogBase.ui
+++ /dev/null
@@ -1,98 +0,0 @@
-
- LogDialogBase
-
-
-
- 0
- 0
- 761
- 395
-
-
-
- Log Output
-
-
- -
-
-
-
- Courier
-
-
-
- false
-
-
- QTextEdit::NoWrap
-
-
- true
-
-
-
- -
-
-
- C&lear
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 441
- 27
-
-
-
-
- -
-
-
- &Close
-
-
-
-
-
-
-
-
- m_pButtonClearLog
- clicked()
- m_pLogOutput
- clear()
-
-
- 27
- 368
-
-
- 335
- 262
-
-
-
-
- pushButton
- clicked()
- LogDialogBase
- accept()
-
-
- 706
- 370
-
-
- 525
- 366
-
-
-
-
-
diff --git a/src/gui/res/MainWindowBase.ui b/src/gui/res/MainWindowBase.ui
deleted file mode 100644
index 3bfda45de..000000000
--- a/src/gui/res/MainWindowBase.ui
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
- MainWindowBase
-
-
-
- 0
- 0
- 445
- 300
-
-
-
-
- 0
- 0
-
-
-
-
- 445
- 300
-
-
-
-
- 445
- 400
-
-
-
- Synergy
-
-
-
- -
-
-
- &Start
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- &Server (share this computer's mouse and keyboard):
-
-
- true
-
-
- true
-
-
-
-
-
-
- Use existing configuration:
-
-
-
- -
-
-
-
-
-
- &Configuration file:
-
-
- m_pLineEditConfigFile
-
-
-
- -
-
-
- false
-
-
-
- -
-
-
- false
-
-
- &Browse...
-
-
-
-
-
- -
-
-
- Configure interactively:
-
-
- true
-
-
-
- -
-
-
-
-
-
- &Configure Server...
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- &Client (use another computer's keyboard and mouse):
-
-
- true
-
-
-
-
-
-
- &Name of the server:
-
-
- m_pLineEditHostname
-
-
-
- -
-
-
-
-
-
- -
-
-
- Ready
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
- &About Synergy...
-
-
-
-
- &Quit
-
-
- Quit
-
-
- Ctrl+Q
-
-
-
-
- &Start
-
-
- Run
-
-
- Ctrl+S
-
-
-
-
- false
-
-
- S&top
-
-
- Stop
-
-
- Ctrl+T
-
-
-
-
- S&how Status
-
-
- Ctrl+H
-
-
-
-
- &Minimize
-
-
-
-
- &Restore
-
-
-
-
- Save configuration &as...
-
-
- Save the interactively generated server configuration to a file.
-
-
- Ctrl+Alt+S
-
-
-
-
- Settings
-
-
- Edit settings
-
-
-
-
- Log output
-
-
- Open a window with output
-
-
-
-
- Services
-
-
-
-
-
-
- m_pButtonToggleStart
- clicked()
- m_pActionStartSynergy
- trigger()
-
-
- 361
- 404
-
-
- -1
- -1
-
-
-
-
- m_pRadioExternalConfig
- toggled(bool)
- m_pLineEditConfigFile
- setEnabled(bool)
-
-
- 156
- 179
-
-
- 169
- 209
-
-
-
-
- m_pRadioExternalConfig
- toggled(bool)
- m_pButtonBrowseConfigFile
- setEnabled(bool)
-
-
- 353
- 182
-
-
- 356
- 211
-
-
-
-
- m_pRadioInternalConfig
- toggled(bool)
- m_pButtonConfigureServer
- setEnabled(bool)
-
-
- 204
- 244
-
-
- 212
- 274
-
-
-
-
-
diff --git a/src/gui/res/QSynergy.qrc b/src/gui/res/QSynergy.qrc
deleted file mode 100644
index b3ba0d0cb..000000000
--- a/src/gui/res/QSynergy.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- icons/16x16/synergy-connected.png
- icons/16x16/synergy-disconnected.png
- icons/64x64/video-display.png
- icons/64x64/user-trash.png
-
-
diff --git a/src/gui/res/ScreenSettingsDialogBase.ui b/src/gui/res/ScreenSettingsDialogBase.ui
deleted file mode 100644
index 95c48685f..000000000
--- a/src/gui/res/ScreenSettingsDialogBase.ui
+++ /dev/null
@@ -1,543 +0,0 @@
-
-
- ScreenSettingsDialogBase
-
-
-
- 0
- 0
- 434
- 437
-
-
-
- Screen Settings
-
-
- -
-
-
-
-
-
- Screen &name:
-
-
- m_pLineEditName
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- true
-
-
- A&liases
-
-
- false
-
-
-
-
-
-
- -
-
-
- false
-
-
- &Add
-
-
-
- -
-
-
- QAbstractItemView::ExtendedSelection
-
-
-
- -
-
-
- false
-
-
- &Remove
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 126
-
-
-
-
-
-
-
- -
-
-
- &Modifier keys
-
-
- false
-
-
-
-
-
-
- &Shift:
-
-
- m_pComboBoxShift
-
-
-
- -
-
-
-
-
- Shift
-
-
- -
-
- Ctrl
-
-
- -
-
- Alt
-
-
- -
-
- Meta
-
-
- -
-
- Super
-
-
- -
-
- None
-
-
-
-
- -
-
-
- &Ctrl:
-
-
- m_pComboBoxCtrl
-
-
-
- -
-
-
- 1
-
-
-
-
- Shift
-
-
- -
-
- Ctrl
-
-
- -
-
- Alt
-
-
- -
-
- Meta
-
-
- -
-
- Super
-
-
- -
-
- None
-
-
-
-
- -
-
-
- Al&t:
-
-
- m_pComboBoxAlt
-
-
-
- -
-
-
- 2
-
-
-
-
- Shift
-
-
- -
-
- Ctrl
-
-
- -
-
- Alt
-
-
- -
-
- Meta
-
-
- -
-
- Super
-
-
- -
-
- None
-
-
-
-
- -
-
-
- M&eta:
-
-
- m_pComboBoxMeta
-
-
-
- -
-
-
- 3
-
-
-
-
- Shift
-
-
- -
-
- Ctrl
-
-
- -
-
- Alt
-
-
- -
-
- Meta
-
-
- -
-
- Super
-
-
- -
-
- None
-
-
-
-
- -
-
-
- S&uper:
-
-
- m_pComboBoxSuper
-
-
-
- -
-
-
- 4
-
-
-
-
- Shift
-
-
- -
-
- Ctrl
-
-
- -
-
- Alt
-
-
- -
-
- Meta
-
-
- -
-
- Super
-
-
- -
-
- None
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- &Dead corners
-
-
- false
-
-
-
-
-
-
- Top-left
-
-
-
- -
-
-
- Top-right
-
-
-
- -
-
-
- Bottom-left
-
-
-
- -
-
-
- Bottom-right
-
-
-
- -
-
-
-
-
-
- Corner Si&ze:
-
-
- m_pSpinBoxSwitchCornerSize
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
- &Fixes
-
-
- false
-
-
-
-
-
-
- Fix CAPS LOCK key
-
-
-
- -
-
-
- Fix NUM LOCK key
-
-
-
- -
-
-
- Fix SCROLL LOCK key
-
-
-
- -
-
-
- Fix XTest for Xinerama
-
-
- false
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
-
-
-
-
-
-
-
-
- m_pButtonBox
- accepted()
- ScreenSettingsDialogBase
- accept()
-
-
- 222
- 502
-
-
- 157
- 274
-
-
-
-
- m_pButtonBox
- rejected()
- ScreenSettingsDialogBase
- reject()
-
-
- 290
- 508
-
-
- 286
- 274
-
-
-
-
-
diff --git a/src/gui/res/ServerConfigDialogBase.ui b/src/gui/res/ServerConfigDialogBase.ui
deleted file mode 100644
index 3c194e5fb..000000000
--- a/src/gui/res/ServerConfigDialogBase.ui
+++ /dev/null
@@ -1,756 +0,0 @@
-
- ServerConfigDialogBase
-
-
-
- 0
- 0
- 740
- 514
-
-
-
- Server Configuration
-
-
- -
-
-
- 0
-
-
-
- Screens and links
-
-
-
-
-
-
-
-
-
- true
-
-
- Drag a screen from the grid to the trashcan to remove it.
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
-
-
- :/res/icons/64x64/user-trash.png
-
-
-
- -
-
-
-
- 1
- 0
-
-
-
- Configure the layout of your synergy server configuration.
-
-
- Qt::AlignCenter
-
-
- true
-
-
-
- -
-
-
- Drag this button to the grid to add a new screen.
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
-
-
- :/res/icons/64x64/video-display.png
-
-
-
-
-
- -
-
-
-
- 0
- 273
-
-
-
-
- 16777215
- 273
-
-
-
- true
-
-
- false
-
-
- QFrame::StyledPanel
-
-
- QFrame::Sunken
-
-
-
- -
-
-
-
- 1
- 0
-
-
-
- Drag new screens to the grid or move existing ones around.
-Drag a screen to the trashcan to delete it.
-Double click on a screen to edit its settings.
-
-
- Qt::AlignCenter
-
-
- true
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
- Hotkeys
-
-
- -
-
-
- &Hotkeys
-
-
-
-
-
-
- -
-
-
- true
-
-
- &New
-
-
-
- -
-
-
- false
-
-
- &Edit
-
-
-
- -
-
-
- false
-
-
- &Remove
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 75
- 161
-
-
-
-
-
-
-
- -
-
-
- A&ctions
-
-
-
-
-
-
- -
-
-
- false
-
-
- Ne&w
-
-
-
- -
-
-
- false
-
-
- E&dit
-
-
-
- -
-
-
- false
-
-
- Re&move
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
-
-
-
- Advanced server settings
-
-
- -
-
-
- &Switch
-
-
-
-
-
-
-
-
-
- true
-
-
- Switch &after waiting
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- false
-
-
- 10
-
-
- 10000
-
-
- 10
-
-
- 250
-
-
-
- -
-
-
- ms
-
-
-
-
-
- -
-
-
-
-
-
- true
-
-
- Switch on double &tap within
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- false
-
-
- 10
-
-
- 10000
-
-
- 10
-
-
- 250
-
-
-
- -
-
-
- ms
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
- -
-
-
- &Options
-
-
-
-
-
-
-
-
-
- true
-
-
- &Check clients every
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- false
-
-
- 1000
-
-
- 30000
-
-
- 1000
-
-
- 5000
-
-
-
- -
-
-
- ms
-
-
-
-
-
- -
-
-
- true
-
-
- Use &relative mouse moves
-
-
-
- -
-
-
- true
-
-
- S&ynchronize screen savers
-
-
-
- -
-
-
- true
-
-
- Don't take &foreground window on Windows servers
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 16
-
-
-
-
-
-
-
- -
-
-
- &Dead corners
-
-
- false
-
-
-
-
-
-
- To&p-left
-
-
-
- -
-
-
- Top-rig&ht
-
-
-
- -
-
-
- &Bottom-left
-
-
-
- -
-
-
- Bottom-ri&ght
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
-
-
- Cor&ner Size:
-
-
- m_pSpinBoxSwitchCornerSize
-
-
-
- -
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok
-
-
-
-
-
-
-
- ScreenSetupView
- QTableView
-
- 1
-
-
- NewScreenWidget
- QLabel
-
-
-
- TrashScreenWidget
- QLabel
-
-
-
-
-
-
-
-
- m_pButtonBox
- accepted()
- ServerConfigDialogBase
- accept()
-
-
- 572
- 424
-
-
- 377
- -8
-
-
-
-
- m_pButtonBox
- rejected()
- ServerConfigDialogBase
- reject()
-
-
- 641
- 424
-
-
- 595
- 1
-
-
-
-
- m_pCheckBoxSwitchDelay
- toggled(bool)
- m_pSpinBoxSwitchDelay
- setEnabled(bool)
-
-
- 110
- 63
-
-
- 110
- 63
-
-
-
-
- m_pCheckBoxSwitchDoubleTap
- toggled(bool)
- m_pSpinBoxSwitchDoubleTap
- setEnabled(bool)
-
-
- 110
- 63
-
-
- 110
- 63
-
-
-
-
- m_pCheckBoxHeartbeat
- toggled(bool)
- m_pSpinBoxHeartbeat
- setEnabled(bool)
-
-
- 110
- 63
-
-
- 110
- 63
-
-
-
-
- m_pListHotkeys
- itemDoubleClicked(QListWidgetItem*)
- m_pButtonEditHotkey
- click()
-
-
- 197
- 115
-
-
- 304
- 115
-
-
-
-
- m_pListActions
- itemDoubleClicked(QListWidgetItem*)
- m_pButtonEditAction
- click()
-
-
- 505
- 120
-
-
- 677
- 118
-
-
-
-
-
diff --git a/src/gui/res/SettingsDialogBase.ui b/src/gui/res/SettingsDialogBase.ui
deleted file mode 100644
index a093f02ad..000000000
--- a/src/gui/res/SettingsDialogBase.ui
+++ /dev/null
@@ -1,330 +0,0 @@
-
-
- SettingsDialogBase
-
-
-
- 0
- 0
- 372
- 412
-
-
-
- Settings
-
-
- -
-
-
- &Advanced
-
-
-
-
-
-
- Sc&reen name:
-
-
- m_pLineEditScreenName
-
-
-
- -
-
-
- true
-
-
-
- -
-
-
- P&ort:
-
-
- m_pSpinBoxPort
-
-
-
- -
-
-
- true
-
-
- 65535
-
-
- 24800
-
-
-
- -
-
-
- &Interface:
-
-
- m_pLineEditInterface
-
-
-
- -
-
-
- true
-
-
-
-
-
-
- -
-
-
- &Start
-
-
-
-
-
-
- A&utomatically start server or client when GUI starts
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
-
-
-
- -
-
-
- &Programs
-
-
-
-
-
-
-
-
-
- Auto detect program paths
-
-
- true
-
-
-
-
-
- -
-
-
- This is the synergy client program, usually called synergyc or synergyc.exe.
-
-
- &Client:
-
-
- m_pLineEditSynergyc
-
-
-
- -
-
-
- false
-
-
-
- -
-
-
- false
-
-
- Browse...
-
-
-
- -
-
-
-
-
-
- This is the synergy server program, usually called synergys or synergys.exe.
-
-
- S&erver:
-
-
- m_pLineEditSynergys
-
-
-
- -
-
-
- false
-
-
-
- -
-
-
- false
-
-
- Browse...
-
-
-
-
-
-
- -
-
-
- Logging
-
-
-
-
-
-
- &Logging level:
-
-
- m_pComboLogLevel
-
-
-
- -
-
-
- Log to file:
-
-
-
- -
-
-
- false
-
-
-
- -
-
-
- false
-
-
- Browse...
-
-
-
- -
-
-
-
-
- Error
-
-
- -
-
- Warning
-
-
- -
-
- Note
-
-
- -
-
- Info
-
-
- -
-
- Debug
-
-
- -
-
- Debug1
-
-
- -
-
- Debug2
-
-
-
-
-
-
-
-
-
-
- m_pCheckBoxAutoDetectPaths
- m_pLineEditSynergyc
- m_pButtonBrowseSynergyc
- m_pLineEditSynergys
- m_pButtonBrowseSynergys
- m_pLineEditScreenName
- m_pSpinBoxPort
- m_pLineEditInterface
- m_pCheckBoxAutoConnect
- m_pComboLogLevel
- m_pCheckBoxLogToFile
- m_pLineEditLogFilename
- m_pButtonBrowseLog
- buttonBox
-
-
-
-
- buttonBox
- accepted()
- SettingsDialogBase
- accept()
-
-
- 266
- 340
-
-
- 157
- 274
-
-
-
-
- buttonBox
- rejected()
- SettingsDialogBase
- reject()
-
-
- 334
- 340
-
-
- 286
- 274
-
-
-
-
-
diff --git a/src/gui/res/WindowsServicesBase.ui b/src/gui/res/WindowsServicesBase.ui
deleted file mode 100644
index 724404279..000000000
--- a/src/gui/res/WindowsServicesBase.ui
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
- WindowsServicesBase
-
-
-
- 0
- 0
- 264
- 200
-
-
-
- Windows Services
-
-
- -
-
-
- Server
-
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Uninstall
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Install
-
-
-
-
-
-
- -
-
-
- Client
-
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Uninstall
-
-
-
- -
-
-
- Install
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Close
-
-
-
- -
-
-
- To start and stop a service, use the Windows services snap-in.
-
-
- true
-
-
-
-
-
-
- buttonBox
-
-
-
-
- buttonBox
- accepted()
- WindowsServicesBase
- accept()
-
-
- 248
- 254
-
-
- 157
- 274
-
-
-
-
- buttonBox
- rejected()
- WindowsServicesBase
- reject()
-
-
- 316
- 260
-
-
- 286
- 274
-
-
-
-
-
diff --git a/src/gui/res/icons/16x16/synergy-connected.png b/src/gui/res/icons/16x16/synergy-connected.png
deleted file mode 100644
index 0a311216c..000000000
Binary files a/src/gui/res/icons/16x16/synergy-connected.png and /dev/null differ
diff --git a/src/gui/res/icons/16x16/synergy-disconnected.png b/src/gui/res/icons/16x16/synergy-disconnected.png
deleted file mode 100644
index c1aacc9c4..000000000
Binary files a/src/gui/res/icons/16x16/synergy-disconnected.png and /dev/null differ
diff --git a/src/gui/res/icons/64x64/user-trash.png b/src/gui/res/icons/64x64/user-trash.png
deleted file mode 100644
index 05eb80ec3..000000000
Binary files a/src/gui/res/icons/64x64/user-trash.png and /dev/null differ
diff --git a/src/gui/res/icons/64x64/video-display.png b/src/gui/res/icons/64x64/video-display.png
deleted file mode 100644
index 8a47d90ff..000000000
Binary files a/src/gui/res/icons/64x64/video-display.png and /dev/null differ
diff --git a/src/gui/res/mac/QSynergy.icns b/src/gui/res/mac/QSynergy.icns
deleted file mode 100644
index 0d87c5a55..000000000
Binary files a/src/gui/res/mac/QSynergy.icns and /dev/null differ
diff --git a/src/gui/res/mac/QSynergy.plist b/src/gui/res/mac/QSynergy.plist
deleted file mode 100644
index 9eb8cab48..000000000
--- a/src/gui/res/mac/QSynergy.plist
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- CFBundleIconFile
- QSynergy.icns
- CFBundlePackageType
- APPL
- CFBundleGetInfoString
- 0.9.0
- CFBundleSignature
- ????
- CFBundleExecutable
- QSynergy
-
-
diff --git a/src/gui/res/win/QSynergy.ico b/src/gui/res/win/QSynergy.ico
deleted file mode 100644
index fc2e41468..000000000
Binary files a/src/gui/res/win/QSynergy.ico and /dev/null differ
diff --git a/src/gui/res/win/QSynergy.rc b/src/gui/res/win/QSynergy.rc
deleted file mode 100644
index f746d72f4..000000000
--- a/src/gui/res/win/QSynergy.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "res\\win\\QSynergy.ico"
diff --git a/src/gui/src/AboutDialog.cpp b/src/gui/src/AboutDialog.cpp
deleted file mode 100644
index 5ed2c6dab..000000000
--- a/src/gui/src/AboutDialog.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "AboutDialog.h"
-
-#include
-#include
-#include
-
-static QString getSynergyVersion(const QString& app)
-{
-#if !defined(Q_OS_WIN)
- QProcess process;
- process.start(app, QStringList() << "--version");
-
- process.setReadChannel(QProcess::StandardError);
- if (!process.waitForStarted() || !process.waitForFinished())
- return QObject::tr("(unknown)");
-
- QRegExp rx("synergy[cs] ([\\d\\.]+)");
- if (rx.indexIn(QString(process.readLine())) != -1)
- return rx.cap(1);
-#else
- Q_UNUSED(app);
-#endif
-
- return QObject::tr("(unknown)");
-}
-
-static QString getIPAddress()
-{
- QList addresses = QNetworkInterface::allAddresses();
-
- for (int i = 0; i < addresses.size(); i++)
- if (addresses[i].protocol() == QAbstractSocket::IPv4Protocol && addresses[i] != QHostAddress(QHostAddress::LocalHost))
- return addresses[i].toString();
-
- return QObject::tr("(unknown)");
-}
-
-AboutDialog::AboutDialog(QWidget* parent, const QString& synergyApp) :
- QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::AboutDialogBase()
-{
- setupUi(this);
-
- m_pLabelSynergyVersion->setText(getSynergyVersion(synergyApp));
- m_pLabelHostname->setText(QHostInfo::localHostName());
- m_pLabelIPAddress->setText(getIPAddress());
-}
-
diff --git a/src/gui/src/AboutDialog.h b/src/gui/src/AboutDialog.h
deleted file mode 100644
index 31cbc24fc..000000000
--- a/src/gui/src/AboutDialog.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(ABOUTDIALOG__H)
-
-#define ABOUTDIALOG__H
-
-#include
-
-#include "ui_AboutDialogBase.h"
-
-class QWidget;
-class QString;
-
-class AboutDialog : public QDialog, public Ui::AboutDialogBase
-{
- Q_OBJECT
-
- public:
- AboutDialog(QWidget* parent, const QString& synergyApp = QString());
-};
-
-#endif
-
diff --git a/src/gui/src/Action.cpp b/src/gui/src/Action.cpp
deleted file mode 100644
index 0493b3c55..000000000
--- a/src/gui/src/Action.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "Action.h"
-
-#include
-#include
-
-const char* Action::m_ActionTypeNames[] =
-{
- "keyDown", "keyUp", "keystroke",
- "switchToScreen", "switchInDirection", "lockCursorToScreen",
- "mouseDown", "mouseUp", "mousebutton"
-};
-
-const char* Action::m_SwitchDirectionNames[] = { "left", "right", "up", "down" };
-const char* Action::m_LockCursorModeNames[] = { "toggle", "on", "off" };
-
-Action::Action() :
- m_KeySequence(),
- m_Type(keystroke),
- m_TypeScreenNames(),
- m_SwitchScreenName(),
- m_SwitchDirection(switchLeft),
- m_LockCursorMode(lockCursorToggle),
- m_ActiveOnRelease(false),
- m_HasScreens(false)
-{
-}
-
-QString Action::text() const
-{
- QString text = QString(m_ActionTypeNames[keySequence().isMouseButton() ? type() + 6 : type() ]) + "(";
-
- switch (type())
- {
- case keyDown:
- case keyUp:
- case keystroke:
- {
- text += keySequence().toString();
-
- if (!keySequence().isMouseButton())
- {
- const QStringList& screens = typeScreenNames();
- if (haveScreens() && !screens.isEmpty())
- {
- text += ",";
-
- for (int i = 0; i < screens.size(); i++)
- {
- text += screens[i];
- if (i != screens.size() - 1)
- text += ":";
- }
- }
- else
- text += ",*";
- }
- }
- break;
-
- case switchToScreen:
- text += switchScreenName();
- break;
-
- case switchInDirection:
- text += m_SwitchDirectionNames[m_SwitchDirection];
- break;
-
- case lockCursorToScreen:
- text += m_LockCursorModeNames[m_LockCursorMode];
- break;
-
- default:
- Q_ASSERT(0);
- break;
- }
-
- text += ")";
-
- return text;
-}
-
-void Action::loadSettings(QSettings& settings)
-{
- keySequence().loadSettings(settings);
- setType(settings.value("type", keyDown).toInt());
-
- typeScreenNames().clear();
- int numTypeScreens = settings.beginReadArray("typeScreenNames");
- for (int i = 0; i < numTypeScreens; i++)
- {
- settings.setArrayIndex(i);
- typeScreenNames().append(settings.value("typeScreenName").toString());
- }
- settings.endArray();
-
- setSwitchScreenName(settings.value("switchScreenName").toString());
- setSwitchDirection(settings.value("switchInDirection", switchLeft).toInt());
- setLockCursorMode(settings.value("lockCursorToScreen", lockCursorToggle).toInt());
- setActiveOnRelease(settings.value("activeOnRelease", false).toBool());
- setHaveScreens(settings.value("hasScreens", false).toBool());
-}
-
-void Action::saveSettings(QSettings& settings) const
-{
- keySequence().saveSettings(settings);
- settings.setValue("type", type());
-
- settings.beginWriteArray("typeScreenNames");
- for (int i = 0; i < typeScreenNames().size(); i++)
- {
- settings.setArrayIndex(i);
- settings.setValue("typeScreenName", typeScreenNames()[i]);
- }
- settings.endArray();
-
- settings.setValue("switchScreenName", switchScreenName());
- settings.setValue("switchInDirection", switchDirection());
- settings.setValue("lockCursorToScreen", lockCursorMode());
- settings.setValue("activeOnRelease", activeOnRelease());
- settings.setValue("hasScreens", haveScreens());
-}
-
-QTextStream& operator<<(QTextStream& outStream, const Action& action)
-{
- if (action.activeOnRelease())
- outStream << ";";
-
- outStream << action.text();
-
- return outStream;
-}
-
diff --git a/src/gui/src/Action.h b/src/gui/src/Action.h
deleted file mode 100644
index ee911421f..000000000
--- a/src/gui/src/Action.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(ACTION_H)
-
-#define ACTION_H
-
-#include "KeySequence.h"
-
-#include
-#include
-#include
-
-class ActionDialog;
-class QSettings;
-class QTextStream;
-
-class Action
-{
- friend class ActionDialog;
- friend QTextStream& operator<<(QTextStream& outStream, const Action& action);
-
- public:
- enum ActionType { keyDown, keyUp, keystroke, switchToScreen, switchInDirection, lockCursorToScreen, mouseDown, mouseUp, mousebutton };
- enum SwitchDirection { switchLeft, switchRight, switchUp, switchDown };
- enum LockCursorMode { lockCursorToggle, lockCursonOn, lockCursorOff };
-
- public:
- Action();
-
- public:
- QString text() const;
- const KeySequence& keySequence() const { return m_KeySequence; }
- void loadSettings(QSettings& settings);
- void saveSettings(QSettings& settings) const;
- int type() const { return m_Type; }
- const QStringList& typeScreenNames() const { return m_TypeScreenNames; }
- const QString& switchScreenName() const { return m_SwitchScreenName; }
- int switchDirection() const { return m_SwitchDirection; }
- int lockCursorMode() const { return m_LockCursorMode; }
- bool activeOnRelease() const { return m_ActiveOnRelease; }
- bool haveScreens() const { return m_HasScreens; }
-
- protected:
- KeySequence& keySequence() { return m_KeySequence; }
- void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; }
- void setType(int t) { m_Type = t; }
- QStringList& typeScreenNames() { return m_TypeScreenNames; }
- void setSwitchScreenName(const QString& n) { m_SwitchScreenName = n; }
- void setSwitchDirection(int d) { m_SwitchDirection = d; }
- void setLockCursorMode(int m) { m_LockCursorMode = m; }
- void setActiveOnRelease(bool b) { m_ActiveOnRelease = b; }
- void setHaveScreens(bool b) { m_HasScreens = b; }
-
- private:
- KeySequence m_KeySequence;
- int m_Type;
- QStringList m_TypeScreenNames;
- QString m_SwitchScreenName;
- int m_SwitchDirection;
- int m_LockCursorMode;
- bool m_ActiveOnRelease;
- bool m_HasScreens;
-
- static const char* m_ActionTypeNames[];
- static const char* m_SwitchDirectionNames[];
- static const char* m_LockCursorModeNames[];
-};
-
-typedef QList ActionList;
-
-QTextStream& operator<<(QTextStream& outStream, const Action& action);
-
-#endif
diff --git a/src/gui/src/ActionDialog.cpp b/src/gui/src/ActionDialog.cpp
deleted file mode 100644
index 0dfde93d7..000000000
--- a/src/gui/src/ActionDialog.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "ActionDialog.h"
-
-#include "Hotkey.h"
-#include "Action.h"
-#include "ServerConfig.h"
-#include "KeySequence.h"
-
-#include
-#include
-
-ActionDialog::ActionDialog(QWidget* parent, ServerConfig& config, Hotkey& hotkey, Action& action) :
- QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::ActionDialogBase(),
- m_ServerConfig(config),
- m_Hotkey(hotkey),
- m_Action(action),
- m_pButtonGroupType(new QButtonGroup(this))
-{
- setupUi(this);
-
- // work around Qt Designer's lack of a QButtonGroup; we need it to get
- // at the button id of the checked radio button
- QRadioButton* const typeButtons[] = { m_pRadioPress, m_pRadioRelease, m_pRadioPressAndRelease, m_pRadioSwitchToScreen, m_pRadioSwitchInDirection, m_pRadioLockCursorToScreen };
-
- for (unsigned int i = 0; i < sizeof(typeButtons) / sizeof(typeButtons[0]); i++)
- m_pButtonGroupType->addButton(typeButtons[i], i);
-
- m_pKeySequenceWidgetHotkey->setText(m_Action.keySequence().toString());
- m_pKeySequenceWidgetHotkey->setKeySequence(m_Action.keySequence());
- m_pButtonGroupType->button(m_Action.type())->setChecked(true);
- m_pComboSwitchInDirection->setCurrentIndex(m_Action.switchDirection());
- m_pComboLockCursorToScreen->setCurrentIndex(m_Action.lockCursorMode());
-
- if (m_Action.activeOnRelease())
- m_pRadioHotkeyReleased->setChecked(true);
- else
- m_pRadioHotkeyPressed->setChecked(true);
-
- m_pGroupBoxScreens->setChecked(m_Action.haveScreens());
-
- int idx = 0;
- foreach(const Screen& screen, serverConfig().screens())
- if (!screen.isNull())
- {
- QListWidgetItem *pListItem = new QListWidgetItem(screen.name());
- m_pListScreens->addItem(pListItem);
- if (m_Action.typeScreenNames().indexOf(screen.name()) != -1)
- m_pListScreens->setCurrentItem(pListItem);
-
- m_pComboSwitchToScreen->addItem(screen.name());
- if (screen.name() == m_Action.switchScreenName())
- m_pComboSwitchToScreen->setCurrentIndex(idx);
-
- idx++;
- }
-}
-
-void ActionDialog::accept()
-{
- if (!sequenceWidget()->valid() && m_pButtonGroupType->checkedId() >= 0 && m_pButtonGroupType->checkedId() < 3)
- return;
-
- m_Action.setKeySequence(sequenceWidget()->keySequence());
- m_Action.setType(m_pButtonGroupType->checkedId());
- m_Action.setHaveScreens(m_pGroupBoxScreens->isChecked());
-
- m_Action.typeScreenNames().clear();
- foreach(const QListWidgetItem* pItem, m_pListScreens->selectedItems())
- m_Action.typeScreenNames().append(pItem->text());
-
- m_Action.setSwitchScreenName(m_pComboSwitchToScreen->currentText());
- m_Action.setSwitchDirection(m_pComboSwitchInDirection->currentIndex());
- m_Action.setLockCursorMode(m_pComboLockCursorToScreen->currentIndex());
- m_Action.setActiveOnRelease(m_pRadioHotkeyReleased->isChecked());
-
- QDialog::accept();
-}
-
-void ActionDialog::on_m_pKeySequenceWidgetHotkey_keySequenceChanged()
-{
- if (sequenceWidget()->keySequence().isMouseButton())
- {
- m_pGroupBoxScreens->setEnabled(false);
- m_pListScreens->setEnabled(false);
- }
- else
- {
- m_pGroupBoxScreens->setEnabled(true);
- m_pListScreens->setEnabled(true);
- }
-}
diff --git a/src/gui/src/ActionDialog.h b/src/gui/src/ActionDialog.h
deleted file mode 100644
index 8bbee52a2..000000000
--- a/src/gui/src/ActionDialog.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(ACTIONDIALOG_H)
-
-#define ACTIONDIALOG_H
-
-#include
-
-#include "ui_ActionDialogBase.h"
-
-class Hotkey;
-class Action;
-class QRadioButton;
-class QButtonGroup;
-class ServerConfig;
-
-class ActionDialog : public QDialog, public Ui::ActionDialogBase
-{
- Q_OBJECT
-
- public:
- ActionDialog(QWidget* parent, ServerConfig& config, Hotkey& hotkey, Action& action);
-
- protected slots:
- void accept();
- void on_m_pKeySequenceWidgetHotkey_keySequenceChanged();
-
- protected:
- const KeySequenceWidget* sequenceWidget() const { return m_pKeySequenceWidgetHotkey; }
- const ServerConfig& serverConfig() const { return m_ServerConfig; }
-
- private:
- const ServerConfig& m_ServerConfig;
- Hotkey& m_Hotkey;
- Action& m_Action;
-
- QButtonGroup* m_pButtonGroupType;
-};
-
-#endif
diff --git a/src/gui/src/AppConfig.cpp b/src/gui/src/AppConfig.cpp
deleted file mode 100644
index 868c89677..000000000
--- a/src/gui/src/AppConfig.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "AppConfig.h"
-
-#include
-#include
-
-#if defined(Q_OS_WIN)
-const char AppConfig::m_SynergysName[] = "synergys.exe";
-const char AppConfig::m_SynergycName[] = "synergyc.exe";
-const char AppConfig::m_SynergyProgramDir[] = "bin/";
-const char AppConfig::m_SynergyLogDir[] = "log/";
-#else
-const char AppConfig::m_SynergysName[] = "synergys";
-const char AppConfig::m_SynergycName[] = "synergyc";
-const char AppConfig::m_SynergyProgramDir[] = "/usr/bin/";
-const char AppConfig::m_SynergyLogDir[] = "/var/log/";
-#endif
-
-static const char* logLevelNames[] =
-{
- "ERROR",
- "WARNING",
- "NOTE",
- "INFO",
- "DEBUG",
- "DEBUG1",
- "DEBUG2"
-};
-
-AppConfig::AppConfig(QSettings* settings) :
- m_pSettings(settings),
- m_AutoConnect(false),
- m_Synergyc(),
- m_Synergys(),
- m_ScreenName(),
- m_Port(24800),
- m_Interface(),
- m_LogLevel(0)
-{
- Q_ASSERT(m_pSettings);
-
- loadSettings();
-}
-
-AppConfig::~AppConfig()
-{
- saveSettings();
-}
-
-QString AppConfig::synergyLogDir()
-{
-#if defined(Q_OS_WIN)
- // on windows, we want to log to program files
- return QString(QDir::currentPath() + "/log/");
-#else
- // on unix, we'll log to the standard log dir
- return "/var/log/";
-#endif
-}
-
-void AppConfig::persistLogDir()
-{
- QDir dir = synergyLogDir();
-
- // persist the log directory
- if (!dir.exists())
- {
- dir.mkpath(dir.path());
- }
-}
-
-QString AppConfig::logLevelText() const
-{
- return logLevelNames[logLevel()];
-}
-
-void AppConfig::loadSettings()
-{
- m_AutoConnect = settings().value("autoConnectChecked", false).toBool();
- m_Synergyc = settings().value("synergyc", QString(synergyProgramDir()) + synergycName()).toString();
- m_Synergys = settings().value("synergys", QString(synergyProgramDir()) + synergysName()).toString();
- m_ScreenName = settings().value("screenName", QHostInfo::localHostName()).toString();
- m_Port = settings().value("port", 24800).toInt();
- m_Interface = settings().value("interface").toString();
- m_LogLevel = settings().value("logLevel", 2).toInt();
- m_AutoDetectPaths = settings().value("autoDetectPaths", true).toBool();
- m_LogToFile = settings().value("logToFile", false).toBool();
- m_LogFilename = settings().value("logFilename", synergyLogDir() + "synergy.log").toString();
-}
-
-void AppConfig::saveSettings()
-{
- settings().setValue("autoConnectChecked", m_AutoConnect);
- settings().setValue("synergyc", m_Synergyc);
- settings().setValue("synergys", m_Synergys);
- settings().setValue("screenName", m_ScreenName);
- settings().setValue("port", m_Port);
- settings().setValue("interface", m_Interface);
- settings().setValue("logLevel", m_LogLevel);
- settings().setValue("autoDetectPaths", m_AutoDetectPaths);
- settings().setValue("logToFile", m_LogToFile);
- settings().setValue("logFilename", m_LogFilename);
-}
-
-bool AppConfig::detectPath(const QString& name, QString& path)
-{
- // look in current working dir and default dir
- QStringList searchDirs;
- searchDirs.append("./");
- searchDirs.append(synergyProgramDir());
-
- // use the first valid path we find
- for (int i = 0; i < searchDirs.length(); i++)
- {
- QFile f(searchDirs[i] + name);
- if (f.exists())
- {
- path = f.fileName();
- return true;
- }
- }
-
- // nothing found!
- return false;
-}
diff --git a/src/gui/src/AppConfig.h b/src/gui/src/AppConfig.h
deleted file mode 100644
index d1d14958e..000000000
--- a/src/gui/src/AppConfig.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(APPCONFIG_H)
-
-#define APPCONFIG_H
-
-#include
-
-class QSettings;
-class SettingsDialog;
-
-class AppConfig
-{
- friend class SettingsDialog;
- friend class MainWindow;
-
- public:
- AppConfig(QSettings* settings);
- ~AppConfig();
-
- public:
- bool autoConnect() const { return m_AutoConnect; }
- const QString& synergyc() const { return m_Synergyc; }
- const QString& synergys() const { return m_Synergys; }
- const QString& screenName() const { return m_ScreenName; }
- int port() const { return m_Port; }
- const QString& interface() const { return m_Interface; }
- int logLevel() const { return m_LogLevel; }
- bool autoDetectPaths() const { return m_AutoDetectPaths; }
- bool logToFile() const { return m_LogToFile; }
- const QString& logFilename() const { return m_LogFilename; }
- QString logLevelText() const;
-
- QString synergysName() const { return m_SynergysName; }
- QString synergycName() const { return m_SynergycName; }
- QString synergyProgramDir() const { return m_SynergyProgramDir; }
- QString synergyLogDir();
-
- bool detectPath(const QString& name, QString& path);
- void persistLogDir();
-
- protected:
- QSettings& settings() { return *m_pSettings; }
- void setAutoConnect(bool b) { m_AutoConnect = b; }
- void setSynergyc(const QString& s) { m_Synergyc = s; }
- void setSynergys(const QString& s) { m_Synergys = s; }
- void setScreenName(const QString& s) { m_ScreenName = s; }
- void setPort(int i) { m_Port = i; }
- void setInterface(const QString& s) { m_Interface = s; }
- void setLogLevel(int i) { m_LogLevel = i; }
- void setAutoDetectPaths(bool b) { m_AutoDetectPaths = b; }
- void setLogToFile(bool b) { m_LogToFile = b; }
- void setLogFilename(const QString& s) { m_LogFilename = s; }
-
- void loadSettings();
- void saveSettings();
-
- private:
- QSettings* m_pSettings;
- bool m_AutoConnect;
- QString m_Synergyc;
- QString m_Synergys;
- QString m_ScreenName;
- int m_Port;
- QString m_Interface;
- int m_LogLevel;
- bool m_AutoDetectPaths;
- bool m_LogToFile;
- QString m_LogFilename;
-
- static const char m_SynergysName[];
- static const char m_SynergycName[];
- static const char m_SynergyProgramDir[];
- static const char m_SynergyLogDir[];
-};
-
-#endif
diff --git a/src/gui/src/BaseConfig.cpp b/src/gui/src/BaseConfig.cpp
deleted file mode 100644
index 1cf9a3c25..000000000
--- a/src/gui/src/BaseConfig.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "BaseConfig.h"
-
-const char* BaseConfig::m_ModifierNames[] =
-{
- "shift",
- "ctrl",
- "alt",
- "meta",
- "super",
- "none"
-};
-
-const char* BaseConfig::m_FixNames[] =
-{
- "halfDuplexCapsLock",
- "halfDuplexNumLock",
- "halfDuplexScrollLock",
- "xtestIsXineramaUnaware"
-};
-
-const char* BaseConfig::m_SwitchCornerNames[] =
-{
- "top-left",
- "top-right",
- "bottom-left",
- "bottom-right"
-};
-
diff --git a/src/gui/src/BaseConfig.h b/src/gui/src/BaseConfig.h
deleted file mode 100644
index 541d3f827..000000000
--- a/src/gui/src/BaseConfig.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(BASECONFIG_H)
-
-#define BASECONFIG_H
-
-#include
-#include
-#include
-
-class BaseConfig
-{
- public:
- enum Modifier { DefaultMod = -1, Shift, Ctrl, Alt, Meta, Super, None, NumModifiers };
- enum SwitchCorner { TopLeft, TopRight, BottomLeft, BottomRight, NumSwitchCorners };
- enum Fix { CapsLock, NumLock, ScrollLock, XTest, NumFixes };
-
- protected:
- BaseConfig() {}
- virtual ~BaseConfig() {}
-
- protected:
- template
- void readSettings(QSettings& settings, T1& array, const QString& arrayName, const T2& deflt)
- {
- int entries = settings.beginReadArray(arrayName + "Array");
- array.clear();
- for (int i = 0; i < entries; i++)
- {
- settings.setArrayIndex(i);
- QVariant v = settings.value(arrayName, deflt);
- array.append(v.value());
- }
- settings.endArray();
- }
-
- template
- void readSettings(QSettings& settings, T1& array, const QString& arrayName, const T2& deflt, int entries)
- {
- Q_ASSERT(array.size() >= entries);
- settings.beginReadArray(arrayName + "Array");
- for (int i = 0; i < entries; i++)
- {
- settings.setArrayIndex(i);
- QVariant v = settings.value(arrayName, deflt);
- array[i] = v.value();
- }
- settings.endArray();
- }
-
- template
- void writeSettings(QSettings& settings, const T& array, const QString& arrayName) const
- {
- settings.beginWriteArray(arrayName + "Array");
- for (int i = 0; i < array.size(); i++)
- {
- settings.setArrayIndex(i);
- settings.setValue(arrayName, array[i]);
- }
- settings.endArray();
- }
-
-
- public:
- static const char* modifierName(int idx) { return m_ModifierNames[idx]; }
- static const char* fixName(int idx) { return m_FixNames[idx]; }
- static const char* switchCornerName(int idx) { return m_SwitchCornerNames[idx]; }
-
- private:
- static const char* m_ModifierNames[];
- static const char* m_FixNames[];
- static const char* m_SwitchCornerNames[];
-};
-
-#endif
diff --git a/src/gui/src/Hotkey.cpp b/src/gui/src/Hotkey.cpp
deleted file mode 100644
index 00cb7d727..000000000
--- a/src/gui/src/Hotkey.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "Hotkey.h"
-
-#include
-
-Hotkey::Hotkey() :
- m_KeySequence(),
- m_Actions()
-{
-}
-
-QString Hotkey::text() const
-{
- QString text = keySequence().toString();
-
- if (keySequence().isMouseButton())
- return "mousebutton(" + text + ")";
-
- return "keystroke(" + text + ")";
-}
-
-void Hotkey::loadSettings(QSettings& settings)
-{
- keySequence().loadSettings(settings);
-
- actions().clear();
- int num = settings.beginReadArray("actions");
- for (int i = 0; i < num; i++)
- {
- settings.setArrayIndex(i);
- Action a;
- a.loadSettings(settings);
- actions().append(a);
- }
-
- settings.endArray();
-}
-
-void Hotkey::saveSettings(QSettings& settings) const
-{
- keySequence().saveSettings(settings);
-
- settings.beginWriteArray("actions");
- for (int i = 0; i < actions().size(); i++)
- {
- settings.setArrayIndex(i);
- actions()[i].saveSettings(settings);
- }
- settings.endArray();
-}
-
-QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey)
-{
- for (int i = 0; i < hotkey.actions().size(); i++)
- outStream << "\t" << hotkey.text() << " = " << hotkey.actions()[i] << endl;
-
- return outStream;
-}
diff --git a/src/gui/src/Hotkey.h b/src/gui/src/Hotkey.h
deleted file mode 100644
index 6f1f49bc2..000000000
--- a/src/gui/src/Hotkey.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(HOTKEY_H)
-
-#define HOTKEY_H
-
-#include
-#include
-#include
-
-#include "Action.h"
-#include "KeySequence.h"
-
-class HotkeyDialog;
-class ServerConfigDialog;
-class QSettings;
-
-class Hotkey
-{
- friend class HotkeyDialog;
- friend class ServerConfigDialog;
- friend QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey);
-
- public:
- Hotkey();
-
- public:
- QString text() const;
- const KeySequence& keySequence() const { return m_KeySequence; }
- const ActionList& actions() const { return m_Actions; }
-
- void loadSettings(QSettings& settings);
- void saveSettings(QSettings& settings) const;
-
- protected:
- KeySequence& keySequence() { return m_KeySequence; }
- void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; }
- ActionList& actions() { return m_Actions; }
-
-
- private:
- KeySequence m_KeySequence;
- ActionList m_Actions;
-};
-
-typedef QList HotkeyList;
-
-QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey);
-
-#endif
diff --git a/src/gui/src/HotkeyDialog.cpp b/src/gui/src/HotkeyDialog.cpp
deleted file mode 100644
index 060666d83..000000000
--- a/src/gui/src/HotkeyDialog.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "HotkeyDialog.h"
-
-#include
-#include
-
-HotkeyDialog::HotkeyDialog (QWidget* parent, Hotkey& hotkey) :
- QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::HotkeyDialogBase(),
- m_Hotkey(hotkey)
-{
- setupUi(this);
-
- m_pKeySequenceWidgetHotkey->setText(m_Hotkey.text());
-}
-
-void HotkeyDialog::accept()
-{
- if (!sequenceWidget()->valid())
- return;
-
- hotkey().setKeySequence(sequenceWidget()->keySequence());
- QDialog::accept();
-}
diff --git a/src/gui/src/HotkeyDialog.h b/src/gui/src/HotkeyDialog.h
deleted file mode 100644
index c22726e9a..000000000
--- a/src/gui/src/HotkeyDialog.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(HOTKEYDIALOG_H)
-
-#define HOTKEYDIALOG_H
-
-#include "ui_HotkeyDialogBase.h"
-#include "Hotkey.h"
-
-#include
-
-class HotkeyDialog : public QDialog, public Ui::HotkeyDialogBase
-{
- Q_OBJECT
-
- public:
- HotkeyDialog(QWidget* parent, Hotkey& hotkey);
-
- public:
- const Hotkey& hotkey() const { return m_Hotkey; }
-
- protected slots:
- void accept();
-
- protected:
- const KeySequenceWidget* sequenceWidget() const { return m_pKeySequenceWidgetHotkey; }
- Hotkey& hotkey() { return m_Hotkey; }
-
- private:
- Hotkey& m_Hotkey;
-};
-
-#endif
diff --git a/src/gui/src/KeySequence.cpp b/src/gui/src/KeySequence.cpp
deleted file mode 100644
index 4704abb94..000000000
--- a/src/gui/src/KeySequence.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "KeySequence.h"
-
-#include
-#include
-
-// this table originally comes from Qt sources (gui/kernel/qkeysequence.cpp)
-// and is heavily modified for QSynergy
-static const struct
-{
- int key;
- const char* name;
-} keyname[] =
-{
- { Qt::Key_Space, "Space" },
- { Qt::Key_Escape, "Escape" },
- { Qt::Key_Tab, "Tab" },
- { Qt::Key_Backtab, "LeftTab" },
- { Qt::Key_Backspace, "BackSpace" },
- { Qt::Key_Return, "Return" },
- { Qt::Key_Insert, "Insert" },
- { Qt::Key_Delete, "Delete" },
- { Qt::Key_Pause, "Pause" },
- { Qt::Key_Print, "Print" },
- { Qt::Key_SysReq, "SysReq" },
- { Qt::Key_Home, "Home" },
- { Qt::Key_End, "End" },
- { Qt::Key_Left, "Left" },
- { Qt::Key_Up, "Up" },
- { Qt::Key_Right, "Right" },
- { Qt::Key_Down, "Down" },
- { Qt::Key_PageUp, "PageUp" },
- { Qt::Key_PageDown, "PageDown" },
- { Qt::Key_CapsLock, "CapsLock" },
- { Qt::Key_NumLock, "NumLock" },
- { Qt::Key_ScrollLock, "ScrollLock" },
- { Qt::Key_Menu, "Menu" },
- { Qt::Key_Help, "Help" },
- { Qt::Key_Enter, "KP_Enter" },
- { Qt::Key_Clear, "Clear" },
-
- { Qt::Key_Back, "WWWBack" },
- { Qt::Key_Forward, "WWWForward" },
- { Qt::Key_Stop, "WWWStop" },
- { Qt::Key_Refresh, "WWWRefresh" },
- { Qt::Key_VolumeDown, "AudioDown" },
- { Qt::Key_VolumeMute, "AudioMute" },
- { Qt::Key_VolumeUp, "AudioUp" },
- { Qt::Key_MediaPlay, "AudioPlay" },
- { Qt::Key_MediaStop, "AudioStop" },
- { Qt::Key_MediaPrevious,"AudioPrev" },
- { Qt::Key_MediaNext, "AudioNext" },
- { Qt::Key_HomePage, "WWWHome" },
- { Qt::Key_Favorites, "WWWFavorites" },
- { Qt::Key_Search, "WWWSearch" },
- { Qt::Key_Standby, "Sleep" },
- { Qt::Key_LaunchMail, "AppMail" },
- { Qt::Key_LaunchMedia, "AppMedia" },
- { Qt::Key_Launch0, "AppUser1" },
- { Qt::Key_Launch1, "AppUser2" },
- { Qt::Key_Select, "Select" },
-
- { 0, 0 }
-};
-
-KeySequence::KeySequence() :
- m_Sequence(),
- m_Modifiers(0),
- m_IsValid(false)
-{
-}
-
-bool KeySequence::isMouseButton() const
-{
- return !m_Sequence.isEmpty() && m_Sequence.last() < Qt::Key_Space;
-}
-
-QString KeySequence::toString() const
-{
- QString result;
-
- for (int i = 0; i < m_Sequence.size(); i++)
- {
- result += keyToString(m_Sequence[i]);
-
- if (i != m_Sequence.size() - 1)
- result += "+";
- }
-
- return result;
-}
-
-bool KeySequence::appendMouseButton(int button)
-{
- return appendKey(button, 0);
-}
-
-bool KeySequence::appendKey(int key, int modifiers)
-{
- if (m_Sequence.size() == 4)
- return true;
-
- switch(key)
- {
- case Qt::Key_AltGr:
- return false;
-
- case Qt::Key_Control:
- case Qt::Key_Alt:
- case Qt::Key_Shift:
- case Qt::Key_Meta:
- case Qt::Key_Menu:
- {
- int mod = modifiers & (~m_Modifiers);
- if (mod)
- {
- m_Sequence.append(mod);
- m_Modifiers |= mod;
- }
- }
- break;
-
- default:
- // see if we can handle this key, if not, don't accept it
- if (keyToString(key).isEmpty())
- break;
-
- m_Sequence.append(key);
- setValid(true);
- return true;
- }
-
- return false;
-}
-
-void KeySequence::loadSettings(QSettings& settings)
-{
- sequence().clear();
- int num = settings.beginReadArray("keys");
- for (int i = 0; i < num; i++)
- {
- settings.setArrayIndex(i);
- sequence().append(settings.value("key", 0).toInt());
- }
- settings.endArray();
-
- setModifiers(0);
- setValid(true);
-}
-
-void KeySequence::saveSettings(QSettings& settings) const
-{
- settings.beginWriteArray("keys");
- for (int i = 0; i < sequence().size(); i++)
- {
- settings.setArrayIndex(i);
- settings.setValue("key", sequence()[i]);
- }
- settings.endArray();
-}
-
-QString KeySequence::keyToString(int key)
-{
- // nothing there?
- if (key == 0)
- return "";
-
- // a hack to handle mouse buttons as if they were keys
- if (key < Qt::Key_Space)
- {
- switch(key)
- {
- case Qt::LeftButton: return "1";
- case Qt::RightButton: return "2";
- case Qt::MidButton: return "3";
- }
-
- return "4"; // qt only knows three mouse buttons, so assume it's an unknown fourth one
- }
-
- // modifiers?
- if (key & Qt::ShiftModifier)
- return "Shift";
-
- if (key & Qt::ControlModifier)
- return "Control";
-
- if (key & Qt::AltModifier)
- return "Alt";
-
- if (key & Qt::MetaModifier)
- return "Meta";
-
- // treat key pad like normal keys (FIXME: we should have another lookup table for keypad keys instead)
- key &= ~Qt::KeypadModifier;
-
- // a printable 7 bit character?
- if (key < 0x80 && key != Qt::Key_Space)
- return QChar(key & 0x7f).toLower();
-
- // a function key?
- if (key >= Qt::Key_F1 && key <= Qt::Key_F35)
- return QString::fromUtf8("F%1").arg(key - Qt::Key_F1 + 1);
-
- // a special key?
- int i=0;
- while (keyname[i].name)
- {
- if (key == keyname[i].key)
- return QString::fromUtf8(keyname[i].name);
- i++;
- }
-
- // representable in ucs2?
- if (key < 0x10000)
- return QString("\\u%1").arg(QChar(key).toLower().unicode(), 4, 16, QChar('0'));
-
- // give up, synergy probably won't handle this
- return "";
-}
diff --git a/src/gui/src/KeySequence.h b/src/gui/src/KeySequence.h
deleted file mode 100644
index a41986157..000000000
--- a/src/gui/src/KeySequence.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(KEYSEQUENCE_H)
-
-#define KEYSEQUENCE_H
-
-#include
-#include
-
-class QSettings;
-
-class KeySequence
-{
- public:
- KeySequence();
-
- public:
- QString toString() const;
- bool appendKey(int modifiers, int key);
- bool appendMouseButton(int button);
- bool isMouseButton() const;
- bool valid() const { return m_IsValid; }
- int modifiers() const { return m_Modifiers; }
- void saveSettings(QSettings& settings) const;
- void loadSettings(QSettings& settings);
- const QList& sequence() const { return m_Sequence; }
-
- private:
- void setValid(bool b) { m_IsValid = b; }
- void setModifiers(int i) { m_Modifiers = i; }
- QList& sequence() { return m_Sequence; }
-
- private:
- QList m_Sequence;
- int m_Modifiers;
- bool m_IsValid;
-
- static QString keyToString(int key);
-};
-
-#endif
-
diff --git a/src/gui/src/KeySequenceWidget.cpp b/src/gui/src/KeySequenceWidget.cpp
deleted file mode 100644
index ba6a73b63..000000000
--- a/src/gui/src/KeySequenceWidget.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "KeySequenceWidget.h"
-
-#include
-
-KeySequenceWidget::KeySequenceWidget(QWidget* parent, const KeySequence& seq) :
- QPushButton(parent),
- m_KeySequence(seq),
- m_BackupSequence(seq),
- m_Status(Stopped),
- m_MousePrefix("mousebutton("),
- m_MousePostfix(")"),
- m_KeyPrefix("keystroke("),
- m_KeyPostfix(")")
-{
- setFocusPolicy(Qt::NoFocus);
- updateOutput();
-}
-
-void KeySequenceWidget::setKeySequence(const KeySequence& seq)
-{
- keySequence() = seq;
- backupSequence() = seq;
-
- setStatus(Stopped);
- updateOutput();
-}
-
-void KeySequenceWidget::mousePressEvent(QMouseEvent* event)
-{
- event->accept();
-
- if (status() == Stopped)
- {
- startRecording();
- return;
- }
-
- if (m_KeySequence.appendMouseButton(event->button()))
- stopRecording();
-
- updateOutput();
-}
-
-void KeySequenceWidget::startRecording()
-{
- keySequence() = KeySequence();
- setDown(true);
- setFocus();
- grabKeyboard();
- setStatus(Recording);
-}
-
-void KeySequenceWidget::stopRecording()
-{
- if (!keySequence().valid())
- {
- keySequence() = backupSequence();
- updateOutput();
- }
-
- setDown(false);
- focusNextChild();
- releaseKeyboard();
- setStatus(Stopped);
- emit keySequenceChanged();
-}
-
-bool KeySequenceWidget::event(QEvent* event)
-{
- if (status() == Recording)
- {
- switch(event->type())
- {
- case QEvent::KeyPress:
- keyPressEvent(static_cast(event));
- return true;
-
- case QEvent::MouseButtonRelease:
- event->accept();
- return true;
-
- case QEvent::ShortcutOverride:
- event->accept();
- return true;
-
- case QEvent::FocusOut:
- stopRecording();
- if (!valid())
- {
- keySequence() = backupSequence();
- updateOutput();
- }
- break;
-
- default:
- break;
- }
- }
-
- return QPushButton::event(event);
-}
-
-void KeySequenceWidget::keyPressEvent(QKeyEvent* event)
-{
- event->accept();
-
- if (status() == Stopped)
- return;
-
- if (m_KeySequence.appendKey(event->key(), event->modifiers()))
- stopRecording();
-
- updateOutput();
-}
-
-void KeySequenceWidget::updateOutput()
-{
- QString s;
-
- if (m_KeySequence.isMouseButton())
- s = mousePrefix() + m_KeySequence.toString() + mousePostfix();
- else
- s = keyPrefix() + m_KeySequence.toString() + keyPostfix();
-
- setText(s);
-}
diff --git a/src/gui/src/KeySequenceWidget.h b/src/gui/src/KeySequenceWidget.h
deleted file mode 100644
index c4599523a..000000000
--- a/src/gui/src/KeySequenceWidget.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(KEYSEQUENCEWIDGET__H)
-
-#define KEYSEQUENCEWIDGET__H
-
-#include
-
-#include "KeySequence.h"
-
-class KeySequenceWidget : public QPushButton
-{
- Q_OBJECT
-
- public:
- KeySequenceWidget(QWidget* parent, const KeySequence& seq = KeySequence());
-
- signals:
- void keySequenceChanged();
-
- public:
- const QString& mousePrefix() const { return m_MousePrefix; }
- const QString& mousePostfix() const { return m_MousePostfix; }
- const QString& keyPrefix() const { return m_KeyPrefix; }
- const QString& keyPostfix() const { return m_KeyPostfix; }
-
- void setMousePrefix(const QString& s) { m_MousePrefix = s; }
- void setMousePostfix(const QString& s) { m_MousePostfix = s; }
- void setKeyPrefix(const QString& s) { m_KeyPrefix = s; }
- void setKeyPostfix(const QString& s) { m_KeyPostfix = s; }
-
- const KeySequence& keySequence() const { return m_KeySequence; }
- const KeySequence& backupSequence() const { return m_BackupSequence; }
- void setKeySequence(const KeySequence& seq);
-
- bool valid() const { return keySequence().valid(); }
-
- protected:
- void mousePressEvent(QMouseEvent*);
- void keyPressEvent(QKeyEvent*);
- bool event(QEvent* event);
- void appendToSequence(int key);
- void updateOutput();
- void startRecording();
- void stopRecording();
- KeySequence& keySequence() { return m_KeySequence; }
- KeySequence& backupSequence() { return m_BackupSequence; }
-
- private:
- enum Status { Stopped, Recording };
- void setStatus(Status s) { m_Status = s; }
- Status status() const { return m_Status; }
-
- private:
- KeySequence m_KeySequence;
- KeySequence m_BackupSequence;
- Status m_Status;
- QString m_MousePrefix;
- QString m_MousePostfix;
- QString m_KeyPrefix;
- QString m_KeyPostfix;
-};
-
-#endif
-
diff --git a/src/gui/src/LogDialog.cpp b/src/gui/src/LogDialog.cpp
deleted file mode 100644
index 17621ceb7..000000000
--- a/src/gui/src/LogDialog.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "LogDialog.h"
-
-#include
-
-LogDialog::LogDialog (QWidget* parent, QProcess*& synergy) :
- QDialog (parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::LogDialogBase(),
- m_pSynergy(synergy)
-{
- setupUi(this);
-}
-
-void LogDialog::append(const QString& s)
-{
- m_pLogOutput->append(s);
-}
-
-void LogDialog::readSynergyOutput()
-{
- if (m_pSynergy)
- {
- QByteArray log;
- log += m_pSynergy->readAllStandardOutput();
- log += m_pSynergy->readAllStandardError();
-
- append(QString(log));
- }
-}
-
diff --git a/src/gui/src/LogDialog.h b/src/gui/src/LogDialog.h
deleted file mode 100644
index d77fd6bfe..000000000
--- a/src/gui/src/LogDialog.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(LOGDIALOG_H)
-
-#define LOGDIALOG_H
-
-#include
-
-#include "ui_LogDialogBase.h"
-
-class QProcess;
-
-class LogDialog : public QDialog, public Ui::LogDialogBase
-{
- Q_OBJECT
-
- public:
- LogDialog(QWidget* parent, QProcess*& synergy);
-
- public:
- void append(const QString& s);
- void clear() { m_pLogOutput->clear(); }
-
- public slots:
- void readSynergyOutput();
-
- private:
- QProcess*& m_pSynergy;
-};
-
-#endif
diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp
deleted file mode 100644
index 88dd5e04e..000000000
--- a/src/gui/src/MainWindow.cpp
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "MainWindow.h"
-#include "AboutDialog.h"
-#include "ServerConfigDialog.h"
-#include "SettingsDialog.h"
-#include "LogDialog.h"
-#include "WindowsServices.h"
-
-#include
-#include
-#include
-
-#if defined(Q_OS_WIN)
-static const char synergyConfigName[] = "synergy.sgc";
-static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.sgc);;All files (*.*)"));
-#else
-static const char synergyConfigName[] = "synergy.conf";
-static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.conf);;All files (*.*)"));
-#endif
-
-static const char* synergyIconFiles[] =
-{
- ":/res/icons/16x16/synergy-disconnected.png",
- ":/res/icons/16x16/synergy-connected.png"
-};
-
-MainWindow::MainWindow(QWidget* parent) :
- QMainWindow(parent),
- MainWindowBase(),
- m_Settings(),
- m_AppConfig(&m_Settings),
- m_pSynergy(NULL),
- m_SynergyState(synergyDisconnected),
- m_ServerConfig(&m_Settings, 5, 3),
- m_pTempConfigFile(NULL),
- m_pLogDialog(new LogDialog(this, synergyProcess())),
- m_pTrayIcon(NULL),
- m_pTrayIconMenu(NULL)
-{
- setupUi(this);
-
- createTrayIcon();
- createMenuBar();
- loadSettings();
- initConnections();
-
- // HACK - surely window should be visible by default?
- setVisible(true);
-
- if (appConfig().autoConnect())
- startSynergy();
-}
-
-MainWindow::~MainWindow()
-{
- stopSynergy();
- saveSettings();
-}
-
-void MainWindow::setStatus(const QString &status)
-{
- m_pStatusLabel->setText(status);
-}
-
-void MainWindow::createTrayIcon()
-{
-#if !defined(Q_OS_MAC)
- m_pTrayIconMenu = new QMenu(this);
-
- m_pTrayIconMenu->addAction(m_pActionStartSynergy);
- m_pTrayIconMenu->addAction(m_pActionStopSynergy);
- m_pTrayIconMenu->addSeparator();
-
- m_pTrayIconMenu->addAction(m_pActionMinimize);
- m_pTrayIconMenu->addAction(m_pActionRestore);
- m_pTrayIconMenu->addSeparator();
- m_pTrayIconMenu->addAction(m_pActionQuit);
-
- m_pTrayIcon = new QSystemTrayIcon(this);
- m_pTrayIcon->setContextMenu(m_pTrayIconMenu);
-
- setIcon(synergyDisconnected);
-
- m_pTrayIcon->show();
-#else
- setIcon(synergyDisconnected);
-#endif
-}
-
-void MainWindow::createMenuBar()
-{
- QMenuBar* menubar = new QMenuBar(this);
- QMenu* pMenuFile = new QMenu(tr("&File"), menubar);
- QMenu* pMenuEdit = new QMenu(tr("&Edit"), menubar);
- QMenu* pMenuView = new QMenu(tr("&View"), menubar);
- QMenu* pMenuWindow = new QMenu(tr("&Window"), menubar);
- QMenu* pMenuHelp = new QMenu(tr("&Help"), menubar);
-
- menubar->addAction(pMenuFile->menuAction());
- menubar->addAction(pMenuEdit->menuAction());
- menubar->addAction(pMenuView->menuAction());
-#if !defined(Q_OS_MAC)
- menubar->addAction(pMenuWindow->menuAction());
-#endif
- menubar->addAction(pMenuHelp->menuAction());
-
- pMenuFile->addAction(m_pActionStartSynergy);
- pMenuFile->addAction(m_pActionStopSynergy);
- pMenuFile->addSeparator();
- pMenuFile->addAction(m_pActionSave);
- pMenuFile->addSeparator();
- pMenuFile->addAction(m_pActionQuit);
- pMenuEdit->addAction(m_pActionSettings);
-#if defined(Q_OS_WIN)
- pMenuEdit->addAction(m_pActionServices);
-#endif
- pMenuView->addAction(m_pActionLogOutput);
- pMenuWindow->addAction(m_pActionMinimize);
- pMenuWindow->addAction(m_pActionRestore);
- pMenuHelp->addAction(m_pActionAbout);
-
- setMenuBar(menubar);
-}
-
-void MainWindow::loadSettings()
-{
- // the next two must come BEFORE loading groupServerChecked and groupClientChecked or
- // disabling and/or enabling the right widgets won't automatically work
- m_pRadioExternalConfig->setChecked(settings().value("externalConfig", false).toBool());
- m_pRadioInternalConfig->setChecked(settings().value("internalConfig", true).toBool());
-
- m_pGroupServer->setChecked(settings().value("groupServerChecked", false).toBool());
- m_pLineEditConfigFile->setText(settings().value("configFile", QDir::homePath() + "/" + synergyConfigName).toString());
- m_pGroupClient->setChecked(settings().value("groupClientChecked", true).toBool());
- m_pLineEditHostname->setText(settings().value("serverHostname").toString());
-}
-
-void MainWindow::initConnections()
-{
- connect(m_pActionMinimize, SIGNAL(triggered()), this, SLOT(hide()));
- connect(m_pActionRestore, SIGNAL(triggered()), this, SLOT(showNormal()));
- connect(m_pActionStartSynergy, SIGNAL(triggered()), this, SLOT(startSynergy()));
- connect(m_pActionStopSynergy, SIGNAL(triggered()), this, SLOT(stopSynergy()));
- connect(m_pActionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
-
- if (m_pTrayIcon)
- connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
-}
-
-void MainWindow::saveSettings()
-{
- // program settings
- settings().setValue("groupServerChecked", m_pGroupServer->isChecked());
- settings().setValue("externalConfig", m_pRadioExternalConfig->isChecked());
- settings().setValue("configFile", m_pLineEditConfigFile->text());
- settings().setValue("internalConfig", m_pRadioInternalConfig->isChecked());
- settings().setValue("groupClientChecked", m_pGroupClient->isChecked());
- settings().setValue("serverHostname", m_pLineEditHostname->text());
-
- settings().sync();
-}
-
-void MainWindow::setIcon(qSynergyState state)
-{
- QIcon icon;
- icon.addFile(synergyIconFiles[state]);
-
- if (m_pTrayIcon)
- m_pTrayIcon->setIcon(icon);
-
- setWindowIcon(icon);
-}
-
-void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason)
-{
- if (reason == QSystemTrayIcon::DoubleClick)
- setVisible(!isVisible());
-}
-
-void MainWindow::startSynergy()
-{
- stopSynergy();
-
- QString app;
- QStringList args;
-
- args << "-f" << "--debug" << appConfig().logLevelText();
-
- if (!appConfig().screenName().isEmpty())
- args << "--name" << appConfig().screenName();
-
- setSynergyProcess(new QProcess(this));
-
- if ((synergyType() == synergyClient && !clientArgs(args, app))
- || (synergyType() == synergyServer && !serverArgs(args, app)))
- {
- stopSynergy();
- return;
- }
-
- connect(synergyProcess(), SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(synergyFinished(int, QProcess::ExitStatus)));
- connect(synergyProcess(), SIGNAL(readyReadStandardOutput()), m_pLogDialog, SLOT(readSynergyOutput()));
- connect(synergyProcess(), SIGNAL(readyReadStandardError()), m_pLogDialog, SLOT(readSynergyOutput()));
-
- m_pLogDialog->append(tr("\n\nRunning synergy: %1 %2\n\n").arg(app).arg(args.join(" ")));
-
- synergyProcess()->start(app, args);
- if (!synergyProcess()->waitForStarted())
- {
- stopSynergy();
- QMessageBox::warning(this, tr("Program can not be started"), QString(tr("The executable
%1
could not be successfully started, although it does exist. Please check if you have sufficient permissions to run this program.").arg(app)));
- return;
- }
-
- setSynergyState(synergyConnected);
-}
-
-bool MainWindow::clientArgs(QStringList& args, QString& app)
-{
- app = appPath(appConfig().synergycName(), appConfig().synergyc());
-
- if (!QFile::exists(app))
- {
- if (QMessageBox::warning(this, tr("Synergy client not found"), tr("The executable for the synergy client does not exist. Do you want to browse for the synergy client now?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
- return false;
-
- app = SettingsDialog::browseForSynergyc(this, appConfig().synergyProgramDir(), appConfig().synergycName());
-
- if (app.isEmpty())
- return false;
-
- appConfig().setSynergyc(app);
- }
-
- if (m_pLineEditHostname->text().isEmpty())
- {
- QMessageBox::warning(this, tr("Hostname is empty"), tr("Please fill in a hostname for the synergy client to connect to."));
- return false;
- }
-
- if (appConfig().logToFile())
- {
- appConfig().persistLogDir();
- args << "--log" << appConfig().logFilename();
- }
-
- args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port());
-
- return true;
-}
-
-QString MainWindow::configFilename()
-{
- QString filename;
- if (m_pRadioInternalConfig->isChecked())
- {
- // TODO: no need to use a temporary file, since we need it to
- // be permenant (since it'll be used for Windows services, etc).
- m_pTempConfigFile = new QTemporaryFile();
- if (!m_pTempConfigFile->open())
- {
- QMessageBox::critical(this, tr("Cannot write configuration file"), tr("The temporary configuration file required to start synergy can not be written."));
- return false;
- }
-
- serverConfig().save(*m_pTempConfigFile);
- filename = m_pTempConfigFile->fileName();
-
- m_pTempConfigFile->close();
- }
- else
- {
- if (!QFile::exists(m_pLineEditConfigFile->text()))
- {
- if (QMessageBox::warning(this, tr("Configuration filename invalid"),
- tr("You have not filled in a valid configuration file for the synergy server. "
- "Do you want to browse for the configuration file now?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes
- || !on_m_pButtonBrowseConfigFile_clicked())
- return false;
- }
-
- filename = m_pLineEditConfigFile->text();
- }
- return filename;
-}
-
-QString MainWindow::address()
-{
- return (!appConfig().interface().isEmpty() ? appConfig().interface() : "") + ":" + QString::number(appConfig().port());
-}
-
-QString MainWindow::appPath(const QString& name, const QString& defaultPath)
-{
- QString app;
- if (appConfig().autoDetectPaths())
- {
- // actually returns bool, but ignore for now
- appConfig().detectPath(name, app);
- }
- else
- {
- app = defaultPath;
- }
- return app;
-}
-
-bool MainWindow::serverArgs(QStringList& args, QString& app)
-{
- app = appPath(appConfig().synergysName(), appConfig().synergys());
-
- if (!QFile::exists(app))
- {
- if (QMessageBox::warning(this, tr("Synergy server not found"), tr("The executable for the synergy server does not exist. Do you want to browse for the synergy server now?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
- return false;
-
- app = SettingsDialog::browseForSynergys(this, appConfig().synergyProgramDir(), appConfig().synergysName());
-
- if (app.isEmpty())
- return false;
-
- appConfig().setSynergys(app);
- }
-
- if (appConfig().logToFile())
- {
- appConfig().persistLogDir();
- args << "--log" << appConfig().logFilename();
- }
-
- args << "-c" << configFilename() << "--address" << address();
-
- return true;
-}
-
-void MainWindow::stopSynergy()
-{
- if (synergyProcess())
- {
- if (synergyProcess()->isOpen())
- synergyProcess()->close();
- delete synergyProcess();
- setSynergyProcess(NULL);
-
- setSynergyState(synergyDisconnected);
- }
-
- // HACK: deleting the object deletes the physical file, which is
- // bad, since it could be in use by the Windows service!
- //delete m_pTempConfigFile;
- m_pTempConfigFile = NULL;
-}
-
-void MainWindow::synergyFinished(int exitCode, QProcess::ExitStatus)
-{
- // on Windows, we always seem to have an exit code != 0.
-#if !defined(Q_OS_WIN)
- if (exitCode != 0)
- {
- QMessageBox::critical(this, tr("Synergy terminated with an error"), QString(tr("Synergy terminated unexpectedly with an exit code of %1.
Please see the log output for details.")).arg(exitCode));
- stopSynergy();
- }
-#else
- Q_UNUSED(exitCode);
-#endif
-
- setSynergyState(synergyDisconnected);
-
- // do not call stopSynergy() in case of clean synergy shutdown, because this must have (well, should have...)
- // come from our own delete synergyProcess() in stopSynergy(), so we would do a double-delete...
-}
-
-void MainWindow::setSynergyState(qSynergyState state)
-{
- if (synergyState() == state)
- return;
-
- if (state == synergyConnected)
- {
- disconnect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStartSynergy, SLOT(trigger()));
- connect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStopSynergy, SLOT(trigger()));
- m_pButtonToggleStart->setText(tr("&Stop"));
- }
- else
- {
- disconnect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStopSynergy, SLOT(trigger()));
- connect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStartSynergy, SLOT(trigger()));
- m_pButtonToggleStart->setText(tr("&Start"));
- }
-
- m_pGroupClient->setEnabled(state == synergyDisconnected);
- m_pGroupServer->setEnabled(state == synergyDisconnected);
- m_pActionStartSynergy->setEnabled(state == synergyDisconnected);
- m_pActionStopSynergy->setEnabled(state == synergyConnected);
- setStatus(state == synergyConnected ? QString(tr("Synergy %1 is running.")).arg(synergyType() == synergyServer ? tr("server") : tr("client")) : tr("Synergy is not running."));
- setIcon(state);
- m_SynergyState = state;
-}
-
-void MainWindow::setVisible(bool visible)
-{
- m_pActionMinimize->setEnabled(visible);
- m_pActionRestore->setEnabled(!visible);
- QMainWindow::setVisible(visible);
-}
-
-bool MainWindow::on_m_pButtonBrowseConfigFile_clicked()
-{
- QString fileName = QFileDialog::getOpenFileName(this, tr("Browse for a synergys config file"), QString(), synergyConfigFilter);
-
- if (!fileName.isEmpty())
- {
- m_pLineEditConfigFile->setText(fileName);
- return true;
- }
-
- return false;
-}
-
-bool MainWindow::on_m_pActionSave_triggered()
-{
- QString fileName = QFileDialog::getSaveFileName(this, tr("Save configuration as..."));
-
- if (!fileName.isEmpty() && !serverConfig().save(fileName))
- {
- QMessageBox::warning(this, tr("Save failed"), tr("Could not save configuration to file."));
- return true;
- }
-
- return false;
-}
-
-void MainWindow::on_m_pActionAbout_triggered()
-{
- AboutDialog dlg(this, appConfig().synergyc());
- dlg.exec();
-}
-
-void MainWindow::on_m_pActionSettings_triggered()
-{
- SettingsDialog dlg(this, appConfig());
- dlg.exec();
-}
-
-void MainWindow::on_m_pActionServices_triggered()
-{
- WindowsServices dlg(this, appConfig());
- dlg.exec();
-}
-
-void MainWindow::on_m_pActionLogOutput_triggered()
-{
- Q_ASSERT(m_pLogDialog);
-
- m_pLogDialog->show();
- m_pLogDialog->raise();
- m_pLogDialog->activateWindow();
-}
-
-void MainWindow::on_m_pButtonConfigureServer_clicked()
-{
- ServerConfigDialog dlg(this, serverConfig(), appConfig().screenName());
- dlg.exec();
-}
-
diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h
deleted file mode 100644
index 5ddbc2723..000000000
--- a/src/gui/src/MainWindow.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(MAINWINDOW__H)
-
-#define MAINWINDOW__H
-
-#include
-#include
-#include
-#include
-
-#include "ui_MainWindowBase.h"
-
-#include "ServerConfig.h"
-#include "AppConfig.h"
-
-class QAction;
-class QMenu;
-class QLineEdit;
-class QGroupBox;
-class QPushButton;
-class QTextEdit;
-class QComboBox;
-class QTabWidget;
-class QCheckBox;
-class QRadioButton;
-class QTemporaryFile;
-
-class LogDialog;
-class QSynergyApplication;
-
-class MainWindow : public QMainWindow, public Ui::MainWindowBase
-{
- Q_OBJECT
-
- friend class QSynergyApplication;
-
- public:
- enum qSynergyState
- {
- synergyDisconnected,
- synergyConnected
- };
-
- enum qSynergyType
- {
- synergyClient,
- synergyServer
- };
-
- public:
- MainWindow(QWidget* parent);
- ~MainWindow();
-
- public:
- void setVisible(bool visible);
- int synergyType() const { return m_pGroupClient->isChecked() ? synergyClient : synergyServer; }
- int synergyState() const { return m_SynergyState; }
- QString hostname() const { return m_pLineEditHostname->text(); }
- QString configFilename();
- QString address();
- QString appPath(const QString& name, const QString& defaultPath);
-
- protected slots:
- void on_m_pGroupClient_toggled(bool on) { m_pGroupServer->setChecked(!on); }
- void on_m_pGroupServer_toggled(bool on) { m_pGroupClient->setChecked(!on); }
- bool on_m_pButtonBrowseConfigFile_clicked();
- void on_m_pButtonConfigureServer_clicked();
- bool on_m_pActionSave_triggered();
- void on_m_pActionAbout_triggered();
- void on_m_pActionSettings_triggered();
- void on_m_pActionServices_triggered();
- void on_m_pActionLogOutput_triggered();
- void synergyFinished(int exitCode, QProcess::ExitStatus);
- void iconActivated(QSystemTrayIcon::ActivationReason reason);
- void startSynergy();
- void stopSynergy();
-
- protected:
- QSettings& settings() { return m_Settings; }
- AppConfig& appConfig() { return m_AppConfig; }
- QProcess*& synergyProcess() { return m_pSynergy; }
- void setSynergyProcess(QProcess* p) { m_pSynergy = p; }
- ServerConfig& serverConfig() { return m_ServerConfig; }
- void initConnections();
- void createMenuBar();
- void createStatusBar();
- void createTrayIcon();
- void loadSettings();
- void saveSettings();
- void setIcon(qSynergyState state);
- void setSynergyState(qSynergyState state);
- bool checkForApp(int which, QString& app);
- bool clientArgs(QStringList& args, QString& app);
- bool serverArgs(QStringList& args, QString& app);
- void setStatus(const QString& status);
-
- private:
- QSettings m_Settings;
- AppConfig m_AppConfig;
- QProcess* m_pSynergy;
- int m_SynergyState;
- ServerConfig m_ServerConfig;
- QTemporaryFile* m_pTempConfigFile;
- LogDialog* m_pLogDialog;
-
- QSystemTrayIcon* m_pTrayIcon;
- QMenu* m_pTrayIconMenu;
-};
-
-#endif
-
diff --git a/src/gui/src/NewScreenWidget.cpp b/src/gui/src/NewScreenWidget.cpp
deleted file mode 100644
index f3e4b25ea..000000000
--- a/src/gui/src/NewScreenWidget.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "NewScreenWidget.h"
-#include "ScreenSetupModel.h"
-
-#include
-#include
-
-NewScreenWidget::NewScreenWidget(QWidget* parent) :
- QLabel(parent)
-{
-}
-
-void NewScreenWidget::mousePressEvent(QMouseEvent* event)
-{
- Screen newScreen(tr("Unnamed"));
-
- QByteArray itemData;
- QDataStream dataStream(&itemData, QIODevice::WriteOnly);
- dataStream << -1 << -1 << newScreen;
-
- QMimeData* pMimeData = new QMimeData;
- pMimeData->setData(ScreenSetupModel::mimeType(), itemData);
-
- QDrag* pDrag = new QDrag(this);
- pDrag->setMimeData(pMimeData);
- pDrag->setPixmap(*pixmap());
- pDrag->setHotSpot(event->pos());
-
- pDrag->exec(Qt::CopyAction, Qt::CopyAction);
-}
-
diff --git a/src/gui/src/NewScreenWidget.h b/src/gui/src/NewScreenWidget.h
deleted file mode 100644
index a26fceb39..000000000
--- a/src/gui/src/NewScreenWidget.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(NEWSCREENWIDGET__H)
-
-#define NEWSCREENWIDGET__H
-
-#include
-
-class QMouseEvent;
-class QWidget;
-
-class NewScreenWidget : public QLabel
-{
- Q_OBJECT
-
- public:
- NewScreenWidget(QWidget* parent);
-
- protected:
- void mousePressEvent(QMouseEvent* event);
-};
-
-#endif
-
diff --git a/src/gui/src/QSynergyApplication.cpp b/src/gui/src/QSynergyApplication.cpp
deleted file mode 100644
index c0b0dcf8f..000000000
--- a/src/gui/src/QSynergyApplication.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "QSynergyApplication.h"
-#include "MainWindow.h"
-
-#include
-#include
-
-QSynergyApplication::QSynergyApplication(int& argc, char** argv) :
- QApplication(argc, argv)
-{
-}
-
-void QSynergyApplication::commitData(QSessionManager&)
-{
- foreach(QWidget* widget, topLevelWidgets())
- {
- MainWindow* mainWindow = qobject_cast(widget);
- if (mainWindow)
- mainWindow->saveSettings();
- }
-}
-
diff --git a/src/gui/src/QSynergyApplication.h b/src/gui/src/QSynergyApplication.h
deleted file mode 100644
index a6e9223fc..000000000
--- a/src/gui/src/QSynergyApplication.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(QSYNERGYAPPLICATION__H)
-
-#define QSYNERGYAPPLICATION__H
-
-#include
-
-class QSessionManager;
-
-class QSynergyApplication : public QApplication
-{
- public:
- QSynergyApplication(int& argc, char** argv);
-
- public:
- void commitData(QSessionManager& manager);
-};
-
-#endif
-
diff --git a/src/gui/src/Screen.cpp b/src/gui/src/Screen.cpp
deleted file mode 100644
index b35b2eee3..000000000
--- a/src/gui/src/Screen.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "Screen.h"
-
-#include
-#include
-
-Screen::Screen() :
- m_Pixmap(QPixmap(":res/icons/64x64/video-display.png")),
- m_Swapped(false)
-{
- init();
-}
-
-Screen::Screen(const QString& name) :
- m_Pixmap(QPixmap(":res/icons/64x64/video-display.png")),
- m_Swapped(false)
-{
- init();
- setName(name);
-}
-
-void Screen::init()
-{
- name().clear();
- aliases().clear();
- modifiers().clear();
- switchCorners().clear();
- fixes().clear();
- setSwitchCornerSize(0);
-
- // m_Modifiers, m_SwitchCorners and m_Fixes are QLists we use like fixed-size arrays,
- // thus we need to make sure to fill them with the required number of elements.
- for (int i = 0; i < NumModifiers; i++)
- modifiers() << i;
-
- for (int i = 0; i < NumSwitchCorners; i++)
- switchCorners() << false;
-
- for (int i = 0; i < NumFixes; i++)
- fixes() << false;
-}
-
-void Screen::loadSettings(QSettings& settings)
-{
- setName(settings.value("name").toString());
-
- if (name().isEmpty())
- return;
-
- setSwitchCornerSize(settings.value("switchCornerSize").toInt());
-
- readSettings(settings, aliases(), "alias", QString(""));
- readSettings(settings, modifiers(), "modifier", static_cast(DefaultMod), NumModifiers);
- readSettings(settings, switchCorners(), "switchCorner", false, NumSwitchCorners);
- readSettings(settings, fixes(), "fix", false, NumFixes);
-}
-
-void Screen::saveSettings(QSettings& settings) const
-{
- settings.setValue("name", name());
-
- if (name().isEmpty())
- return;
-
- settings.setValue("switchCornerSize", switchCornerSize());
-
- writeSettings(settings, aliases(), "alias");
- writeSettings(settings, modifiers(), "modifier");
- writeSettings(settings, switchCorners(), "switchCorner");
- writeSettings(settings, fixes(), "fix");
-}
-
-QTextStream& Screen::writeScreensSection(QTextStream& outStream) const
-{
- outStream << "\t" << name() << ":" << endl;
-
- for (int i = 0; i < modifiers().size(); i++)
- if (modifier(i) != i)
- outStream << "\t\t" << modifierName(i) << " = " << modifierName(modifier(i)) << endl;
-
- for (int i = 0; i < fixes().size(); i++)
- outStream << "\t\t" << fixName(i) << " = " << (fixes()[i] ? "true" : "false") << endl;
-
- outStream << "\t\t" << "switchCorners = none ";
- for (int i = 0; i < switchCorners().size(); i++)
- if (switchCorners()[i])
- outStream << "+" << switchCornerName(i) << " ";
- outStream << endl;
-
- outStream << "\t\t" << "switchCornerSize = " << switchCornerSize() << endl;
-
- return outStream;
-}
-
-QTextStream& Screen::writeAliasesSection(QTextStream& outStream) const
-{
- if (!aliases().isEmpty())
- {
- outStream << "\t" << name() << ":" << endl;
-
- foreach (const QString& alias, aliases())
- outStream << "\t\t" << alias << endl;
- }
-
- return outStream;
-}
-
-QDataStream& operator<<(QDataStream& outStream, const Screen& screen)
-{
- return outStream
- << screen.name()
- << screen.switchCornerSize()
- << screen.aliases()
- << screen.modifiers()
- << screen.switchCorners()
- << screen.fixes()
- ;
-}
-
-QDataStream& operator>>(QDataStream& inStream, Screen& screen)
-{
- return inStream
- >> screen.m_Name
- >> screen.m_SwitchCornerSize
- >> screen.m_Aliases
- >> screen.m_Modifiers
- >> screen.m_SwitchCorners
- >> screen.m_Fixes
- ;
-}
diff --git a/src/gui/src/Screen.h b/src/gui/src/Screen.h
deleted file mode 100644
index 637712817..000000000
--- a/src/gui/src/Screen.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(SCREEN__H)
-
-#define SCREEN__H
-
-#include
-#include
-#include
-#include
-
-#include "BaseConfig.h"
-
-class QSettings;
-class QTextStream;
-
-class ScreenSettingsDialog;
-
-class Screen : public BaseConfig
-{
- friend QDataStream& operator<<(QDataStream& outStream, const Screen& screen);
- friend QDataStream& operator>>(QDataStream& inStream, Screen& screen);
- friend class ScreenSettingsDialog;
- friend class ScreenSetupModel;
- friend class ScreenSetupView;
-
- public:
- Screen();
- Screen(const QString& name);
-
- public:
- const QPixmap* pixmap() const { return &m_Pixmap; }
- const QString& name() const { return m_Name; }
- const QStringList& aliases() const { return m_Aliases; }
-
- bool isNull() const { return m_Name.isEmpty(); }
- int modifier(int m) const { return m_Modifiers[m] == DefaultMod ? m : m_Modifiers[m]; }
- const QList& modifiers() const { return m_Modifiers; }
- bool switchCorner(int c) const { return m_SwitchCorners[c]; }
- const QList& switchCorners() const { return m_SwitchCorners; }
- int switchCornerSize() const { return m_SwitchCornerSize; }
- bool fix(Fix f) const { return m_Fixes[f]; }
- const QList& fixes() const { return m_Fixes; }
-
- void loadSettings(QSettings& settings);
- void saveSettings(QSettings& settings) const;
- QTextStream& writeScreensSection(QTextStream& outStream) const;
- QTextStream& writeAliasesSection(QTextStream& outStream) const;
-
- bool swapped() const { return m_Swapped; }
-
- protected:
- void init();
- void setName(const QString& name) { m_Name = name; }
- QPixmap* pixmap() { return &m_Pixmap; }
- QString& name() { return m_Name; }
-
- void setPixmap(const QPixmap& pixmap) { m_Pixmap = pixmap; }
- QStringList& aliases() { return m_Aliases; }
- void setModifier(int m, int n) { m_Modifiers[m] = n; }
- QList& modifiers() { return m_Modifiers; }
- void addAlias(const QString& alias) { m_Aliases.append(alias); }
- void setSwitchCorner(int c, bool on) { m_SwitchCorners[c] = on; }
- QList& switchCorners() { return m_SwitchCorners; }
- void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; }
- void setFix(int f, bool on) { m_Fixes[f] = on; }
- QList& fixes() { return m_Fixes; }
- void setSwapped(bool on) { m_Swapped = on; }
-
- private:
- QPixmap m_Pixmap;
- QString m_Name;
-
- QStringList m_Aliases;
- QList m_Modifiers;
- QList m_SwitchCorners;
- int m_SwitchCornerSize;
- QList m_Fixes;
-
- bool m_Swapped;
-};
-
-typedef QList ScreenList;
-
-QDataStream& operator<<(QDataStream& outStream, const Screen& screen);
-QDataStream& operator>>(QDataStream& inStream, Screen& screen);
-
-#endif
-
diff --git a/src/gui/src/ScreenSettingsDialog.cpp b/src/gui/src/ScreenSettingsDialog.cpp
deleted file mode 100644
index 96276e899..000000000
--- a/src/gui/src/ScreenSettingsDialog.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "ScreenSettingsDialog.h"
-#include "Screen.h"
-
-#include
-#include
-
-ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen) :
- QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::ScreenSettingsDialogBase(),
- m_pScreen(pScreen)
-{
- setupUi(this);
-
- QRegExp validScreenName("[a-z_][a-z0-9\\._-]{,31}", Qt::CaseInsensitive);
-
- m_pLineEditName->setText(m_pScreen->name());
- m_pLineEditName->setValidator(new QRegExpValidator(validScreenName, m_pLineEditName));
- m_pLineEditName->selectAll();
-
- m_pLineEditAlias->setValidator(new QRegExpValidator(validScreenName, m_pLineEditName));
-
- for (int i = 0; i < m_pScreen->aliases().count(); i++)
- new QListWidgetItem(m_pScreen->aliases()[i], m_pListAliases);
-
- m_pComboBoxShift->setCurrentIndex(m_pScreen->modifier(Screen::Shift));
- m_pComboBoxCtrl->setCurrentIndex(m_pScreen->modifier(Screen::Ctrl));
- m_pComboBoxAlt->setCurrentIndex(m_pScreen->modifier(Screen::Alt));
- m_pComboBoxMeta->setCurrentIndex(m_pScreen->modifier(Screen::Meta));
- m_pComboBoxSuper->setCurrentIndex(m_pScreen->modifier(Screen::Super));
-
- m_pCheckBoxCornerTopLeft->setChecked(m_pScreen->switchCorner(Screen::TopLeft));
- m_pCheckBoxCornerTopRight->setChecked(m_pScreen->switchCorner(Screen::TopRight));
- m_pCheckBoxCornerBottomLeft->setChecked(m_pScreen->switchCorner(Screen::BottomLeft));
- m_pCheckBoxCornerBottomRight->setChecked(m_pScreen->switchCorner(Screen::BottomRight));
- m_pSpinBoxSwitchCornerSize->setValue(m_pScreen->switchCornerSize());
-
- m_pCheckBoxCapsLock->setChecked(m_pScreen->fix(Screen::CapsLock));
- m_pCheckBoxNumLock->setChecked(m_pScreen->fix(Screen::NumLock));
- m_pCheckBoxScrollLock->setChecked(m_pScreen->fix(Screen::ScrollLock));
- m_pCheckBoxXTest->setChecked(m_pScreen->fix(Screen::XTest));
-}
-
-void ScreenSettingsDialog::accept()
-{
- if (m_pLineEditName->text().isEmpty())
- {
- QMessageBox::warning(this, tr("Screen name is empty"), tr("The name for a screen can not be empty. Please fill in a name or cancel the dialog."));
- return;
- }
-
- m_pScreen->init();
-
- m_pScreen->setName(m_pLineEditName->text());
-
- for (int i = 0; i < m_pListAliases->count(); i++)
- m_pScreen->addAlias(m_pListAliases->item(i)->text());
-
- m_pScreen->setModifier(Screen::Shift, m_pComboBoxShift->currentIndex());
- m_pScreen->setModifier(Screen::Ctrl, m_pComboBoxCtrl->currentIndex());
- m_pScreen->setModifier(Screen::Alt, m_pComboBoxAlt->currentIndex());
- m_pScreen->setModifier(Screen::Meta, m_pComboBoxMeta->currentIndex());
- m_pScreen->setModifier(Screen::Super, m_pComboBoxSuper->currentIndex());
-
- m_pScreen->setSwitchCorner(Screen::TopLeft, m_pCheckBoxCornerTopLeft->isChecked());
- m_pScreen->setSwitchCorner(Screen::TopRight, m_pCheckBoxCornerTopRight->isChecked());
- m_pScreen->setSwitchCorner(Screen::BottomLeft, m_pCheckBoxCornerBottomLeft->isChecked());
- m_pScreen->setSwitchCorner(Screen::BottomRight, m_pCheckBoxCornerBottomRight->isChecked());
- m_pScreen->setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
-
- m_pScreen->setFix(Screen::CapsLock, m_pCheckBoxCapsLock->isChecked());
- m_pScreen->setFix(Screen::NumLock, m_pCheckBoxNumLock->isChecked());
- m_pScreen->setFix(Screen::ScrollLock, m_pCheckBoxScrollLock->isChecked());
- m_pScreen->setFix(Screen::XTest, m_pCheckBoxXTest->isChecked());
-
- QDialog::accept();
-}
-
-void ScreenSettingsDialog::on_m_pButtonAddAlias_clicked()
-{
- if (!m_pLineEditAlias->text().isEmpty() && m_pListAliases->findItems(m_pLineEditAlias->text(), Qt::MatchFixedString).isEmpty())
- {
- new QListWidgetItem(m_pLineEditAlias->text(), m_pListAliases);
- m_pLineEditAlias->clear();
- }
-}
-
-void ScreenSettingsDialog::on_m_pLineEditAlias_textChanged(const QString& text)
-{
- m_pButtonAddAlias->setEnabled(!text.isEmpty());
-}
-
-void ScreenSettingsDialog::on_m_pButtonRemoveAlias_clicked()
-{
- QList items = m_pListAliases->selectedItems();
-
- for (int i = 0; i < items.count(); i++)
- delete items[i];
-}
-
-void ScreenSettingsDialog::on_m_pListAliases_itemSelectionChanged()
-{
- m_pButtonRemoveAlias->setEnabled(!m_pListAliases->selectedItems().isEmpty());
-}
-
diff --git a/src/gui/src/ScreenSettingsDialog.h b/src/gui/src/ScreenSettingsDialog.h
deleted file mode 100644
index 876b31e4b..000000000
--- a/src/gui/src/ScreenSettingsDialog.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(SCREENSETTINGSDIALOG__H)
-
-#define SCREENSETTINGSDIALOG__H
-
-#include
-
-#include "ui_ScreenSettingsDialogBase.h"
-
-class QWidget;
-class QString;
-
-class Screen;
-
-class ScreenSettingsDialog : public QDialog, public Ui::ScreenSettingsDialogBase
-{
- Q_OBJECT
-
- public:
- ScreenSettingsDialog(QWidget* parent, Screen* pScreen = NULL);
-
- public slots:
- void accept();
-
- private slots:
- void on_m_pButtonAddAlias_clicked();
- void on_m_pButtonRemoveAlias_clicked();
- void on_m_pLineEditAlias_textChanged(const QString& text);
- void on_m_pListAliases_itemSelectionChanged();
-
- private:
- Screen* m_pScreen;
-};
-
-#endif
-
diff --git a/src/gui/src/ScreenSetupModel.cpp b/src/gui/src/ScreenSetupModel.cpp
deleted file mode 100644
index f2fb4126d..000000000
--- a/src/gui/src/ScreenSetupModel.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "ScreenSetupModel.h"
-#include "Screen.h"
-
-#include
-#include
-
-const QString ScreenSetupModel::m_MimeType = "application/x-qsynergy-screen";
-
-ScreenSetupModel::ScreenSetupModel(ScreenList& screens, int numColumns, int numRows) :
- QAbstractTableModel(NULL),
- m_Screens(screens),
- m_NumColumns(numColumns),
- m_NumRows(numRows)
-{
- if (m_NumColumns * m_NumRows > screens.size())
- qFatal("Not enough elements (%u) in screens QList for %d columns and %d rows", screens.size(), m_NumColumns, m_NumRows);
-}
-
-QVariant ScreenSetupModel::data(const QModelIndex& index, int role) const
-{
- if (index.isValid() && index.row() < m_NumRows && index.column() < m_NumColumns)
- {
- switch(role)
- {
- case Qt::DecorationRole:
- if (screen(index).isNull())
- break;
- return QIcon(*screen(index).pixmap());
-
- case Qt::ToolTipRole:
- if (screen(index).isNull())
- break;
- return QString(tr(
- "Screen: %1"
- "
Double click to edit settings"
- "
Drag screen to the trashcan to remove it")).arg(screen(index).name());
-
- case Qt::DisplayRole:
- if (screen(index).isNull())
- break;
- return screen(index).name();
- }
- }
-
- return QVariant();
-}
-
-Qt::ItemFlags ScreenSetupModel::flags(const QModelIndex& index) const
-{
- if (!index.isValid() || index.row() >= m_NumRows || index.column() >= m_NumColumns)
- return 0;
-
- if (!screen(index).isNull())
- return Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled;
-
- return Qt::ItemIsDropEnabled;
-}
-
-Qt::DropActions ScreenSetupModel::supportedDropActions() const
-{
- return Qt::MoveAction | Qt::CopyAction;
-}
-
-QStringList ScreenSetupModel::mimeTypes() const
-{
- return QStringList() << m_MimeType;
-}
-
-QMimeData* ScreenSetupModel::mimeData(const QModelIndexList& indexes) const
-{
- QMimeData* pMimeData = new QMimeData();
- QByteArray encodedData;
-
- QDataStream stream(&encodedData, QIODevice::WriteOnly);
-
- foreach (const QModelIndex& index, indexes)
- if (index.isValid())
- stream << index.column() << index.row() << screen(index);
-
- pMimeData->setData(m_MimeType, encodedData);
-
- return pMimeData;
-}
-
-bool ScreenSetupModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent)
-{
- if (action == Qt::IgnoreAction)
- return true;
-
- if (!data->hasFormat(m_MimeType))
- return false;
-
- if (!parent.isValid() || row != -1 || column != -1)
- return false;
-
- QByteArray encodedData = data->data(m_MimeType);
- QDataStream stream(&encodedData, QIODevice::ReadOnly);
-
- int sourceColumn = -1;
- int sourceRow = -1;
-
- stream >> sourceColumn;
- stream >> sourceRow;
-
- // don't drop screen onto itself
- if (sourceColumn == parent.column() && sourceRow == parent.row())
- return false;
-
- Screen droppedScreen;
- stream >> droppedScreen;
-
- Screen oldScreen = screen(parent.column(), parent.row());
- if (!oldScreen.isNull() && sourceColumn != -1 && sourceRow != -1)
- {
- // mark the screen so it isn't deleted after the dragndrop succeeded
- // see ScreenSetupView::startDrag()
- oldScreen.setSwapped(true);
- screen(sourceColumn, sourceRow) = oldScreen;
- }
-
- screen(parent.column(), parent.row()) = droppedScreen;
-
- return true;
-}
-
diff --git a/src/gui/src/ScreenSetupModel.h b/src/gui/src/ScreenSetupModel.h
deleted file mode 100644
index 1537e7f14..000000000
--- a/src/gui/src/ScreenSetupModel.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(SCREENSETUPMODEL__H)
-
-#define SCREENSETUPMODEL__H
-
-#include
-#include
-#include
-#include
-
-#include "Screen.h"
-
-class ScreenSetupView;
-class ServerConfigDialog;
-
-class ScreenSetupModel : public QAbstractTableModel
-{
- Q_OBJECT
-
- friend class ScreenSetupView;
- friend class ServerConfigDialog;
-
- public:
- ScreenSetupModel(ScreenList& screens, int numColumns, int numRows);
-
- public:
- static const QString& mimeType() { return m_MimeType; }
- QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
- int rowCount() const { return m_NumRows; }
- int columnCount() const { return m_NumColumns; }
- int rowCount(const QModelIndex&) const { return rowCount(); }
- int columnCount(const QModelIndex&) const { return columnCount(); }
- Qt::DropActions supportedDropActions() const;
- Qt::ItemFlags flags(const QModelIndex& index) const;
- QStringList mimeTypes() const;
- QMimeData* mimeData(const QModelIndexList& indexes) const;
-
- protected:
- bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
- const Screen& screen(const QModelIndex& index) const { return screen(index.column(), index.row()); }
- Screen& screen(const QModelIndex& index) { return screen(index.column(), index.row()); }
- const Screen& screen(int column, int row) const { return m_Screens[row * m_NumColumns + column]; }
- Screen& screen(int column, int row) { return m_Screens[row * m_NumColumns + column]; }
-
- private:
- ScreenList& m_Screens;
- const int m_NumColumns;
- const int m_NumRows;
-
- static const QString m_MimeType;
-};
-
-#endif
-
diff --git a/src/gui/src/ScreenSetupView.cpp b/src/gui/src/ScreenSetupView.cpp
deleted file mode 100644
index b238eaedc..000000000
--- a/src/gui/src/ScreenSetupView.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "ScreenSetupView.h"
-#include "ScreenSetupModel.h"
-#include "ScreenSettingsDialog.h"
-
-#include
-#include
-
-ScreenSetupView::ScreenSetupView(QWidget* parent) :
- QTableView(parent)
-{
- setDropIndicatorShown(true);
- setDragDropMode(DragDrop);
- setSelectionMode(SingleSelection);
-
- setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-
- setIconSize(QSize(64, 64));
- horizontalHeader()->hide();
- verticalHeader()->hide();
-}
-
-void ScreenSetupView::setModel(ScreenSetupModel* model)
-{
- QTableView::setModel(model);
- setTableSize();
-}
-
-ScreenSetupModel* ScreenSetupView::model() const
-{
- return qobject_cast(QTableView::model());
-}
-
-void ScreenSetupView::setTableSize()
-{
- for (int i = 0; i < model()->columnCount(); i++)
- setColumnWidth(i, width() / model()->columnCount());
-
- for (int i = 0; i < model()->rowCount(); i++)
- setRowHeight(i, height() / model()->rowCount());
-}
-
-void ScreenSetupView::resizeEvent(QResizeEvent* event)
-{
- setTableSize();
- event->ignore();
-}
-
-void ScreenSetupView::mouseDoubleClickEvent(QMouseEvent* event)
-{
- if (event->buttons() & Qt::LeftButton)
- {
- int col = columnAt(event->pos().x());
- int row = rowAt(event->pos().y());
-
- if (!model()->screen(col, row).isNull())
- {
- ScreenSettingsDialog dlg(this, &model()->screen(col, row));
- dlg.exec();
- }
- }
- else
- event->ignore();
-}
-
-void ScreenSetupView::dragEnterEvent(QDragEnterEvent* event)
-{
- // we accept anything that enters us by a drag as long as the
- // mime type is okay. anything else is dealt with in dragMoveEvent()
- if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType()))
- event->accept();
- else
- event->ignore();
-}
-
-void ScreenSetupView::dragMoveEvent(QDragMoveEvent* event)
-{
- if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType()))
- {
- // where does the event come from? myself or someone else?
- if (event->source() == this)
- {
- // myself is ok, but then it must be a move action, never a copy
- event->setDropAction(Qt::MoveAction);
- event->accept();
- }
- else
- {
- int col = columnAt(event->pos().x());
- int row = rowAt(event->pos().y());
-
- // a drop from outside is not allowed if there's a screen already there.
- if (!model()->screen(col, row).isNull())
- event->ignore();
- else
- event->acceptProposedAction();
- }
- }
- else
- event->ignore();
-}
-
-// this is reimplemented from QAbstractItemView::startDrag()
-void ScreenSetupView::startDrag(Qt::DropActions)
-{
- QModelIndexList indexes = selectedIndexes();
-
- if (indexes.count() != 1)
- return;
-
- QMimeData* pData = model()->mimeData(indexes);
- if (pData == NULL)
- return;
-
- QPixmap pixmap = *model()->screen(indexes[0]).pixmap();
- QDrag* pDrag = new QDrag(this);
- pDrag->setPixmap(pixmap);
- pDrag->setMimeData(pData);
- pDrag->setHotSpot(QPoint(pixmap.width() / 2, pixmap.height() / 2));
-
- if (pDrag->exec(Qt::MoveAction, Qt::MoveAction) == Qt::MoveAction)
- {
- selectionModel()->clear();
-
- // make sure to only delete the drag source if screens weren't swapped
- // see ScreenSetupModel::dropMimeData
- if (!model()->screen(indexes[0]).swapped())
- model()->screen(indexes[0]) = Screen();
- else
- model()->screen(indexes[0]).setSwapped(false);
- }
-}
-
-QStyleOptionViewItem ScreenSetupView::viewOptions() const
-{
- QStyleOptionViewItem option = QTableView::viewOptions();
- option.showDecorationSelected = true;
- option.decorationPosition = QStyleOptionViewItem::Top;
- option.displayAlignment = Qt::AlignCenter;
- option.textElideMode = Qt::ElideMiddle;
- return option;
-}
-
diff --git a/src/gui/src/ScreenSetupView.h b/src/gui/src/ScreenSetupView.h
deleted file mode 100644
index b6e4d156d..000000000
--- a/src/gui/src/ScreenSetupView.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(SCREENSETUPVIEW__H)
-
-#define SCREENSETUPVIEW__H
-
-#include
-#include
-
-#include "Screen.h"
-
-class QWidget;
-class QMouseEvent;
-class QResizeEvent;
-class QDragEnterEvent;
-class ScreenSetupModel;
-
-class ScreenSetupView : public QTableView
-{
- Q_OBJECT
-
- public:
- ScreenSetupView(QWidget* parent);
-
- public:
- void setModel(ScreenSetupModel* model);
- ScreenSetupModel* model() const;
-
- protected:
- void mouseDoubleClickEvent(QMouseEvent*);
- void setTableSize();
- void resizeEvent(QResizeEvent*);
- void dragEnterEvent(QDragEnterEvent* event);
- void dragMoveEvent(QDragMoveEvent* event);
- void startDrag(Qt::DropActions supportedActions);
- QStyleOptionViewItem viewOptions() const;
- void scrollTo(const QModelIndex&, ScrollHint) {}
-};
-
-#endif
-
diff --git a/src/gui/src/ServerConfig.cpp b/src/gui/src/ServerConfig.cpp
deleted file mode 100644
index 386d447da..000000000
--- a/src/gui/src/ServerConfig.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "ServerConfig.h"
-#include "Hotkey.h"
-
-#include
-
-static const struct
-{
- int x;
- int y;
- const char* name;
-} neighbourDirs[] =
-{
- { 0, -1, "up" },
- { 1, 0, "right" },
- { 0, 1, "down" },
- { -1, 0, "left" },
-};
-
-
-ServerConfig::ServerConfig(QSettings* settings, int numColumns, int numRows) :
- m_pSettings(settings),
- m_Screens(),
- m_NumColumns(numColumns),
- m_NumRows(numRows)
-{
- Q_ASSERT(m_pSettings);
-
- loadSettings();
-}
-
-ServerConfig::~ServerConfig()
-{
- saveSettings();
-}
-
-bool ServerConfig::save(const QString& fileName) const
-{
- QFile file(fileName);
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
- return false;
-
- save(file);
- file.close();
-
- return true;
-}
-
-void ServerConfig::save(QFile& file) const
-{
- QTextStream outStream(&file);
- outStream << *this;
-}
-
-void ServerConfig::init()
-{
- switchCorners().clear();
- screens().clear();
-
- // m_NumSwitchCorners is used as a fixed size array. See Screen::init()
- for (int i = 0; i < NumSwitchCorners; i++)
- switchCorners() << false;
-
- // There must always be screen objects for each cell in the screens QList. Unused screens
- // are identified by having an empty name.
- for (int i = 0; i < numColumns() * numRows(); i++)
- addScreen(Screen());
-}
-
-void ServerConfig::saveSettings()
-{
- settings().beginGroup("internalConfig");
- settings().remove("");
-
- settings().setValue("numColumns", numColumns());
- settings().setValue("numRows", numRows());
-
- settings().setValue("hasHeartbeat", hasHeartbeat());
- settings().setValue("heartbeat", heartbeat());
- settings().setValue("relativeMouseMoves", relativeMouseMoves());
- settings().setValue("screenSaverSync", screenSaverSync());
- settings().setValue("win32KeepForeground", win32KeepForeground());
- settings().setValue("hasSwitchDelay", hasSwitchDelay());
- settings().setValue("switchDelay", switchDelay());
- settings().setValue("hasSwitchDoubleTap", hasSwitchDoubleTap());
- settings().setValue("switchDoubleTap", switchDoubleTap());
- settings().setValue("switchCornerSize", switchCornerSize());
-
- writeSettings(settings(), switchCorners(), "switchCorner");
-
- settings().beginWriteArray("screens");
- for (int i = 0; i < screens().size(); i++)
- {
- settings().setArrayIndex(i);
- screens()[i].saveSettings(settings());
- }
- settings().endArray();
-
- settings().beginWriteArray("hotkeys");
- for (int i = 0; i < hotkeys().size(); i++)
- {
- settings().setArrayIndex(i);
- hotkeys()[i].saveSettings(settings());
- }
- settings().endArray();
-
- settings().endGroup();
-}
-
-void ServerConfig::loadSettings()
-{
- settings().beginGroup("internalConfig");
-
- setNumColumns(settings().value("numColumns", 5).toInt());
- setNumRows(settings().value("numRows", 3).toInt());
-
- // we need to know the number of columns and rows before we can set up ourselves
- init();
-
- haveHeartbeat(settings().value("hasHeartbeat", false).toBool());
- setHeartbeat(settings().value("heartbeat", 5000).toInt());
- setRelativeMouseMoves(settings().value("relativeMouseMoves", false).toBool());
- setScreenSaverSync(settings().value("screenSaverSync", true).toBool());
- setWin32KeepForeground(settings().value("win32KeepForeground", false).toBool());
- haveSwitchDelay(settings().value("hasSwitchDelay", false).toBool());
- setSwitchDelay(settings().value("switchDelay", 250).toInt());
- haveSwitchDoubleTap(settings().value("hasSwitchDoubleTap", false).toBool());
- setSwitchDoubleTap(settings().value("switchDoubleTap", 250).toInt());
- setSwitchCornerSize(settings().value("switchCornerSize").toInt());
-
- readSettings(settings(), switchCorners(), "switchCorner", false, NumSwitchCorners);
-
- int numScreens = settings().beginReadArray("screens");
- Q_ASSERT(numScreens <= screens().size());
- for (int i = 0; i < numScreens; i++)
- {
- settings().setArrayIndex(i);
- screens()[i].loadSettings(settings());
- }
- settings().endArray();
-
- int numHotkeys = settings().beginReadArray("hotkeys");
- for (int i = 0; i < numHotkeys; i++)
- {
- settings().setArrayIndex(i);
- Hotkey h;
- h.loadSettings(settings());
- hotkeys().append(h);
- }
- settings().endArray();
-
- settings().endGroup();
-}
-
-int ServerConfig::adjacentScreenIndex(int idx, int deltaColumn, int deltaRow) const
-{
- if (screens()[idx].isNull())
- return -1;
-
- // if we're at the left or right end of the table, don't find results going further left or right
- if ((deltaColumn > 0 && (idx+1) % numColumns() == 0)
- || (deltaColumn < 0 && idx % numColumns() == 0))
- return -1;
-
- int arrayPos = idx + deltaColumn + deltaRow * numColumns();
-
- if (arrayPos >= screens().size() || arrayPos < 0)
- return -1;
-
- return arrayPos;
-}
-
-QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config)
-{
- outStream << "section: screens" << endl;
-
- foreach (const Screen& s, config.screens())
- if (!s.isNull())
- s.writeScreensSection(outStream);
-
- outStream << "end" << endl << endl;
-
- outStream << "section: aliases" << endl;
-
- foreach (const Screen& s, config.screens())
- if (!s.isNull())
- s.writeAliasesSection(outStream);
-
- outStream << "end" << endl << endl;
-
- outStream << "section: links" << endl;
-
- for (int i = 0; i < config.screens().size(); i++)
- if (!config.screens()[i].isNull())
- {
- outStream << "\t" << config.screens()[i].name() << ":" << endl;
-
- for (unsigned int j = 0; j < sizeof(neighbourDirs) / sizeof(neighbourDirs[0]); j++)
- {
- int idx = config.adjacentScreenIndex(i, neighbourDirs[j].x, neighbourDirs[j].y);
- if (idx != -1 && !config.screens()[idx].isNull())
- outStream << "\t\t" << neighbourDirs[j].name << " = " << config.screens()[idx].name() << endl;
- }
- }
-
- outStream << "end" << endl << endl;
-
- outStream << "section: options" << endl;
-
- if (config.hasHeartbeat())
- outStream << "\t" << "heartbeat = " << config.heartbeat() << endl;
-
- outStream << "\t" << "relativeMouseMoves = " << (config.relativeMouseMoves() ? "true" : "false") << endl;
- outStream << "\t" << "screenSaverSync = " << (config.screenSaverSync() ? "true" : "false") << endl;
- outStream << "\t" << "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << endl;
-
- if (config.hasSwitchDelay())
- outStream << "\t" << "switchDelay = " << config.switchDelay() << endl;
-
- if (config.hasSwitchDoubleTap())
- outStream << "\t" << "switchDoubleTap = " << config.switchDoubleTap() << endl;
-
- outStream << "\t" << "switchCorners = none ";
- for (int i = 0; i < config.switchCorners().size(); i++)
- if (config.switchCorners()[i])
- outStream << "+" << config.switchCornerName(i) << " ";
- outStream << endl;
-
- outStream << "\t" << "switchCornerSize = " << config.switchCornerSize() << endl;
-
- foreach(const Hotkey& hotkey, config.hotkeys())
- outStream << hotkey;
-
- outStream << "end" << endl << endl;
-
- return outStream;
-}
-
-int ServerConfig::numScreens() const
-{
- int rval = 0;
-
- foreach(const Screen& s, screens())
- if (!s.isNull())
- rval++;
-
- return rval;
-}
diff --git a/src/gui/src/ServerConfig.h b/src/gui/src/ServerConfig.h
deleted file mode 100644
index 327b55560..000000000
--- a/src/gui/src/ServerConfig.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(SERVERCONFIG__H)
-
-#define SERVERCONFIG__H
-
-#include
-
-#include "Screen.h"
-#include "BaseConfig.h"
-#include "Hotkey.h"
-
-class QTextStream;
-class QSettings;
-class QString;
-class QFile;
-class ServerConfigDialog;
-
-class ServerConfig : public BaseConfig
-{
- friend class ServerConfigDialog;
- friend QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config);
-
- public:
- ServerConfig(QSettings* settings, int numColumns, int numRows);
- ~ServerConfig();
-
- public:
- const ScreenList& screens() const { return m_Screens; }
- int numColumns() const { return m_NumColumns; }
- int numRows() const { return m_NumRows; }
- bool hasHeartbeat() const { return m_HasHeartbeat; }
- int heartbeat() const { return m_Heartbeat; }
- bool relativeMouseMoves() const { return m_RelativeMouseMoves; }
- bool screenSaverSync() const { return m_ScreenSaverSync; }
- bool win32KeepForeground() const { return m_Win32KeepForeground; }
- bool hasSwitchDelay() const { return m_HasSwitchDelay; }
- int switchDelay() const { return m_SwitchDelay; }
- bool hasSwitchDoubleTap() const { return m_HasSwitchDoubleTap; }
- int switchDoubleTap() const { return m_SwitchDoubleTap; }
- bool switchCorner(int c) const { return m_SwitchCorners[c]; }
- int switchCornerSize() const { return m_SwitchCornerSize; }
- const QList& switchCorners() const { return m_SwitchCorners; }
- const HotkeyList& hotkeys() const { return m_Hotkeys; }
-
- void saveSettings();
- void loadSettings();
- bool save(const QString& fileName) const;
- void save(QFile& file) const;
- int numScreens() const;
-
- protected:
- QSettings& settings() { return *m_pSettings; }
- ScreenList& screens() { return m_Screens; }
- void setScreens(const ScreenList& screens) { m_Screens = screens; }
- void addScreen(const Screen& screen) { m_Screens.append(screen); }
- void setNumColumns(int n) { m_NumColumns = n; }
- void setNumRows(int n) { m_NumRows = n; }
- void haveHeartbeat(bool on) { m_HasHeartbeat = on; }
- void setHeartbeat(int val) { m_Heartbeat = val; }
- void setRelativeMouseMoves(bool on) { m_RelativeMouseMoves = on; }
- void setScreenSaverSync(bool on) { m_ScreenSaverSync = on; }
- void setWin32KeepForeground(bool on) { m_Win32KeepForeground = on; }
- void haveSwitchDelay(bool on) { m_HasSwitchDelay = on; }
- void setSwitchDelay(int val) { m_SwitchDelay = val; }
- void haveSwitchDoubleTap(bool on) { m_HasSwitchDoubleTap = on; }
- void setSwitchDoubleTap(int val) { m_SwitchDoubleTap = val; }
- void setSwitchCorner(int c, bool on) { m_SwitchCorners[c] = on; }
- void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; }
- QList& switchCorners() { return m_SwitchCorners; }
- HotkeyList& hotkeys() { return m_Hotkeys; }
-
- void init();
- int adjacentScreenIndex(int idx, int deltaColumn, int deltaRow) const;
-
- private:
- QSettings* m_pSettings;
- ScreenList m_Screens;
- int m_NumColumns;
- int m_NumRows;
- bool m_HasHeartbeat;
- int m_Heartbeat;
- bool m_RelativeMouseMoves;
- bool m_ScreenSaverSync;
- bool m_Win32KeepForeground;
- bool m_HasSwitchDelay;
- int m_SwitchDelay;
- bool m_HasSwitchDoubleTap;
- int m_SwitchDoubleTap;
- int m_SwitchCornerSize;
- QList m_SwitchCorners;
- HotkeyList m_Hotkeys;
-};
-
-QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config);
-
-#endif
-
diff --git a/src/gui/src/ServerConfigDialog.cpp b/src/gui/src/ServerConfigDialog.cpp
deleted file mode 100644
index aea752785..000000000
--- a/src/gui/src/ServerConfigDialog.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "ServerConfigDialog.h"
-#include "ServerConfig.h"
-#include "HotkeyDialog.h"
-#include "ActionDialog.h"
-
-#include
-#include
-
-ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, const QString& defaultScreenName) :
- QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::ServerConfigDialogBase(),
- m_OrigServerConfig(config),
- m_ServerConfig(config),
- m_ScreenSetupModel(serverConfig().screens(), serverConfig().numColumns(), serverConfig().numRows())
-{
- setupUi(this);
-
- m_pCheckBoxHeartbeat->setChecked(serverConfig().hasHeartbeat());
- m_pSpinBoxHeartbeat->setValue(serverConfig().heartbeat());
-
- m_pCheckBoxRelativeMouseMoves->setChecked(serverConfig().relativeMouseMoves());
- m_pCheckBoxScreenSaverSync->setChecked(serverConfig().screenSaverSync());
- m_pCheckBoxWin32KeepForeground->setChecked(serverConfig().win32KeepForeground());
-
- m_pCheckBoxSwitchDelay->setChecked(serverConfig().hasSwitchDelay());
- m_pSpinBoxSwitchDelay->setValue(serverConfig().switchDelay());
-
- m_pCheckBoxSwitchDoubleTap->setChecked(serverConfig().hasSwitchDoubleTap());
- m_pSpinBoxSwitchDoubleTap->setValue(serverConfig().switchDoubleTap());
-
- m_pCheckBoxCornerTopLeft->setChecked(serverConfig().switchCorner(BaseConfig::TopLeft));
- m_pCheckBoxCornerTopRight->setChecked(serverConfig().switchCorner(BaseConfig::TopRight));
- m_pCheckBoxCornerBottomLeft->setChecked(serverConfig().switchCorner(BaseConfig::BottomLeft));
- m_pCheckBoxCornerBottomRight->setChecked(serverConfig().switchCorner(BaseConfig::BottomRight));
- m_pSpinBoxSwitchCornerSize->setValue(serverConfig().switchCornerSize());
-
- foreach(const Hotkey& hotkey, serverConfig().hotkeys())
- m_pListHotkeys->addItem(hotkey.text());
-
- m_pScreenSetupView->setModel(&m_ScreenSetupModel);
-
- if (serverConfig().numScreens() == 0)
- model().screen(serverConfig().numColumns() / 2, serverConfig().numRows() / 2) = Screen(defaultScreenName);
-}
-
-void ServerConfigDialog::accept()
-{
- serverConfig().haveHeartbeat(m_pCheckBoxHeartbeat->isChecked());
- serverConfig().setHeartbeat(m_pSpinBoxHeartbeat->value());
-
- serverConfig().setRelativeMouseMoves(m_pCheckBoxRelativeMouseMoves->isChecked());
- serverConfig().setScreenSaverSync(m_pCheckBoxScreenSaverSync->isChecked());
- serverConfig().setWin32KeepForeground(m_pCheckBoxWin32KeepForeground->isChecked());
-
- serverConfig().haveSwitchDelay(m_pCheckBoxSwitchDelay->isChecked());
- serverConfig().setSwitchDelay(m_pSpinBoxSwitchDelay->value());
-
- serverConfig().haveSwitchDoubleTap(m_pCheckBoxSwitchDoubleTap->isChecked());
- serverConfig().setSwitchDoubleTap(m_pSpinBoxSwitchDoubleTap->value());
-
- serverConfig().setSwitchCorner(BaseConfig::TopLeft, m_pCheckBoxCornerTopLeft->isChecked());
- serverConfig().setSwitchCorner(BaseConfig::TopRight, m_pCheckBoxCornerTopRight->isChecked());
- serverConfig().setSwitchCorner(BaseConfig::BottomLeft, m_pCheckBoxCornerBottomLeft->isChecked());
- serverConfig().setSwitchCorner(BaseConfig::BottomRight, m_pCheckBoxCornerBottomRight->isChecked());
- serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
-
- // now that the dialog has been accepted, copy the new server config to the original one,
- // which is a reference to the one in MainWindow.
- setOrigServerConfig(serverConfig());
-
- QDialog::accept();
-}
-
-void ServerConfigDialog::on_m_pButtonNewHotkey_clicked()
-{
- Hotkey hotkey;
- HotkeyDialog dlg(this, hotkey);
- if (dlg.exec() == QDialog::Accepted)
- {
- serverConfig().hotkeys().append(hotkey);
- m_pListHotkeys->addItem(hotkey.text());
- }
-}
-
-void ServerConfigDialog::on_m_pButtonEditHotkey_clicked()
-{
- int idx = m_pListHotkeys->currentRow();
- Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
- Hotkey& hotkey = serverConfig().hotkeys()[idx];
- HotkeyDialog dlg(this, hotkey);
- if (dlg.exec() == QDialog::Accepted)
- m_pListHotkeys->currentItem()->setText(hotkey.text());
-}
-
-void ServerConfigDialog::on_m_pButtonRemoveHotkey_clicked()
-{
- int idx = m_pListHotkeys->currentRow();
- Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
- serverConfig().hotkeys().removeAt(idx);
- m_pListActions->clear();
- delete m_pListHotkeys->item(idx);
-}
-
-void ServerConfigDialog::on_m_pListHotkeys_itemSelectionChanged()
-{
- bool itemsSelected = !m_pListHotkeys->selectedItems().isEmpty();
- m_pButtonEditHotkey->setEnabled(itemsSelected);
- m_pButtonRemoveHotkey->setEnabled(itemsSelected);
- m_pButtonNewAction->setEnabled(itemsSelected);
-
- if (itemsSelected && serverConfig().hotkeys().size() > 0)
- {
- m_pListActions->clear();
-
- int idx = m_pListHotkeys->row(m_pListHotkeys->selectedItems()[0]);
-
- // There's a bug somewhere around here: We get idx == 1 right after we deleted the next to last item, so idx can
- // only possibly be 0. GDB shows we got called indirectly from the delete line in
- // on_m_pButtonRemoveHotkey_clicked() above, but the delete is of course necessary and seems correct.
- // The while() is a generalized workaround for all that and shouldn't be required.
- while (idx >= 0 && idx >= serverConfig().hotkeys().size())
- idx--;
-
- Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
-
- const Hotkey& hotkey = serverConfig().hotkeys()[idx];
- foreach(const Action& action, hotkey.actions())
- m_pListActions->addItem(action.text());
- }
-}
-
-void ServerConfigDialog::on_m_pButtonNewAction_clicked()
-{
- int idx = m_pListHotkeys->currentRow();
- Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
- Hotkey& hotkey = serverConfig().hotkeys()[idx];
-
- Action action;
- ActionDialog dlg(this, serverConfig(), hotkey, action);
- if (dlg.exec() == QDialog::Accepted)
- {
- hotkey.actions().append(action);
- m_pListActions->addItem(action.text());
- }
-}
-
-void ServerConfigDialog::on_m_pButtonEditAction_clicked()
-{
- int idxHotkey = m_pListHotkeys->currentRow();
- Q_ASSERT(idxHotkey >= 0 && idxHotkey < serverConfig().hotkeys().size());
- Hotkey& hotkey = serverConfig().hotkeys()[idxHotkey];
-
- int idxAction = m_pListActions->currentRow();
- Q_ASSERT(idxAction >= 0 && idxAction < hotkey.actions().size());
- Action& action = hotkey.actions()[idxAction];
-
- ActionDialog dlg(this, serverConfig(), hotkey, action);
- if (dlg.exec() == QDialog::Accepted)
- m_pListActions->currentItem()->setText(action.text());
-}
-
-void ServerConfigDialog::on_m_pButtonRemoveAction_clicked()
-{
- int idxHotkey = m_pListHotkeys->currentRow();
- Q_ASSERT(idxHotkey >= 0 && idxHotkey < serverConfig().hotkeys().size());
- Hotkey& hotkey = serverConfig().hotkeys()[idxHotkey];
-
- int idxAction = m_pListActions->currentRow();
- Q_ASSERT(idxAction >= 0 && idxAction < hotkey.actions().size());
-
- hotkey.actions().removeAt(idxAction);
- delete m_pListActions->currentItem();
-}
-
-void ServerConfigDialog::on_m_pListActions_itemSelectionChanged()
-{
- m_pButtonEditAction->setEnabled(!m_pListActions->selectedItems().isEmpty());
- m_pButtonRemoveAction->setEnabled(!m_pListActions->selectedItems().isEmpty());
-}
diff --git a/src/gui/src/ServerConfigDialog.h b/src/gui/src/ServerConfigDialog.h
deleted file mode 100644
index 9fb34b163..000000000
--- a/src/gui/src/ServerConfigDialog.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(SERVERCONFIGDIALOG__H)
-
-#define SERVERCONFIGDIALOG__H
-
-#include "ScreenSetupModel.h"
-#include "ServerConfig.h"
-
-#include "ui_ServerConfigDialogBase.h"
-
-#include
-
-class ServerConfigDialog : public QDialog, public Ui::ServerConfigDialogBase
-{
- Q_OBJECT
-
- public:
- ServerConfigDialog(QWidget* parent, ServerConfig& config, const QString& defaultScreenName);
-
- public slots:
- void accept();
-
- protected slots:
- void on_m_pButtonNewHotkey_clicked();
- void on_m_pListHotkeys_itemSelectionChanged();
- void on_m_pButtonEditHotkey_clicked();
- void on_m_pButtonRemoveHotkey_clicked();
-
- void on_m_pButtonNewAction_clicked();
- void on_m_pListActions_itemSelectionChanged();
- void on_m_pButtonEditAction_clicked();
- void on_m_pButtonRemoveAction_clicked();
-
- protected:
- ServerConfig& serverConfig() { return m_ServerConfig; }
- void setOrigServerConfig(const ServerConfig& s) { m_OrigServerConfig = s; }
- ScreenSetupModel& model() { return m_ScreenSetupModel; }
-
- private:
- ServerConfig& m_OrigServerConfig;
- ServerConfig m_ServerConfig;
- ScreenSetupModel m_ScreenSetupModel;
-};
-
-#endif
-
diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp
deleted file mode 100644
index fbbb5f447..000000000
--- a/src/gui/src/SettingsDialog.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "SettingsDialog.h"
-
-#include
-#include
-
-#include "AppConfig.h"
-
-SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) :
- QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::SettingsDialogBase(),
- m_AppConfig(config)
-{
- setupUi(this);
-
- m_pCheckBoxAutoConnect->setChecked(appConfig().autoConnect());
- m_pLineEditSynergyc->setText(appConfig().synergyc());
- m_pLineEditSynergys->setText(appConfig().synergys());
- m_pLineEditScreenName->setText(appConfig().screenName());
- m_pSpinBoxPort->setValue(appConfig().port());
- m_pLineEditInterface->setText(appConfig().interface());
- m_pComboLogLevel->setCurrentIndex(appConfig().logLevel());
- m_pCheckBoxAutoDetectPaths->setChecked(appConfig().autoDetectPaths());
- m_pCheckBoxLogToFile->setChecked(appConfig().logToFile());
- m_pLineEditLogFilename->setText(appConfig().logFilename());
-}
-
-QString SettingsDialog::browseForSynergyc(QWidget* parent, const QString& programDir, const QString& synergycName)
-{
- return QFileDialog::getOpenFileName(parent, tr("Browse for synergyc executable"), programDir, synergycName);
-}
-
-QString SettingsDialog::browseForSynergys(QWidget* parent, const QString& programDir, const QString& synergysName)
-{
- return QFileDialog::getOpenFileName(parent, tr("Browse for synergys executable"), programDir, synergysName);
-}
-bool SettingsDialog::on_m_pButtonBrowseSynergys_clicked()
-{
- QString fileName = browseForSynergys(this, appConfig().synergyProgramDir(), appConfig().synergysName());
-
- if (!fileName.isEmpty())
- {
- m_pLineEditSynergys->setText(fileName);
- return true;
- }
-
- return false;
-}
-
-bool SettingsDialog::on_m_pButtonBrowseSynergyc_clicked()
-{
- QString fileName = browseForSynergyc(this, appConfig().synergyProgramDir(), appConfig().synergycName());
-
- if (!fileName.isEmpty())
- {
- m_pLineEditSynergyc->setText(fileName);
- return true;
- }
-
- return false;
-}
-
-void SettingsDialog::on_m_pCheckBoxAutoDetectPaths_stateChanged(int i)
-{
- bool unchecked = i == 0;
- m_pLineEditSynergyc->setEnabled(unchecked);
- m_pLineEditSynergys->setEnabled(unchecked);
- m_pButtonBrowseSynergyc->setEnabled(unchecked);
- m_pButtonBrowseSynergys->setEnabled(unchecked);
-}
-
-void SettingsDialog::accept()
-{
- appConfig().setAutoConnect(m_pCheckBoxAutoConnect->isChecked());
- appConfig().setSynergyc(m_pLineEditSynergyc->text());
- appConfig().setSynergys(m_pLineEditSynergys->text());
- appConfig().setScreenName(m_pLineEditScreenName->text());
- appConfig().setPort(m_pSpinBoxPort->value());
- appConfig().setInterface(m_pLineEditInterface->text());
- appConfig().setLogLevel(m_pComboLogLevel->currentIndex());
- appConfig().setAutoDetectPaths(m_pCheckBoxAutoDetectPaths->isChecked());
- appConfig().setLogToFile(m_pCheckBoxLogToFile->isChecked());
- appConfig().setLogFilename(m_pLineEditLogFilename->text());
-
- QDialog::accept();
-}
-
-void SettingsDialog::on_m_pCheckBoxLogToFile_stateChanged(int i)
-{
- bool checked = i == 2;
-
- m_pLineEditLogFilename->setEnabled(checked);
- m_pButtonBrowseLog->setEnabled(checked);
-}
-
-void SettingsDialog::on_m_pButtonBrowseLog_clicked()
-{
- QString fileName = QFileDialog::getSaveFileName(
- this, tr("Save log file to..."),
- m_pLineEditLogFilename->text(),
- "Logs (*.log *.txt)");
-
- if (!fileName.isEmpty())
- {
- m_pLineEditLogFilename->setText(fileName);
- }
-}
diff --git a/src/gui/src/SettingsDialog.h b/src/gui/src/SettingsDialog.h
deleted file mode 100644
index b567ab4ea..000000000
--- a/src/gui/src/SettingsDialog.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(SETTINGSDIALOG_H)
-
-#define SETTINGSDIALOG_H
-
-#include
-#include "ui_SettingsDialogBase.h"
-
-class AppConfig;
-
-class SettingsDialog : public QDialog, public Ui::SettingsDialogBase
-{
- Q_OBJECT
-
- public:
- SettingsDialog(QWidget* parent, AppConfig& config);
- static QString browseForSynergyc(QWidget* parent, const QString& programDir, const QString& synergycName);
- static QString browseForSynergys(QWidget* parent, const QString& programDir, const QString& synergysName);
-
- protected:
- void accept();
- AppConfig& appConfig() { return m_AppConfig; }
-
- private:
- AppConfig& m_AppConfig;
-
- private slots:
- void on_m_pCheckBoxLogToFile_stateChanged(int );
- bool on_m_pButtonBrowseSynergys_clicked();
- bool on_m_pButtonBrowseSynergyc_clicked();
- void on_m_pCheckBoxAutoDetectPaths_stateChanged(int i);
- void on_m_pButtonBrowseLog_clicked();
-};
-
-#endif
diff --git a/src/gui/src/TrashScreenWidget.cpp b/src/gui/src/TrashScreenWidget.cpp
deleted file mode 100644
index 1be9aabcf..000000000
--- a/src/gui/src/TrashScreenWidget.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "TrashScreenWidget.h"
-#include "ScreenSetupModel.h"
-
-#include
-#include
-
-void TrashScreenWidget::dragEnterEvent(QDragEnterEvent* event)
-{
- if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType()))
- {
- event->setDropAction(Qt::MoveAction);
- event->accept();
- }
- else
- event->ignore();
-}
-
-void TrashScreenWidget::dropEvent(QDropEvent* event)
-{
- if (event->mimeData()->hasFormat(ScreenSetupModel::mimeType()))
- event->acceptProposedAction();
- else
- event->ignore();
-}
-
diff --git a/src/gui/src/TrashScreenWidget.h b/src/gui/src/TrashScreenWidget.h
deleted file mode 100644
index 34a5608ea..000000000
--- a/src/gui/src/TrashScreenWidget.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if !defined(TRASHSCREENWIDGET__H)
-
-#define TRASHSCREENWIDGET__H
-
-#include
-
-class QWidget;
-class QDragEnterEvent;
-class QDropEvent;
-
-class TrashScreenWidget : public QLabel
-{
- Q_OBJECT
-
- public:
- TrashScreenWidget(QWidget* parent) : QLabel(parent) {}
-
- public:
- void dragEnterEvent(QDragEnterEvent* event);
- void dropEvent(QDropEvent* event);
-};
-
-#endif
-
diff --git a/src/gui/src/WindowsServices.cpp b/src/gui/src/WindowsServices.cpp
deleted file mode 100644
index e0c1b3d09..000000000
--- a/src/gui/src/WindowsServices.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "WindowsServices.h"
-#include "AppConfig.h"
-#include "MainWindow.h"
-#include "LogDialog.h"
-
-#include
-#include
-#include
-#include
-
-WindowsServices::WindowsServices(QWidget* parent, AppConfig& appConfig) :
- QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::WindowsServicesBase(),
- m_appConfig(appConfig),
- m_log(new LogDialog(this, process()))
-{
- setupUi(this);
-}
-
-void WindowsServices::runProc(const QString& app, const QStringList& args, QPushButton* button)
-{
- // disable until we know we've finished
- button->setEnabled(false);
-
- // clear contents so user doesn't get confused by previous messages
- m_log->clear();
-
- // deleted at end of function
- QProcess proc(this);
- m_process = &proc;
-
- // send output to log window
- connect(m_process, SIGNAL(readyReadStandardOutput()), m_log, SLOT(readSynergyOutput()));
- connect(m_process, SIGNAL(readyReadStandardError()), m_log, SLOT(readSynergyOutput()));
-
- m_process->start(app, args);
- m_log->show();
-
- // service management should be instant
- m_process->waitForFinished();
-
- if (m_process->exitCode() == 0)
- {
- QMessageBox::information(m_log, "Service manager", "Completed successfully.");
- }
- else
- {
- QMessageBox::critical(
- m_log, "Service manager error",
- QString("Unable to install or uninstall service. Error code: " +
- QString::number(m_process->exitCode())));
- }
-
- disconnect(m_process, SIGNAL(readyReadStandardOutput()), m_log, SLOT(readSynergyOutput()));
- disconnect(m_process, SIGNAL(readyReadStandardError()), m_log, SLOT(readSynergyOutput()));
-
- button->setEnabled(true);
-}
-
-void WindowsServices::on_m_pInstallServer_clicked()
-{
- QString app = mainWindow()->appPath(
- appConfig().synergysName(), appConfig().synergys());
-
- QStringList args;
- args <<
- "--service" << "install" <<
- "--relaunch" <<
- "--debug" << appConfig().logLevelText() <<
- "-c" << mainWindow()->configFilename() <<
- "--address" << mainWindow()->address();
-
- if (appConfig().logToFile())
- {
- appConfig().persistLogDir();
- args << "--log" << appConfig().logFilename();
- }
-
- runProc(app, args, m_pInstallServer);
-}
-
-void WindowsServices::on_m_pUninstallServer_clicked()
-{
- QString app = mainWindow()->appPath(
- appConfig().synergysName(), appConfig().synergys());
-
- QStringList args;
- args << "--service" << "uninstall";
- runProc(app, args, m_pInstallServer);
-}
-
-void WindowsServices::on_m_pInstallClient_clicked()
-{
- if (mainWindow()->hostname().isEmpty())
- {
- QMessageBox::critical(
- this, "Service manager error", "Hostname was not specified on main screen.");
- return;
- }
-
- QString app = mainWindow()->appPath(
- appConfig().synergycName(), appConfig().synergyc());
-
- QStringList args;
- args <<
- "--service" << "install" <<
- "--relaunch" <<
- "--debug" << appConfig().logLevelText();
-
- if (appConfig().logToFile())
- {
- appConfig().persistLogDir();
- args << "--log" << appConfig().logFilename();
- }
-
- // hostname must come last to be a valid arg
- args << mainWindow()->hostname();
-
- runProc(app, args, m_pInstallServer);
-}
-
-void WindowsServices::on_m_pUninstallClient_clicked()
-{
- QString app = mainWindow()->appPath(
- appConfig().synergycName(), appConfig().synergyc());
-
- QStringList args;
- args << "--service" << "uninstall";
- runProc(app, args, m_pInstallServer);
-}
diff --git a/src/gui/src/WindowsServices.h b/src/gui/src/WindowsServices.h
deleted file mode 100644
index fbbb445b3..000000000
--- a/src/gui/src/WindowsServices.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef WINDOWSSERVICES_H
-#define WINDOWSSERVICES_H
-
-#include "ui_WindowsServicesBase.h"
-
-class QWidget;
-class QProcess;
-class QPushButton;
-class QProcess;
-
-class AppConfig;
-class MainWindow;
-class LogDialog;
-
-class WindowsServices : public QDialog, public Ui::WindowsServicesBase
-{
- Q_OBJECT
-
- public:
- WindowsServices(QWidget* parent, AppConfig& appConfig);
-
- protected:
- AppConfig &appConfig() const { return m_appConfig; }
- MainWindow* mainWindow() const { return (MainWindow*)parent(); }
- QProcess*& process() { return m_process; }
- void runProc(const QString& app, const QStringList& args, QPushButton* button);
-
- private:
- QString m_app;
- AppConfig &m_appConfig;
- QProcess* m_process;
- LogDialog* m_log;
-
- private slots:
- void on_m_pUninstallClient_clicked();
- void on_m_pInstallClient_clicked();
- void on_m_pUninstallServer_clicked();
- void on_m_pInstallServer_clicked();
-};
-
-#endif // WINDOWSSERVICES_H
diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp
deleted file mode 100644
index f8d5a114c..000000000
--- a/src/gui/src/main.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2008 Volker Lanz (vl@fidra.de)
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "QSynergyApplication.h"
-#include "MainWindow.h"
-
-#include
-#include
-
-int main(int argc, char* argv[])
-{
- QCoreApplication::setOrganizationName("The Synergy Project");
- QCoreApplication::setOrganizationDomain("http://synergy-foss.org/");
- QCoreApplication::setApplicationName("Synergy");
-
- QSynergyApplication app(argc, argv);
-
-#if !defined(Q_OS_MAC)
- if (!QSystemTrayIcon::isSystemTrayAvailable())
- {
- QMessageBox::critical(NULL, "Synergy", QObject::tr("There doesn't seem to be a system tray available. Quitting."));
- return -1;
- }
-
- QApplication::setQuitOnLastWindowClosed(false);
-#endif
-
- QTranslator qtTranslator;
- qtTranslator.load("qt_" + QLocale::system().name());
- app.installTranslator(&qtTranslator);
-
- QTranslator myappTranslator;
- myappTranslator.load("res/lang/QSynergy_" + QLocale::system().name());
- app.installTranslator(&myappTranslator);
-
- MainWindow mainWindow(NULL);
- return app.exec();
-}
-
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
deleted file mode 100644
index 4cbb3c780..000000000
--- a/src/lib/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-# synergy -- mouse and keyboard sharing utility
-# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-add_subdirectory(arch)
-add_subdirectory(base)
-add_subdirectory(client)
-add_subdirectory(common)
-add_subdirectory(io)
-add_subdirectory(mt)
-add_subdirectory(net)
-add_subdirectory(platform)
-add_subdirectory(server)
-add_subdirectory(synergy)
diff --git a/src/lib/arch/CArch.cpp b/src/lib/arch/CArch.cpp
deleted file mode 100644
index 4186c084a..000000000
--- a/src/lib/arch/CArch.cpp
+++ /dev/null
@@ -1,681 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "common.h"
-#include "CArch.h"
-#include "CLog.h"
-
-#undef ARCH_CONSOLE
-#undef ARCH_DAEMON
-#undef ARCH_FILE
-#undef ARCH_LOG
-#undef ARCH_MULTITHREAD
-#undef ARCH_NETWORK
-#undef ARCH_SLEEP
-#undef ARCH_STRING
-#undef ARCH_SYSTEM
-#undef ARCH_TASKBAR
-#undef ARCH_TIME
-
-// include appropriate architecture implementation
-#if SYSAPI_WIN32
-# include "CArchConsoleWindows.h"
-# include "CArchDaemonWindows.h"
-# include "CArchFileWindows.h"
-# include "CArchLogWindows.h"
-# include "CArchMiscWindows.h"
-# include "CArchMultithreadWindows.h"
-# include "CArchNetworkWinsock.h"
-# include "CArchSleepWindows.h"
-# include "CArchStringWindows.h"
-# include "CArchSystemWindows.h"
-# include "CArchTaskBarWindows.h"
-# include "CArchTimeWindows.h"
-# include "CArchAppUtilWindows.h"
-#elif SYSAPI_UNIX
-# include "CArchConsoleUnix.h"
-# include "CArchDaemonUnix.h"
-# include "CArchFileUnix.h"
-# include "CArchLogUnix.h"
-# if HAVE_PTHREAD
-# include "CArchMultithreadPosix.h"
-# endif
-# include "CArchNetworkBSD.h"
-# include "CArchSleepUnix.h"
-# include "CArchStringUnix.h"
-# include "CArchSystemUnix.h"
-# include "CArchTaskBarXWindows.h"
-# include "CArchTimeUnix.h"
-# include "CArchAppUtilUnix.h"
-#endif
-
-#if !defined(ARCH_CONSOLE)
-# error unsupported platform for console
-#endif
-
-#if !defined(ARCH_DAEMON)
-# error unsupported platform for daemon
-#endif
-
-#if !defined(ARCH_FILE)
-# error unsupported platform for file
-#endif
-
-#if !defined(ARCH_LOG)
-# error unsupported platform for logging
-#endif
-
-#if !defined(ARCH_MULTITHREAD)
-# error unsupported platform for multithreading
-#endif
-
-#if !defined(ARCH_NETWORK)
-# error unsupported platform for network
-#endif
-
-#if !defined(ARCH_SLEEP)
-# error unsupported platform for sleep
-#endif
-
-#if !defined(ARCH_STRING)
-# error unsupported platform for string
-#endif
-
-#if !defined(ARCH_SYSTEM)
-# error unsupported platform for system
-#endif
-
-#if !defined(ARCH_TASKBAR)
-# error unsupported platform for taskbar
-#endif
-
-#if !defined(ARCH_TIME)
-# error unsupported platform for time
-#endif
-
-#if !defined(ARCH_APPUTIL)
-# error unsupported platform for app util
-#endif
-
-//
-// CArch
-//
-
-CArch* CArch::s_instance = NULL;
-
-CArch::CArch()
-{
- // only once instance of CArch
- assert(s_instance == NULL);
- s_instance = this;
-
- // create architecture implementation objects
- m_mt = new ARCH_MULTITHREAD;
- m_system = new ARCH_SYSTEM;
- m_file = new ARCH_FILE;
- m_log = new ARCH_LOG;
- m_net = new ARCH_NETWORK;
- m_sleep = new ARCH_SLEEP;
- m_string = new ARCH_STRING;
- m_time = new ARCH_TIME;
- m_console = new ARCH_CONSOLE;
- m_daemon = new ARCH_DAEMON;
- m_taskbar = new ARCH_TASKBAR;
- m_appUtil = new ARCH_APPUTIL;
-
-#if SYSAPI_WIN32
- CArchMiscWindows::init();
-#endif
-}
-
-CArch::~CArch()
-{
- // clean up
- delete m_taskbar;
- delete m_daemon;
- delete m_console;
- delete m_time;
- delete m_string;
- delete m_sleep;
- delete m_net;
- delete m_log;
- delete m_file;
- delete m_system;
- delete m_mt;
- delete m_appUtil;
-
- // no instance
- s_instance = NULL;
-}
-
-CArch*
-CArch::getInstance()
-{
- assert(s_instance != NULL);
-
- return s_instance;
-}
-
-void
-CArch::openConsole(const char* title)
-{
- m_console->openConsole(title);
-}
-
-void
-CArch::closeConsole()
-{
- m_console->closeConsole();
-}
-
-void
-CArch::showConsole(bool showIfEmpty)
-{
- m_console->showConsole(showIfEmpty);
-}
-
-void
-CArch::writeConsole(ELevel level, const char* str)
-{
- m_console->writeConsole(level, str);
-}
-
-void
-CArch::installDaemon(const char* name,
- const char* description,
- const char* pathname,
- const char* commandLine,
- const char* dependencies,
- bool allUsers)
-{
- m_daemon->installDaemon(name, description, pathname,
- commandLine, dependencies, allUsers);
-}
-
-void
-CArch::uninstallDaemon(const char* name, bool allUsers)
-{
- m_daemon->uninstallDaemon(name, allUsers);
-}
-
-int
-CArch::daemonize(const char* name, DaemonFunc func)
-{
- return m_daemon->daemonize(name, func);
-}
-
-bool
-CArch::canInstallDaemon(const char* name, bool allUsers)
-{
- return m_daemon->canInstallDaemon(name, allUsers);
-}
-
-bool
-CArch::isDaemonInstalled(const char* name, bool allUsers)
-{
- return m_daemon->isDaemonInstalled(name, allUsers);
-}
-
-const char*
-CArch::getBasename(const char* pathname)
-{
- return m_file->getBasename(pathname);
-}
-
-std::string
-CArch::getUserDirectory()
-{
- return m_file->getUserDirectory();
-}
-
-std::string
-CArch::getSystemDirectory()
-{
- return m_file->getSystemDirectory();
-}
-
-std::string
-CArch::concatPath(const std::string& prefix, const std::string& suffix)
-{
- return m_file->concatPath(prefix, suffix);
-}
-
-void
-CArch::openLog(const char* name)
-{
- m_log->openLog(name);
-}
-
-void
-CArch::closeLog()
-{
- m_log->closeLog();
-}
-
-void
-CArch::showLog(bool showIfEmpty)
-{
- m_log->showLog(showIfEmpty);
-}
-
-void
-CArch::writeLog(ELevel level, const char* msg)
-{
- m_log->writeLog(level, msg);
-}
-
-CArchCond
-CArch::newCondVar()
-{
- return m_mt->newCondVar();
-}
-
-void
-CArch::closeCondVar(CArchCond cond)
-{
- m_mt->closeCondVar(cond);
-}
-
-void
-CArch::signalCondVar(CArchCond cond)
-{
- m_mt->signalCondVar(cond);
-}
-
-void
-CArch::broadcastCondVar(CArchCond cond)
-{
- m_mt->broadcastCondVar(cond);
-}
-
-bool
-CArch::waitCondVar(CArchCond cond, CArchMutex mutex, double timeout)
-{
- return m_mt->waitCondVar(cond, mutex, timeout);
-}
-
-CArchMutex
-CArch::newMutex()
-{
- return m_mt->newMutex();
-}
-
-void
-CArch::closeMutex(CArchMutex mutex)
-{
- m_mt->closeMutex(mutex);
-}
-
-void
-CArch::lockMutex(CArchMutex mutex)
-{
- m_mt->lockMutex(mutex);
-}
-
-void
-CArch::unlockMutex(CArchMutex mutex)
-{
- m_mt->unlockMutex(mutex);
-}
-
-CArchThread
-CArch::newThread(ThreadFunc func, void* data)
-{
- return m_mt->newThread(func, data);
-}
-
-CArchThread
-CArch::newCurrentThread()
-{
- return m_mt->newCurrentThread();
-}
-
-CArchThread
-CArch::copyThread(CArchThread thread)
-{
- return m_mt->copyThread(thread);
-}
-
-void
-CArch::closeThread(CArchThread thread)
-{
- m_mt->closeThread(thread);
-}
-
-void
-CArch::cancelThread(CArchThread thread)
-{
- m_mt->cancelThread(thread);
-}
-
-void
-CArch::setPriorityOfThread(CArchThread thread, int n)
-{
- m_mt->setPriorityOfThread(thread, n);
-}
-
-void
-CArch::testCancelThread()
-{
- m_mt->testCancelThread();
-}
-
-bool
-CArch::wait(CArchThread thread, double timeout)
-{
- return m_mt->wait(thread, timeout);
-}
-
-bool
-CArch::isSameThread(CArchThread thread1, CArchThread thread2)
-{
- return m_mt->isSameThread(thread1, thread2);
-}
-
-bool
-CArch::isExitedThread(CArchThread thread)
-{
- return m_mt->isExitedThread(thread);
-}
-
-void*
-CArch::getResultOfThread(CArchThread thread)
-{
- return m_mt->getResultOfThread(thread);
-}
-
-IArchMultithread::ThreadID
-CArch::getIDOfThread(CArchThread thread)
-{
- return m_mt->getIDOfThread(thread);
-}
-
-void
-CArch::setSignalHandler(ESignal signal, SignalFunc func, void* userData)
-{
- m_mt->setSignalHandler(signal, func, userData);
-}
-
-void
-CArch::raiseSignal(ESignal signal)
-{
- m_mt->raiseSignal(signal);
-}
-
-CArchSocket
-CArch::newSocket(EAddressFamily family, ESocketType type)
-{
- return m_net->newSocket(family, type);
-}
-
-CArchSocket
-CArch::copySocket(CArchSocket s)
-{
- return m_net->copySocket(s);
-}
-
-void
-CArch::closeSocket(CArchSocket s)
-{
- m_net->closeSocket(s);
-}
-
-void
-CArch::closeSocketForRead(CArchSocket s)
-{
- m_net->closeSocketForRead(s);
-}
-
-void
-CArch::closeSocketForWrite(CArchSocket s)
-{
- m_net->closeSocketForWrite(s);
-}
-
-void
-CArch::bindSocket(CArchSocket s, CArchNetAddress addr)
-{
- m_net->bindSocket(s, addr);
-}
-
-void
-CArch::listenOnSocket(CArchSocket s)
-{
- m_net->listenOnSocket(s);
-}
-
-CArchSocket
-CArch::acceptSocket(CArchSocket s, CArchNetAddress* addr)
-{
- return m_net->acceptSocket(s, addr);
-}
-
-bool
-CArch::connectSocket(CArchSocket s, CArchNetAddress name)
-{
- return m_net->connectSocket(s, name);
-}
-
-int
-CArch::pollSocket(CPollEntry pe[], int num, double timeout)
-{
- return m_net->pollSocket(pe, num, timeout);
-}
-
-void
-CArch::unblockPollSocket(CArchThread thread)
-{
- m_net->unblockPollSocket(thread);
-}
-
-size_t
-CArch::readSocket(CArchSocket s, void* buf, size_t len)
-{
- return m_net->readSocket(s, buf, len);
-}
-
-size_t
-CArch::writeSocket(CArchSocket s, const void* buf, size_t len)
-{
- return m_net->writeSocket(s, buf, len);
-}
-
-void
-CArch::throwErrorOnSocket(CArchSocket s)
-{
- m_net->throwErrorOnSocket(s);
-}
-
-bool
-CArch::setNoDelayOnSocket(CArchSocket s, bool noDelay)
-{
- return m_net->setNoDelayOnSocket(s, noDelay);
-}
-
-bool
-CArch::setReuseAddrOnSocket(CArchSocket s, bool reuse)
-{
- return m_net->setReuseAddrOnSocket(s, reuse);
-}
-
-std::string
-CArch::getHostName()
-{
- return m_net->getHostName();
-}
-
-CArchNetAddress
-CArch::newAnyAddr(EAddressFamily family)
-{
- return m_net->newAnyAddr(family);
-}
-
-CArchNetAddress
-CArch::copyAddr(CArchNetAddress addr)
-{
- return m_net->copyAddr(addr);
-}
-
-CArchNetAddress
-CArch::nameToAddr(const std::string& name)
-{
- return m_net->nameToAddr(name);
-}
-
-void
-CArch::closeAddr(CArchNetAddress addr)
-{
- m_net->closeAddr(addr);
-}
-
-std::string
-CArch::addrToName(CArchNetAddress addr)
-{
- return m_net->addrToName(addr);
-}
-
-std::string
-CArch::addrToString(CArchNetAddress addr)
-{
- return m_net->addrToString(addr);
-}
-
-IArchNetwork::EAddressFamily
-CArch::getAddrFamily(CArchNetAddress addr)
-{
- return m_net->getAddrFamily(addr);
-}
-
-void
-CArch::setAddrPort(CArchNetAddress addr, int port)
-{
- m_net->setAddrPort(addr, port);
-}
-
-int
-CArch::getAddrPort(CArchNetAddress addr)
-{
- return m_net->getAddrPort(addr);
-}
-
-bool
-CArch::isAnyAddr(CArchNetAddress addr)
-{
- return m_net->isAnyAddr(addr);
-}
-
-bool
-CArch::isEqualAddr(CArchNetAddress a, CArchNetAddress b)
-{
- return m_net->isEqualAddr(a, b);
-}
-
-void
-CArch::sleep(double timeout)
-{
- m_sleep->sleep(timeout);
-}
-
-int
-CArch::vsnprintf(char* str, int size, const char* fmt, va_list ap)
-{
- return m_string->vsnprintf(str, size, fmt, ap);
-}
-
-int
-CArch::convStringMBToWC(wchar_t* dst, const char* src, UInt32 n, bool* errors)
-{
- return m_string->convStringMBToWC(dst, src, n, errors);
-}
-
-int
-CArch::convStringWCToMB(char* dst, const wchar_t* src, UInt32 n, bool* errors)
-{
- return m_string->convStringWCToMB(dst, src, n, errors);
-}
-
-IArchString::EWideCharEncoding
-CArch::getWideCharEncoding()
-{
- return m_string->getWideCharEncoding();
-}
-
-std::string
-CArch::getOSName() const
-{
- return m_system->getOSName();
-}
-
-std::string
-CArch::getPlatformName() const
-{
- return m_system->getPlatformName();
-}
-
-void
-CArch::addReceiver(IArchTaskBarReceiver* receiver)
-{
- m_taskbar->addReceiver(receiver);
-}
-
-void
-CArch::removeReceiver(IArchTaskBarReceiver* receiver)
-{
- m_taskbar->removeReceiver(receiver);
-}
-
-void
-CArch::updateReceiver(IArchTaskBarReceiver* receiver)
-{
- m_taskbar->updateReceiver(receiver);
-}
-
-double
-CArch::time()
-{
- return m_time->time();
-}
-
-bool
-CArch::parseArg(const int& argc, const char* const* argv, int& i)
-{
- return m_appUtil->parseArg(argc, argv, i);
-}
-
-void
-CArch::adoptApp(CApp* app)
-{
- m_appUtil->adoptApp(app);
-}
-
-CApp&
-CArch::app() const
-{
- return m_appUtil->app();
-}
-
-int
-CArch::run(int argc, char** argv)
-{
- return m_appUtil->run(argc, argv);
-}
-
-void
-CArch::beforeAppExit()
-{
- m_appUtil->beforeAppExit();
-}
diff --git a/src/lib/arch/CArch.h b/src/lib/arch/CArch.h
deleted file mode 100644
index 7d36eb15f..000000000
--- a/src/lib/arch/CArch.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCH_H
-#define CARCH_H
-
-#include "IArchConsole.h"
-#include "IArchDaemon.h"
-#include "IArchFile.h"
-#include "IArchLog.h"
-#include "IArchMultithread.h"
-#include "IArchNetwork.h"
-#include "IArchSleep.h"
-#include "IArchString.h"
-#include "IArchSystem.h"
-#include "IArchTaskBar.h"
-#include "IArchTime.h"
-#include "IArchAppUtil.h"
-
-/*!
-\def ARCH
-This macro evaluates to the singleton CArch object.
-*/
-#define ARCH (CArch::getInstance())
-
-//! Delegating implementation of architecture dependent interfaces
-/*!
-This class is a centralized interface to all architecture dependent
-interface implementations (except miscellaneous functions). It
-instantiates an implementation of each interface and delegates calls
-to each method to those implementations. Clients should use the
-\c ARCH macro to access this object. Clients must also instantiate
-exactly one of these objects before attempting to call any method,
-typically at the beginning of \c main().
-*/
-class CArch : public IArchConsole,
- public IArchDaemon,
- public IArchFile,
- public IArchLog,
- public IArchMultithread,
- public IArchNetwork,
- public IArchSleep,
- public IArchString,
- public IArchSystem,
- public IArchTaskBar,
- public IArchTime {
-public:
- CArch();
- ~CArch();
-
- //
- // accessors
- //
-
- //! Return the singleton instance
- /*!
- The client must have instantiated exactly once CArch object before
- calling this function.
- */
- static CArch* getInstance();
-
- // IArchConsole overrides
- virtual void openConsole(const char*);
- virtual void closeConsole();
- virtual void showConsole(bool showIfEmpty);
- virtual void writeConsole(ELevel, const char*);
-
- // IArchDaemon overrides
- virtual void installDaemon(const char* name,
- const char* description,
- const char* pathname,
- const char* commandLine,
- const char* dependencies,
- bool allUsers);
- virtual void uninstallDaemon(const char* name, bool allUsers);
- virtual int daemonize(const char* name, DaemonFunc func);
- virtual bool canInstallDaemon(const char* name, bool allUsers);
- virtual bool isDaemonInstalled(const char* name, bool allUsers);
-
- // IArchFile overrides
- virtual const char* getBasename(const char* pathname);
- virtual std::string getUserDirectory();
- virtual std::string getSystemDirectory();
- virtual std::string concatPath(const std::string& prefix,
- const std::string& suffix);
-
- // IArchLog overrides
- virtual void openLog(const char*);
- virtual void closeLog();
- virtual void showLog(bool showIfEmpty);
- virtual void writeLog(ELevel, const char*);
-
- // IArchMultithread overrides
- virtual CArchCond newCondVar();
- virtual void closeCondVar(CArchCond);
- virtual void signalCondVar(CArchCond);
- virtual void broadcastCondVar(CArchCond);
- virtual bool waitCondVar(CArchCond, CArchMutex, double timeout);
- virtual CArchMutex newMutex();
- virtual void closeMutex(CArchMutex);
- virtual void lockMutex(CArchMutex);
- virtual void unlockMutex(CArchMutex);
- virtual CArchThread newThread(ThreadFunc, void*);
- virtual CArchThread newCurrentThread();
- virtual CArchThread copyThread(CArchThread);
- virtual void closeThread(CArchThread);
- virtual void cancelThread(CArchThread);
- virtual void setPriorityOfThread(CArchThread, int n);
- virtual void testCancelThread();
- virtual bool wait(CArchThread, double timeout);
- virtual bool isSameThread(CArchThread, CArchThread);
- virtual bool isExitedThread(CArchThread);
- virtual void* getResultOfThread(CArchThread);
- virtual ThreadID getIDOfThread(CArchThread);
- virtual void setSignalHandler(ESignal, SignalFunc, void*);
- virtual void raiseSignal(ESignal);
-
- // IArchNetwork overrides
- virtual CArchSocket newSocket(EAddressFamily, ESocketType);
- virtual CArchSocket copySocket(CArchSocket s);
- virtual void closeSocket(CArchSocket s);
- virtual void closeSocketForRead(CArchSocket s);
- virtual void closeSocketForWrite(CArchSocket s);
- virtual void bindSocket(CArchSocket s, CArchNetAddress addr);
- virtual void listenOnSocket(CArchSocket s);
- virtual CArchSocket acceptSocket(CArchSocket s, CArchNetAddress* addr);
- virtual bool connectSocket(CArchSocket s, CArchNetAddress name);
- virtual int pollSocket(CPollEntry[], int num, double timeout);
- virtual void unblockPollSocket(CArchThread thread);
- virtual size_t readSocket(CArchSocket s, void* buf, size_t len);
- virtual size_t writeSocket(CArchSocket s,
- const void* buf, size_t len);
- virtual void throwErrorOnSocket(CArchSocket);
- virtual bool setNoDelayOnSocket(CArchSocket, bool noDelay);
- virtual bool setReuseAddrOnSocket(CArchSocket, bool reuse);
- virtual std::string getHostName();
- virtual CArchNetAddress newAnyAddr(EAddressFamily);
- virtual CArchNetAddress copyAddr(CArchNetAddress);
- virtual CArchNetAddress nameToAddr(const std::string&);
- virtual void closeAddr(CArchNetAddress);
- virtual std::string addrToName(CArchNetAddress);
- virtual std::string addrToString(CArchNetAddress);
- virtual EAddressFamily getAddrFamily(CArchNetAddress);
- virtual void setAddrPort(CArchNetAddress, int port);
- virtual int getAddrPort(CArchNetAddress);
- virtual bool isAnyAddr(CArchNetAddress);
- virtual bool isEqualAddr(CArchNetAddress, CArchNetAddress);
-
- // IArchSleep overrides
- virtual void sleep(double timeout);
-
- // IArchString overrides
- virtual int vsnprintf(char* str,
- int size, const char* fmt, va_list ap);
- virtual int convStringMBToWC(wchar_t*,
- const char*, UInt32 n, bool* errors);
- virtual int convStringWCToMB(char*,
- const wchar_t*, UInt32 n, bool* errors);
- virtual EWideCharEncoding
- getWideCharEncoding();
-
- // IArchSystem overrides
- virtual std::string getOSName() const;
- virtual std::string getPlatformName() const;
-
- // IArchTaskBar
- virtual void addReceiver(IArchTaskBarReceiver*);
- virtual void removeReceiver(IArchTaskBarReceiver*);
- virtual void updateReceiver(IArchTaskBarReceiver*);
-
- // IArchTime overrides
- virtual double time();
-
- // IArchAppUtil overrides
- virtual bool parseArg(const int& argc, const char* const* argv, int& i);
- virtual void adoptApp(CApp* app);
- virtual CApp& app() const;
- virtual int run(int argc, char** argv);
- virtual void beforeAppExit();
-
- // expose util so we don't need to re-implement all the functions
- IArchAppUtil& util() const { return *m_appUtil; }
- IArchDaemon& daemon() const { return *m_daemon; }
-
-private:
- static CArch* s_instance;
-
- IArchConsole* m_console;
- IArchDaemon* m_daemon;
- IArchFile* m_file;
- IArchLog* m_log;
- IArchMultithread* m_mt;
- IArchNetwork* m_net;
- IArchSleep* m_sleep;
- IArchString* m_string;
- IArchSystem* m_system;
- IArchTaskBar* m_taskbar;
- IArchTime* m_time;
- IArchAppUtil* m_appUtil;
-};
-
-//! Convenience object to lock/unlock an arch mutex
-class CArchMutexLock {
-public:
- CArchMutexLock(CArchMutex mutex) : m_mutex(mutex)
- {
- ARCH->lockMutex(m_mutex);
- }
- ~CArchMutexLock()
- {
- ARCH->unlockMutex(m_mutex);
- }
-
-private:
- CArchMutex m_mutex;
-};
-
-#endif
diff --git a/src/lib/arch/CArchAppUtil.cpp b/src/lib/arch/CArchAppUtil.cpp
deleted file mode 100644
index f994af82d..000000000
--- a/src/lib/arch/CArchAppUtil.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchAppUtil.h"
-#include "CApp.h"
-
-CArchAppUtil* CArchAppUtil::s_instance = nullptr;
-
-CArchAppUtil::CArchAppUtil() :
-m_app(nullptr)
-{
- s_instance = this;
-}
-
-CArchAppUtil::~CArchAppUtil()
-{
-}
-
-bool
-CArchAppUtil::parseArg(const int& argc, const char* const* argv, int& i)
-{
- // no common platform args (yet)
- return false;
-}
-
-void
-CArchAppUtil::adoptApp(CApp* app)
-{
- app->m_bye = &exitAppStatic;
- m_app = app;
-}
-
-CApp&
-CArchAppUtil::app() const
-{
- assert(m_app != nullptr);
- return *m_app;
-}
-
-CArchAppUtil&
-CArchAppUtil::instance()
-{
- assert(s_instance != nullptr);
- return *s_instance;
-}
diff --git a/src/lib/arch/CArchAppUtil.h b/src/lib/arch/CArchAppUtil.h
deleted file mode 100644
index df6a0336e..000000000
--- a/src/lib/arch/CArchAppUtil.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#pragma once
-
-#include "IArchAppUtil.h"
-#include "XSynergy.h"
-
-class CArchAppUtil : public IArchAppUtil {
-public:
- CArchAppUtil();
- virtual ~CArchAppUtil();
-
- virtual bool parseArg(const int& argc, const char* const* argv, int& i);
- virtual void adoptApp(CApp* app);
- CApp& app() const;
- virtual void exitApp(int code) { throw XExitApp(code); }
-
- static CArchAppUtil& instance();
- static void exitAppStatic(int code) { instance().exitApp(code); }
- virtual void beforeAppExit() {}
-
-private:
- CApp* m_app;
- static CArchAppUtil* s_instance;
-};
diff --git a/src/lib/arch/CArchAppUtilUnix.cpp b/src/lib/arch/CArchAppUtilUnix.cpp
deleted file mode 100644
index 8590c0137..000000000
--- a/src/lib/arch/CArchAppUtilUnix.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchAppUtilUnix.h"
-
-CArchAppUtilUnix::CArchAppUtilUnix()
-{
-}
-
-CArchAppUtilUnix::~CArchAppUtilUnix()
-{
-}
-
-bool
-CArchAppUtilUnix::parseArg(const int& argc, const char* const* argv, int& i)
-{
-#if WINAPI_XWINDOWS
- if (app().isArg(i, argc, argv, "-display", "--display", 1)) {
- // use alternative display
- app().argsBase().m_display = argv[++i];
- }
-
- else if (app().isArg(i, argc, argv, NULL, "--no-xinitthreads")) {
- app().argsBase().m_disableXInitThreads = true;
- }
-
- else {
- // option not supported here
- return false;
- }
-
- return true;
-#else
- // no options for carbon
- return false;
-#endif
-}
-
-int
-standardStartupStatic(int argc, char** argv)
-{
- return CArchAppUtil::instance().app().standardStartup(argc, argv);
-}
-
-int
-CArchAppUtilUnix::run(int argc, char** argv)
-{
- return app().runInner(argc, argv, NULL, &standardStartupStatic);
-}
-
-void
-CArchAppUtilUnix::startNode()
-{
- app().startNode();
-}
diff --git a/src/lib/arch/CArchAppUtilUnix.h b/src/lib/arch/CArchAppUtilUnix.h
deleted file mode 100644
index 24458cd7a..000000000
--- a/src/lib/arch/CArchAppUtilUnix.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#pragma once
-
-#include "CArchAppUtil.h"
-
-#define ARCH_APPUTIL CArchAppUtilUnix
-
-class CArchAppUtilUnix : public CArchAppUtil {
-public:
- CArchAppUtilUnix();
- virtual ~CArchAppUtilUnix();
-
- bool parseArg(const int& argc, const char* const* argv, int& i);
- int run(int argc, char** argv);
- void startNode();
-};
diff --git a/src/lib/arch/CArchAppUtilWindows.cpp b/src/lib/arch/CArchAppUtilWindows.cpp
deleted file mode 100644
index 63fe6c796..000000000
--- a/src/lib/arch/CArchAppUtilWindows.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchAppUtilWindows.h"
-#include "Version.h"
-#include "CLog.h"
-#include "XArchWindows.h"
-#include "CArchMiscWindows.h"
-#include "CApp.h"
-#include "LogOutputters.h"
-#include "CMSWindowsScreen.h"
-#include "XSynergy.h"
-#include "IArchTaskBarReceiver.h"
-#include "CMSWindowsRelauncher.h"
-#include "CScreen.h"
-
-#include
-#include
-#include
-
-CArchAppUtilWindows::CArchAppUtilWindows() :
-m_exitMode(kExitModeNormal)
-{
- if (SetConsoleCtrlHandler((PHANDLER_ROUTINE)consoleHandler, TRUE) == FALSE)
- {
- throw XArchEvalWindows();
- }
-}
-
-CArchAppUtilWindows::~CArchAppUtilWindows()
-{
-}
-
-BOOL WINAPI CArchAppUtilWindows::consoleHandler(DWORD CEvent)
-{
- if (instance().app().m_taskBarReceiver)
- {
- // HACK: it would be nice to delete the s_taskBarReceiver object, but
- // this is best done by the CApp destructor; however i don't feel like
- // opening up that can of worms today... i need sleep.
- instance().app().m_taskBarReceiver->cleanup();
- }
-
- ExitProcess(kExitTerminated);
- return TRUE;
-}
-
-bool
-CArchAppUtilWindows::parseArg(const int& argc, const char* const* argv, int& i)
-{
- if (app().isArg(i, argc, argv, NULL, "--service")) {
-
- const char* action = argv[++i];
-
- if (_stricmp(action, "install") == 0) {
- installService();
- }
- else if (_stricmp(action, "uninstall") == 0) {
- uninstallService();
- }
- else if (_stricmp(action, "start") == 0) {
- startService();
- }
- else if (_stricmp(action, "stop") == 0) {
- stopService();
- }
- else {
- LOG((CLOG_ERR "unknown service action: %s", action));
- app().m_bye(kExitArgs);
- }
- app().m_bye(kExitSuccess);
- }
- else if (app().isArg(i, argc, argv, NULL, "--debug-service-wait")) {
-
- app().argsBase().m_debugServiceWait = true;
- }
- else if (app().isArg(i, argc, argv, NULL, "--relaunch")) {
-
- app().argsBase().m_relaunchMode = true;
- }
- else if (app().isArg(i, argc, argv, NULL, "--exit-pause")) {
-
- app().argsBase().m_pauseOnExit = true;
- }
- else if (app().isArg(i, argc, argv, NULL, "--no-tray")) {
-
- app().argsBase().m_disableTray = true;
- }
- else {
- // option not supported here
- return false;
- }
-
- return true;
-}
-
-CString
-CArchAppUtilWindows::getServiceArgs() const
-{
- std::stringstream argBuf;
- for (int i = 1; i < __argc; i++) {
- const char* arg = __argv[i];
-
- // ignore service setup args
- if (_stricmp(arg, "--service") == 0) {
- // ignore and skip the next arg also (service action)
- i++;
- }
- else {
- if (strchr(arg, ' ') != NULL) {
- // surround argument with quotes if it contains a space
- argBuf << " \"" << arg << "\"";
- } else {
- argBuf << " " << arg;
- }
- }
- }
- return argBuf.str();
-}
-
-void
-CArchAppUtilWindows::installService()
-{
- CString args = getServiceArgs();
-
- // get the path of this program
- char thisPath[MAX_PATH];
- GetModuleFileName(CArchMiscWindows::instanceWin32(), thisPath, MAX_PATH);
-
- ARCH->installDaemon(
- app().daemonName(), app().daemonInfo(),
- thisPath, args.c_str(), NULL, true);
-
- LOG((CLOG_INFO "service '%s' installed with args: %s",
- app().daemonName(), args != "" ? args.c_str() : "none" ));
-}
-
-void
-CArchAppUtilWindows::uninstallService()
-{
- ARCH->uninstallDaemon(app().daemonName(), true);
- LOG((CLOG_INFO "service '%s' uninstalled", app().daemonName()));
-}
-
-void
-CArchAppUtilWindows::startService()
-{
- // open service manager
- SC_HANDLE mgr = OpenSCManager(NULL, NULL, GENERIC_READ);
- if (mgr == NULL) {
- throw XArchDaemonFailed(new XArchEvalWindows());
- }
-
- // open the service
- SC_HANDLE service = OpenService(
- mgr, app().daemonName(), SERVICE_START);
-
- if (service == NULL) {
- CloseServiceHandle(mgr);
- throw XArchDaemonFailed(new XArchEvalWindows());
- }
-
- // start the service
- if (StartService(service, 0, NULL)) {
- LOG((CLOG_INFO "service '%s' started", app().daemonName()));
- }
- else {
- throw XArchDaemonFailed(new XArchEvalWindows());
- }
-}
-
-void
-CArchAppUtilWindows::stopService()
-{
- // open service manager
- SC_HANDLE mgr = OpenSCManager(NULL, NULL, GENERIC_READ);
- if (mgr == NULL) {
- throw XArchDaemonFailed(new XArchEvalWindows());
- }
-
- // open the service
- SC_HANDLE service = OpenService(
- mgr, app().daemonName(),
- SERVICE_STOP | SERVICE_QUERY_STATUS);
-
- if (service == NULL) {
- CloseServiceHandle(mgr);
- throw XArchDaemonFailed(new XArchEvalWindows());
- }
-
- // ask the service to stop, asynchronously
- SERVICE_STATUS ss;
- if (!ControlService(service, SERVICE_CONTROL_STOP, &ss)) {
- DWORD dwErrCode = GetLastError();
- if (dwErrCode != ERROR_SERVICE_NOT_ACTIVE) {
- LOG((CLOG_ERR "cannot stop service '%s'", app().daemonName()));
- throw XArchDaemonFailed(new XArchEvalWindows());
- }
- }
-
- LOG((CLOG_INFO "service '%s' stopping asynchronously", app().daemonName()));
-}
-
-static
-int
-mainLoopStatic()
-{
- return CArchAppUtil::instance().app().mainLoop();
-}
-
-int
-CArchAppUtilWindows::daemonNTMainLoop(int argc, const char** argv)
-{
- app().initApp(argc, argv);
- debugServiceWait();
-
- // NB: what the hell does this do?!
- app().argsBase().m_backend = false;
-
- return CArchMiscWindows::runDaemon(mainLoopStatic);
-}
-
-void
-CArchAppUtilWindows::exitApp(int code)
-{
- switch (m_exitMode) {
-
- case kExitModeDaemon:
- CArchMiscWindows::daemonFailed(code);
- break;
-
- default:
- throw XExitApp(code);
- }
-}
-
-int daemonNTMainLoopStatic(int argc, const char** argv)
-{
- return CArchAppUtilWindows::instance().daemonNTMainLoop(argc, argv);
-}
-
-int
-CArchAppUtilWindows::daemonNTStartup(int, char**)
-{
- CSystemLogger sysLogger(app().daemonName(), false);
- m_exitMode = kExitModeDaemon;
- return ARCH->daemonize(app().daemonName(), daemonNTMainLoopStatic);
-}
-
-static
-int
-daemonNTStartupStatic(int argc, char** argv)
-{
- return CArchAppUtilWindows::instance().daemonNTStartup(argc, argv);
-}
-
-static
-int
-foregroundStartupStatic(int argc, char** argv)
-{
- return CArchAppUtil::instance().app().foregroundStartup(argc, argv);
-}
-
-void
-CArchAppUtilWindows::beforeAppExit()
-{
- // this can be handy for debugging, since the application is launched in
- // a new console window, and will normally close on exit (making it so
- // that we can't see error messages).
- if (app().argsBase().m_pauseOnExit) {
- std::cout << std::endl << "Press any key to exit..." << std::endl;
- int c = _getch();
- }
-}
-
-int
-CArchAppUtilWindows::run(int argc, char** argv)
-{
- // record window instance for tray icon, etc
- CArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
-
- CMSWindowsScreen::init(CArchMiscWindows::instanceWin32());
- CThread::getCurrentThread().setPriority(-14);
-
- StartupFunc startup;
- if (CArchMiscWindows::wasLaunchedAsService()) {
- startup = &daemonNTStartupStatic;
- } else {
- startup = &foregroundStartupStatic;
- app().argsBase().m_daemon = false;
- }
-
- return app().runInner(argc, argv, NULL, startup);
-}
-
-CArchAppUtilWindows&
-CArchAppUtilWindows::instance()
-{
- return (CArchAppUtilWindows&)CArchAppUtil::instance();
-}
-
-void
-CArchAppUtilWindows::debugServiceWait()
-{
- if (app().argsBase().m_debugServiceWait)
- {
- while(true)
- {
- // this code is only executed when the process is launched via the
- // windows service controller (and --debug-service-wait arg is
- // used). to debug, set a breakpoint on this line so that
- // execution is delayed until the debugger is attached.
- ARCH->sleep(1);
- LOG((CLOG_INFO "waiting for debugger to attach"));
- }
- }
-}
-
-void
-CArchAppUtilWindows::startNode()
-{
- if (app().argsBase().m_relaunchMode) {
-
- LOG((CLOG_DEBUG1 "entering relaunch mode"));
- CMSWindowsRelauncher relauncher;
- relauncher.startAsync();
-
- // HACK: create a dummy screen, which can handle system events
- // (such as a stop request from the service controller).
- CScreen* dummyScreen = app().createScreen();
- }
- else {
- app().startNode();
- }
-}
diff --git a/src/lib/arch/CArchAppUtilWindows.h b/src/lib/arch/CArchAppUtilWindows.h
deleted file mode 100644
index 2a8aedb2c..000000000
--- a/src/lib/arch/CArchAppUtilWindows.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#pragma once
-
-#include "CArchAppUtil.h"
-#include "CString.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include "Windows.h"
-
-#define ARCH_APPUTIL CArchAppUtilWindows
-
-enum AppExitMode {
- kExitModeNormal,
- kExitModeDaemon
-};
-
-class CArchAppUtilWindows : public CArchAppUtil {
-public:
- CArchAppUtilWindows();
- virtual ~CArchAppUtilWindows();
-
- // Gets the arguments to be used with a service.
- CString getServiceArgs() const;
-
- // Install application as Windows service.
- void installService();
-
- // Uninstall a Windows service with matching daemon name.
- void uninstallService();
-
- // Start a Windows service with matching daemon name.
- void startService();
-
- // Stop a Windows service with matching daemon name.
- void stopService();
-
- // Will install, uninstall, start, or stop the service depending on arg.
- void handleServiceArg(const char* serviceAction);
-
- bool parseArg(const int& argc, const char* const* argv, int& i);
-
- int daemonNTStartup(int, char**);
-
- int daemonNTMainLoop(int argc, const char** argv);
-
- void debugServiceWait();
-
- int run(int argc, char** argv);
-
- void exitApp(int code);
-
- void beforeAppExit();
-
- static CArchAppUtilWindows& instance();
-
- void startNode();
-
-private:
- AppExitMode m_exitMode;
- static BOOL WINAPI consoleHandler(DWORD CEvent);
-};
diff --git a/src/lib/arch/CArchConsoleStd.cpp b/src/lib/arch/CArchConsoleStd.cpp
deleted file mode 100644
index b579bc0ab..000000000
--- a/src/lib/arch/CArchConsoleStd.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchConsoleStd.h"
-#include "CLog.h"
-#include
-
-void
-CArchConsoleStd::writeConsole(ELevel level, const char* str)
-{
- if ((level >= kFATAL) && (level <= kWARNING))
- std::cerr << str << std::endl;
- else
- std::cout << str << std::endl;
-
- std::cout.flush();
-}
\ No newline at end of file
diff --git a/src/lib/arch/CArchConsoleStd.h b/src/lib/arch/CArchConsoleStd.h
deleted file mode 100644
index 1863d2a3f..000000000
--- a/src/lib/arch/CArchConsoleStd.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#pragma once
-
-#include "IArchConsole.h"
-
-//! Cross platform implementation of IArchConsole
-class CArchConsoleStd : public IArchConsole {
-public:
- CArchConsoleStd() { }
- virtual ~CArchConsoleStd() { }
-
- // IArchConsole overrides
- virtual void openConsole(const char* title) { }
- virtual void closeConsole() { }
- virtual void showConsole(bool) { }
- virtual void writeConsole(ELevel level, const char*);
-};
diff --git a/src/lib/arch/CArchConsoleUnix.cpp b/src/lib/arch/CArchConsoleUnix.cpp
deleted file mode 100644
index 4f934f748..000000000
--- a/src/lib/arch/CArchConsoleUnix.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchConsoleUnix.h"
-
-CArchConsoleUnix::CArchConsoleUnix() { }
-
-CArchConsoleUnix::~CArchConsoleUnix() { }
diff --git a/src/lib/arch/CArchConsoleUnix.h b/src/lib/arch/CArchConsoleUnix.h
deleted file mode 100644
index 18141d070..000000000
--- a/src/lib/arch/CArchConsoleUnix.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#pragma once
-
-#include "CArchConsoleStd.h"
-
-#define ARCH_CONSOLE CArchConsoleUnix
-
-class CArchConsoleUnix : public CArchConsoleStd {
-public:
- CArchConsoleUnix();
- virtual ~CArchConsoleUnix();
-};
diff --git a/src/lib/arch/CArchConsoleWindows.cpp b/src/lib/arch/CArchConsoleWindows.cpp
deleted file mode 100644
index 33315573d..000000000
--- a/src/lib/arch/CArchConsoleWindows.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchConsoleWindows.h"
-
-CArchConsoleWindows::CArchConsoleWindows() { }
-
-CArchConsoleWindows::~CArchConsoleWindows() { }
diff --git a/src/lib/arch/CArchConsoleWindows.h b/src/lib/arch/CArchConsoleWindows.h
deleted file mode 100644
index f86f75014..000000000
--- a/src/lib/arch/CArchConsoleWindows.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#pragma once
-
-#include "CArchConsoleStd.h"
-
-#define ARCH_CONSOLE CArchConsoleWindows
-
-class CArchConsoleWindows : public CArchConsoleStd {
-public:
- CArchConsoleWindows();
- virtual ~CArchConsoleWindows();
-};
diff --git a/src/lib/arch/CArchDaemonNone.cpp b/src/lib/arch/CArchDaemonNone.cpp
deleted file mode 100644
index c5390f954..000000000
--- a/src/lib/arch/CArchDaemonNone.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchDaemonNone.h"
-
-//
-// CArchDaemonNone
-//
-
-CArchDaemonNone::CArchDaemonNone()
-{
- // do nothing
-}
-
-CArchDaemonNone::~CArchDaemonNone()
-{
- // do nothing
-}
-
-void
-CArchDaemonNone::installDaemon(const char*,
- const char*,
- const char*,
- const char*,
- const char*,
- bool)
-{
- // do nothing
-}
-
-void
-CArchDaemonNone::uninstallDaemon(const char*, bool)
-{
- // do nothing
-}
-
-int
-CArchDaemonNone::daemonize(const char* name, DaemonFunc func)
-{
- // simply forward the call to func. obviously, this doesn't
- // do any daemonizing.
- return func(1, &name);
-}
-
-bool
-CArchDaemonNone::canInstallDaemon(const char*, bool)
-{
- return false;
-}
-
-bool
-CArchDaemonNone::isDaemonInstalled(const char*, bool)
-{
- return false;
-}
diff --git a/src/lib/arch/CArchDaemonNone.h b/src/lib/arch/CArchDaemonNone.h
deleted file mode 100644
index dd79f7569..000000000
--- a/src/lib/arch/CArchDaemonNone.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHDAEMONNONE_H
-#define CARCHDAEMONNONE_H
-
-#include "IArchDaemon.h"
-
-#define ARCH_DAEMON CArchDaemonNone
-
-//! Dummy implementation of IArchDaemon
-/*!
-This class implements IArchDaemon for a platform that does not have
-daemons. The install and uninstall functions do nothing, the query
-functions return false, and \c daemonize() simply calls the passed
-function and returns its result.
-*/
-class CArchDaemonNone : public IArchDaemon {
-public:
- CArchDaemonNone();
- virtual ~CArchDaemonNone();
-
- // IArchDaemon overrides
- virtual void installDaemon(const char* name,
- const char* description,
- const char* pathname,
- const char* commandLine,
- const char* dependencies,
- bool allUsers);
- virtual void uninstallDaemon(const char* name, bool allUsers);
- virtual int daemonize(const char* name, DaemonFunc func);
- virtual bool canInstallDaemon(const char* name, bool allUsers);
- virtual bool isDaemonInstalled(const char* name, bool allUsers);
-};
-
-#endif
diff --git a/src/lib/arch/CArchDaemonUnix.cpp b/src/lib/arch/CArchDaemonUnix.cpp
deleted file mode 100644
index cc6c986a5..000000000
--- a/src/lib/arch/CArchDaemonUnix.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchDaemonUnix.h"
-#include "XArchUnix.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include "CLog.h"
-
-//
-// CArchDaemonUnix
-//
-
-CArchDaemonUnix::CArchDaemonUnix()
-{
- // do nothing
-}
-
-CArchDaemonUnix::~CArchDaemonUnix()
-{
- // do nothing
-}
-
-
-#ifdef __APPLE__
-
-// In Mac OS X, fork()'d child processes can't use most APIs (the frameworks
-// that Synergy uses in fact prevent it and make the process just up and die),
-// so need to exec a copy of the program that doesn't fork so isn't limited.
-int
-execSelfNonDaemonized()
-{
- extern char** NXArgv;
- char** selfArgv = NXArgv;
-
- setenv("_SYNERGY_DAEMONIZED", "", 1);
-
- execvp(selfArgv[0], selfArgv);
- return 0;
-}
-
-bool alreadyDaemonized() {
- return getenv("_SYNERGY_DAEMONIZED") != NULL;
-}
-
-#endif
-
-int
-CArchDaemonUnix::daemonize(const char* name, DaemonFunc func)
-{
-#ifdef __APPLE__
- if (alreadyDaemonized())
- return func(1, &name);
-#endif
-
- // fork so shell thinks we're done and so we're not a process
- // group leader
- switch (fork()) {
- case -1:
- // failed
- throw XArchDaemonFailed(new XArchEvalUnix(errno));
-
- case 0:
- // child
- break;
-
- default:
- // parent exits
- exit(0);
- }
-
- // become leader of a new session
- setsid();
-
-#ifndef __APPLE__
- // NB: don't run chdir on apple; causes strange behaviour.
- // chdir to root so we don't keep mounted filesystems points busy
- // TODO: this is a bit of a hack - can we find a better solution?
- int chdirErr = chdir("/");
- if (chdirErr)
- // NB: file logging actually isn't working at this point!
- LOG((CLOG_ERR "chdir error: %i", chdirErr));
-#endif
-
- // mask off permissions for any but owner
- umask(077);
-
- // close open files. we only expect stdin, stdout, stderr to be open.
- close(0);
- close(1);
- close(2);
-
- // attach file descriptors 0, 1, 2 to /dev/null so inadvertent use
- // of standard I/O safely goes in the bit bucket.
- open("/dev/null", O_RDONLY);
- open("/dev/null", O_RDWR);
-
- int dupErr = dup(1);
- if (dupErr)
- // NB: file logging actually isn't working at this point!
- LOG((CLOG_ERR "dup error: %i", dupErr));
-
-#ifdef __APPLE__
- return execSelfNonDaemonized();
-#endif
-
- // invoke function
- return func(1, &name);
-}
diff --git a/src/lib/arch/CArchDaemonUnix.h b/src/lib/arch/CArchDaemonUnix.h
deleted file mode 100644
index 8f7e12ed6..000000000
--- a/src/lib/arch/CArchDaemonUnix.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHDAEMONUNIX_H
-#define CARCHDAEMONUNIX_H
-
-#include "CArchDaemonNone.h"
-
-#undef ARCH_DAEMON
-#define ARCH_DAEMON CArchDaemonUnix
-
-//! Unix implementation of IArchDaemon
-class CArchDaemonUnix : public CArchDaemonNone {
-public:
- CArchDaemonUnix();
- virtual ~CArchDaemonUnix();
-
- // IArchDaemon overrides
- virtual int daemonize(const char* name, DaemonFunc func);
-};
-
-#endif
diff --git a/src/lib/arch/CArchDaemonWindows.cpp b/src/lib/arch/CArchDaemonWindows.cpp
deleted file mode 100644
index d2d06f8d0..000000000
--- a/src/lib/arch/CArchDaemonWindows.cpp
+++ /dev/null
@@ -1,783 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchDaemonWindows.h"
-#include "CArch.h"
-#include "CArchMiscWindows.h"
-#include "XArchWindows.h"
-#include "stdvector.h"
-
-//
-// CArchDaemonWindows
-//
-
-CArchDaemonWindows* CArchDaemonWindows::s_daemon = NULL;
-
-CArchDaemonWindows::CArchDaemonWindows()
-{
- m_quitMessage = RegisterWindowMessage("SynergyDaemonExit");
-}
-
-CArchDaemonWindows::~CArchDaemonWindows()
-{
- // do nothing
-}
-
-int
-CArchDaemonWindows::runDaemon(RunFunc runFunc)
-{
- assert(s_daemon != NULL);
-
- return s_daemon->doRunDaemon(runFunc);
-}
-
-void
-CArchDaemonWindows::daemonRunning(bool running)
-{
- // if s_daemon is NULL we assume we're running on the windows
- // 95 family and we just ignore this call so the caller doesn't
- // have to go through the trouble of not calling it on the
- // windows 95 family.
- if (s_daemon != NULL) {
- s_daemon->doDaemonRunning(running);
- }
-}
-
-UINT
-CArchDaemonWindows::getDaemonQuitMessage()
-{
- if (s_daemon != NULL) {
- return s_daemon->doGetDaemonQuitMessage();
- }
- else {
- return 0;
- }
-}
-
-void
-CArchDaemonWindows::daemonFailed(int result)
-{
- // if s_daemon is NULL we assume we're running on the windows
- // 95 family and we just ignore this call so the caller doesn't
- // have to go through the trouble of not calling it on the
- // windows 95 family.
- if (s_daemon != NULL) {
- throw XArchDaemonRunFailed(result);
- }
-}
-
-void
-CArchDaemonWindows::installDaemon(const char* name,
- const char* description,
- const char* pathname,
- const char* commandLine,
- const char* dependencies,
- bool allUsers)
-{
- // if not for all users then use the user's autostart registry.
- // key. if windows 95 family then use windows 95 services key.
- if (!allUsers || CArchMiscWindows::isWindows95Family()) {
- // open registry
- HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ?
- open95ServicesKey() : openUserStartupKey();
- if (key == NULL) {
- // can't open key
- throw XArchDaemonInstallFailed(new XArchEvalWindows);
- }
-
- // construct entry
- std::string value;
- value += "\"";
- value += pathname;
- value += "\" ";
- value += commandLine;
-
- // install entry
- CArchMiscWindows::setValue(key, name, value);
-
- // clean up
- CArchMiscWindows::closeKey(key);
- }
-
- // windows NT family services
- else {
- // open service manager
- SC_HANDLE mgr = OpenSCManager(NULL, NULL, GENERIC_WRITE);
- if (mgr == NULL) {
- // can't open service manager
- throw XArchDaemonInstallFailed(new XArchEvalWindows);
- }
-
- // create the service
- SC_HANDLE service = CreateService(mgr,
- name,
- name,
- 0,
- SERVICE_WIN32_OWN_PROCESS |
- SERVICE_INTERACTIVE_PROCESS,
- SERVICE_AUTO_START,
- SERVICE_ERROR_NORMAL,
- pathname,
- NULL,
- NULL,
- dependencies,
- NULL,
- NULL);
- if (service == NULL) {
- // can't create service
- DWORD err = GetLastError();
- if (err != ERROR_SERVICE_EXISTS) {
- CloseServiceHandle(mgr);
- throw XArchDaemonInstallFailed(new XArchEvalWindows(err));
- }
- }
- else {
- // done with service (but only try to close if not null)
- CloseServiceHandle(service);
- }
-
- // done with manager
- CloseServiceHandle(mgr);
-
- // open the registry key for this service
- HKEY key = openNTServicesKey();
- key = CArchMiscWindows::addKey(key, name);
- if (key == NULL) {
- // can't open key
- DWORD err = GetLastError();
- try {
- uninstallDaemon(name, allUsers);
- }
- catch (...) {
- // ignore
- }
- throw XArchDaemonInstallFailed(new XArchEvalWindows(err));
- }
-
- // set the description
- CArchMiscWindows::setValue(key, _T("Description"), description);
-
- // set command line
- key = CArchMiscWindows::addKey(key, _T("Parameters"));
- if (key == NULL) {
- // can't open key
- DWORD err = GetLastError();
- CArchMiscWindows::closeKey(key);
- try {
- uninstallDaemon(name, allUsers);
- }
- catch (...) {
- // ignore
- }
- throw XArchDaemonInstallFailed(new XArchEvalWindows(err));
- }
- CArchMiscWindows::setValue(key, _T("CommandLine"), commandLine);
-
- // done with registry
- CArchMiscWindows::closeKey(key);
- }
-}
-
-void
-CArchDaemonWindows::uninstallDaemon(const char* name, bool allUsers)
-{
- // if not for all users then use the user's autostart registry.
- // key. if windows 95 family then use windows 95 services key.
- if (!allUsers || CArchMiscWindows::isWindows95Family()) {
- // open registry
- HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ?
- open95ServicesKey() : openUserStartupKey();
- if (key == NULL) {
- // can't open key. daemon is probably not installed.
- throw XArchDaemonUninstallNotInstalled(new XArchEvalWindows);
- }
-
- // remove entry
- CArchMiscWindows::deleteValue(key, name);
-
- // clean up
- CArchMiscWindows::closeKey(key);
- }
-
- // windows NT family services
- else {
- // remove parameters for this service. ignore failures.
- HKEY key = openNTServicesKey();
- key = CArchMiscWindows::openKey(key, name);
- if (key != NULL) {
- CArchMiscWindows::deleteKey(key, _T("Parameters"));
- CArchMiscWindows::closeKey(key);
- }
-
- // open service manager
- SC_HANDLE mgr = OpenSCManager(NULL, NULL, GENERIC_WRITE);
- if (mgr == NULL) {
- // can't open service manager
- throw XArchDaemonUninstallFailed(new XArchEvalWindows);
- }
-
- // open the service. oddly, you must open a service to delete it.
- SC_HANDLE service = OpenService(mgr, name, DELETE | SERVICE_STOP);
- if (service == NULL) {
- DWORD err = GetLastError();
- CloseServiceHandle(mgr);
- if (err != ERROR_SERVICE_DOES_NOT_EXIST) {
- throw XArchDaemonUninstallFailed(new XArchEvalWindows(err));
- }
- throw XArchDaemonUninstallNotInstalled(new XArchEvalWindows(err));
- }
-
- // stop the service. we don't care if we fail.
- SERVICE_STATUS status;
- ControlService(service, SERVICE_CONTROL_STOP, &status);
-
- // delete the service
- const bool okay = (DeleteService(service) == 0);
- const DWORD err = GetLastError();
-
- // clean up
- CloseServiceHandle(service);
- CloseServiceHandle(mgr);
-
- // handle failure. ignore error if service isn't installed anymore.
- if (!okay && isDaemonInstalled(name, allUsers)) {
- if (err == ERROR_IO_PENDING) {
- // this seems to be a spurious error
- return;
- }
- if (err != ERROR_SERVICE_MARKED_FOR_DELETE) {
- throw XArchDaemonUninstallFailed(new XArchEvalWindows(err));
- }
- throw XArchDaemonUninstallNotInstalled(new XArchEvalWindows(err));
- }
- }
-}
-
-int
-CArchDaemonWindows::daemonize(const char* name, DaemonFunc func)
-{
- assert(name != NULL);
- assert(func != NULL);
-
- // windows 95 family services
- if (CArchMiscWindows::isWindows95Family()) {
- typedef DWORD (WINAPI *RegisterServiceProcessT)(DWORD, DWORD);
-
- // mark this process as a service so it's not killed when the
- // user logs off.
- HINSTANCE kernel = LoadLibrary("kernel32.dll");
- if (kernel == NULL) {
- throw XArchDaemonFailed(new XArchEvalWindows);
- }
- RegisterServiceProcessT RegisterServiceProcess =
- reinterpret_cast(
- GetProcAddress(kernel,
- "RegisterServiceProcess"));
- if (RegisterServiceProcess == NULL) {
- // missing RegisterServiceProcess function
- DWORD err = GetLastError();
- FreeLibrary(kernel);
- throw XArchDaemonFailed(new XArchEvalWindows(err));
- }
- if (RegisterServiceProcess(0, 1) == 0) {
- // RegisterServiceProcess failed
- DWORD err = GetLastError();
- FreeLibrary(kernel);
- throw XArchDaemonFailed(new XArchEvalWindows(err));
- }
- FreeLibrary(kernel);
-
- // now simply call the daemon function
- return func(1, &name);
- }
-
- // windows NT family services
- else {
- // save daemon function
- m_daemonFunc = func;
-
- // construct the service entry
- SERVICE_TABLE_ENTRY entry[2];
- entry[0].lpServiceName = const_cast(name);
- entry[0].lpServiceProc = &CArchDaemonWindows::serviceMainEntry;
- entry[1].lpServiceName = NULL;
- entry[1].lpServiceProc = NULL;
-
- // hook us up to the service control manager. this won't return
- // (if successful) until the processes have terminated.
- s_daemon = this;
- if (StartServiceCtrlDispatcher(entry) == 0) {
- // StartServiceCtrlDispatcher failed
- s_daemon = NULL;
- throw XArchDaemonFailed(new XArchEvalWindows);
- }
-
- s_daemon = NULL;
- return m_daemonResult;
- }
-}
-
-bool
-CArchDaemonWindows::canInstallDaemon(const char* /*name*/, bool allUsers)
-{
- // if not for all users then use the user's autostart registry.
- // key. if windows 95 family then use windows 95 services key.
- if (!allUsers || CArchMiscWindows::isWindows95Family()) {
- // check if we can open the registry key
- HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ?
- open95ServicesKey() : openUserStartupKey();
- CArchMiscWindows::closeKey(key);
- return (key != NULL);
- }
-
- // windows NT family services
- else {
- // check if we can open service manager for write
- SC_HANDLE mgr = OpenSCManager(NULL, NULL, GENERIC_WRITE);
- if (mgr == NULL) {
- return false;
- }
- CloseServiceHandle(mgr);
-
- // check if we can open the registry key
- HKEY key = openNTServicesKey();
-// key = CArchMiscWindows::addKey(key, name);
-// key = CArchMiscWindows::addKey(key, _T("Parameters"));
- CArchMiscWindows::closeKey(key);
-
- return (key != NULL);
- }
-}
-
-bool
-CArchDaemonWindows::isDaemonInstalled(const char* name, bool allUsers)
-{
- // if not for all users then use the user's autostart registry.
- // key. if windows 95 family then use windows 95 services key.
- if (!allUsers || CArchMiscWindows::isWindows95Family()) {
- // check if we can open the registry key
- HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ?
- open95ServicesKey() : openUserStartupKey();
- if (key == NULL) {
- return false;
- }
-
- // check for entry
- const bool installed = !CArchMiscWindows::readValueString(key,
- name).empty();
-
- // clean up
- CArchMiscWindows::closeKey(key);
-
- return installed;
- }
-
- // windows NT family services
- else {
- // check parameters for this service
- HKEY key = openNTServicesKey();
- key = CArchMiscWindows::openKey(key, name);
- key = CArchMiscWindows::openKey(key, _T("Parameters"));
- if (key != NULL) {
- const bool installed = !CArchMiscWindows::readValueString(key,
- _T("CommandLine")).empty();
- CArchMiscWindows::closeKey(key);
- if (!installed) {
- 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, GENERIC_READ);
-
- // clean up
- if (service != NULL) {
- CloseServiceHandle(service);
- }
- CloseServiceHandle(mgr);
-
- return (service != NULL);
- }
-}
-
-HKEY
-CArchDaemonWindows::openNTServicesKey()
-{
- static const char* s_keyNames[] = {
- _T("SYSTEM"),
- _T("CurrentControlSet"),
- _T("Services"),
- NULL
- };
-
- return CArchMiscWindows::addKey(HKEY_LOCAL_MACHINE, s_keyNames);
-}
-
-HKEY
-CArchDaemonWindows::open95ServicesKey()
-{
- static const char* s_keyNames[] = {
- _T("Software"),
- _T("Microsoft"),
- _T("Windows"),
- _T("CurrentVersion"),
- _T("RunServices"),
- NULL
- };
-
- return CArchMiscWindows::addKey(HKEY_LOCAL_MACHINE, s_keyNames);
-}
-
-HKEY
-CArchDaemonWindows::openUserStartupKey()
-{
- static const char* s_keyNames[] = {
- _T("Software"),
- _T("Microsoft"),
- _T("Windows"),
- _T("CurrentVersion"),
- _T("Run"),
- NULL
- };
-
- return CArchMiscWindows::addKey(HKEY_CURRENT_USER, s_keyNames);
-}
-
-bool
-CArchDaemonWindows::isRunState(DWORD state)
-{
- switch (state) {
- case SERVICE_START_PENDING:
- case SERVICE_CONTINUE_PENDING:
- case SERVICE_RUNNING:
- return true;
-
- default:
- return false;
- }
-}
-
-int
-CArchDaemonWindows::doRunDaemon(RunFunc run)
-{
- // should only be called from DaemonFunc
- assert(m_serviceMutex != NULL);
- assert(run != NULL);
-
- // create message queue for this thread
- MSG dummy;
- PeekMessage(&dummy, NULL, 0, 0, PM_NOREMOVE);
-
- int result = 0;
- ARCH->lockMutex(m_serviceMutex);
- m_daemonThreadID = GetCurrentThreadId();
- while (m_serviceState != SERVICE_STOPPED) {
- // wait until we're told to start
- while (!isRunState(m_serviceState) &&
- m_serviceState != SERVICE_STOP_PENDING) {
- ARCH->waitCondVar(m_serviceCondVar, m_serviceMutex, -1.0);
- }
-
- // run unless told to stop
- if (m_serviceState != SERVICE_STOP_PENDING) {
- ARCH->unlockMutex(m_serviceMutex);
- try {
- result = run();
- }
- catch (...) {
- ARCH->lockMutex(m_serviceMutex);
- setStatusError(0);
- m_serviceState = SERVICE_STOPPED;
- setStatus(m_serviceState);
- ARCH->broadcastCondVar(m_serviceCondVar);
- ARCH->unlockMutex(m_serviceMutex);
- throw;
- }
- ARCH->lockMutex(m_serviceMutex);
- }
-
- // notify of new state
- if (m_serviceState == SERVICE_PAUSE_PENDING) {
- m_serviceState = SERVICE_PAUSED;
- }
- else {
- m_serviceState = SERVICE_STOPPED;
- }
- setStatus(m_serviceState);
- ARCH->broadcastCondVar(m_serviceCondVar);
- }
- ARCH->unlockMutex(m_serviceMutex);
- return result;
-}
-
-void
-CArchDaemonWindows::doDaemonRunning(bool running)
-{
- ARCH->lockMutex(m_serviceMutex);
- if (running) {
- m_serviceState = SERVICE_RUNNING;
- setStatus(m_serviceState);
- ARCH->broadcastCondVar(m_serviceCondVar);
- }
- ARCH->unlockMutex(m_serviceMutex);
-}
-
-UINT
-CArchDaemonWindows::doGetDaemonQuitMessage()
-{
- return m_quitMessage;
-}
-
-void
-CArchDaemonWindows::setStatus(DWORD state)
-{
- setStatus(state, 0, 0);
-}
-
-void
-CArchDaemonWindows::setStatus(DWORD state, DWORD step, DWORD waitHint)
-{
- assert(s_daemon != NULL);
-
- SERVICE_STATUS status;
- status.dwServiceType = SERVICE_WIN32_OWN_PROCESS |
- SERVICE_INTERACTIVE_PROCESS;
- status.dwCurrentState = state;
- status.dwControlsAccepted = SERVICE_ACCEPT_STOP |
- SERVICE_ACCEPT_PAUSE_CONTINUE |
- SERVICE_ACCEPT_SHUTDOWN;
- status.dwWin32ExitCode = NO_ERROR;
- status.dwServiceSpecificExitCode = 0;
- status.dwCheckPoint = step;
- status.dwWaitHint = waitHint;
- SetServiceStatus(s_daemon->m_statusHandle, &status);
-}
-
-void
-CArchDaemonWindows::setStatusError(DWORD error)
-{
- assert(s_daemon != NULL);
-
- SERVICE_STATUS status;
- status.dwServiceType = SERVICE_WIN32_OWN_PROCESS |
- SERVICE_INTERACTIVE_PROCESS;
- status.dwCurrentState = SERVICE_STOPPED;
- status.dwControlsAccepted = SERVICE_ACCEPT_STOP |
- SERVICE_ACCEPT_PAUSE_CONTINUE |
- SERVICE_ACCEPT_SHUTDOWN;
- status.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR;
- status.dwServiceSpecificExitCode = error;
- status.dwCheckPoint = 0;
- status.dwWaitHint = 0;
- SetServiceStatus(s_daemon->m_statusHandle, &status);
-}
-
-void
-CArchDaemonWindows::serviceMain(DWORD argc, LPTSTR* argvIn)
-{
- typedef std::vector ArgList;
- typedef std::vector Arguments;
- const char** argv = const_cast(argvIn);
-
- // create synchronization objects
- m_serviceMutex = ARCH->newMutex();
- m_serviceCondVar = ARCH->newCondVar();
-
- // register our service handler function
- m_statusHandle = RegisterServiceCtrlHandler(argv[0],
- &CArchDaemonWindows::serviceHandlerEntry);
- if (m_statusHandle == 0) {
- // cannot start as service
- m_daemonResult = -1;
- ARCH->closeCondVar(m_serviceCondVar);
- ARCH->closeMutex(m_serviceMutex);
- return;
- }
-
- // tell service control manager that we're starting
- m_serviceState = SERVICE_START_PENDING;
- setStatus(m_serviceState, 0, 10000);
-
- std::string commandLine;
-
- // if no arguments supplied then try getting them from the registry.
- // the first argument doesn't count because it's the service name.
- Arguments args;
- ArgList myArgv;
- if (argc <= 1) {
- // read command line
- HKEY key = openNTServicesKey();
- key = CArchMiscWindows::openKey(key, argvIn[0]);
- key = CArchMiscWindows::openKey(key, _T("Parameters"));
- if (key != NULL) {
- commandLine = CArchMiscWindows::readValueString(key,
- _T("CommandLine"));
- }
-
- // if the command line isn't empty then parse and use it
- if (!commandLine.empty()) {
- // parse, honoring double quoted substrings
- std::string::size_type i = commandLine.find_first_not_of(" \t");
- while (i != std::string::npos && i != commandLine.size()) {
- // find end of string
- std::string::size_type e;
- if (commandLine[i] == '\"') {
- // quoted. find closing quote.
- ++i;
- e = commandLine.find("\"", i);
-
- // whitespace must follow closing quote
- if (e == std::string::npos ||
- (e + 1 != commandLine.size() &&
- commandLine[e + 1] != ' ' &&
- commandLine[e + 1] != '\t')) {
- args.clear();
- break;
- }
-
- // extract
- args.push_back(commandLine.substr(i, e - i));
- i = e + 1;
- }
- else {
- // unquoted. find next whitespace.
- e = commandLine.find_first_of(" \t", i);
- if (e == std::string::npos) {
- e = commandLine.size();
- }
-
- // extract
- args.push_back(commandLine.substr(i, e - i));
- i = e + 1;
- }
-
- // next argument
- i = commandLine.find_first_not_of(" \t", i);
- }
-
- // service name goes first
- myArgv.push_back(argv[0]);
-
- // get pointers
- for (size_t j = 0; j < args.size(); ++j) {
- myArgv.push_back(args[j].c_str());
- }
-
- // adjust argc/argv
- argc = (DWORD)myArgv.size();
- argv = &myArgv[0];
- }
- }
-
- m_commandLine = commandLine;
-
- try {
- // invoke daemon function
- m_daemonResult = m_daemonFunc(static_cast(argc), argv);
- }
- catch (XArchDaemonRunFailed& e) {
- setStatusError(e.m_result);
- m_daemonResult = -1;
- }
- catch (...) {
- setStatusError(1);
- m_daemonResult = -1;
- }
-
- // clean up
- ARCH->closeCondVar(m_serviceCondVar);
- ARCH->closeMutex(m_serviceMutex);
-
- // we're going to exit now, so set status to stopped
- m_serviceState = SERVICE_STOPPED;
- setStatus(m_serviceState, 0, 10000);
-}
-
-void WINAPI
-CArchDaemonWindows::serviceMainEntry(DWORD argc, LPTSTR* argv)
-{
- s_daemon->serviceMain(argc, argv);
-}
-
-void
-CArchDaemonWindows::serviceHandler(DWORD ctrl)
-{
- assert(m_serviceMutex != NULL);
- assert(m_serviceCondVar != NULL);
-
- ARCH->lockMutex(m_serviceMutex);
-
- // ignore request if service is already stopped
- if (s_daemon == NULL || m_serviceState == SERVICE_STOPPED) {
- if (s_daemon != NULL) {
- setStatus(m_serviceState);
- }
- ARCH->unlockMutex(m_serviceMutex);
- return;
- }
-
- switch (ctrl) {
- case SERVICE_CONTROL_PAUSE:
- m_serviceState = SERVICE_PAUSE_PENDING;
- setStatus(m_serviceState, 0, 5000);
- PostThreadMessage(m_daemonThreadID, m_quitMessage, 0, 0);
- while (isRunState(m_serviceState)) {
- ARCH->waitCondVar(m_serviceCondVar, m_serviceMutex, -1.0);
- }
- break;
-
- case SERVICE_CONTROL_CONTINUE:
- // FIXME -- maybe should flush quit messages from queue
- m_serviceState = SERVICE_CONTINUE_PENDING;
- setStatus(m_serviceState, 0, 5000);
- ARCH->broadcastCondVar(m_serviceCondVar);
- break;
-
- case SERVICE_CONTROL_STOP:
- case SERVICE_CONTROL_SHUTDOWN:
- m_serviceState = SERVICE_STOP_PENDING;
- setStatus(m_serviceState, 0, 5000);
- PostThreadMessage(m_daemonThreadID, m_quitMessage, 0, 0);
- ARCH->broadcastCondVar(m_serviceCondVar);
- while (isRunState(m_serviceState)) {
- ARCH->waitCondVar(m_serviceCondVar, m_serviceMutex, -1.0);
- }
- break;
-
- default:
- // unknown service command
- // fall through
-
- case SERVICE_CONTROL_INTERROGATE:
- setStatus(m_serviceState);
- break;
- }
-
- ARCH->unlockMutex(m_serviceMutex);
-}
-
-void WINAPI
-CArchDaemonWindows::serviceHandlerEntry(DWORD ctrl)
-{
- s_daemon->serviceHandler(ctrl);
-}
diff --git a/src/lib/arch/CArchDaemonWindows.h b/src/lib/arch/CArchDaemonWindows.h
deleted file mode 100644
index 9cc45520a..000000000
--- a/src/lib/arch/CArchDaemonWindows.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHDAEMONWINDOWS_H
-#define CARCHDAEMONWINDOWS_H
-
-#define WIN32_LEAN_AND_MEAN
-
-#include "IArchDaemon.h"
-#include "IArchMultithread.h"
-#include "stdstring.h"
-#include
-#include
-
-#define ARCH_DAEMON CArchDaemonWindows
-
-//! Win32 implementation of IArchDaemon
-class CArchDaemonWindows : public IArchDaemon {
-public:
- typedef int (*RunFunc)(void);
-
- CArchDaemonWindows();
- virtual ~CArchDaemonWindows();
-
- //! Run the daemon
- /*!
- When the client calls \c daemonize(), the \c DaemonFunc should call this
- function after initialization and argument parsing to perform the
- daemon processing. The \c runFunc should perform the daemon's
- main loop, calling \c daemonRunning(true) when it enters the main loop
- (i.e. after initialization) and \c daemonRunning(false) when it leaves
- the main loop. The \c runFunc is called in a new thread and when the
- daemon must exit the main loop due to some external control the
- getDaemonQuitMessage() is posted to the thread. This function returns
- what \c runFunc returns. \c runFunc should call \c daemonFailed() if
- the daemon fails.
- */
- static int runDaemon(RunFunc runFunc);
-
- //! Indicate daemon is in main loop
- /*!
- The \c runFunc passed to \c runDaemon() should call this function
- to indicate when it has entered (\c running is \c true) or exited
- (\c running is \c false) the main loop.
- */
- static void daemonRunning(bool running);
-
- //! Indicate failure of running daemon
- /*!
- The \c runFunc passed to \c runDaemon() should call this function
- to indicate failure. \c result is returned by \c daemonize().
- */
- static void daemonFailed(int result);
-
- //! Get daemon quit message
- /*!
- The windows NT daemon tells daemon thread to exit by posting this
- message to it. The thread must, of course, have a message queue
- for this to work.
- */
- static UINT getDaemonQuitMessage();
-
- // IArchDaemon overrides
- virtual void installDaemon(const char* name,
- const char* description,
- const char* pathname,
- const char* commandLine,
- const char* dependencies,
- bool allUsers);
- virtual void uninstallDaemon(const char* name, bool allUsers);
- virtual int daemonize(const char* name, DaemonFunc func);
- virtual bool canInstallDaemon(const char* name, bool allUsers);
- virtual bool isDaemonInstalled(const char* name, bool allUsers);
-
- std::string commandLine() const { return m_commandLine; }
-
-private:
- static HKEY openNTServicesKey();
- static HKEY open95ServicesKey();
- static HKEY openUserStartupKey();
-
- int doRunDaemon(RunFunc runFunc);
- void doDaemonRunning(bool running);
- UINT doGetDaemonQuitMessage();
-
- static void setStatus(DWORD state);
- static void setStatus(DWORD state, DWORD step, DWORD waitHint);
- static void setStatusError(DWORD error);
-
- static bool isRunState(DWORD state);
-
- void serviceMain(DWORD, LPTSTR*);
- static void WINAPI serviceMainEntry(DWORD, LPTSTR*);
-
- void serviceHandler(DWORD ctrl);
- static void WINAPI serviceHandlerEntry(DWORD ctrl);
-
-private:
- class XArchDaemonRunFailed {
- public:
- XArchDaemonRunFailed(int result) : m_result(result) { }
-
- public:
- int m_result;
- };
-
-private:
- static CArchDaemonWindows* s_daemon;
-
- CArchMutex m_serviceMutex;
- CArchCond m_serviceCondVar;
- DWORD m_serviceState;
- bool m_serviceHandlerWaiting;
- bool m_serviceRunning;
-
- DWORD m_daemonThreadID;
- DaemonFunc m_daemonFunc;
- int m_daemonResult;
-
- SERVICE_STATUS_HANDLE m_statusHandle;
-
- UINT m_quitMessage;
-
- std::string m_commandLine;
-};
-
-#endif
diff --git a/src/lib/arch/CArchFileUnix.cpp b/src/lib/arch/CArchFileUnix.cpp
deleted file mode 100644
index 526811b9d..000000000
--- a/src/lib/arch/CArchFileUnix.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchFileUnix.h"
-#include
-#include
-#include
-#include
-#include
-
-//
-// CArchFileUnix
-//
-
-CArchFileUnix::CArchFileUnix()
-{
- // do nothing
-}
-
-CArchFileUnix::~CArchFileUnix()
-{
- // do nothing
-}
-
-const char*
-CArchFileUnix::getBasename(const char* pathname)
-{
- if (pathname == NULL) {
- return NULL;
- }
-
- const char* basename = strrchr(pathname, '/');
- if (basename != NULL) {
- return basename + 1;
- }
- else {
- return pathname;
- }
-}
-
-std::string
-CArchFileUnix::getUserDirectory()
-{
- char* buffer = NULL;
- std::string dir;
-#if HAVE_GETPWUID_R
- struct passwd pwent;
- struct passwd* pwentp;
-#if defined(_SC_GETPW_R_SIZE_MAX)
- long size = sysconf(_SC_GETPW_R_SIZE_MAX);
- if (size == -1) {
- size = BUFSIZ;
- }
-#else
- long size = BUFSIZ;
-#endif
- buffer = new char[size];
- getpwuid_r(getuid(), &pwent, buffer, size, &pwentp);
-#else
- struct passwd* pwentp = getpwuid(getuid());
-#endif
- if (pwentp != NULL && pwentp->pw_dir != NULL) {
- dir = pwentp->pw_dir;
- }
- delete[] buffer;
- return dir;
-}
-
-std::string
-CArchFileUnix::getSystemDirectory()
-{
- return "/etc";
-}
-
-std::string
-CArchFileUnix::concatPath(const std::string& prefix,
- const std::string& suffix)
-{
- std::string path;
- path.reserve(prefix.size() + 1 + suffix.size());
- path += prefix;
- if (path.size() == 0 || path[path.size() - 1] != '/') {
- path += '/';
- }
- path += suffix;
- return path;
-}
diff --git a/src/lib/arch/CArchFileUnix.h b/src/lib/arch/CArchFileUnix.h
deleted file mode 100644
index 0c4e92541..000000000
--- a/src/lib/arch/CArchFileUnix.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHFILEUNIX_H
-#define CARCHFILEUNIX_H
-
-#include "IArchFile.h"
-
-#define ARCH_FILE CArchFileUnix
-
-//! Unix implementation of IArchFile
-class CArchFileUnix : public IArchFile {
-public:
- CArchFileUnix();
- virtual ~CArchFileUnix();
-
- // IArchFile overrides
- virtual const char* getBasename(const char* pathname);
- virtual std::string getUserDirectory();
- virtual std::string getSystemDirectory();
- virtual std::string concatPath(const std::string& prefix,
- const std::string& suffix);
-};
-
-#endif
diff --git a/src/lib/arch/CArchFileWindows.cpp b/src/lib/arch/CArchFileWindows.cpp
deleted file mode 100644
index c75752c5b..000000000
--- a/src/lib/arch/CArchFileWindows.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchFileWindows.h"
-#include
-#include
-#include
-#include
-
-//
-// CArchFileWindows
-//
-
-CArchFileWindows::CArchFileWindows()
-{
- // do nothing
-}
-
-CArchFileWindows::~CArchFileWindows()
-{
- // do nothing
-}
-
-const char*
-CArchFileWindows::getBasename(const char* pathname)
-{
- if (pathname == NULL) {
- return NULL;
- }
-
- // check for last slash
- const char* basename = strrchr(pathname, '/');
- if (basename != NULL) {
- ++basename;
- }
- else {
- basename = pathname;
- }
-
- // check for last backslash
- const char* basename2 = strrchr(pathname, '\\');
- if (basename2 != NULL && basename2 > basename) {
- basename = basename2 + 1;
- }
-
- return basename;
-}
-
-std::string
-CArchFileWindows::getUserDirectory()
-{
- // try %HOMEPATH%
- TCHAR dir[MAX_PATH];
- DWORD size = sizeof(dir) / sizeof(TCHAR);
- DWORD result = GetEnvironmentVariable(_T("HOMEPATH"), dir, size);
- if (result != 0 && result <= size) {
- // sanity check -- if dir doesn't appear to start with a
- // drive letter and isn't a UNC name then don't use it
- // FIXME -- allow UNC names
- if (dir[0] != '\0' && (dir[1] == ':' ||
- ((dir[0] == '\\' || dir[0] == '/') &&
- (dir[1] == '\\' || dir[1] == '/')))) {
- return dir;
- }
- }
-
- // get the location of the personal files. that's as close to
- // a home directory as we're likely to find.
- ITEMIDLIST* idl;
- if (SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_PERSONAL, &idl))) {
- TCHAR* path = NULL;
- if (SHGetPathFromIDList(idl, dir)) {
- DWORD attr = GetFileAttributes(dir);
- if (attr != 0xffffffff && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0)
- path = dir;
- }
-
- IMalloc* shalloc;
- if (SUCCEEDED(SHGetMalloc(&shalloc))) {
- shalloc->Free(idl);
- shalloc->Release();
- }
-
- if (path != NULL) {
- return path;
- }
- }
-
- // use root of C drive as a default
- return "C:";
-}
-
-std::string
-CArchFileWindows::getSystemDirectory()
-{
- // get windows directory
- char dir[MAX_PATH];
- if (GetWindowsDirectory(dir, sizeof(dir)) != 0) {
- return dir;
- }
- else {
- // can't get it. use C:\ as a default.
- return "C:";
- }
-}
-
-std::string
-CArchFileWindows::concatPath(const std::string& prefix,
- const std::string& suffix)
-{
- std::string path;
- path.reserve(prefix.size() + 1 + suffix.size());
- path += prefix;
- if (path.size() == 0 ||
- (path[path.size() - 1] != '\\' &&
- path[path.size() - 1] != '/')) {
- path += '\\';
- }
- path += suffix;
- return path;
-}
diff --git a/src/lib/arch/CArchFileWindows.h b/src/lib/arch/CArchFileWindows.h
deleted file mode 100644
index a3cf50754..000000000
--- a/src/lib/arch/CArchFileWindows.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHFILEWINDOWS_H
-#define CARCHFILEWINDOWS_H
-
-#include "IArchFile.h"
-
-#define ARCH_FILE CArchFileWindows
-
-//! Win32 implementation of IArchFile
-class CArchFileWindows : public IArchFile {
-public:
- CArchFileWindows();
- virtual ~CArchFileWindows();
-
- // IArchFile overrides
- virtual const char* getBasename(const char* pathname);
- virtual std::string getUserDirectory();
- virtual std::string getSystemDirectory();
- virtual std::string concatPath(const std::string& prefix,
- const std::string& suffix);
-};
-
-#endif
diff --git a/src/lib/arch/CArchLogUnix.cpp b/src/lib/arch/CArchLogUnix.cpp
deleted file mode 100644
index 7e66bb768..000000000
--- a/src/lib/arch/CArchLogUnix.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchLogUnix.h"
-#include
-
-//
-// CArchLogUnix
-//
-
-CArchLogUnix::CArchLogUnix()
-{
- // do nothing
-}
-
-CArchLogUnix::~CArchLogUnix()
-{
- // do nothing
-}
-
-void
-CArchLogUnix::openLog(const char* name)
-{
- openlog(name, 0, LOG_DAEMON);
-}
-
-void
-CArchLogUnix::closeLog()
-{
- closelog();
-}
-
-void
-CArchLogUnix::showLog(bool)
-{
- // do nothing
-}
-
-void
-CArchLogUnix::writeLog(ELevel level, const char* msg)
-{
- // convert level
- int priority;
- switch (level) {
- case kERROR:
- priority = LOG_ERR;
- break;
-
- case kWARNING:
- priority = LOG_WARNING;
- break;
-
- case kNOTE:
- priority = LOG_NOTICE;
- break;
-
- case kINFO:
- priority = LOG_INFO;
- break;
-
- default:
- priority = LOG_DEBUG;
- break;
- }
-
- // log it
- syslog(priority, "%s", msg);
-}
diff --git a/src/lib/arch/CArchLogUnix.h b/src/lib/arch/CArchLogUnix.h
deleted file mode 100644
index 800526c53..000000000
--- a/src/lib/arch/CArchLogUnix.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHLOGUNIX_H
-#define CARCHLOGUNIX_H
-
-#include "IArchLog.h"
-
-#define ARCH_LOG CArchLogUnix
-
-//! Unix implementation of IArchLog
-class CArchLogUnix : public IArchLog {
-public:
- CArchLogUnix();
- virtual ~CArchLogUnix();
-
- // IArchLog overrides
- virtual void openLog(const char* name);
- virtual void closeLog();
- virtual void showLog(bool);
- virtual void writeLog(ELevel, const char*);
-};
-
-#endif
diff --git a/src/lib/arch/CArchLogWindows.cpp b/src/lib/arch/CArchLogWindows.cpp
deleted file mode 100644
index fad39e2e9..000000000
--- a/src/lib/arch/CArchLogWindows.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchLogWindows.h"
-#include "CArchMiscWindows.h"
-#include
-
-//
-// CArchLogWindows
-//
-
-CArchLogWindows::CArchLogWindows() : m_eventLog(NULL)
-{
- // do nothing
-}
-
-CArchLogWindows::~CArchLogWindows()
-{
- // do nothing
-}
-
-void
-CArchLogWindows::openLog(const char* name)
-{
- if (m_eventLog == NULL && !CArchMiscWindows::isWindows95Family()) {
- m_eventLog = RegisterEventSource(NULL, name);
- }
-}
-
-void
-CArchLogWindows::closeLog()
-{
- if (m_eventLog != NULL) {
- DeregisterEventSource(m_eventLog);
- m_eventLog = NULL;
- }
-}
-
-void
-CArchLogWindows::showLog(bool)
-{
- // do nothing
-}
-
-void
-CArchLogWindows::writeLog(ELevel level, const char* msg)
-{
- if (m_eventLog != NULL) {
- // convert priority
- WORD type;
- switch (level) {
- case kERROR:
- type = EVENTLOG_ERROR_TYPE;
- break;
-
- case kWARNING:
- type = EVENTLOG_WARNING_TYPE;
- break;
-
- default:
- type = EVENTLOG_INFORMATION_TYPE;
- break;
- }
-
- // log it
- // FIXME -- win32 wants to use a message table to look up event
- // strings. log messages aren't organized that way so we'll
- // just dump our string into the raw data section of the event
- // so users can at least see the message. note that we use our
- // level as the event category.
- ReportEvent(m_eventLog, type, static_cast(level),
- 0, // event ID
- NULL,
- 0,
- (DWORD)strlen(msg) + 1, // raw data size
- NULL,
- const_cast(msg));// raw data
- }
-}
diff --git a/src/lib/arch/CArchLogWindows.h b/src/lib/arch/CArchLogWindows.h
deleted file mode 100644
index 38ab2931d..000000000
--- a/src/lib/arch/CArchLogWindows.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHLOGWINDOWS_H
-#define CARCHLOGWINDOWS_H
-
-#define WIN32_LEAN_AND_MEAN
-
-#include "IArchLog.h"
-#include
-
-#define ARCH_LOG CArchLogWindows
-
-//! Win32 implementation of IArchLog
-class CArchLogWindows : public IArchLog {
-public:
- CArchLogWindows();
- virtual ~CArchLogWindows();
-
- // IArchLog overrides
- virtual void openLog(const char* name);
- virtual void closeLog();
- virtual void showLog(bool showIfEmpty);
- virtual void writeLog(ELevel, const char*);
-
-private:
- HANDLE m_eventLog;
-};
-
-#endif
diff --git a/src/lib/arch/CArchMiscWindows.cpp b/src/lib/arch/CArchMiscWindows.cpp
deleted file mode 100644
index 1420fe25e..000000000
--- a/src/lib/arch/CArchMiscWindows.cpp
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchMiscWindows.h"
-#include "CArchDaemonWindows.h"
-#include "CLog.h"
-
-#include
-#pragma warning(disable: 4099)
-#include
-#pragma warning(default: 4099)
-#include "Version.h"
-
-// parent process name for services in Vista
-#define SERVICE_LAUNCHER "services.exe"
-
-#ifndef ES_SYSTEM_REQUIRED
-#define ES_SYSTEM_REQUIRED ((DWORD)0x00000001)
-#endif
-#ifndef ES_DISPLAY_REQUIRED
-#define ES_DISPLAY_REQUIRED ((DWORD)0x00000002)
-#endif
-#ifndef ES_CONTINUOUS
-#define ES_CONTINUOUS ((DWORD)0x80000000)
-#endif
-typedef DWORD EXECUTION_STATE;
-
-//
-// CArchMiscWindows
-//
-
-CArchMiscWindows::CDialogs* CArchMiscWindows::s_dialogs = NULL;
-DWORD CArchMiscWindows::s_busyState = 0;
-CArchMiscWindows::STES_t CArchMiscWindows::s_stes = NULL;
-HICON CArchMiscWindows::s_largeIcon = NULL;
-HICON CArchMiscWindows::s_smallIcon = NULL;
-HINSTANCE CArchMiscWindows::s_instanceWin32 = NULL;
-
-void
-CArchMiscWindows::init()
-{
- s_dialogs = new CDialogs;
- isWindows95Family();
-}
-
-bool
-CArchMiscWindows::isWindows95Family()
-{
- static bool init = false;
- static bool result = false;
-
- if (!init) {
- OSVERSIONINFO version;
- version.dwOSVersionInfoSize = sizeof(version);
- if (GetVersionEx(&version) == 0) {
- // cannot determine OS; assume windows 95 family
- result = true;
- }
- else {
- result = (version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
- }
- init = true;
- }
- return result;
-}
-
-bool
-CArchMiscWindows::isWindowsModern()
-{
- static bool init = false;
- static bool result = false;
-
- if (!init) {
- OSVERSIONINFO version;
- version.dwOSVersionInfoSize = sizeof(version);
- if (GetVersionEx(&version) == 0) {
- // cannot determine OS; assume not modern
- result = false;
- }
- else {
- result = ((version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS &&
- version.dwMajorVersion == 4 &&
- version.dwMinorVersion > 0) ||
- (version.dwPlatformId == VER_PLATFORM_WIN32_NT &&
- version.dwMajorVersion > 4));
- }
- init = true;
- }
- return result;
-}
-
-void
-CArchMiscWindows::setIcons(HICON largeIcon, HICON smallIcon)
-{
- s_largeIcon = largeIcon;
- s_smallIcon = smallIcon;
-}
-
-void
-CArchMiscWindows::getIcons(HICON& largeIcon, HICON& smallIcon)
-{
- largeIcon = s_largeIcon;
- smallIcon = s_smallIcon;
-}
-
-int
-CArchMiscWindows::runDaemon(RunFunc runFunc)
-{
- return CArchDaemonWindows::runDaemon(runFunc);
-}
-
-void
-CArchMiscWindows::daemonRunning(bool running)
-{
- CArchDaemonWindows::daemonRunning(running);
-}
-
-void
-CArchMiscWindows::daemonFailed(int result)
-{
- CArchDaemonWindows::daemonFailed(result);
-}
-
-UINT
-CArchMiscWindows::getDaemonQuitMessage()
-{
- return CArchDaemonWindows::getDaemonQuitMessage();
-}
-
-HKEY
-CArchMiscWindows::openKey(HKEY key, const TCHAR* keyName)
-{
- return openKey(key, keyName, false);
-}
-
-HKEY
-CArchMiscWindows::openKey(HKEY key, const TCHAR* const* keyNames)
-{
- return openKey(key, keyNames, false);
-}
-
-HKEY
-CArchMiscWindows::addKey(HKEY key, const TCHAR* keyName)
-{
- return openKey(key, keyName, true);
-}
-
-HKEY
-CArchMiscWindows::addKey(HKEY key, const TCHAR* const* keyNames)
-{
- return openKey(key, keyNames, true);
-}
-
-HKEY
-CArchMiscWindows::openKey(HKEY key, const TCHAR* keyName, bool create)
-{
- // ignore if parent is NULL
- if (key == NULL) {
- return NULL;
- }
-
- // open next key
- HKEY newKey;
- LONG result = RegOpenKeyEx(key, keyName, 0,
- KEY_WRITE | KEY_QUERY_VALUE, &newKey);
- if (result != ERROR_SUCCESS && create) {
- DWORD disp;
- result = RegCreateKeyEx(key, keyName, 0, TEXT(""),
- 0, KEY_WRITE | KEY_QUERY_VALUE,
- NULL, &newKey, &disp);
- }
- if (result != ERROR_SUCCESS) {
- RegCloseKey(key);
- return NULL;
- }
-
- // switch to new key
- RegCloseKey(key);
- return newKey;
-}
-
-HKEY
-CArchMiscWindows::openKey(HKEY key, const TCHAR* const* keyNames, bool create)
-{
- for (size_t i = 0; key != NULL && keyNames[i] != NULL; ++i) {
- // open next key
- key = openKey(key, keyNames[i], create);
- }
- return key;
-}
-
-void
-CArchMiscWindows::closeKey(HKEY key)
-{
- assert(key != NULL);
- if (key==NULL) return;
- RegCloseKey(key);
-}
-
-void
-CArchMiscWindows::deleteKey(HKEY key, const TCHAR* name)
-{
- assert(key != NULL);
- assert(name != NULL);
- if (key==NULL || name==NULL) return;
- RegDeleteKey(key, name);
-}
-
-void
-CArchMiscWindows::deleteValue(HKEY key, const TCHAR* name)
-{
- assert(key != NULL);
- assert(name != NULL);
- if (key==NULL || name==NULL) return;
- RegDeleteValue(key, name);
-}
-
-bool
-CArchMiscWindows::hasValue(HKEY key, const TCHAR* name)
-{
- DWORD type;
- LONG result = RegQueryValueEx(key, name, 0, &type, NULL, NULL);
- return (result == ERROR_SUCCESS &&
- (type == REG_DWORD || type == REG_SZ));
-}
-
-CArchMiscWindows::EValueType
-CArchMiscWindows::typeOfValue(HKEY key, const TCHAR* name)
-{
- DWORD type;
- LONG result = RegQueryValueEx(key, name, 0, &type, NULL, NULL);
- if (result != ERROR_SUCCESS) {
- return kNO_VALUE;
- }
- switch (type) {
- case REG_DWORD:
- return kUINT;
-
- case REG_SZ:
- return kSTRING;
-
- case REG_BINARY:
- return kBINARY;
-
- default:
- return kUNKNOWN;
- }
-}
-
-void
-CArchMiscWindows::setValue(HKEY key,
- const TCHAR* name, const std::string& value)
-{
- assert(key != NULL);
- assert(name != NULL);
- if(key ==NULL || name==NULL) return; // TODO: throw exception
- RegSetValueEx(key, name, 0, REG_SZ,
- reinterpret_cast(value.c_str()),
- (DWORD)value.size() + 1);
-}
-
-void
-CArchMiscWindows::setValue(HKEY key, const TCHAR* name, DWORD value)
-{
- assert(key != NULL);
- assert(name != NULL);
- if(key ==NULL || name==NULL) return; // TODO: throw exception
- RegSetValueEx(key, name, 0, REG_DWORD,
- reinterpret_cast(&value),
- sizeof(DWORD));
-}
-
-void
-CArchMiscWindows::setValueBinary(HKEY key,
- const TCHAR* name, const std::string& value)
-{
- assert(key != NULL);
- assert(name != NULL);
- if(key ==NULL || name==NULL) return; // TODO: throw exception
- RegSetValueEx(key, name, 0, REG_BINARY,
- reinterpret_cast(value.data()),
- (DWORD)value.size());
-}
-
-std::string
-CArchMiscWindows::readBinaryOrString(HKEY key, const TCHAR* name, DWORD type)
-{
- // get the size of the string
- DWORD actualType;
- DWORD size = 0;
- LONG result = RegQueryValueEx(key, name, 0, &actualType, NULL, &size);
- if (result != ERROR_SUCCESS || actualType != type) {
- return std::string();
- }
-
- // if zero size then return empty string
- if (size == 0) {
- return std::string();
- }
-
- // allocate space
- char* buffer = new char[size];
-
- // read it
- result = RegQueryValueEx(key, name, 0, &actualType,
- reinterpret_cast(buffer), &size);
- if (result != ERROR_SUCCESS || actualType != type) {
- delete[] buffer;
- return std::string();
- }
-
- // clean up and return value
- if (type == REG_SZ && buffer[size - 1] == '\0') {
- // don't include terminating nul; std::string will add one.
- --size;
- }
- std::string value(buffer, size);
- delete[] buffer;
- return value;
-}
-
-std::string
-CArchMiscWindows::readValueString(HKEY key, const TCHAR* name)
-{
- return readBinaryOrString(key, name, REG_SZ);
-}
-
-std::string
-CArchMiscWindows::readValueBinary(HKEY key, const TCHAR* name)
-{
- return readBinaryOrString(key, name, REG_BINARY);
-}
-
-DWORD
-CArchMiscWindows::readValueInt(HKEY key, const TCHAR* name)
-{
- DWORD type;
- DWORD value;
- DWORD size = sizeof(value);
- LONG result = RegQueryValueEx(key, name, 0, &type,
- reinterpret_cast(&value), &size);
- if (result != ERROR_SUCCESS || type != REG_DWORD) {
- return 0;
- }
- return value;
-}
-
-void
-CArchMiscWindows::addDialog(HWND hwnd)
-{
- s_dialogs->insert(hwnd);
-}
-
-void
-CArchMiscWindows::removeDialog(HWND hwnd)
-{
- s_dialogs->erase(hwnd);
-}
-
-bool
-CArchMiscWindows::processDialog(MSG* msg)
-{
- for (CDialogs::const_iterator index = s_dialogs->begin();
- index != s_dialogs->end(); ++index) {
- if (IsDialogMessage(*index, msg)) {
- return true;
- }
- }
- return false;
-}
-
-void
-CArchMiscWindows::addBusyState(DWORD busyModes)
-{
- s_busyState |= busyModes;
- setThreadExecutionState(s_busyState);
-}
-
-void
-CArchMiscWindows::removeBusyState(DWORD busyModes)
-{
- s_busyState &= ~busyModes;
- setThreadExecutionState(s_busyState);
-}
-
-void
-CArchMiscWindows::setThreadExecutionState(DWORD busyModes)
-{
- // look up function dynamically so we work on older systems
- if (s_stes == NULL) {
- HINSTANCE kernel = LoadLibrary("kernel32.dll");
- if (kernel != NULL) {
- s_stes = reinterpret_cast(GetProcAddress(kernel,
- "SetThreadExecutionState"));
- }
- if (s_stes == NULL) {
- s_stes = &CArchMiscWindows::dummySetThreadExecutionState;
- }
- }
-
- // convert to STES form
- EXECUTION_STATE state = 0;
- if ((busyModes & kSYSTEM) != 0) {
- state |= ES_SYSTEM_REQUIRED;
- }
- if ((busyModes & kDISPLAY) != 0) {
- state |= ES_DISPLAY_REQUIRED;
- }
- if (state != 0) {
- state |= ES_CONTINUOUS;
- }
-
- // do it
- s_stes(state);
-}
-
-DWORD
-CArchMiscWindows::dummySetThreadExecutionState(DWORD)
-{
- // do nothing
- return 0;
-}
-
-void
-CArchMiscWindows::wakeupDisplay()
-{
- // We can't use ::setThreadExecutionState here because it sets
- // ES_CONTINUOUS, which we don't want.
-
- if (s_stes == NULL) {
- HINSTANCE kernel = LoadLibrary("kernel32.dll");
- if (kernel != NULL) {
- s_stes = reinterpret_cast(GetProcAddress(kernel,
- "SetThreadExecutionState"));
- }
- if (s_stes == NULL) {
- s_stes = &CArchMiscWindows::dummySetThreadExecutionState;
- }
- }
-
- s_stes(ES_DISPLAY_REQUIRED);
-
- // restore the original execution states
- setThreadExecutionState(s_busyState);
-}
-
-bool
-CArchMiscWindows::wasLaunchedAsService()
-{
- CString name;
- if (!getParentProcessName(name)) {
- LOG((CLOG_ERR "cannot determine if process was launched as service"));
- return false;
- }
-
- return (name == SERVICE_LAUNCHER);
-}
-
-bool
-CArchMiscWindows::getParentProcessName(CString &name)
-{
- PROCESSENTRY32 parentEntry;
- if (!getParentProcessEntry(parentEntry)){
- LOG((CLOG_ERR "could not get entry for parent process"));
- return false;
- }
-
- name = parentEntry.szExeFile;
- return true;
-}
-
-BOOL WINAPI
-CArchMiscWindows::getSelfProcessEntry(PROCESSENTRY32& entry)
-{
- // get entry from current PID
- return getProcessEntry(entry, GetCurrentProcessId());
-}
-
-BOOL WINAPI
-CArchMiscWindows::getParentProcessEntry(PROCESSENTRY32& entry)
-{
- // get the current process, so we can get parent PID
- PROCESSENTRY32 selfEntry;
- if (!getSelfProcessEntry(selfEntry)) {
- return FALSE;
- }
-
- // get entry from parent PID
- return getProcessEntry(entry, selfEntry.th32ParentProcessID);
-}
-
-BOOL WINAPI
-CArchMiscWindows::getProcessEntry(PROCESSENTRY32& entry, DWORD processID)
-{
- // first we need to take a snapshot of the running processes
- HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
- if (snapshot == INVALID_HANDLE_VALUE) {
- LOG((CLOG_ERR "could not get process snapshot (error: %i)",
- GetLastError()));
- return FALSE;
- }
-
- entry.dwSize = sizeof(PROCESSENTRY32);
-
- // get the first process, and if we can't do that then it's
- // unlikely we can go any further
- BOOL gotEntry = Process32First(snapshot, &entry);
- if (!gotEntry) {
- LOG((CLOG_ERR "could not get first process entry (error: %i)",
- GetLastError()));
- return FALSE;
- }
-
- while(gotEntry) {
-
- if (entry.th32ProcessID == processID) {
- // found current process
- return TRUE;
- }
-
- // now move on to the next entry (when we reach end, loop will stop)
- gotEntry = Process32Next(snapshot, &entry);
- }
-
- return FALSE;
-}
-
-HINSTANCE
-CArchMiscWindows::instanceWin32()
-{
- assert(s_instanceWin32 != NULL);
- return s_instanceWin32;
-}
-
-void
-CArchMiscWindows::setInstanceWin32(HINSTANCE instance)
-{
- assert(instance != NULL);
- s_instanceWin32 = instance;
-}
\ No newline at end of file
diff --git a/src/lib/arch/CArchMiscWindows.h b/src/lib/arch/CArchMiscWindows.h
deleted file mode 100644
index 3abad4638..000000000
--- a/src/lib/arch/CArchMiscWindows.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHMISCWINDOWS_H
-#define CARCHMISCWINDOWS_H
-
-#define WIN32_LEAN_AND_MEAN
-
-#include "common.h"
-#include "stdstring.h"
-#include "stdset.h"
-#include
-#include
-#include "CString.h"
-
-//! Miscellaneous win32 functions.
-class CArchMiscWindows {
-public:
- enum EValueType {
- kUNKNOWN,
- kNO_VALUE,
- kUINT,
- kSTRING,
- kBINARY
- };
- enum EBusyModes {
- kIDLE = 0x0000,
- kSYSTEM = 0x0001,
- kDISPLAY = 0x0002
- };
-
- typedef int (*RunFunc)(void);
-
- //! Initialize
- static void init();
-
- //! Test if windows 95, et al.
- /*!
- Returns true iff the platform is win95/98/me.
- */
- static bool isWindows95Family();
-
- //! Test if windows 95, et al.
- /*!
- Returns true iff the platform is win98 or win2k or higher (i.e.
- not windows 95 or windows NT).
- */
- static bool isWindowsModern();
-
- //! Set the application icons
- /*!
- Set the application icons.
- */
- static void setIcons(HICON largeIcon, HICON smallIcon);
-
- //! Get the application icons
- /*!
- Get the application icons.
- */
- static void getIcons(HICON& largeIcon, HICON& smallIcon);
-
- //! Run the daemon
- /*!
- Delegates to CArchDaemonWindows.
- */
- static int runDaemon(RunFunc runFunc);
-
- //! Indicate daemon is in main loop
- /*!
- Delegates to CArchDaemonWindows.
- */
- static void daemonRunning(bool running);
-
- //! Indicate failure of running daemon
- /*!
- Delegates to CArchDaemonWindows.
- */
- static void daemonFailed(int result);
-
- //! Get daemon quit message
- /*!
- Delegates to CArchDaemonWindows.
- */
- static UINT getDaemonQuitMessage();
-
- //! Open and return a registry key, closing the parent key
- static HKEY openKey(HKEY parent, const TCHAR* child);
-
- //! Open and return a registry key, closing the parent key
- static HKEY openKey(HKEY parent, const TCHAR* const* keyPath);
-
- //! Open/create and return a registry key, closing the parent key
- static HKEY addKey(HKEY parent, const TCHAR* child);
-
- //! Open/create and return a registry key, closing the parent key
- static HKEY addKey(HKEY parent, const TCHAR* const* keyPath);
-
- //! Close a key
- static void closeKey(HKEY);
-
- //! Delete a key (which should have no subkeys)
- static void deleteKey(HKEY parent, const TCHAR* name);
-
- //! Delete a value
- static void deleteValue(HKEY parent, const TCHAR* name);
-
- //! Test if a value exists
- static bool hasValue(HKEY key, const TCHAR* name);
-
- //! Get type of value
- static EValueType typeOfValue(HKEY key, const TCHAR* name);
-
- //! Set a string value in the registry
- static void setValue(HKEY key, const TCHAR* name,
- const std::string& value);
-
- //! Set a DWORD value in the registry
- static void setValue(HKEY key, const TCHAR* name, DWORD value);
-
- //! Set a BINARY value in the registry
- /*!
- Sets the \p name value of \p key to \p value.data().
- */
- static void setValueBinary(HKEY key, const TCHAR* name,
- const std::string& value);
-
- //! Read a string value from the registry
- static std::string readValueString(HKEY, const TCHAR* name);
-
- //! Read a DWORD value from the registry
- static DWORD readValueInt(HKEY, const TCHAR* name);
-
- //! Read a BINARY value from the registry
- static std::string readValueBinary(HKEY, const TCHAR* name);
-
- //! Add a dialog
- static void addDialog(HWND);
-
- //! Remove a dialog
- static void removeDialog(HWND);
-
- //! Process dialog message
- /*!
- Checks if the message is destined for a dialog. If so the message
- is passed to the dialog and returns true, otherwise returns false.
- */
- static bool processDialog(MSG*);
-
- //! Disable power saving
- static void addBusyState(DWORD busyModes);
-
- //! Enable power saving
- static void removeBusyState(DWORD busyModes);
-
- //! Briefly interrupt power saving
- static void wakeupDisplay();
-
- //! Returns true if this process was launched via NT service host.
- static bool wasLaunchedAsService();
-
- //! Returns true if we got the parent process name.
- static bool getParentProcessName(CString &name);
-
- static HINSTANCE instanceWin32();
-
- static void setInstanceWin32(HINSTANCE instance);
-
- static BOOL WINAPI getProcessEntry(PROCESSENTRY32& entry, DWORD processID);
- static BOOL WINAPI getSelfProcessEntry(PROCESSENTRY32& entry);
- static BOOL WINAPI getParentProcessEntry(PROCESSENTRY32& entry);
-
-private:
- //! Open and return a registry key, closing the parent key
- static HKEY openKey(HKEY parent, const TCHAR* child, bool create);
-
- //! Open and return a registry key, closing the parent key
- static HKEY openKey(HKEY parent, const TCHAR* const* keyPath,
- bool create);
-
- //! Read a string value from the registry
- static std::string readBinaryOrString(HKEY, const TCHAR* name, DWORD type);
-
- //! Set thread busy state
- static void setThreadExecutionState(DWORD);
-
- static DWORD WINAPI dummySetThreadExecutionState(DWORD);
-
-private:
- typedef std::set CDialogs;
- typedef DWORD (WINAPI *STES_t)(DWORD);
-
- static CDialogs* s_dialogs;
- static DWORD s_busyState;
- static STES_t s_stes;
- static HICON s_largeIcon;
- static HICON s_smallIcon;
- static HINSTANCE s_instanceWin32;
-};
-
-#endif
diff --git a/src/lib/arch/CArchMultithreadPosix.cpp b/src/lib/arch/CArchMultithreadPosix.cpp
deleted file mode 100644
index 1c5f07892..000000000
--- a/src/lib/arch/CArchMultithreadPosix.cpp
+++ /dev/null
@@ -1,809 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchMultithreadPosix.h"
-#include "CArch.h"
-#include "XArch.h"
-#include
-#if TIME_WITH_SYS_TIME
-# include
-# include
-#else
-# if HAVE_SYS_TIME_H
-# include
-# else
-# include
-# endif
-#endif
-#include
-
-#define SIGWAKEUP SIGUSR1
-
-#if !HAVE_PTHREAD_SIGNAL
- // boy, is this platform broken. forget about pthread signal
- // handling and let signals through to every process. synergy
- // will not terminate cleanly when it gets SIGTERM or SIGINT.
-# define pthread_sigmask sigprocmask
-# define pthread_kill(tid_, sig_) kill(0, (sig_))
-# define sigwait(set_, sig_)
-# undef HAVE_POSIX_SIGWAIT
-# define HAVE_POSIX_SIGWAIT 1
-#endif
-
-static
-void
-setSignalSet(sigset_t* sigset)
-{
- sigemptyset(sigset);
- sigaddset(sigset, SIGHUP);
- sigaddset(sigset, SIGINT);
- sigaddset(sigset, SIGTERM);
- sigaddset(sigset, SIGUSR2);
-}
-
-//
-// CArchThreadImpl
-//
-
-class CArchThreadImpl {
-public:
- CArchThreadImpl();
-
-public:
- int m_refCount;
- IArchMultithread::ThreadID m_id;
- pthread_t m_thread;
- IArchMultithread::ThreadFunc m_func;
- void* m_userData;
- bool m_cancel;
- bool m_cancelling;
- bool m_exited;
- void* m_result;
- void* m_networkData;
-};
-
-CArchThreadImpl::CArchThreadImpl() :
- m_refCount(1),
- m_id(0),
- m_func(NULL),
- m_userData(NULL),
- m_cancel(false),
- m_cancelling(false),
- m_exited(false),
- m_result(NULL),
- m_networkData(NULL)
-{
- // do nothing
-}
-
-
-//
-// CArchMultithreadPosix
-//
-
-CArchMultithreadPosix* CArchMultithreadPosix::s_instance = NULL;
-
-CArchMultithreadPosix::CArchMultithreadPosix() :
- m_newThreadCalled(false),
- m_nextID(0)
-{
- assert(s_instance == NULL);
-
- s_instance = this;
-
- // no signal handlers
- for (size_t i = 0; i < kNUM_SIGNALS; ++i) {
- m_signalFunc[i] = NULL;
- m_signalUserData[i] = NULL;
- }
-
- // create mutex for thread list
- m_threadMutex = newMutex();
-
- // create thread for calling (main) thread and add it to our
- // list. no need to lock the mutex since we're the only thread.
- m_mainThread = new CArchThreadImpl;
- m_mainThread->m_thread = pthread_self();
- insert(m_mainThread);
-
- // install SIGWAKEUP handler. this causes SIGWAKEUP to interrupt
- // system calls. we use that when cancelling a thread to force it
- // to wake up immediately if it's blocked in a system call. we
- // won't need this until another thread is created but it's fine
- // to install it now.
- struct sigaction act;
- sigemptyset(&act.sa_mask);
-# if defined(SA_INTERRUPT)
- act.sa_flags = SA_INTERRUPT;
-# else
- act.sa_flags = 0;
-# endif
- act.sa_handler = &threadCancel;
- sigaction(SIGWAKEUP, &act, NULL);
-
- // set desired signal dispositions. let SIGWAKEUP through but
- // ignore SIGPIPE (we'll handle EPIPE).
- sigset_t sigset;
- sigemptyset(&sigset);
- sigaddset(&sigset, SIGWAKEUP);
- pthread_sigmask(SIG_UNBLOCK, &sigset, NULL);
- sigemptyset(&sigset);
- sigaddset(&sigset, SIGPIPE);
- pthread_sigmask(SIG_BLOCK, &sigset, NULL);
-}
-
-CArchMultithreadPosix::~CArchMultithreadPosix()
-{
- assert(s_instance != NULL);
-
- closeMutex(m_threadMutex);
- s_instance = NULL;
-}
-
-void
-CArchMultithreadPosix::setNetworkDataForCurrentThread(void* data)
-{
- lockMutex(m_threadMutex);
- CArchThreadImpl* thread = find(pthread_self());
- thread->m_networkData = data;
- unlockMutex(m_threadMutex);
-}
-
-void*
-CArchMultithreadPosix::getNetworkDataForThread(CArchThread thread)
-{
- lockMutex(m_threadMutex);
- void* data = thread->m_networkData;
- unlockMutex(m_threadMutex);
- return data;
-}
-
-CArchMultithreadPosix*
-CArchMultithreadPosix::getInstance()
-{
- return s_instance;
-}
-
-CArchCond
-CArchMultithreadPosix::newCondVar()
-{
- CArchCondImpl* cond = new CArchCondImpl;
- int status = pthread_cond_init(&cond->m_cond, NULL);
- (void)status;
- assert(status == 0);
- return cond;
-}
-
-void
-CArchMultithreadPosix::closeCondVar(CArchCond cond)
-{
- int status = pthread_cond_destroy(&cond->m_cond);
- (void)status;
- assert(status == 0);
- delete cond;
-}
-
-void
-CArchMultithreadPosix::signalCondVar(CArchCond cond)
-{
- int status = pthread_cond_signal(&cond->m_cond);
- (void)status;
- assert(status == 0);
-}
-
-void
-CArchMultithreadPosix::broadcastCondVar(CArchCond cond)
-{
- int status = pthread_cond_broadcast(&cond->m_cond);
- (void)status;
- assert(status == 0);
-}
-
-bool
-CArchMultithreadPosix::waitCondVar(CArchCond cond,
- CArchMutex mutex, double timeout)
-{
- // we can't wait on a condition variable and also wake it up for
- // cancellation since we don't use posix cancellation. so we
- // must wake up periodically to check for cancellation. we
- // can't simply go back to waiting after the check since the
- // condition may have changed and we'll have lost the signal.
- // so we have to return to the caller. since the caller will
- // always check for spurious wakeups the only drawback here is
- // performance: we're waking up a lot more than desired.
- static const double maxCancellationLatency = 0.1;
- if (timeout < 0.0 || timeout > maxCancellationLatency) {
- timeout = maxCancellationLatency;
- }
-
- // see if we should cancel this thread
- testCancelThread();
-
- // get final time
- struct timeval now;
- gettimeofday(&now, NULL);
- struct timespec finalTime;
- finalTime.tv_sec = now.tv_sec;
- finalTime.tv_nsec = now.tv_usec * 1000;
- long timeout_sec = (long)timeout;
- long timeout_nsec = (long)(1.0e+9 * (timeout - timeout_sec));
- finalTime.tv_sec += timeout_sec;
- finalTime.tv_nsec += timeout_nsec;
- if (finalTime.tv_nsec >= 1000000000) {
- finalTime.tv_nsec -= 1000000000;
- finalTime.tv_sec += 1;
- }
-
- // wait
- int status = pthread_cond_timedwait(&cond->m_cond,
- &mutex->m_mutex, &finalTime);
-
- // check for cancel again
- testCancelThread();
-
- switch (status) {
- case 0:
- // success
- return true;
-
- case ETIMEDOUT:
- return false;
-
- default:
- assert(0 && "condition variable wait error");
- return false;
- }
-}
-
-CArchMutex
-CArchMultithreadPosix::newMutex()
-{
- pthread_mutexattr_t attr;
- int status = pthread_mutexattr_init(&attr);
- assert(status == 0);
- CArchMutexImpl* mutex = new CArchMutexImpl;
- status = pthread_mutex_init(&mutex->m_mutex, &attr);
- assert(status == 0);
- return mutex;
-}
-
-void
-CArchMultithreadPosix::closeMutex(CArchMutex mutex)
-{
- int status = pthread_mutex_destroy(&mutex->m_mutex);
- (void)status;
- assert(status == 0);
- delete mutex;
-}
-
-void
-CArchMultithreadPosix::lockMutex(CArchMutex mutex)
-{
- int status = pthread_mutex_lock(&mutex->m_mutex);
-
- switch (status) {
- case 0:
- // success
- return;
-
- case EDEADLK:
- assert(0 && "lock already owned");
- break;
-
- case EAGAIN:
- assert(0 && "too many recursive locks");
- break;
-
- default:
- assert(0 && "unexpected error");
- break;
- }
-}
-
-void
-CArchMultithreadPosix::unlockMutex(CArchMutex mutex)
-{
- int status = pthread_mutex_unlock(&mutex->m_mutex);
-
- switch (status) {
- case 0:
- // success
- return;
-
- case EPERM:
- assert(0 && "thread doesn't own a lock");
- break;
-
- default:
- assert(0 && "unexpected error");
- break;
- }
-}
-
-CArchThread
-CArchMultithreadPosix::newThread(ThreadFunc func, void* data)
-{
- assert(func != NULL);
-
- // initialize signal handler. we do this here instead of the
- // constructor so we can avoid daemonizing (using fork())
- // when there are multiple threads. clients can safely
- // use condition variables and mutexes before creating a
- // new thread and they can safely use the only thread
- // they have access to, the main thread, so they really
- // can't tell the difference.
- if (!m_newThreadCalled) {
- m_newThreadCalled = true;
-#if HAVE_PTHREAD_SIGNAL
- startSignalHandler();
-#endif
- }
-
- lockMutex(m_threadMutex);
-
- // create thread impl for new thread
- CArchThreadImpl* thread = new CArchThreadImpl;
- thread->m_func = func;
- thread->m_userData = data;
-
- // create the thread. pthread_create() on RedHat 7.2 smp fails
- // if passed a NULL attr so use a default attr.
- pthread_attr_t attr;
- int status = pthread_attr_init(&attr);
- if (status == 0) {
- status = pthread_create(&thread->m_thread, &attr,
- &CArchMultithreadPosix::threadFunc, thread);
- pthread_attr_destroy(&attr);
- }
-
- // check if thread was started
- if (status != 0) {
- // failed to start thread so clean up
- delete thread;
- thread = NULL;
- }
- else {
- // add thread to list
- insert(thread);
-
- // increment ref count to account for the thread itself
- refThread(thread);
- }
-
- // note that the child thread will wait until we release this mutex
- unlockMutex(m_threadMutex);
-
- return thread;
-}
-
-CArchThread
-CArchMultithreadPosix::newCurrentThread()
-{
- lockMutex(m_threadMutex);
- CArchThreadImpl* thread = find(pthread_self());
- unlockMutex(m_threadMutex);
- assert(thread != NULL);
- return thread;
-}
-
-void
-CArchMultithreadPosix::closeThread(CArchThread thread)
-{
- assert(thread != NULL);
-
- // decrement ref count and clean up thread if no more references
- if (--thread->m_refCount == 0) {
- // detach from thread (unless it's the main thread)
- if (thread->m_func != NULL) {
- pthread_detach(thread->m_thread);
- }
-
- // remove thread from list
- lockMutex(m_threadMutex);
- assert(findNoRef(thread->m_thread) == thread);
- erase(thread);
- unlockMutex(m_threadMutex);
-
- // done with thread
- delete thread;
- }
-}
-
-CArchThread
-CArchMultithreadPosix::copyThread(CArchThread thread)
-{
- refThread(thread);
- return thread;
-}
-
-void
-CArchMultithreadPosix::cancelThread(CArchThread thread)
-{
- assert(thread != NULL);
-
- // set cancel and wakeup flags if thread can be cancelled
- bool wakeup = false;
- lockMutex(m_threadMutex);
- if (!thread->m_exited && !thread->m_cancelling) {
- thread->m_cancel = true;
- wakeup = true;
- }
- unlockMutex(m_threadMutex);
-
- // force thread to exit system calls if wakeup is true
- if (wakeup) {
- pthread_kill(thread->m_thread, SIGWAKEUP);
- }
-}
-
-void
-CArchMultithreadPosix::setPriorityOfThread(CArchThread thread, int /*n*/)
-{
- assert(thread != NULL);
-
- // FIXME
-}
-
-void
-CArchMultithreadPosix::testCancelThread()
-{
- // find current thread
- lockMutex(m_threadMutex);
- CArchThreadImpl* thread = findNoRef(pthread_self());
- unlockMutex(m_threadMutex);
-
- // test cancel on thread
- testCancelThreadImpl(thread);
-}
-
-bool
-CArchMultithreadPosix::wait(CArchThread target, double timeout)
-{
- assert(target != NULL);
-
- lockMutex(m_threadMutex);
-
- // find current thread
- CArchThreadImpl* self = findNoRef(pthread_self());
-
- // ignore wait if trying to wait on ourself
- if (target == self) {
- unlockMutex(m_threadMutex);
- return false;
- }
-
- // ref the target so it can't go away while we're watching it
- refThread(target);
-
- unlockMutex(m_threadMutex);
-
- try {
- // do first test regardless of timeout
- testCancelThreadImpl(self);
- if (isExitedThread(target)) {
- closeThread(target);
- return true;
- }
-
- // wait and repeat test if there's a timeout
- if (timeout != 0.0) {
- const double start = ARCH->time();
- do {
- // wait a little
- ARCH->sleep(0.05);
-
- // repeat test
- testCancelThreadImpl(self);
- if (isExitedThread(target)) {
- closeThread(target);
- return true;
- }
-
- // repeat wait and test until timed out
- } while (timeout < 0.0 || (ARCH->time() - start) <= timeout);
- }
-
- closeThread(target);
- return false;
- }
- catch (...) {
- closeThread(target);
- throw;
- }
-}
-
-bool
-CArchMultithreadPosix::isSameThread(CArchThread thread1, CArchThread thread2)
-{
- return (thread1 == thread2);
-}
-
-bool
-CArchMultithreadPosix::isExitedThread(CArchThread thread)
-{
- lockMutex(m_threadMutex);
- bool exited = thread->m_exited;
- unlockMutex(m_threadMutex);
- return exited;
-}
-
-void*
-CArchMultithreadPosix::getResultOfThread(CArchThread thread)
-{
- lockMutex(m_threadMutex);
- void* result = thread->m_result;
- unlockMutex(m_threadMutex);
- return result;
-}
-
-IArchMultithread::ThreadID
-CArchMultithreadPosix::getIDOfThread(CArchThread thread)
-{
- return thread->m_id;
-}
-
-void
-CArchMultithreadPosix::setSignalHandler(
- ESignal signal, SignalFunc func, void* userData)
-{
- lockMutex(m_threadMutex);
- m_signalFunc[signal] = func;
- m_signalUserData[signal] = userData;
- unlockMutex(m_threadMutex);
-}
-
-void
-CArchMultithreadPosix::raiseSignal(ESignal signal)
-{
- lockMutex(m_threadMutex);
- if (m_signalFunc[signal] != NULL) {
- m_signalFunc[signal](signal, m_signalUserData[signal]);
- pthread_kill(m_mainThread->m_thread, SIGWAKEUP);
- }
- else if (signal == kINTERRUPT || signal == kTERMINATE) {
- ARCH->cancelThread(m_mainThread);
- }
- unlockMutex(m_threadMutex);
-}
-
-void
-CArchMultithreadPosix::startSignalHandler()
-{
- // set signal mask. the main thread blocks these signals and
- // the signal handler thread will listen for them.
- sigset_t sigset, oldsigset;
- setSignalSet(&sigset);
- pthread_sigmask(SIG_BLOCK, &sigset, &oldsigset);
-
- // fire up the INT and TERM signal handler thread. we could
- // instead arrange to catch and handle these signals but
- // we'd be unable to cancel the main thread since no pthread
- // calls are allowed in a signal handler.
- pthread_attr_t attr;
- int status = pthread_attr_init(&attr);
- if (status == 0) {
- status = pthread_create(&m_signalThread, &attr,
- &CArchMultithreadPosix::threadSignalHandler,
- NULL);
- pthread_attr_destroy(&attr);
- }
- if (status != 0) {
- // can't create thread to wait for signal so don't block
- // the signals.
- pthread_sigmask(SIG_UNBLOCK, &oldsigset, NULL);
- }
-}
-
-CArchThreadImpl*
-CArchMultithreadPosix::find(pthread_t thread)
-{
- CArchThreadImpl* impl = findNoRef(thread);
- if (impl != NULL) {
- refThread(impl);
- }
- return impl;
-}
-
-CArchThreadImpl*
-CArchMultithreadPosix::findNoRef(pthread_t thread)
-{
- // linear search
- for (CThreadList::const_iterator index = m_threadList.begin();
- index != m_threadList.end(); ++index) {
- if ((*index)->m_thread == thread) {
- return *index;
- }
- }
- return NULL;
-}
-
-void
-CArchMultithreadPosix::insert(CArchThreadImpl* thread)
-{
- assert(thread != NULL);
-
- // thread shouldn't already be on the list
- assert(findNoRef(thread->m_thread) == NULL);
-
- // set thread id. note that we don't worry about m_nextID
- // wrapping back to 0 and duplicating thread ID's since the
- // likelihood of synergy running that long is vanishingly
- // small.
- thread->m_id = ++m_nextID;
-
- // append to list
- m_threadList.push_back(thread);
-}
-
-void
-CArchMultithreadPosix::erase(CArchThreadImpl* thread)
-{
- for (CThreadList::iterator index = m_threadList.begin();
- index != m_threadList.end(); ++index) {
- if (*index == thread) {
- m_threadList.erase(index);
- break;
- }
- }
-}
-
-void
-CArchMultithreadPosix::refThread(CArchThreadImpl* thread)
-{
- assert(thread != NULL);
- assert(findNoRef(thread->m_thread) != NULL);
- ++thread->m_refCount;
-}
-
-void
-CArchMultithreadPosix::testCancelThreadImpl(CArchThreadImpl* thread)
-{
- assert(thread != NULL);
-
- // update cancel state
- lockMutex(m_threadMutex);
- bool cancel = false;
- if (thread->m_cancel && !thread->m_cancelling) {
- thread->m_cancelling = true;
- thread->m_cancel = false;
- cancel = true;
- }
- unlockMutex(m_threadMutex);
-
- // unwind thread's stack if cancelling
- if (cancel) {
- throw XThreadCancel();
- }
-}
-
-void*
-CArchMultithreadPosix::threadFunc(void* vrep)
-{
- // get the thread
- CArchThreadImpl* thread = reinterpret_cast(vrep);
-
- // setup pthreads
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
- pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
-
- // run thread
- s_instance->doThreadFunc(thread);
-
- // terminate the thread
- return NULL;
-}
-
-void
-CArchMultithreadPosix::doThreadFunc(CArchThread thread)
-{
- // default priority is slightly below normal
- setPriorityOfThread(thread, 1);
-
- // wait for parent to initialize this object
- lockMutex(m_threadMutex);
- unlockMutex(m_threadMutex);
-
- void* result = NULL;
- try {
- // go
- result = (*thread->m_func)(thread->m_userData);
- }
-
- catch (XThreadCancel&) {
- // client called cancel()
- }
- catch (...) {
- // note -- don't catch (...) to avoid masking bugs
- lockMutex(m_threadMutex);
- thread->m_exited = true;
- unlockMutex(m_threadMutex);
- closeThread(thread);
- throw;
- }
-
- // thread has exited
- lockMutex(m_threadMutex);
- thread->m_result = result;
- thread->m_exited = true;
- unlockMutex(m_threadMutex);
-
- // done with thread
- closeThread(thread);
-}
-
-void
-CArchMultithreadPosix::threadCancel(int)
-{
- // do nothing
-}
-
-void*
-CArchMultithreadPosix::threadSignalHandler(void*)
-{
- // detach
- pthread_detach(pthread_self());
-
- // add signal to mask
- sigset_t sigset;
- setSignalSet(&sigset);
-
- // also wait on SIGABRT. on linux (others?) this thread (process)
- // will persist after all the other threads evaporate due to an
- // assert unless we wait on SIGABRT. that means our resources (like
- // the socket we're listening on) are not released and never will be
- // until the lingering thread is killed. i don't know why sigwait()
- // should protect the thread from being killed. note that sigwait()
- // doesn't actually return if we receive SIGABRT and, for some
- // reason, we don't have to block SIGABRT.
- sigaddset(&sigset, SIGABRT);
-
- // we exit the loop via thread cancellation in sigwait()
- for (;;) {
- // wait
-#if HAVE_POSIX_SIGWAIT
- int signal = 0;
- sigwait(&sigset, &signal);
-#else
- sigwait(&sigset);
-#endif
-
- // if we get here then the signal was raised
- switch (signal) {
- case SIGINT:
- ARCH->raiseSignal(kINTERRUPT);
- break;
-
- case SIGTERM:
- ARCH->raiseSignal(kTERMINATE);
- break;
-
- case SIGHUP:
- ARCH->raiseSignal(kHANGUP);
- break;
-
- case SIGUSR2:
- ARCH->raiseSignal(kUSER);
- break;
-
- default:
- // ignore
- break;
- }
- }
-
- return NULL;
-}
diff --git a/src/lib/arch/CArchMultithreadPosix.h b/src/lib/arch/CArchMultithreadPosix.h
deleted file mode 100644
index 031adcd72..000000000
--- a/src/lib/arch/CArchMultithreadPosix.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHMULTITHREADPOSIX_H
-#define CARCHMULTITHREADPOSIX_H
-
-#include "IArchMultithread.h"
-#include "stdlist.h"
-#include
-
-#define ARCH_MULTITHREAD CArchMultithreadPosix
-
-class CArchCondImpl {
-public:
- pthread_cond_t m_cond;
-};
-
-class CArchMutexImpl {
-public:
- pthread_mutex_t m_mutex;
-};
-
-//! Posix implementation of IArchMultithread
-class CArchMultithreadPosix : public IArchMultithread {
-public:
- CArchMultithreadPosix();
- virtual ~CArchMultithreadPosix();
-
- //! @name manipulators
- //@{
-
- void setNetworkDataForCurrentThread(void*);
-
- //@}
- //! @name accessors
- //@{
-
- void* getNetworkDataForThread(CArchThread);
-
- static CArchMultithreadPosix* getInstance();
-
- //@}
-
- // IArchMultithread overrides
- virtual CArchCond newCondVar();
- virtual void closeCondVar(CArchCond);
- virtual void signalCondVar(CArchCond);
- virtual void broadcastCondVar(CArchCond);
- virtual bool waitCondVar(CArchCond, CArchMutex, double timeout);
- virtual CArchMutex newMutex();
- virtual void closeMutex(CArchMutex);
- virtual void lockMutex(CArchMutex);
- virtual void unlockMutex(CArchMutex);
- virtual CArchThread newThread(ThreadFunc, void*);
- virtual CArchThread newCurrentThread();
- virtual CArchThread copyThread(CArchThread);
- virtual void closeThread(CArchThread);
- virtual void cancelThread(CArchThread);
- virtual void setPriorityOfThread(CArchThread, int n);
- virtual void testCancelThread();
- virtual bool wait(CArchThread, double timeout);
- virtual bool isSameThread(CArchThread, CArchThread);
- virtual bool isExitedThread(CArchThread);
- virtual void* getResultOfThread(CArchThread);
- virtual ThreadID getIDOfThread(CArchThread);
- virtual void setSignalHandler(ESignal, SignalFunc, void*);
- virtual void raiseSignal(ESignal);
-
-private:
- void startSignalHandler();
-
- CArchThreadImpl* find(pthread_t thread);
- CArchThreadImpl* findNoRef(pthread_t thread);
- void insert(CArchThreadImpl* thread);
- void erase(CArchThreadImpl* thread);
-
- void refThread(CArchThreadImpl* rep);
- void testCancelThreadImpl(CArchThreadImpl* rep);
-
- void doThreadFunc(CArchThread thread);
- static void* threadFunc(void* vrep);
- static void threadCancel(int);
- static void* threadSignalHandler(void* vrep);
-
-private:
- typedef std::list CThreadList;
-
- static CArchMultithreadPosix* s_instance;
-
- bool m_newThreadCalled;
-
- CArchMutex m_threadMutex;
- CArchThread m_mainThread;
- CThreadList m_threadList;
- ThreadID m_nextID;
-
- pthread_t m_signalThread;
- SignalFunc m_signalFunc[kNUM_SIGNALS];
- void* m_signalUserData[kNUM_SIGNALS];
-};
-
-#endif
diff --git a/src/lib/arch/CArchMultithreadWindows.cpp b/src/lib/arch/CArchMultithreadWindows.cpp
deleted file mode 100644
index d7a6101b1..000000000
--- a/src/lib/arch/CArchMultithreadWindows.cpp
+++ /dev/null
@@ -1,702 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#if defined(_MSC_VER) && !defined(_MT)
-# error multithreading compile option is required
-#endif
-
-#include "CArchMultithreadWindows.h"
-#include "CArch.h"
-#include "XArch.h"
-#include
-
-//
-// note -- implementation of condition variable taken from:
-// http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
-// titled "Strategies for Implementing POSIX Condition Variables
-// on Win32." it also provides an implementation that doesn't
-// suffer from the incorrectness problem described in our
-// corresponding header but it is slower, still unfair, and
-// can cause busy waiting.
-//
-
-//
-// CArchThreadImpl
-//
-
-class CArchThreadImpl {
-public:
- CArchThreadImpl();
- ~CArchThreadImpl();
-
-public:
- int m_refCount;
- HANDLE m_thread;
- DWORD m_id;
- IArchMultithread::ThreadFunc m_func;
- void* m_userData;
- HANDLE m_cancel;
- bool m_cancelling;
- HANDLE m_exit;
- void* m_result;
- void* m_networkData;
-};
-
-CArchThreadImpl::CArchThreadImpl() :
- m_refCount(1),
- m_thread(NULL),
- m_id(0),
- m_func(NULL),
- m_userData(NULL),
- m_cancelling(false),
- m_result(NULL),
- m_networkData(NULL)
-{
- m_exit = CreateEvent(NULL, TRUE, FALSE, NULL);
- m_cancel = CreateEvent(NULL, TRUE, FALSE, NULL);
-}
-
-CArchThreadImpl::~CArchThreadImpl()
-{
- CloseHandle(m_exit);
- CloseHandle(m_cancel);
-}
-
-
-//
-// CArchMultithreadWindows
-//
-
-CArchMultithreadWindows* CArchMultithreadWindows::s_instance = NULL;
-
-CArchMultithreadWindows::CArchMultithreadWindows()
-{
- assert(s_instance == NULL);
- s_instance = this;
-
- // no signal handlers
- for (size_t i = 0; i < kNUM_SIGNALS; ++i) {
- m_signalFunc[i] = NULL;
- m_signalUserData[i] = NULL;
- }
-
- // create mutex for thread list
- m_threadMutex = newMutex();
-
- // create thread for calling (main) thread and add it to our
- // list. no need to lock the mutex since we're the only thread.
- m_mainThread = new CArchThreadImpl;
- m_mainThread->m_thread = NULL;
- m_mainThread->m_id = GetCurrentThreadId();
- insert(m_mainThread);
-}
-
-CArchMultithreadWindows::~CArchMultithreadWindows()
-{
- s_instance = NULL;
-
- // clean up thread list
- for (CThreadList::iterator index = m_threadList.begin();
- index != m_threadList.end(); ++index) {
- delete *index;
- }
-
- // done with mutex
- delete m_threadMutex;
-}
-
-void
-CArchMultithreadWindows::setNetworkDataForCurrentThread(void* data)
-{
- lockMutex(m_threadMutex);
- CArchThreadImpl* thread = findNoRef(GetCurrentThreadId());
- thread->m_networkData = data;
- unlockMutex(m_threadMutex);
-}
-
-void*
-CArchMultithreadWindows::getNetworkDataForThread(CArchThread thread)
-{
- lockMutex(m_threadMutex);
- void* data = thread->m_networkData;
- unlockMutex(m_threadMutex);
- return data;
-}
-
-HANDLE
-CArchMultithreadWindows::getCancelEventForCurrentThread()
-{
- lockMutex(m_threadMutex);
- CArchThreadImpl* thread = findNoRef(GetCurrentThreadId());
- unlockMutex(m_threadMutex);
- return thread->m_cancel;
-}
-
-CArchMultithreadWindows*
-CArchMultithreadWindows::getInstance()
-{
- return s_instance;
-}
-
-CArchCond
-CArchMultithreadWindows::newCondVar()
-{
- CArchCondImpl* cond = new CArchCondImpl;
- cond->m_events[CArchCondImpl::kSignal] = CreateEvent(NULL,
- FALSE, FALSE, NULL);
- cond->m_events[CArchCondImpl::kBroadcast] = CreateEvent(NULL,
- TRUE, FALSE, NULL);
- cond->m_waitCountMutex = newMutex();
- cond->m_waitCount = 0;
- return cond;
-}
-
-void
-CArchMultithreadWindows::closeCondVar(CArchCond cond)
-{
- CloseHandle(cond->m_events[CArchCondImpl::kSignal]);
- CloseHandle(cond->m_events[CArchCondImpl::kBroadcast]);
- closeMutex(cond->m_waitCountMutex);
- delete cond;
-}
-
-void
-CArchMultithreadWindows::signalCondVar(CArchCond cond)
-{
- // is anybody waiting?
- lockMutex(cond->m_waitCountMutex);
- const bool hasWaiter = (cond->m_waitCount > 0);
- unlockMutex(cond->m_waitCountMutex);
-
- // wake one thread if anybody is waiting
- if (hasWaiter) {
- SetEvent(cond->m_events[CArchCondImpl::kSignal]);
- }
-}
-
-void
-CArchMultithreadWindows::broadcastCondVar(CArchCond cond)
-{
- // is anybody waiting?
- lockMutex(cond->m_waitCountMutex);
- const bool hasWaiter = (cond->m_waitCount > 0);
- unlockMutex(cond->m_waitCountMutex);
-
- // wake all threads if anybody is waiting
- if (hasWaiter) {
- SetEvent(cond->m_events[CArchCondImpl::kBroadcast]);
- }
-}
-
-bool
-CArchMultithreadWindows::waitCondVar(CArchCond cond,
- CArchMutex mutex, double timeout)
-{
- // prepare to wait
- const DWORD winTimeout = (timeout < 0.0) ? INFINITE :
- static_cast(1000.0 * timeout);
-
- // make a list of the condition variable events and the cancel event
- // for the current thread.
- HANDLE handles[4];
- handles[0] = cond->m_events[CArchCondImpl::kSignal];
- handles[1] = cond->m_events[CArchCondImpl::kBroadcast];
- handles[2] = getCancelEventForCurrentThread();
-
- // update waiter count
- lockMutex(cond->m_waitCountMutex);
- ++cond->m_waitCount;
- unlockMutex(cond->m_waitCountMutex);
-
- // release mutex. this should be atomic with the wait so that it's
- // impossible for another thread to signal us between the unlock and
- // the wait, which would lead to a lost signal on broadcasts.
- // however, we're using a manual reset event for broadcasts which
- // stays set until we reset it, so we don't lose the broadcast.
- unlockMutex(mutex);
-
- // wait for a signal or broadcast
- DWORD result = WaitForMultipleObjects(3, handles, FALSE, winTimeout);
-
- // cancel takes priority
- if (result != WAIT_OBJECT_0 + 2 &&
- WaitForSingleObject(handles[2], 0) == WAIT_OBJECT_0) {
- result = WAIT_OBJECT_0 + 2;
- }
-
- // update the waiter count and check if we're the last waiter
- lockMutex(cond->m_waitCountMutex);
- --cond->m_waitCount;
- const bool last = (result == WAIT_OBJECT_0 + 1 && cond->m_waitCount == 0);
- unlockMutex(cond->m_waitCountMutex);
-
- // reset the broadcast event if we're the last waiter
- if (last) {
- ResetEvent(cond->m_events[CArchCondImpl::kBroadcast]);
- }
-
- // reacquire the mutex
- lockMutex(mutex);
-
- // cancel thread if necessary
- if (result == WAIT_OBJECT_0 + 2) {
- ARCH->testCancelThread();
- }
-
- // return success or failure
- return (result == WAIT_OBJECT_0 + 0 ||
- result == WAIT_OBJECT_0 + 1);
-}
-
-CArchMutex
-CArchMultithreadWindows::newMutex()
-{
- CArchMutexImpl* mutex = new CArchMutexImpl;
- InitializeCriticalSection(&mutex->m_mutex);
- return mutex;
-}
-
-void
-CArchMultithreadWindows::closeMutex(CArchMutex mutex)
-{
- DeleteCriticalSection(&mutex->m_mutex);
- delete mutex;
-}
-
-void
-CArchMultithreadWindows::lockMutex(CArchMutex mutex)
-{
- EnterCriticalSection(&mutex->m_mutex);
-}
-
-void
-CArchMultithreadWindows::unlockMutex(CArchMutex mutex)
-{
- LeaveCriticalSection(&mutex->m_mutex);
-}
-
-CArchThread
-CArchMultithreadWindows::newThread(ThreadFunc func, void* data)
-{
- lockMutex(m_threadMutex);
-
- // create thread impl for new thread
- CArchThreadImpl* thread = new CArchThreadImpl;
- thread->m_func = func;
- thread->m_userData = data;
-
- // create thread
- unsigned int id = 0;
- thread->m_thread = reinterpret_cast(_beginthreadex(NULL, 0,
- threadFunc, (void*)thread, 0, &id));
- thread->m_id = static_cast(id);
-
- // check if thread was started
- if (thread->m_thread == 0) {
- // failed to start thread so clean up
- delete thread;
- thread = NULL;
- }
- else {
- // add thread to list
- insert(thread);
-
- // increment ref count to account for the thread itself
- refThread(thread);
- }
-
- // note that the child thread will wait until we release this mutex
- unlockMutex(m_threadMutex);
-
- return thread;
-}
-
-CArchThread
-CArchMultithreadWindows::newCurrentThread()
-{
- lockMutex(m_threadMutex);
- CArchThreadImpl* thread = find(GetCurrentThreadId());
- unlockMutex(m_threadMutex);
- assert(thread != NULL);
- return thread;
-}
-
-void
-CArchMultithreadWindows::closeThread(CArchThread thread)
-{
- assert(thread != NULL);
-
- // decrement ref count and clean up thread if no more references
- if (--thread->m_refCount == 0) {
- // close the handle (main thread has a NULL handle)
- if (thread->m_thread != NULL) {
- CloseHandle(thread->m_thread);
- }
-
- // remove thread from list
- lockMutex(m_threadMutex);
- assert(findNoRefOrCreate(thread->m_id) == thread);
- erase(thread);
- unlockMutex(m_threadMutex);
-
- // done with thread
- delete thread;
- }
-}
-
-CArchThread
-CArchMultithreadWindows::copyThread(CArchThread thread)
-{
- refThread(thread);
- return thread;
-}
-
-void
-CArchMultithreadWindows::cancelThread(CArchThread thread)
-{
- assert(thread != NULL);
-
- // set cancel flag
- SetEvent(thread->m_cancel);
-}
-
-void
-CArchMultithreadWindows::setPriorityOfThread(CArchThread thread, int n)
-{
- struct CPriorityInfo {
- public:
- DWORD m_class;
- int m_level;
- };
- static const CPriorityInfo s_pClass[] = {
- { IDLE_PRIORITY_CLASS, THREAD_PRIORITY_IDLE },
- { IDLE_PRIORITY_CLASS, THREAD_PRIORITY_LOWEST },
- { IDLE_PRIORITY_CLASS, THREAD_PRIORITY_BELOW_NORMAL },
- { IDLE_PRIORITY_CLASS, THREAD_PRIORITY_NORMAL },
- { IDLE_PRIORITY_CLASS, THREAD_PRIORITY_ABOVE_NORMAL },
- { IDLE_PRIORITY_CLASS, THREAD_PRIORITY_HIGHEST },
- { NORMAL_PRIORITY_CLASS, THREAD_PRIORITY_LOWEST },
- { NORMAL_PRIORITY_CLASS, THREAD_PRIORITY_BELOW_NORMAL },
- { NORMAL_PRIORITY_CLASS, THREAD_PRIORITY_NORMAL },
- { NORMAL_PRIORITY_CLASS, THREAD_PRIORITY_ABOVE_NORMAL },
- { NORMAL_PRIORITY_CLASS, THREAD_PRIORITY_HIGHEST },
- { HIGH_PRIORITY_CLASS, THREAD_PRIORITY_LOWEST },
- { HIGH_PRIORITY_CLASS, THREAD_PRIORITY_BELOW_NORMAL },
- { HIGH_PRIORITY_CLASS, THREAD_PRIORITY_NORMAL },
- { HIGH_PRIORITY_CLASS, THREAD_PRIORITY_ABOVE_NORMAL },
- { HIGH_PRIORITY_CLASS, THREAD_PRIORITY_HIGHEST },
- { REALTIME_PRIORITY_CLASS, THREAD_PRIORITY_IDLE },
- { REALTIME_PRIORITY_CLASS, THREAD_PRIORITY_LOWEST },
- { REALTIME_PRIORITY_CLASS, THREAD_PRIORITY_BELOW_NORMAL },
- { REALTIME_PRIORITY_CLASS, THREAD_PRIORITY_NORMAL },
- { REALTIME_PRIORITY_CLASS, THREAD_PRIORITY_ABOVE_NORMAL },
- { REALTIME_PRIORITY_CLASS, THREAD_PRIORITY_HIGHEST },
- { REALTIME_PRIORITY_CLASS, THREAD_PRIORITY_TIME_CRITICAL}
- };
-#if defined(_DEBUG)
- // don't use really high priorities when debugging
- static const size_t s_pMax = 13;
-#else
- static const size_t s_pMax = sizeof(s_pClass) / sizeof(s_pClass[0]) - 1;
-#endif
- static const size_t s_pBase = 8; // index of normal priority
-
- assert(thread != NULL);
-
- size_t index;
- if (n > 0 && s_pBase < (size_t)n) {
- // lowest priority
- index = 0;
- }
- else {
- index = (size_t)((int)s_pBase - n);
- if (index > s_pMax) {
- // highest priority
- index = s_pMax;
- }
- }
- SetPriorityClass(GetCurrentProcess(), s_pClass[index].m_class);
- SetThreadPriority(thread->m_thread, s_pClass[index].m_level);
-}
-
-void
-CArchMultithreadWindows::testCancelThread()
-{
- // find current thread
- lockMutex(m_threadMutex);
- CArchThreadImpl* thread = findNoRef(GetCurrentThreadId());
- unlockMutex(m_threadMutex);
-
- // test cancel on thread
- testCancelThreadImpl(thread);
-}
-
-bool
-CArchMultithreadWindows::wait(CArchThread target, double timeout)
-{
- assert(target != NULL);
-
- lockMutex(m_threadMutex);
-
- // find current thread
- CArchThreadImpl* self = findNoRef(GetCurrentThreadId());
-
- // ignore wait if trying to wait on ourself
- if (target == self) {
- unlockMutex(m_threadMutex);
- return false;
- }
-
- // ref the target so it can't go away while we're watching it
- refThread(target);
-
- unlockMutex(m_threadMutex);
-
- // convert timeout
- DWORD t;
- if (timeout < 0.0) {
- t = INFINITE;
- }
- else {
- t = (DWORD)(1000.0 * timeout);
- }
-
- // wait for this thread to be cancelled or woken up or for the
- // target thread to terminate.
- HANDLE handles[2];
- handles[0] = target->m_exit;
- handles[1] = self->m_cancel;
- DWORD result = WaitForMultipleObjects(2, handles, FALSE, t);
-
- // cancel takes priority
- if (result != WAIT_OBJECT_0 + 1 &&
- WaitForSingleObject(handles[1], 0) == WAIT_OBJECT_0) {
- result = WAIT_OBJECT_0 + 1;
- }
-
- // release target
- closeThread(target);
-
- // handle result
- switch (result) {
- case WAIT_OBJECT_0 + 0:
- // target thread terminated
- return true;
-
- case WAIT_OBJECT_0 + 1:
- // this thread was cancelled. does not return.
- testCancelThreadImpl(self);
-
- default:
- // timeout or error
- return false;
- }
-}
-
-bool
-CArchMultithreadWindows::isSameThread(CArchThread thread1, CArchThread thread2)
-{
- return (thread1 == thread2);
-}
-
-bool
-CArchMultithreadWindows::isExitedThread(CArchThread thread)
-{
- // poll exit event
- return (WaitForSingleObject(thread->m_exit, 0) == WAIT_OBJECT_0);
-}
-
-void*
-CArchMultithreadWindows::getResultOfThread(CArchThread thread)
-{
- lockMutex(m_threadMutex);
- void* result = thread->m_result;
- unlockMutex(m_threadMutex);
- return result;
-}
-
-IArchMultithread::ThreadID
-CArchMultithreadWindows::getIDOfThread(CArchThread thread)
-{
- return static_cast(thread->m_id);
-}
-
-void
-CArchMultithreadWindows::setSignalHandler(
- ESignal signal, SignalFunc func, void* userData)
-{
- lockMutex(m_threadMutex);
- m_signalFunc[signal] = func;
- m_signalUserData[signal] = userData;
- unlockMutex(m_threadMutex);
-}
-
-void
-CArchMultithreadWindows::raiseSignal(ESignal signal)
-{
- lockMutex(m_threadMutex);
- if (m_signalFunc[signal] != NULL) {
- m_signalFunc[signal](signal, m_signalUserData[signal]);
- ARCH->unblockPollSocket(m_mainThread);
- }
- else if (signal == kINTERRUPT || signal == kTERMINATE) {
- ARCH->cancelThread(m_mainThread);
- }
- unlockMutex(m_threadMutex);
-}
-
-CArchThreadImpl*
-CArchMultithreadWindows::find(DWORD id)
-{
- CArchThreadImpl* impl = findNoRef(id);
- if (impl != NULL) {
- refThread(impl);
- }
- return impl;
-}
-
-CArchThreadImpl*
-CArchMultithreadWindows::findNoRef(DWORD id)
-{
- CArchThreadImpl* impl = findNoRefOrCreate(id);
- if (impl == NULL) {
- // create thread for calling thread which isn't in our list and
- // add it to the list. this won't normally happen but it can if
- // the system calls us under a new thread, like it does when we
- // run as a service.
- impl = new CArchThreadImpl;
- impl->m_thread = NULL;
- impl->m_id = GetCurrentThreadId();
- insert(impl);
- }
- return impl;
-}
-
-CArchThreadImpl*
-CArchMultithreadWindows::findNoRefOrCreate(DWORD id)
-{
- // linear search
- for (CThreadList::const_iterator index = m_threadList.begin();
- index != m_threadList.end(); ++index) {
- if ((*index)->m_id == id) {
- return *index;
- }
- }
- return NULL;
-}
-
-void
-CArchMultithreadWindows::insert(CArchThreadImpl* thread)
-{
- assert(thread != NULL);
-
- // thread shouldn't already be on the list
- assert(findNoRefOrCreate(thread->m_id) == NULL);
-
- // append to list
- m_threadList.push_back(thread);
-}
-
-void
-CArchMultithreadWindows::erase(CArchThreadImpl* thread)
-{
- for (CThreadList::iterator index = m_threadList.begin();
- index != m_threadList.end(); ++index) {
- if (*index == thread) {
- m_threadList.erase(index);
- break;
- }
- }
-}
-
-void
-CArchMultithreadWindows::refThread(CArchThreadImpl* thread)
-{
- assert(thread != NULL);
- assert(findNoRefOrCreate(thread->m_id) != NULL);
- ++thread->m_refCount;
-}
-
-void
-CArchMultithreadWindows::testCancelThreadImpl(CArchThreadImpl* thread)
-{
- assert(thread != NULL);
-
- // poll cancel event. return if not set.
- const DWORD result = WaitForSingleObject(thread->m_cancel, 0);
- if (result != WAIT_OBJECT_0) {
- return;
- }
-
- // update cancel state
- lockMutex(m_threadMutex);
- bool cancel = !thread->m_cancelling;
- thread->m_cancelling = true;
- ResetEvent(thread->m_cancel);
- unlockMutex(m_threadMutex);
-
- // unwind thread's stack if cancelling
- if (cancel) {
- throw XThreadCancel();
- }
-}
-
-unsigned int __stdcall
-CArchMultithreadWindows::threadFunc(void* vrep)
-{
- // get the thread
- CArchThreadImpl* thread = reinterpret_cast(vrep);
-
- // run thread
- s_instance->doThreadFunc(thread);
-
- // terminate the thread
- return 0;
-}
-
-void
-CArchMultithreadWindows::doThreadFunc(CArchThread thread)
-{
- // wait for parent to initialize this object
- lockMutex(m_threadMutex);
- unlockMutex(m_threadMutex);
-
- void* result = NULL;
- try {
- // go
- result = (*thread->m_func)(thread->m_userData);
- }
-
- catch (XThreadCancel&) {
- // client called cancel()
- }
- catch (...) {
- // note -- don't catch (...) to avoid masking bugs
- SetEvent(thread->m_exit);
- closeThread(thread);
- throw;
- }
-
- // thread has exited
- lockMutex(m_threadMutex);
- thread->m_result = result;
- unlockMutex(m_threadMutex);
- SetEvent(thread->m_exit);
-
- // done with thread
- closeThread(thread);
-}
diff --git a/src/lib/arch/CArchMultithreadWindows.h b/src/lib/arch/CArchMultithreadWindows.h
deleted file mode 100644
index 71414b0b8..000000000
--- a/src/lib/arch/CArchMultithreadWindows.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef CARCHMULTITHREADWINDOWS_H
-#define CARCHMULTITHREADWINDOWS_H
-
-#define WIN32_LEAN_AND_MEAN
-
-#include "IArchMultithread.h"
-#include "stdlist.h"
-#include
-
-#define ARCH_MULTITHREAD CArchMultithreadWindows
-
-class CArchCondImpl {
-public:
- enum { kSignal = 0, kBroadcast };
-
- HANDLE m_events[2];
- mutable int m_waitCount;
- CArchMutex m_waitCountMutex;
-};
-
-class CArchMutexImpl {
-public:
- CRITICAL_SECTION m_mutex;
-};
-
-//! Win32 implementation of IArchMultithread
-class CArchMultithreadWindows : public IArchMultithread {
-public:
- CArchMultithreadWindows();
- virtual ~CArchMultithreadWindows();
-
- //! @name manipulators
- //@{
-
- void setNetworkDataForCurrentThread(void*);
-
- //@}
- //! @name accessors
- //@{
-
- HANDLE getCancelEventForCurrentThread();
-
- void* getNetworkDataForThread(CArchThread);
-
- static CArchMultithreadWindows* getInstance();
-
- //@}
-
- // IArchMultithread overrides
- virtual CArchCond newCondVar();
- virtual void closeCondVar(CArchCond);
- virtual void signalCondVar(CArchCond);
- virtual void broadcastCondVar(CArchCond);
- virtual bool waitCondVar(CArchCond, CArchMutex, double timeout);
- virtual CArchMutex newMutex();
- virtual void closeMutex(CArchMutex);
- virtual void lockMutex(CArchMutex);
- virtual void unlockMutex(CArchMutex);
- virtual CArchThread newThread(ThreadFunc, void*);
- virtual CArchThread newCurrentThread();
- virtual CArchThread copyThread(CArchThread);
- virtual void closeThread(CArchThread);
- virtual void cancelThread(CArchThread);
- virtual void setPriorityOfThread(CArchThread, int n);
- virtual void testCancelThread();
- virtual bool wait(CArchThread, double timeout);
- virtual bool isSameThread(CArchThread, CArchThread);
- virtual bool isExitedThread(CArchThread);
- virtual void* getResultOfThread(CArchThread);
- virtual ThreadID getIDOfThread(CArchThread);
- virtual void setSignalHandler(ESignal, SignalFunc, void*);
- virtual void raiseSignal(ESignal);
-
-private:
- CArchThreadImpl* find(DWORD id);
- CArchThreadImpl* findNoRef(DWORD id);
- CArchThreadImpl* findNoRefOrCreate(DWORD id);
- void insert(CArchThreadImpl* thread);
- void erase(CArchThreadImpl* thread);
-
- void refThread(CArchThreadImpl* rep);
- void testCancelThreadImpl(CArchThreadImpl* rep);
-
- void doThreadFunc(CArchThread thread);
- static unsigned int __stdcall threadFunc(void* vrep);
-
-private:
- typedef std::list CThreadList;
-
- static CArchMultithreadWindows* s_instance;
-
- CArchMutex m_threadMutex;
-
- CThreadList m_threadList;
- CArchThread m_mainThread;
-
- SignalFunc m_signalFunc[kNUM_SIGNALS];
- void* m_signalUserData[kNUM_SIGNALS];
-};
-
-#endif
diff --git a/src/lib/arch/CArchNetworkBSD.cpp b/src/lib/arch/CArchNetworkBSD.cpp
deleted file mode 100644
index cc92604f2..000000000
--- a/src/lib/arch/CArchNetworkBSD.cpp
+++ /dev/null
@@ -1,981 +0,0 @@
-/*
- * synergy -- mouse and keyboard sharing utility
- * Copyright (C) 2002 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include "CArchNetworkBSD.h"
-#include "CArch.h"
-#include "CArchMultithreadPosix.h"
-#include "XArchUnix.h"
-#if HAVE_UNISTD_H
-# include
-#endif
-#include
-#include
-#if !defined(TCP_NODELAY)
-# include
-#endif
-#include