aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-07-21 06:15:16 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2020-07-21 06:15:16 -0400
commit37a7155ea7c504b308a8afa642c653a12bbe5f84 (patch)
treebd68ea5d2a2400dcd04b1aa85617534e66aba94c
parent1ae09e76cde035d716763fc88b570535884cd50f (diff)
parentfbc30002ab3438356c0476e70c4577a0310d52c0 (diff)
downloadbarrier-37a7155ea7c504b308a8afa642c653a12bbe5f84.tar.bz2
barrier-37a7155ea7c504b308a8afa642c653a12bbe5f84.tar.xz
barrier-37a7155ea7c504b308a8afa642c653a12bbe5f84.tar.zst
Update upstream source from tag 'upstream/2.3.3+dfsg'
Update to upstream version '2.3.3+dfsg' with Debian dir f7eeed313bc1a4c2bda69f04f0316ee29651397f
-rw-r--r--.gitmodules6
-rw-r--r--CMakeLists.txt37
-rw-r--r--README.md25
-rw-r--r--azure-pipelines.yml13
-rw-r--r--clean_build.bat6
-rwxr-xr-xclean_build.sh4
-rw-r--r--cmake/Version.cmake3
-rw-r--r--doc/UpdateManpages.txt7
-rw-r--r--doc/barrierc.14
-rw-r--r--doc/barriers.115
-rw-r--r--res/barrier.desktop2
-rw-r--r--res/config.h.in6
-rw-r--r--snap/snapcraft.yaml5
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/cmd/barriers/barriers.cpp7
-rw-r--r--src/gui/CMakeLists.txt4
-rw-r--r--src/gui/res/Barrier.qrc3
-rw-r--r--src/gui/res/icons/32x32/barrier-connected-mask.pngbin0 -> 876 bytes
-rw-r--r--src/gui/res/icons/32x32/barrier-connected-mask.svg114
-rw-r--r--src/gui/res/icons/32x32/barrier-disconnected-mask.pngbin0 -> 732 bytes
-rw-r--r--src/gui/res/icons/32x32/barrier-disconnected-mask.svg102
-rw-r--r--src/gui/res/icons/32x32/barrier-transfering-mask.pngbin0 -> 682 bytes
-rw-r--r--src/gui/res/icons/32x32/barrier-transfering-mask.svg148
-rw-r--r--src/gui/res/lang/gui_sv.ts576
-rw-r--r--src/gui/src/Action.cpp23
-rw-r--r--src/gui/src/Action.h4
-rw-r--r--src/gui/src/ActionDialog.cpp2
-rw-r--r--src/gui/src/ActionDialogBase.ui11
-rw-r--r--src/gui/src/BaseConfig.h72
-rw-r--r--src/gui/src/MainWindow.cpp30
-rw-r--r--src/gui/src/Screen.cpp65
-rw-r--r--src/gui/src/Screen.h23
-rw-r--r--src/gui/src/ScreenSettingsDialog.cpp65
-rw-r--r--src/gui/src/ServerConfig.cpp17
-rw-r--r--src/gui/src/ServerConfig.h4
-rw-r--r--src/gui/src/ServerConfigDialog.cpp20
-rw-r--r--src/gui/src/ServerConfigDialogBase.ui100
-rw-r--r--src/gui/src/SettingsDialog.cpp4
-rw-r--r--src/lib/arch/Arch.h4
-rw-r--r--src/lib/arch/ArchDaemonNone.h3
-rw-r--r--src/lib/arch/IArchDaemon.h4
-rw-r--r--src/lib/arch/IArchTaskBarReceiver.h6
-rw-r--r--src/lib/arch/XArch.h6
-rw-r--r--src/lib/arch/unix/ArchInternetUnix.cpp16
-rw-r--r--src/lib/arch/unix/ArchInternetUnix.h6
-rw-r--r--src/lib/arch/unix/ArchMultithreadPosix.cpp13
-rw-r--r--src/lib/arch/unix/ArchNetworkBSD.cpp1
-rw-r--r--src/lib/arch/unix/XArchUnix.h2
-rw-r--r--src/lib/arch/win32/ArchInternetWindows.cpp36
-rw-r--r--src/lib/arch/win32/ArchInternetWindows.h6
-rw-r--r--src/lib/arch/win32/ArchMiscWindows.cpp7
-rw-r--r--src/lib/arch/win32/ArchMiscWindows.h3
-rw-r--r--src/lib/arch/win32/XArchWindows.cpp4
-rw-r--r--src/lib/arch/win32/XArchWindows.h4
-rw-r--r--src/lib/barrier/ClientApp.cpp4
-rw-r--r--src/lib/barrier/PlatformScreen.h2
-rw-r--r--src/lib/barrier/ProtocolUtil.cpp3
-rw-r--r--src/lib/barrier/ProtocolUtil.h6
-rw-r--r--src/lib/barrier/ServerApp.cpp13
-rw-r--r--src/lib/barrier/StreamChunker.cpp2
-rw-r--r--src/lib/barrier/XBarrier.cpp30
-rw-r--r--src/lib/barrier/XBarrier.h34
-rw-r--r--src/lib/barrier/XScreen.cpp11
-rw-r--r--src/lib/barrier/XScreen.h4
-rw-r--r--src/lib/barrier/win32/DaemonApp.cpp5
-rw-r--r--src/lib/base/EventQueue.cpp9
-rw-r--r--src/lib/base/EventQueue.h6
-rw-r--r--src/lib/base/EventTypes.cpp1
-rw-r--r--src/lib/base/EventTypes.h9
-rw-r--r--src/lib/base/IEventQueue.h11
-rw-r--r--src/lib/base/Log.cpp1
-rw-r--r--src/lib/base/String.cpp62
-rw-r--r--src/lib/base/String.h40
-rw-r--r--src/lib/base/Unicode.cpp81
-rw-r--r--src/lib/base/Unicode.h42
-rw-r--r--src/lib/base/XBase.cpp11
-rw-r--r--src/lib/base/XBase.h41
-rw-r--r--src/lib/base/log_outputters.cpp5
-rw-r--r--src/lib/base/log_outputters.h4
-rw-r--r--src/lib/client/Client.cpp20
-rw-r--r--src/lib/client/Client.h20
-rw-r--r--src/lib/client/ServerProxy.cpp10
-rw-r--r--src/lib/client/ServerProxy.h1
-rw-r--r--src/lib/common/stdexcept.h23
-rw-r--r--src/lib/io/XIO.cpp9
-rw-r--r--src/lib/ipc/IpcClientProxy.cpp4
-rw-r--r--src/lib/ipc/IpcLogOutputter.cpp10
-rw-r--r--src/lib/ipc/IpcLogOutputter.h7
-rw-r--r--src/lib/ipc/IpcMessage.cpp14
-rw-r--r--src/lib/ipc/IpcMessage.h14
-rw-r--r--src/lib/ipc/IpcServerProxy.cpp4
-rw-r--r--src/lib/mt/XMT.cpp3
-rw-r--r--src/lib/net/IDataSocket.h4
-rw-r--r--src/lib/net/NetworkAddress.cpp5
-rw-r--r--src/lib/net/NetworkAddress.h7
-rw-r--r--src/lib/net/SecureListenSocket.cpp3
-rw-r--r--src/lib/net/SecureSocket.cpp24
-rw-r--r--src/lib/net/SecureSocket.h18
-rw-r--r--src/lib/net/TCPSocket.cpp25
-rw-r--r--src/lib/net/TCPSocket.h3
-rw-r--r--src/lib/net/XSocket.cpp27
-rw-r--r--src/lib/net/XSocket.h15
-rw-r--r--src/lib/platform/MSWindowsClipboard.cpp9
-rw-r--r--src/lib/platform/MSWindowsClipboard.h14
-rw-r--r--src/lib/platform/MSWindowsClipboardAnyTextConverter.cpp24
-rw-r--r--src/lib/platform/MSWindowsClipboardAnyTextConverter.h14
-rw-r--r--src/lib/platform/MSWindowsClipboardBitmapConverter.cpp12
-rw-r--r--src/lib/platform/MSWindowsClipboardBitmapConverter.h4
-rw-r--r--src/lib/platform/MSWindowsClipboardHTMLConverter.cpp41
-rw-r--r--src/lib/platform/MSWindowsClipboardHTMLConverter.h6
-rw-r--r--src/lib/platform/MSWindowsClipboardTextConverter.cpp12
-rw-r--r--src/lib/platform/MSWindowsClipboardTextConverter.h4
-rw-r--r--src/lib/platform/MSWindowsClipboardUTF16Converter.cpp12
-rw-r--r--src/lib/platform/MSWindowsClipboardUTF16Converter.h4
-rw-r--r--src/lib/platform/MSWindowsDesks.cpp12
-rw-r--r--src/lib/platform/MSWindowsDesks.h12
-rw-r--r--src/lib/platform/MSWindowsEventQueueBuffer.cpp16
-rw-r--r--src/lib/platform/MSWindowsEventQueueBuffer.h1
-rw-r--r--src/lib/platform/MSWindowsKeyState.h1
-rw-r--r--src/lib/platform/MSWindowsScreen.cpp13
-rw-r--r--src/lib/platform/MSWindowsScreen.h9
-rw-r--r--src/lib/platform/MSWindowsScreenSaver.h1
-rw-r--r--src/lib/platform/MSWindowsSession.cpp5
-rw-r--r--src/lib/platform/MSWindowsSession.h4
-rw-r--r--src/lib/platform/MSWindowsUtil.cpp17
-rw-r--r--src/lib/platform/MSWindowsUtil.h6
-rw-r--r--src/lib/platform/MSWindowsWatchdog.cpp7
-rw-r--r--src/lib/platform/MSWindowsWatchdog.h8
-rw-r--r--src/lib/platform/OSXClipboard.cpp12
-rw-r--r--src/lib/platform/OSXClipboard.h12
-rw-r--r--src/lib/platform/OSXClipboardAnyBitmapConverter.cpp6
-rw-r--r--src/lib/platform/OSXClipboardAnyBitmapConverter.h8
-rw-r--r--src/lib/platform/OSXClipboardAnyTextConverter.cpp16
-rw-r--r--src/lib/platform/OSXClipboardAnyTextConverter.h15
-rw-r--r--src/lib/platform/OSXClipboardBMPConverter.cpp12
-rw-r--r--src/lib/platform/OSXClipboardBMPConverter.h9
-rw-r--r--src/lib/platform/OSXClipboardHTMLConverter.cpp20
-rw-r--r--src/lib/platform/OSXClipboardHTMLConverter.h9
-rw-r--r--src/lib/platform/OSXClipboardTextConverter.cpp20
-rw-r--r--src/lib/platform/OSXClipboardTextConverter.h9
-rw-r--r--src/lib/platform/OSXClipboardUTF16Converter.cpp6
-rw-r--r--src/lib/platform/OSXClipboardUTF16Converter.h4
-rw-r--r--src/lib/platform/OSXDragView.m4
-rw-r--r--src/lib/platform/OSXKeyState.cpp12
-rw-r--r--src/lib/platform/OSXScreen.h6
-rw-r--r--src/lib/platform/XWindowsClipboard.cpp50
-rw-r--r--src/lib/platform/XWindowsClipboard.h30
-rw-r--r--src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp16
-rw-r--r--src/lib/platform/XWindowsClipboardAnyBitmapConverter.h14
-rw-r--r--src/lib/platform/XWindowsClipboardBMPConverter.cpp12
-rw-r--r--src/lib/platform/XWindowsClipboardBMPConverter.h4
-rw-r--r--src/lib/platform/XWindowsClipboardHTMLConverter.cpp6
-rw-r--r--src/lib/platform/XWindowsClipboardHTMLConverter.h4
-rw-r--r--src/lib/platform/XWindowsClipboardTextConverter.cpp8
-rw-r--r--src/lib/platform/XWindowsClipboardTextConverter.h4
-rw-r--r--src/lib/platform/XWindowsClipboardUCS2Converter.cpp6
-rw-r--r--src/lib/platform/XWindowsClipboardUCS2Converter.h4
-rw-r--r--src/lib/platform/XWindowsClipboardUTF8Converter.cpp6
-rw-r--r--src/lib/platform/XWindowsClipboardUTF8Converter.h4
-rw-r--r--src/lib/platform/XWindowsEventQueueBuffer.cpp15
-rw-r--r--src/lib/platform/XWindowsEventQueueBuffer.h2
-rw-r--r--src/lib/platform/XWindowsKeyState.cpp1
-rw-r--r--src/lib/platform/XWindowsKeyState.h2
-rw-r--r--src/lib/platform/XWindowsScreen.cpp1
-rw-r--r--src/lib/platform/XWindowsUtil.cpp24
-rw-r--r--src/lib/platform/XWindowsUtil.h24
-rw-r--r--src/lib/server/BaseClientProxy.cpp5
-rw-r--r--src/lib/server/BaseClientProxy.h7
-rw-r--r--src/lib/server/ClientProxy.cpp2
-rw-r--r--src/lib/server/ClientProxy.h3
-rw-r--r--src/lib/server/ClientProxy1_0.cpp3
-rw-r--r--src/lib/server/ClientProxy1_0.h2
-rw-r--r--src/lib/server/ClientProxy1_1.cpp3
-rw-r--r--src/lib/server/ClientProxy1_1.h2
-rw-r--r--src/lib/server/ClientProxy1_2.cpp3
-rw-r--r--src/lib/server/ClientProxy1_2.h2
-rw-r--r--src/lib/server/ClientProxy1_3.cpp3
-rw-r--r--src/lib/server/ClientProxy1_3.h2
-rw-r--r--src/lib/server/ClientProxy1_4.cpp3
-rw-r--r--src/lib/server/ClientProxy1_4.h3
-rw-r--r--src/lib/server/ClientProxy1_5.cpp9
-rw-r--r--src/lib/server/ClientProxy1_5.h3
-rw-r--r--src/lib/server/ClientProxy1_6.cpp7
-rw-r--r--src/lib/server/ClientProxy1_6.h3
-rw-r--r--src/lib/server/ClientProxyUnknown.cpp3
-rw-r--r--src/lib/server/Config.cpp349
-rw-r--r--src/lib/server/Config.h167
-rw-r--r--src/lib/server/InputFilter.cpp93
-rw-r--r--src/lib/server/InputFilter.h57
-rw-r--r--src/lib/server/PrimaryClient.cpp2
-rw-r--r--src/lib/server/PrimaryClient.h2
-rw-r--r--src/lib/server/Server.cpp56
-rw-r--r--src/lib/server/Server.h29
-rw-r--r--src/test/global/TestEventQueue.cpp2
-rw-r--r--src/test/global/TestEventQueue.h2
-rw-r--r--src/test/integtests/CMakeLists.txt42
-rw-r--r--src/test/integtests/arch/ArchInternetTests.cpp6
-rw-r--r--src/test/integtests/net/NetworkTests.cpp2
-rw-r--r--src/test/integtests/platform/MSWindowsKeyStateTests.cpp1
-rw-r--r--src/test/integtests/platform/XWindowsKeyStateTests.cpp35
-rw-r--r--src/test/integtests/platform/XWindowsScreenTests.cpp5
-rw-r--r--src/test/mock/barrier/MockEventQueue.h2
-rw-r--r--src/test/unittests/CMakeLists.txt3
-rw-r--r--src/test/unittests/barrier/ClipboardChunkTests.cpp52
204 files changed, 2188 insertions, 1828 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..ad9a302
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "ext/gtest"]
+ path = ext/gtest
+ url = https://github.com/google/googletest.git
+[submodule "ext/gmock"]
+ path = ext/gmock
+ url = https://github.com/google/googlemock.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e456e2f..6a377c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,12 +123,10 @@ if (UNIX)
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()
- message (FATAL_ERROR "Missing library: pthread")
- endif()
+ set (CMAKE_THREAD_PREFER_PTHREAD TRUE)
+ set (THREADS_PREFER_PTHREAD_FLAG TRUE)
+ find_package (Threads REQUIRED)
+ list (APPEND libs Threads::Threads)
# curl is used on both Linux and Mac
find_package (CURL)
@@ -167,7 +165,15 @@ if (UNIX)
link_directories("/usr/local/lib")
endif()
- if (${PKG_CONFIG_FOUND})
+ if (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+ set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};/usr/X11R6/include;/usr/local/include;/usr/local/include/avahi-compat-libdns_sd")
+ set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L/usr/local/lib -L/usr/X11R6/lib")
+ include_directories("/usr/local/include" "/usr/X11R6/include" "/usr/local/include/avahi-compat-libdns_sd")
+ link_directories("/usr/local/lib")
+ link_directories("/usr/X11R6/lib")
+ endif()
+
+ if (BARRIER_BUILD_GUI AND ${PKG_CONFIG_FOUND})
pkg_check_modules (AVAHI_COMPAT REQUIRED avahi-compat-libdns_sd)
include_directories (BEFORE SYSTEM ${AVAHI_COMPAT_INCLUDE_DIRS})
set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${AVAHI_COMPAT_INCLUDE_DIRS}")
@@ -261,7 +267,6 @@ if (UNIX)
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 *)")
@@ -349,12 +354,6 @@ else()
set (OPENSSL_LIBS ${lib_ssl} ${lib_crypto})
endif()
-
-# Check we have the *required* Qt5 libs.
-find_package(Qt5Core REQUIRED)
-find_package(Qt5Network REQUIRED)
-find_package(Qt5Widgets REQUIRED)
-
#
# Configure_file... but for directories, recursively.
#
@@ -398,12 +397,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
configure_files (${BARRIER_BUNDLE_SOURCE_DIR} ${BARRIER_BUNDLE_DIR})
- if (CMAKE_BUILD_TYPE STREQUAL "Release")
- add_custom_target(Barrier_dmg ALL
- bash build_installer.sh
- DEPENDS barrier barriers barrierc
- WORKING_DIRECTORY ${BARRIER_BUNDLE_DIR})
- endif()
+ add_custom_target(Barrier_MacOS ALL
+ bash build_dist.sh
+ DEPENDS barrier barriers barrierc
+ WORKING_DIRECTORY ${BARRIER_BUNDLE_DIR})
endif()
#
diff --git a/README.md b/README.md
index 39d2c61..7f380b1 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,8 @@
Eliminate the barrier between your machines.
Find [releases for windows and macOS here](https://github.com/debauchee/barrier/releases).
Your distro probably already has barrier packaged for it, see [distro specific packages](#distro-specific-packages)
-below for a list. Alternatively, we also provide a [flatpak](https://github.com/flathub/com.github.debauchee.barrier).
+below for a list. Alternatively, we also provide a [flatpak](https://github.com/flathub/com.github.debauchee.barrier)
+and a [snap](https://snapcraft.io/barrier).
### Contact info:
@@ -12,21 +13,26 @@ below for a list. Alternatively, we also provide a [flatpak](https://github.com/
#### CI Build Status
Master branch overall build status: [![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)
-* Linux Build Status: [![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master&jobName=Linux%20Build)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)
-* Mac Build Status: [![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master&jobName=Mac%20Build)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)
-* Windows Debug Build Status: [![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master&jobName=Windows%20Build&configuration=Windows%20Build%20Debug)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)
-* Windows Release Build Status: [![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master&jobName=Windows%20Build&configuration=Windows%20Build%20Release%20with%20Release%20Installer)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)
-* Snap: [![Snap Status](https://build.snapcraft.io/badge/debauchee/barrier.svg)](https://build.snapcraft.io/user/debauchee/barrier)
+
+|Platform |Build Status|
+| --:|:-- |
+|Linux |[![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master&jobName=Linux%20Build)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)|
+|Mac |[![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master&jobName=Mac%20Build)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)|
+|Windows Debug |[![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master&jobName=Windows%20Build&configuration=Windows%20Build%20Debug)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)|
+|Windows Release|[![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master&jobName=Windows%20Build&configuration=Windows%20Build%20Release%20with%20Release%20Installer)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master)|
+|Snap |[![Snap Status](https://build.snapcraft.io/badge/debauchee/barrier.svg)](https://build.snapcraft.io/user/debauchee/barrier)|
Our CI Builds are provided by Microsoft Azure Pipelines, Flathub, and Canonical.
### What is it?
-Barrier is KVM software forked from Symless's synergy 1.9 codebase. Synergy was a commercialized reimplementation of the original CosmoSynergy written by Chris Schoeneman.
+Barrier is software that mimics the functionality of a KVM switch, which historically would allow you to use a single keyboard and mouse to control multiple computers by physically turning a dial on the box to switch the machine you're controlling at any given moment. Barrier does this in software, allowing you to tell it which machine to control by moving your mouse to the edge of the screen, or by using a keypress to switch focus to a different system.
+
+Barrier was forked from Symless's Synergy 1.9 codebase. Synergy was a commercialized reimplementation of the original CosmoSynergy written by Chris Schoeneman.
### What's different?
-Whereas synergy has moved beyond its goals from the 1.x era, Barrier aims to maintain that simplicity. Barrier will let you use your keyboard and mouse from machine A to control machine B (or more). It's that simple.
+Whereas Synergy has moved beyond its goals from the 1.x era, Barrier aims to maintain that simplicity. Barrier will let you use your keyboard and mouse from machine A to control machine B (or more). It's that simple.
### Project goals
@@ -38,7 +44,7 @@ Communication. Everything we do is in the open. Our issue tracker will let you s
### Contact & support
-Please be aware that the *only* way to draw our attention to a bug is to create a new PR in the issue tracker. Write a clear, concise, detailed report and you will get a clear, concise, detailed response. Priority is always given to issues that affect a wider range of users.
+Please be aware that the *only* way to draw our attention to a bug is to create a new issue in [the issue tracker](https://github.com/debauchee/barrier/issues). Write a clear, concise, detailed report and you will get a clear, concise, detailed response. Priority is always given to issues that affect a wider range of users.
For short and simple questions or to just say hello find us on the Freenode IRC network in the #barrier channel.
@@ -66,6 +72,7 @@ A:
- MacOS/OS X
- Linux
- FreeBSD
+ - OpenBSD
Q: Are 32-bit versions of Windows supported?
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index bd773d3..e12cdd6 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -82,11 +82,16 @@ jobs:
Release:
B_BUILD_TYPE: Release
BARRIER_VERSION_STAGE: Release
+ variables:
+ VERBOSE: 1
+ TERM: xterm-256color
steps:
- - script: brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/aac86fc018c48d7b6f23a2e7535276899774567a/Formula/qt.rb
- displayName: Installed Pinned Qt
- - script: brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/aac86fc018c48d7b6f23a2e7535276899774567a/Formula/openssl.rb
- displayName: Installed Pinned OpenSSL
+ - script: rm -rf /usr/local/opt/openssl
+ displayName: Remove incompatible OpenSSL 1.0.2t from macOS-10.14 vmImage
+ - script: brew reinstall openssl
+ displayName: Installed newer OpenSSL 1.1.x
+ - script: brew install pkg-config qt5
+ displayName: Install Qt5 and pkg-config prereqs
- script: sh -x ./clean_build.sh
displayName: Clean Build
- task: PublishBuildArtifacts@1
diff --git a/clean_build.bat b/clean_build.bat
index edce29c..4416a7e 100644
--- a/clean_build.bat
+++ b/clean_build.bat
@@ -33,6 +33,8 @@ set B_QT_FULLPATH=%B_QT_ROOT%\%B_QT_VER%\%B_QT_MSVC%
echo Bonjour: %BONJOUR_SDK_HOME%
echo Qt: %B_QT_FULLPATH%
+git submodule update --init --recursive
+
rmdir /q /s build
mkdir build
if ERRORLEVEL 1 goto failed
@@ -67,9 +69,11 @@ if exist bin\Debug (
)
echo Build completed successfully
+set BUILD_FAILED=0
goto done
:failed
+set BUILD_FAILED=%ERRORLEVEL%
echo Build failed
:done
@@ -84,3 +88,5 @@ set BONJOUR_SDK_HOME=
set B_QT_FULLPATH=
set savedir=
set cmake_gen=
+
+EXIT /B %BUILD_FAILED%
diff --git a/clean_build.sh b/clean_build.sh
index fc1065a..3a92d8b 100755
--- a/clean_build.sh
+++ b/clean_build.sh
@@ -18,6 +18,10 @@ if [ "$(uname)" = "Darwin" ]; then
fi
# allow local customizations to build environment
[ -r ./build_env.sh ] && . ./build_env.sh
+
+# Initialise Git submodules
+git submodule update --init --recursive
+
B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE $B_CMAKE_FLAGS"
rm -rf build
mkdir build || exit 1
diff --git a/cmake/Version.cmake b/cmake/Version.cmake
index a27ffb4..9683649 100644
--- a/cmake/Version.cmake
+++ b/cmake/Version.cmake
@@ -2,7 +2,8 @@ cmake_minimum_required (VERSION 3.4)
set (BARRIER_VERSION_MAJOR 2)
set (BARRIER_VERSION_MINOR 3)
-set (BARRIER_VERSION_PATCH 2)
+set (BARRIER_VERSION_PATCH 3)
+set (BARRIER_VERSION_STAGE "release")
#
# Barrier Version
diff --git a/doc/UpdateManpages.txt b/doc/UpdateManpages.txt
index cdbe86f..4401c45 100644
--- a/doc/UpdateManpages.txt
+++ b/doc/UpdateManpages.txt
@@ -1,5 +1,10 @@
-To recreate the barrierc manpage use a command like:
+To recreate the generated part of barrierc manpage use a command like:
help2man -N --output=barrierc.1 --name='Barrier Keyboard/Mouse Client' /path/to/barrierc
And for barriers:
help2man -N --output=barriers.1 --name='Barrier Keyboard/Mouse Server' /path/to/barriers
+
+After that manually fixup:
+ * replace your home directory with $HOME in barriers.1
+ * revert formatting of FILES and COPYRIGHT sections to match formatting of existing version.
+ * add note referencing this file for instructions to the first line.
diff --git a/doc/barrierc.1 b/doc/barrierc.1
index 42aa824..2fd882a 100644
--- a/doc/barrierc.1
+++ b/doc/barrierc.1
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
-.TH BARRIERC "1" "May 2018" "barrierc 2.1.0-snapshot" "User Commands"
+.\" See UpdateManpages.txt about modification of this file. Most of it was generated by help2man 1.47.8.
+.TH BARRIERC "1" "November 2019" "barrierc 2.3.3-release" "User Commands"
.SH NAME
barrierc \- Barrier Keyboard/Mouse Client
.SH SYNOPSIS
diff --git a/doc/barriers.1 b/doc/barriers.1
index e0dc49a..098ea84 100644
--- a/doc/barriers.1
+++ b/doc/barriers.1
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
-.TH BARRIERS "1" "May 2018" "barriers 2.1.0-snapshot" "User Commands"
+.\" See UpdateManpages.txt about modification of this file. Most of it was generated by help2man 1.47.8.
+.TH BARRIERS "1" "November 2019" "barriers 2.3.3-release" "User Commands"
.SH NAME
barriers \- Barrier Keyboard/Mouse Server
.SH SYNOPSIS
@@ -47,6 +47,10 @@ connect to the X server at <display>
\fB\-\-no\-xinitthreads\fR
do not call XInitThreads()
.TP
+\fB\-\-screen\-change\-script\fR <path>
+full path to script to run on screen change
+first argument is the new screen name
+.TP
\fB\-f\fR, \fB\-\-no\-daemon\fR
run in the foreground.
.TP
@@ -66,12 +70,13 @@ hostname must be the address or hostname of an interface on the system.
Placing brackets around an IPv6 address is required when also specifying
a port number and optional otherwise. The default is to listen on all
interfaces using port number 24800.
-.PP
+.SH FILES
If no configuration file pathname is provided then the first of the
following to load successfully sets the configuration:
.IP
-$HOME/.local/share/barrier/barrier.conf
-\fI\,/etc/barrier.conf\/\fP
+.I $HOME/.local/share/barrier/.barrier.conf
+.br
+.I /etc/barrier.conf
.SH COPYRIGHT
Copyright \(co 2018 Debauchee Open Source Group
.br
diff --git a/res/barrier.desktop b/res/barrier.desktop
index fe59751..6bb60e1 100644
--- a/res/barrier.desktop
+++ b/res/barrier.desktop
@@ -5,6 +5,6 @@ Comment=Keyboard and mouse sharing solution
Exec=barrier
Icon=barrier
Terminal=false
-Categories=Utility;
+Categories=Utility;DesktopUtility;
Keywords=keyboard;mouse;sharing;network;share;
diff --git a/res/config.h.in b/res/config.h.in
index f3a7244..2bd3b3b 100644
--- a/res/config.h.in
+++ b/res/config.h.in
@@ -55,12 +55,6 @@
/* 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}
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 804c0fc..25b1f47 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -11,6 +11,9 @@ license: GPL-2.0
apps:
barrier:
command: desktop-launch barrier #first run might take longer
+ environment:
+ # Fallback to XWayland if running in a Wayland session.
+ DISABLE_WAYLAND: 1
desktop: usr/share/applications/barrier.desktop
common-id: com.github.debauchee.barrier
plugs: &plugs
@@ -40,11 +43,13 @@ parts:
barrier:
source: .
+ source-type: git
plugin: cmake
configflags:
- "-DCMAKE_INSTALL_PREFIX=/usr"
- "-DCMAKE_BUILD_TYPE=Release"
build-packages:
+ - build-essential
- xorg-dev
- libcurl4-openssl-dev
- libavahi-compat-libdnssd-dev
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3a8e83e..55aad09 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,6 +19,7 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR}/lib)
add_subdirectory(lib)
add_subdirectory(cmd)
+add_subdirectory(test)
if (BARRIER_BUILD_GUI)
add_subdirectory(gui)
diff --git a/src/cmd/barriers/barriers.cpp b/src/cmd/barriers/barriers.cpp
index cd67bcb..21c4d80 100644
--- a/src/cmd/barriers/barriers.cpp
+++ b/src/cmd/barriers/barriers.cpp
@@ -38,6 +38,13 @@ main(int argc, char** argv)
// record window instance for tray icon, etc
ArchMiscWindows::setInstanceWin32(GetModuleHandle(NULL));
#endif
+
+#ifdef __APPLE__
+ /* Silence "is calling TIS/TSM in non-main thread environment" as it is a red
+ herring that causes a lot of issues to be filed for the MacOS client/server.
+ */
+ setenv("OS_ACTIVITY_DT_MODE", "NO", true);
+#endif
Arch arch;
arch.init();
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 9eaa67e..f29fd91 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.4)
-find_package (Qt5 COMPONENTS Core Widgets Network)
+find_package (Qt5 REQUIRED COMPONENTS Core Widgets Network)
set (CMAKE_AUTOMOC ON)
set (CMAKE_AUTORCC ON)
set (CMAKE_AUTOUIC ON)
@@ -48,6 +48,6 @@ target_link_libraries (barrier common)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
install (TARGETS barrier DESTINATION ${BARRIER_BUNDLE_BINARY_DIR})
-elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
install (TARGETS barrier DESTINATION bin)
endif()
diff --git a/src/gui/res/Barrier.qrc b/src/gui/res/Barrier.qrc
index 39da79e..ee6127d 100644
--- a/src/gui/res/Barrier.qrc
+++ b/src/gui/res/Barrier.qrc
@@ -54,5 +54,8 @@
<file>image/spinning-wheel.gif</file>
<file>icons/16x16/padlock.png</file>
<file>icons/16x16/barrier-transfering.png</file>
+ <file>icons/32x32/barrier-connected-mask.png</file>
+ <file>icons/32x32/barrier-disconnected-mask.png</file>
+ <file>icons/32x32/barrier-transfering-mask.png</file>
</qresource>
</RCC>
diff --git a/src/gui/res/icons/32x32/barrier-connected-mask.png b/src/gui/res/icons/32x32/barrier-connected-mask.png
new file mode 100644
index 0000000..7e17314
--- /dev/null
+++ b/src/gui/res/icons/32x32/barrier-connected-mask.png
Binary files differ
diff --git a/src/gui/res/icons/32x32/barrier-connected-mask.svg b/src/gui/res/icons/32x32/barrier-connected-mask.svg
new file mode 100644
index 0000000..e710bff
--- /dev/null
+++ b/src/gui/res/icons/32x32/barrier-connected-mask.svg
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ inkscape:export-ydpi="6.1439996"
+ inkscape:export-xdpi="6.1439996"
+ inkscape:export-filename="/Users/daniel/Documents/Projects/barrier/src/gui/res/icons/16x16/barrier-connected2.png"
+ inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
+ sodipodi:docname="barrier-connected.svg"
+ xml:space="preserve"
+ style="enable-background:new 0 0 500 500;"
+ viewBox="0 0 500 500"
+ y="0px"
+ x="0px"
+ id="Layer_1"
+ version="1.1">
+ <metadata
+ id="metadata3769">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+
+
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+
+
+ <dc:title />
+
+
+ </cc:Work>
+
+
+ </rdf:RDF>
+
+
+ </metadata>
+
+
+ <defs
+ id="defs3767" />
+
+
+ <sodipodi:namedview
+ inkscape:document-rotation="0"
+ inkscape:current-layer="Layer_1"
+ inkscape:window-maximized="0"
+ inkscape:window-y="23"
+ inkscape:window-x="0"
+ inkscape:cy="560"
+ inkscape:cx="400"
+ inkscape:zoom="0.35"
+ showgrid="false"
+ id="namedview3765"
+ inkscape:window-height="1035"
+ inkscape:window-width="1600"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10"
+ gridtolerance="10"
+ objecttolerance="10"
+ borderopacity="1"
+ bordercolor="#666666"
+ pagecolor="#ffffff" />
+
+
+ <style
+ id="style3754"
+ type="text/css">
+ .st0{fill:#3F96B9;}
+ .st1{fill:#5D7DBD;}
+ .st2{fill:#196260;}
+ .st3{fill:#97C33D;}
+</style>
+
+
+ <path
+ id="path3758"
+ style="fill:#000000;fill-opacity:1;stroke-width:113.38582677;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 208.92773 63.982422 C 205.33457 63.989839 201.75572 64.077891 198.19531 64.248047 C 166.11331 65.781284 155.9386 96.232598 158.8418 110.98047 C 162.3116 128.60661 175.6547 145.03532 201.17188 144.74805 C 234.8387 144.36902 274.55668 155.22284 308.83984 174.3418 C 328.46906 152.78912 352.20206 134.77401 379.11719 121.6543 C 329.91472 85.187932 267.50995 63.861491 208.92773 63.982422 z M 461.23047 229.19336 C 461.14679 229.22471 461.06407 229.25756 460.98047 229.28906 A 165 165 0 0 1 461.35742 229.58789 C 461.31331 229.4571 461.27486 229.32404 461.23047 229.19336 z " />
+
+
+ <path
+ id="path3762"
+ style="fill:#000000;fill-opacity:1;stroke-width:113.38582677;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 163.16016,154.06445 c 0.24078,23.52501 -4.88694,46.19659 -14.44141,66.57422 20.25274,20.32232 46.9064,33.15132 76.96484,39.47071 11.24207,-26.49781 16.13886,-54.62798 14.70508,-87.98243 -10.98012,-2.4768 -21.58009,-4.43174 -36.08789,-4.99414 -16.13136,0.32407 -29.99886,-1.41943 -41.14062,-13.06836 z M 54.447266,301.49609 c -4.440357,1.30022 -8.977109,2.42138 -13.613282,3.33399 -1.13569,0.22849 -2.312497,0.36038 -3.466796,0.58789 -20.324201,5.37891 -33.2705698,25.89072 -29.1308599,47.01172 4.0713009,20.60749 22.9741349,34.58694 43.2402339,32.74804 1.667491,-0.2832 3.315378,-0.55083 4.992188,-0.85351 29.823413,-5.86765 53.8902,-14.8631 77.54297,-27.68555 -31.66639,-12.35179 -56.65893,-31.70018 -79.564454,-55.14258 z"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccccccccc" />
+
+
+ <path
+ id="path3756"
+ style="fill:#000000;fill-opacity:1;stroke-width:113.38582677;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 48.044922 83.142578 C 28.954084 83.503095 9.2123555 97.093877 8.0878906 117.92188 C 2.0242998 230.23527 80.84571 332.7332 194.02148 356.32031 A 165 165 0 0 1 215.30273 277.91016 C 214.29378 277.73837 213.28878 277.55747 212.28906 277.36719 C 139.33013 263.00789 88.885816 198.64775 88.947266 126.89844 C 88.96652 104.41725 77.647355 86.548954 53.927734 83.460938 C 51.988078 83.208417 50.019836 83.105283 48.044922 83.142578 z " />
+
+
+ <path
+ id="path3760"
+ style="fill:#000000;fill-opacity:1;stroke-width:113.38582677;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 458.02539 122.87695 C 456.77519 122.86833 455.51624 122.91912 454.25195 123.03125 C 453.03915 123.25585 451.82615 123.4009 450.62305 123.63281 C 398.11964 133.95371 353.1195 161.21828 320.23438 198.61914 A 165 165 0 0 1 359 194 A 165 165 0 0 1 435.7168 212.91797 C 445.35833 208.56785 455.56561 205.24658 466.25977 203.14258 C 466.87406 203.01858 467.49027 202.95126 468.13477 202.84375 C 488.52347 197.50195 501.51813 176.94243 497.36133 155.76172 C 493.57843 136.46881 476.77846 123.00624 458.02539 122.87695 z " />
+
+
+<path
+ id="circle2502"
+ style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:113.386;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.332155"
+ d="M 359 230.66602 A 128.33333 128.33333 0 0 0 230.66602 359 A 128.33333 128.33333 0 0 0 359 487.33398 A 128.33333 128.33333 0 0 0 487.33398 359 A 128.33333 128.33333 0 0 0 359 230.66602 z M 424.85547 296.02734 A 18.89765 18.89765 0 0 1 437.22852 300.73438 A 18.89765 18.89765 0 0 1 438.93945 327.40625 L 351.25977 427.10742 A 18.89954 18.89954 0 0 1 325.02734 429.19336 L 271.99414 385.35352 A 18.89765 18.89765 0 0 1 269.4707 358.74609 A 18.89765 18.89765 0 0 1 296.07617 356.22266 L 334.98242 388.38477 L 410.55859 302.44531 A 18.89765 18.89765 0 0 1 424.49023 296.0293 A 18.89765 18.89765 0 0 1 424.85547 296.02734 z " />
+
+</svg>
diff --git a/src/gui/res/icons/32x32/barrier-disconnected-mask.png b/src/gui/res/icons/32x32/barrier-disconnected-mask.png
new file mode 100644
index 0000000..bedfa75
--- /dev/null
+++ b/src/gui/res/icons/32x32/barrier-disconnected-mask.png
Binary files differ
diff --git a/src/gui/res/icons/32x32/barrier-disconnected-mask.svg b/src/gui/res/icons/32x32/barrier-disconnected-mask.svg
new file mode 100644
index 0000000..aae4aea
--- /dev/null
+++ b/src/gui/res/icons/32x32/barrier-disconnected-mask.svg
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ viewBox="0 0 500 500"
+ style="enable-background:new 0 0 500 500;"
+ xml:space="preserve"
+ sodipodi:docname="barrier-foo.svg"
+ inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
+ inkscape:export-filename="/home/ian/src/barrier.git/res/barrier.png"
+ inkscape:export-xdpi="49.150002"
+ inkscape:export-ydpi="49.150002">
+ <metadata
+ id="metadata3769">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+
+ <dc:title />
+
+ </cc:Work>
+
+ </rdf:RDF>
+
+ </metadata>
+
+ <defs
+ id="defs3767" />
+
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1035"
+ id="namedview3765"
+ showgrid="false"
+ inkscape:zoom="0.35355339"
+ inkscape:cx="-672.59049"
+ inkscape:cy="-25.818972"
+ inkscape:window-x="0"
+ inkscape:window-y="23"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_1"
+ inkscape:document-rotation="0" />
+
+ <style
+ type="text/css"
+ id="style3754">
+ .st0{fill:#3F96B9;}
+ .st1{fill:#5D7DBD;}
+ .st2{fill:#196260;}
+ .st3{fill:#97C33D;}
+</style>
+
+ <path
+ d="M 208.92773 63.982422 C 205.33457 63.989839 201.75572 64.077891 198.19531 64.248047 C 166.11331 65.781284 155.9386 96.232599 158.8418 110.98047 C 162.3116 128.60661 175.6547 145.03532 201.17188 144.74805 C 234.8387 144.36902 274.55668 155.22284 308.83984 174.3418 C 328.46906 152.78912 352.20206 134.77401 379.11719 121.6543 C 329.91472 85.187935 267.50995 63.861491 208.92773 63.982422 z M 461.23047 229.19336 C 433.75784 239.48583 410.4292 258.03313 393.10547 281.19727 C 401.63731 295.34291 418.53512 303.36814 435.80859 299.96289 C 455.53659 296.07959 469.1128 278.63474 468.6582 259.35742 C 468.2597 257.10893 467.93894 254.85983 467.49414 252.58203 C 465.92526 244.60302 463.81575 236.80429 461.23047 229.19336 z "
+ style="fill:#000000;fill-opacity:1"
+ id="path3758" />
+
+ <path
+ sodipodi:nodetypes="cccccccccccccc"
+ inkscape:connector-curvature="0"
+ d="m 163.16016,154.06445 c 0.24078,23.52501 -4.88694,46.19659 -14.44141,66.57422 20.25274,20.32232 46.9064,33.15132 76.96484,39.47071 11.24207,-26.49781 16.13886,-54.62798 14.70508,-87.98243 -10.98012,-2.4768 -21.58009,-4.43174 -36.08789,-4.99414 -16.13136,0.32407 -29.99886,-1.41943 -41.14062,-13.06836 z M 54.447266,301.49609 c -4.440357,1.30022 -8.977109,2.42138 -13.613282,3.33399 -1.13569,0.22849 -2.312497,0.36038 -3.466796,0.58789 -20.324201,5.37891 -33.2705698,25.89072 -29.1308599,47.01172 4.0713009,20.60749 22.9741349,34.58694 43.2402339,32.74804 1.667491,-0.2832 3.315378,-0.55083 4.992188,-0.85351 29.823413,-5.86765 53.8902,-14.8631 77.54297,-27.68555 -31.66639,-12.35179 -56.65893,-31.70018 -79.564454,-55.14258 z"
+ style="fill:#000000;fill-opacity:1"
+ id="path3762" />
+
+ <path
+ class="st0"
+ d="m 196.90869,356.69147 c 21.74407,4.28031 42.98725,-10.13468 47.31436,-32.13466 3.97759,-20.209 -7.7089,-39.89847 -26.5175,-46.26266 -1.8194,-0.26571 -3.62598,-0.5869 -5.41698,-0.92779 C 139.32964,263.00706 88.885416,198.6481 88.946866,126.89879 88.96612,104.4176 77.646542,86.549919 53.926921,83.461903 33.237257,80.768352 9.328315,94.939572 8.0875262,117.92219 1.9767374,231.10981 82.070866,334.34191 196.66358,356.87018 c 0.0467,0.0186 0.13284,0.0186 0.207,0.0186 z"
+ id="path3756"
+ inkscape:connector-curvature="0"
+ style="fill:#000000;fill-opacity:1;stroke-width:0.999999"
+ sodipodi:nodetypes="ccccsssccc" />
+
+ <path
+ class="st2"
+ d="m 454.25179,123.03077 c 20.22858,-1.794 39.0743,12.1518 43.10939,32.7309 4.1568,21.18071 -8.8369,41.7407 -29.2256,47.0825 -0.6445,0.10751 -1.26071,0.1739 -1.875,0.2979 -73.01749,14.3657 -123.57474,85.14129 -123.3252,156.96256 0.0568,16.34024 -13.64233,39.82782 -39.26405,39.84442 -27.53579,0.0179 -40.84582,-21.96106 -41.53764,-36.13118 -5.55175,-113.71384 73.49121,-217.57908 188.4902,-240.18509 1.2031,-0.23191 2.4151,-0.37741 3.6279,-0.60201"
+ id="path3760"
+ inkscape:connector-curvature="0"
+ style="fill:#000000;fill-opacity:1"
+ sodipodi:nodetypes="ccccssscc" />
+
+</svg>
diff --git a/src/gui/res/icons/32x32/barrier-transfering-mask.png b/src/gui/res/icons/32x32/barrier-transfering-mask.png
new file mode 100644
index 0000000..90b69d1
--- /dev/null
+++ b/src/gui/res/icons/32x32/barrier-transfering-mask.png
Binary files differ
diff --git a/src/gui/res/icons/32x32/barrier-transfering-mask.svg b/src/gui/res/icons/32x32/barrier-transfering-mask.svg
new file mode 100644
index 0000000..ef7126a
--- /dev/null
+++ b/src/gui/res/icons/32x32/barrier-transfering-mask.svg
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ inkscape:export-ydpi="6.1440001"
+ inkscape:export-xdpi="6.1440001"
+ inkscape:export-filename="/Users/daniel/Documents/Projects/barrier/src/gui/res/icons/16x16/barrier-transfering2.png"
+ inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
+ sodipodi:docname="barrier-transferring.svg"
+ xml:space="preserve"
+ style="enable-background:new 0 0 500 500;"
+ viewBox="0 0 500 500"
+ y="0px"
+ x="0px"
+ id="Layer_1"
+ version="1.1">
+ <metadata
+ id="metadata3769">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+
+
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+
+
+ <dc:title></dc:title>
+
+
+ </cc:Work>
+
+
+ </rdf:RDF>
+
+
+ </metadata>
+
+
+ <defs
+ id="defs3767">
+ <inkscape:path-effect
+ effect="fillet_chamfer"
+ id="path-effect874"
+ is_visible="true"
+ satellites_param="F,0,0,1,0,10,0,1 @ F,0,0,1,0,10,0,1 @ F,0,0,1,0,22.763694,0,1 @ F,0,0,1,0,4.6597885e-05,0,1 @ F,0,0,1,0,10.886678,0,1 @ F,0,0,1,0,4.6584863e-05,0,1 @ F,0,0,1,0,22.763694,0,1 @ F,0,0,1,0,10,0,1 @ F,0,0,1,0,10,0,1"
+ unit="px"
+ method="auto"
+ mode="F"
+ radius="10"
+ chamfer_steps="1"
+ flexible="false"
+ use_knot_distance="false"
+ apply_no_radius="true"
+ apply_with_radius="true"
+ only_selected="false"
+ hide_knots="false" />
+ <inkscape:path-effect
+ hide_knots="false"
+ only_selected="false"
+ apply_with_radius="true"
+ apply_no_radius="true"
+ use_knot_distance="false"
+ flexible="false"
+ chamfer_steps="1"
+ radius="10"
+ mode="F"
+ method="auto"
+ unit="px"
+ satellites_param="F,0,0,1,0,10,0,1 @ F,0,0,1,0,10,0,1 @ F,0,0,1,0,22.763694,0,1 @ F,0,0,1,0,4.6597885e-05,0,1 @ F,0,0,1,0,10.886678,0,1 @ F,0,0,1,0,4.6584863e-05,0,1 @ F,0,0,1,0,22.763694,0,1 @ F,0,0,1,0,10,0,1 @ F,0,0,1,0,10,0,1"
+ is_visible="true"
+ id="path-effect870"
+ effect="fillet_chamfer" />
+</defs>
+
+
+ <sodipodi:namedview
+ inkscape:document-rotation="0"
+ inkscape:current-layer="Layer_1"
+ inkscape:window-maximized="0"
+ inkscape:window-y="23"
+ inkscape:window-x="0"
+ inkscape:cy="235.51537"
+ inkscape:cx="-886.92239"
+ inkscape:zoom="0.24748737"
+ showgrid="false"
+ id="namedview3765"
+ inkscape:window-height="1035"
+ inkscape:window-width="1600"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10"
+ gridtolerance="10"
+ objecttolerance="10"
+ borderopacity="1"
+ bordercolor="#666666"
+ pagecolor="#ffffff" />
+
+
+ <style
+ id="style3754"
+ type="text/css">
+ .st0{fill:#3F96B9;}
+ .st1{fill:#5D7DBD;}
+ .st2{fill:#196260;}
+ .st3{fill:#97C33D;}
+</style>
+
+
+ <path
+ d="M 359.27734 108.21094 L 359.27734 132.55664 C 365.67653 128.62358 372.29397 124.98025 379.11719 121.6543 C 372.71637 116.91034 366.08754 112.42856 359.27734 108.21094 z M 461.23047 229.19336 C 448.78642 233.85545 437.20343 240.2242 426.63281 247.93555 C 427.32332 248.09983 428.00806 248.28771 428.6875 248.49414 C 428.98032 248.58313 429.26812 248.68657 429.55859 248.7832 C 429.98853 248.92619 430.41747 249.07106 430.8418 249.23047 C 431.16859 249.35328 431.49129 249.48482 431.81445 249.61719 C 432.20554 249.77731 432.59315 249.94531 432.97852 250.11914 C 433.29471 250.26184 433.60982 250.40488 433.92188 250.55664 C 434.32764 250.75387 434.72672 250.96357 435.125 251.17578 C 435.39583 251.32017 435.67035 251.45625 435.9375 251.60742 C 436.57194 251.96623 437.19461 252.34423 437.80664 252.74023 C 438.02384 252.88085 438.23309 253.03257 438.44727 253.17773 C 438.87539 253.46776 439.29942 253.76249 439.71484 254.07031 C 439.94593 254.24162 440.17149 254.41902 440.39844 254.5957 C 440.78856 254.89927 441.17344 255.20827 441.55078 255.52734 C 441.77623 255.71807 442.00003 255.90935 442.2207 256.10547 C 442.60765 256.44921 442.98385 256.80415 443.35547 257.16406 C 443.53383 257.33689 443.71594 257.50518 443.89062 257.68164 C 444.42629 258.22248 444.94793 258.77577 445.44727 259.34961 C 445.52294 259.4366 445.59121 259.52946 445.66602 259.61719 C 446.08728 260.11107 446.49598 260.61625 446.88867 261.13281 C 447.04472 261.33814 447.1924 261.54902 447.34375 261.75781 C 447.6497 262.17974 447.94631 262.60731 448.23242 263.04297 C 448.38282 263.27201 448.53104 263.50166 448.67578 263.73438 C 448.95168 264.17788 449.21409 264.62952 449.46875 265.08594 C 449.5924 265.30759 449.72135 265.5254 449.83984 265.75 C 450.19652 266.42591 450.53561 267.11108 450.84375 267.8125 C 451.14496 268.49814 451.41239 269.19713 451.66406 269.90039 C 451.72111 270.05969 451.77749 270.21879 451.83203 270.37891 C 452.06677 271.06871 452.28446 271.76363 452.47266 272.4668 C 452.50323 272.58078 452.52728 272.69626 452.55664 272.81055 C 452.70936 273.40644 452.84304 274.00607 452.96289 274.60938 C 453.00574 274.82419 453.04917 275.0383 453.08789 275.25391 C 453.20598 275.91459 453.3092 276.57741 453.38867 277.24414 C 453.41929 277.4989 453.43981 277.75434 453.46484 278.00977 C 453.50973 278.47248 453.54565 278.93605 453.57227 279.40039 C 453.58861 279.68041 453.60744 279.95984 453.61719 280.24023 C 453.6375 280.8435 453.64092 281.4469 453.63086 282.05078 C 453.62483 282.4392 453.60835 282.8267 453.58984 283.21484 C 453.5759 283.50077 453.55778 283.78669 453.53711 284.07227 C 453.48422 284.81374 453.40655 285.55196 453.30859 286.28906 C 453.28314 286.47925 453.2628 286.6696 453.23438 286.85938 C 453.16302 287.33865 453.07854 287.81495 452.98828 288.29102 C 452.96879 288.39344 452.9481 288.4954 452.92773 288.59766 C 452.73735 289.55706 452.50869 290.5066 452.24219 291.44727 C 452.23431 291.47505 452.22865 291.50348 452.2207 291.53125 C 452.21827 291.53977 452.21533 291.54813 452.21289 291.55664 C 452.06962 292.05641 451.9165 292.55197 451.75195 293.04492 C 451.7485 293.05527 451.74565 293.06583 451.74219 293.07617 C 462.43797 285.39716 468.97586 272.8277 468.6582 259.35742 C 468.2597 257.10893 467.93894 254.85983 467.49414 252.58203 C 465.92526 244.60302 463.81575 236.80429 461.23047 229.19336 z "
+ style="fill:#000000;fill-opacity:1"
+ id="path3758" />
+
+
+ <path
+ d="M 53.083984 301.87891 C 49.07799 303.01375 44.998206 304.01037 40.833984 304.83008 C 39.698294 305.05857 38.521487 305.19046 37.367188 305.41797 C 17.042987 310.79688 4.0966182 331.30869 8.2363281 352.42969 C 12.307629 373.03718 31.210464 387.01663 51.476562 385.17773 C 53.144053 384.89453 54.79194 384.6269 56.46875 384.32422 C 77.389116 380.20821 95.473066 374.54685 112.57227 367.11133 L 55.820312 305.32617 C 54.82468 304.2425 53.920669 303.08325 53.083984 301.87891 z "
+ style="fill:#000000;fill-opacity:1"
+ id="path3762" />
+
+
+ <path
+ d="M 48.044922 83.142578 C 28.954084 83.503095 9.2123555 97.093877 8.0878906 117.92188 C 5.2049772 171.32089 21.516937 222.49852 51.578125 264.03711 C 57.777775 253.83012 69.446281 247.02325 81.429688 247.02344 L 81.433594 247.02344 L 141.15625 247.02344 L 141.15625 242.33984 C 108.58757 213.6735 88.90887 171.7289 88.947266 126.89844 C 88.96652 104.41725 77.647355 86.548954 53.927734 83.460938 C 51.988078 83.208417 50.019836 83.105283 48.044922 83.142578 z M 188.87695 270.79492 A 24.778213 24.778213 0 0 1 177.49414 283.36328 A 24.778213 24.778213 0 0 1 158.08789 296.44922 C 168.01464 296.16786 172.89889 294.01125 180.52148 286.38867 C 186.05078 280.85937 188.69577 276.76351 189.84375 271.14648 C 189.52112 271.03002 189.19843 270.91344 188.87695 270.79492 z "
+ style="fill:#000000;fill-opacity:1;stroke-width:0.999999"
+ id="path3756" />
+
+
+ <path
+ d="M 458.02539 122.87695 C 456.77519 122.86833 455.51624 122.91912 454.25195 123.03125 C 453.03915 123.25585 451.82615 123.4009 450.62305 123.63281 C 416.60828 130.31929 385.74205 144.11691 359.27734 163.17383 L 359.27734 247.02344 L 388.2207 247.02344 C 408.86762 225.17574 435.57914 209.17878 466.25977 203.14258 C 466.87406 203.01858 467.49027 202.95126 468.13477 202.84375 C 488.52347 197.50195 501.51813 176.94243 497.36133 155.76172 C 493.57843 136.46881 476.77846 123.00624 458.02539 122.87695 z M 309.85156 263.95508 C 309.90432 265.81634 310.02219 267.50059 310.23047 269.05859 C 310.50817 271.13593 310.94528 272.98927 311.59766 274.74023 C 311.76075 275.17798 311.93801 275.60832 312.12891 276.03516 C 312.12915 276.03571 312.12866 276.03656 312.12891 276.03711 C 312.51053 276.89024 312.94993 277.72623 313.45312 278.55859 C 313.95663 279.39147 314.52481 280.22199 315.16406 281.06445 C 315.80331 281.90692 316.51371 282.76013 317.30273 283.64258 C 317.30307 283.64296 317.3024 283.64415 317.30273 283.64453 C 318.09151 284.52666 318.95966 285.43622 319.91211 286.38867 C 320.93784 287.4144 321.90898 288.34218 322.84766 289.18164 C 322.848 289.18195 322.84926 289.18133 322.84961 289.18164 C 323.78828 290.0211 324.69232 290.77163 325.58398 291.44141 C 327.81313 293.11584 329.95672 294.28671 332.33008 295.08203 C 332.33066 295.08223 332.33145 295.08184 332.33203 295.08203 C 335.17961 296.036 338.3563 296.45178 342.40234 296.55078 C 343.07745 296.56732 343.77593 296.57422 344.50195 296.57422 L 344.50195 284.11719 A 24.778213 24.778213 0 0 1 344.28125 284.21289 A 24.778213 24.778213 0 0 1 344.11719 284.2832 A 24.778213 24.778213 0 0 1 344.01953 284.32227 A 24.778213 24.778213 0 0 1 343.77148 284.42383 A 24.778213 24.778213 0 0 1 343.73047 284.44141 A 24.778213 24.778213 0 0 1 343.50781 284.5293 A 24.778213 24.778213 0 0 1 343.33984 284.59375 A 24.778213 24.778213 0 0 1 342.98633 284.72656 A 24.778213 24.778213 0 0 1 342.94922 284.74023 A 24.778213 24.778213 0 0 1 342.72266 284.82031 A 24.778213 24.778213 0 0 1 342.41992 284.92383 A 24.778213 24.778213 0 0 1 342.15625 285.01172 A 24.778213 24.778213 0 0 1 341.83984 285.11133 A 24.778213 24.778213 0 0 1 341.54492 285.20117 A 24.778213 24.778213 0 0 1 341.52734 285.20703 A 24.778213 24.778213 0 0 1 341.51562 285.21094 A 24.778213 24.778213 0 0 1 341.125 285.32227 A 24.778213 24.778213 0 0 1 340.7207 285.43164 A 24.778213 24.778213 0 0 1 340.36719 285.51953 A 24.778213 24.778213 0 0 1 340.31445 285.5332 A 24.778213 24.778213 0 0 1 340.14062 285.57422 A 24.778213 24.778213 0 0 1 339.9082 285.62695 A 24.778213 24.778213 0 0 1 339.86328 285.63672 A 24.778213 24.778213 0 0 1 339.49805 285.71484 A 24.778213 24.778213 0 0 1 339.18555 285.77734 A 24.778213 24.778213 0 0 1 338.91211 285.82812 A 24.778213 24.778213 0 0 1 338.57422 285.88672 A 24.778213 24.778213 0 0 1 338.5 285.90039 A 24.778213 24.778213 0 0 1 338.26172 285.9375 A 24.778213 24.778213 0 0 1 338.25977 285.9375 A 24.778213 24.778213 0 0 1 337.92383 285.98633 A 24.778213 24.778213 0 0 1 337.84766 285.99805 A 24.778213 24.778213 0 0 1 337.66992 286.02148 A 24.778213 24.778213 0 0 1 337.58594 286.03125 A 24.778213 24.778213 0 0 1 337.25586 286.07031 A 24.778213 24.778213 0 0 1 336.83984 286.11328 A 24.778213 24.778213 0 0 1 336.59961 286.13477 A 24.778213 24.778213 0 0 1 336.58203 286.13672 A 24.778213 24.778213 0 0 1 336.27344 286.16016 A 24.778213 24.778213 0 0 1 335.91797 286.18359 A 24.778213 24.778213 0 0 1 335.61328 286.19922 A 24.778213 24.778213 0 0 1 335.58594 286.20117 A 24.778213 24.778213 0 0 1 335.55859 286.20117 A 24.778213 24.778213 0 0 1 335.16797 286.21484 A 24.778213 24.778213 0 0 1 334.78125 286.22266 A 24.778213 24.778213 0 0 1 334.75 286.22266 A 24.778213 24.778213 0 0 1 334.6875 286.22266 A 24.778213 24.778213 0 0 1 334.50977 286.22461 A 24.778213 24.778213 0 0 1 334.44922 286.22461 A 24.778213 24.778213 0 0 1 334.15039 286.2207 A 24.778213 24.778213 0 0 1 334.0918 286.2207 A 24.778213 24.778213 0 0 1 333.97266 286.21875 A 24.778213 24.778213 0 0 1 333.91211 286.2168 A 24.778213 24.778213 0 0 1 333.88281 286.2168 A 24.778213 24.778213 0 0 1 333.49414 286.20312 A 24.778213 24.778213 0 0 1 333.15039 286.1875 A 24.778213 24.778213 0 0 1 332.85547 286.16992 A 24.778213 24.778213 0 0 1 332.83594 286.16797 A 24.778213 24.778213 0 0 1 332.82617 286.16797 A 24.778213 24.778213 0 0 1 332.48438 286.14062 A 24.778213 24.778213 0 0 1 332.41992 286.13672 A 24.778213 24.778213 0 0 1 332.03125 286.09961 A 24.778213 24.778213 0 0 1 331.98828 286.0957 A 24.778213 24.778213 0 0 1 331.65234 286.06055 A 24.778213 24.778213 0 0 1 331.52344 286.04492 A 24.778213 24.778213 0 0 1 331.28516 286.01367 A 24.778213 24.778213 0 0 1 331.05859 285.98242 A 24.778213 24.778213 0 0 1 330.86719 285.95508 A 24.778213 24.778213 0 0 1 330.70312 285.93164 A 24.778213 24.778213 0 0 1 330.4668 285.89258 A 24.778213 24.778213 0 0 1 330.21094 285.84961 A 24.778213 24.778213 0 0 1 330.08203 285.82617 A 24.778213 24.778213 0 0 1 329.86328 285.78516 A 24.778213 24.778213 0 0 1 329.63867 285.74219 A 24.778213 24.778213 0 0 1 329.4043 285.69336 A 24.778213 24.778213 0 0 1 329.25 285.66016 A 24.778213 24.778213 0 0 1 329.02734 285.61133 A 24.778213 24.778213 0 0 1 328.84766 285.57031 A 24.778213 24.778213 0 0 1 328.58789 285.50781 A 24.778213 24.778213 0 0 1 328.38477 285.45703 A 24.778213 24.778213 0 0 1 328.25 285.42188 A 24.778213 24.778213 0 0 1 328.0293 285.36523 A 24.778213 24.778213 0 0 1 327.75586 285.28906 A 24.778213 24.778213 0 0 1 327.68555 285.26953 A 24.778213 24.778213 0 0 1 327.32031 285.16016 A 24.778213 24.778213 0 0 1 326.94531 285.04297 A 24.778213 24.778213 0 0 1 326.875 285.02148 A 24.778213 24.778213 0 0 1 326.58789 284.92578 A 24.778213 24.778213 0 0 1 326.43359 284.87305 A 24.778213 24.778213 0 0 1 326.12891 284.76758 A 24.778213 24.778213 0 0 1 326.12695 284.76562 A 24.778213 24.778213 0 0 1 326.125 284.76562 A 24.778213 24.778213 0 0 1 325.74805 284.625 A 24.778213 24.778213 0 0 1 325.51172 284.53516 A 24.778213 24.778213 0 0 1 325.16016 284.39453 A 24.778213 24.778213 0 0 1 325.07812 284.36328 A 24.778213 24.778213 0 0 1 324.78516 284.24023 A 24.778213 24.778213 0 0 1 324.70703 284.20703 A 24.778213 24.778213 0 0 1 324.4082 284.07422 A 24.778213 24.778213 0 0 1 324.2793 284.01562 A 24.778213 24.778213 0 0 1 324.13672 283.95117 A 24.778213 24.778213 0 0 1 323.81055 283.79883 A 24.778213 24.778213 0 0 1 323.43555 283.61523 A 24.778213 24.778213 0 0 1 323.09375 283.44141 A 24.778213 24.778213 0 0 1 323.02344 283.40625 A 24.778213 24.778213 0 0 1 322.73633 283.25195 A 24.778213 24.778213 0 0 1 322.60156 283.17969 A 24.778213 24.778213 0 0 1 322.32617 283.02539 A 24.778213 24.778213 0 0 1 322.0332 282.85742 A 24.778213 24.778213 0 0 1 321.75781 282.69531 A 24.778213 24.778213 0 0 1 321.41992 282.48828 A 24.778213 24.778213 0 0 1 321.32031 282.42578 A 24.778213 24.778213 0 0 1 321.23047 282.36914 A 24.778213 24.778213 0 0 1 320.89648 282.1543 A 24.778213 24.778213 0 0 1 320.54883 281.92188 A 24.778213 24.778213 0 0 1 320.22266 281.69531 A 24.778213 24.778213 0 0 1 320.17578 281.66406 A 24.778213 24.778213 0 0 1 319.90625 281.46875 A 24.778213 24.778213 0 0 1 319.80273 281.39258 A 24.778213 24.778213 0 0 1 319.60742 281.24805 A 24.778213 24.778213 0 0 1 319.33984 281.04297 A 24.778213 24.778213 0 0 1 319.10352 280.85938 A 24.778213 24.778213 0 0 1 318.89062 280.6875 A 24.778213 24.778213 0 0 1 318.8418 280.64648 A 24.778213 24.778213 0 0 1 318.54883 280.4043 A 24.778213 24.778213 0 0 1 318.26758 280.16406 A 24.778213 24.778213 0 0 1 318.1582 280.07031 A 24.778213 24.778213 0 0 1 317.94336 279.87891 A 24.778213 24.778213 0 0 1 317.90039 279.83984 A 24.778213 24.778213 0 0 1 317.60938 279.57227 A 24.778213 24.778213 0 0 1 317.43359 279.4082 A 24.778213 24.778213 0 0 1 317.37109 279.34766 A 24.778213 24.778213 0 0 1 317.17383 279.1582 A 24.778213 24.778213 0 0 1 317.10547 279.08984 A 24.778213 24.778213 0 0 1 316.9082 278.89258 A 24.778213 24.778213 0 0 1 316.73438 278.71484 A 24.778213 24.778213 0 0 1 316.69141 278.67188 A 24.778213 24.778213 0 0 1 316.45117 278.41797 A 24.778213 24.778213 0 0 1 316.39844 278.36328 A 24.778213 24.778213 0 0 1 316.14062 278.08203 A 24.778213 24.778213 0 0 1 315.98047 277.9043 A 24.778213 24.778213 0 0 1 315.91602 277.83203 A 24.778213 24.778213 0 0 1 315.77734 277.67383 A 24.778213 24.778213 0 0 1 315.65625 277.53125 A 24.778213 24.778213 0 0 1 315.52539 277.37695 A 24.778213 24.778213 0 0 1 315.3457 277.16016 A 24.778213 24.778213 0 0 1 315.2832 277.08398 A 24.778213 24.778213 0 0 1 315.05859 276.80469 A 24.778213 24.778213 0 0 1 314.83789 276.52148 A 24.778213 24.778213 0 0 1 314.75586 276.41406 A 24.778213 24.778213 0 0 1 314.55078 276.13867 A 24.778213 24.778213 0 0 1 314.41016 275.94727 A 24.778213 24.778213 0 0 1 314.36719 275.88477 A 24.778213 24.778213 0 0 1 314.22852 275.69141 A 24.778213 24.778213 0 0 1 314.07227 275.4668 A 24.778213 24.778213 0 0 1 314.06055 275.44727 A 24.778213 24.778213 0 0 1 313.85352 275.14062 A 24.778213 24.778213 0 0 1 313.79883 275.05859 A 24.778213 24.778213 0 0 1 313.64258 274.81641 A 24.778213 24.778213 0 0 1 313.55469 274.67969 A 24.778213 24.778213 0 0 1 313.4082 274.44531 A 24.778213 24.778213 0 0 1 313.34766 274.3457 A 24.778213 24.778213 0 0 1 313.20312 274.10742 A 24.778213 24.778213 0 0 1 313.11914 273.96289 A 24.778213 24.778213 0 0 1 312.99023 273.74023 A 24.778213 24.778213 0 0 1 312.91797 273.61328 A 24.778213 24.778213 0 0 1 312.75391 273.31641 A 24.778213 24.778213 0 0 1 312.57031 272.97656 A 24.778213 24.778213 0 0 1 312.5293 272.89648 A 24.778213 24.778213 0 0 1 312.36523 272.57617 A 24.778213 24.778213 0 0 1 312.25781 272.36133 A 24.778213 24.778213 0 0 1 312.2168 272.27539 A 24.778213 24.778213 0 0 1 312.14453 272.12695 A 24.778213 24.778213 0 0 1 312.00977 271.83984 A 24.778213 24.778213 0 0 1 311.95703 271.72266 A 24.778213 24.778213 0 0 1 311.89062 271.57617 A 24.778213 24.778213 0 0 1 311.79492 271.35938 A 24.778213 24.778213 0 0 1 311.66406 271.05469 A 24.778213 24.778213 0 0 1 311.51562 270.69727 A 24.778213 24.778213 0 0 1 311.46484 270.56836 A 24.778213 24.778213 0 0 1 311.39648 270.39453 A 24.778213 24.778213 0 0 1 311.27734 270.08008 A 24.778213 24.778213 0 0 1 311.26172 270.03711 A 24.778213 24.778213 0 0 1 311.16016 269.75977 A 24.778213 24.778213 0 0 1 311.0918 269.56445 A 24.778213 24.778213 0 0 1 311.02344 269.36523 A 24.778213 24.778213 0 0 1 310.96875 269.19922 A 24.778213 24.778213 0 0 1 310.90039 268.98828 A 24.778213 24.778213 0 0 1 310.80859 268.69531 A 24.778213 24.778213 0 0 1 310.68945 268.29492 A 24.778213 24.778213 0 0 1 310.58984 267.9375 A 24.778213 24.778213 0 0 1 310.53906 267.74805 A 24.778213 24.778213 0 0 1 310.50586 267.62109 A 24.778213 24.778213 0 0 1 310.4375 267.34961 A 24.778213 24.778213 0 0 1 310.37305 267.07812 A 24.778213 24.778213 0 0 1 310.28125 266.66992 A 24.778213 24.778213 0 0 1 310.11914 265.84961 A 24.778213 24.778213 0 0 1 310.05859 265.50586 A 24.778213 24.778213 0 0 1 310.0332 265.3418 A 24.778213 24.778213 0 0 1 309.98438 265.02344 A 24.778213 24.778213 0 0 1 309.92773 264.60938 A 24.778213 24.778213 0 0 1 309.88086 264.2168 A 24.778213 24.778213 0 0 1 309.85156 263.95508 z "
+ style="fill:#000000;fill-opacity:1"
+ id="path3760" />
+
+
+<path
+ transform="translate(793.9799,36.365491)"
+ inkscape:connector-curvature="0"
+ inkscape:original-d="M -628.04883,-2.9160156 V 235.43359 h -107.26562 l 95.77539,104.26953 95.77539,104.26758 95.77539,-104.26758 95.77539,-104.26953 H -459.47852 V -2.9160156 Z"
+ inkscape:path-effect="#path-effect870"
+ d="M -628.04883,7.0839844 V 225.43359 a 10,10 135 0 1 -10,10 h -74.50193 a 10,10 113.71569 0 0 -7.36467,16.76473 l 80.37634,87.50477 a 10.001443,10.001443 47.431118 0 0 6e-5,6e-5 l 88.41075,96.24993 a 10,10 180 0 0 14.72922,0 l 88.41075,-96.24993 a 10.000439,10.000439 132.56888 0 0 6e-5,-6e-5 l 80.37634,-87.50477 a 10,10 66.284308 0 0 -7.36467,-16.76473 h -74.50194 a 10,10 45 0 1 -10,-10 V 7.0839844 a 10,10 45 0 0 -10,-10 h -148.57031 a 10,10 135 0 0 -10,10 z"
+ style="fill:#000000;stroke:none;stroke-width:34.4741;stroke-linecap:round;stroke-linejoin:round"
+ id="rect860" />
+</svg>
diff --git a/src/gui/res/lang/gui_sv.ts b/src/gui/res/lang/gui_sv.ts
index 6a8420e..f0c239e 100644
--- a/src/gui/res/lang/gui_sv.ts
+++ b/src/gui/res/lang/gui_sv.ts
@@ -1,12 +1,14 @@
-<?xml version="1.0" encoding="utf-8"?><!DOCTYPE TS><TS language="sv" sourcelanguage="en" version="2.0">
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="sv" sourcelanguage="en">
<context>
<name>AboutDialogBase</name>
<message>
<location filename="res/AboutDialogBase.ui" line="38"/>
<source>About Barrier</source>
- <translation type="finished">Om Barrier</translation>
+ <translation>Om Barrier</translation>
</message>
- <message utf8="true">
+ <message>
<location filename="res/AboutDialogBase.ui" line="53"/>
<source>&lt;p&gt;
Keyboard and mouse sharing application. Cross platform and open source.&lt;br /&gt;&lt;br /&gt;
@@ -26,22 +28,30 @@ Barrier is based on CosmoSynergy by Richard Lee and Adam Feder.&lt;br /&gt;
The Barrier GUI is based on QSynergy by Volker Lanz.&lt;br /&gt;&lt;br /&gt;
Visit our website for help and info (symless.com).
&lt;/p&gt;</oldsource>
- <translation type="unfinished"></translation>
+ <translation>&lt;p&gt;
+Program för att dela tangentbord och mus. Plattformsöverskridande och öppen källkod.&lt;br /&gt;&lt;br /&gt;
+Copyright © 2012-2016 Symless Ltd.&lt;br /&gt;
+Copyright © 2002-2012 Chris Schoeneman, Nick Bolton, Volker Lanz.&lt;br /&gt;&lt;br /&gt;
+Barrier är släppt under GNU General Public License (GPLv2).&lt;br /&gt;&lt;br /&gt;
+Barrier baseras på CosmoSynergy av Richard Lee and Adam Feder.&lt;br /&gt;
+Barrier GUI baseras på QSynergy av Volker Lanz.&lt;br /&gt;&lt;br /&gt;
+Besök vår webbplats för hjälp och information (symless.com).
+&lt;/p&gt;</translation>
</message>
<message>
<location filename="res/AboutDialogBase.ui" line="140"/>
<source>Unknown</source>
- <translation type="finished">Okänd</translation>
+ <translation>Okänd</translation>
</message>
<message>
<location filename="res/AboutDialogBase.ui" line="124"/>
<source>Version:</source>
- <translation type="finished">Version:</translation>
+ <translation>Version:</translation>
</message>
<message>
<location filename="res/AboutDialogBase.ui" line="163"/>
<source>&amp;Ok</source>
- <translation type="finished">&amp;Ok</translation>
+ <translation>&amp;OK</translation>
</message>
</context>
<context>
@@ -49,97 +59,97 @@ Visit our website for help and info (symless.com).
<message>
<location filename="res/ActionDialogBase.ui" line="14"/>
<source>Configure Action</source>
- <translation type="finished">Konfigurera</translation>
+ <translation>Konfigurera åtgärd</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="20"/>
<source>Choose the action to perform</source>
- <translation type="finished">Välj funktion som skall utföras</translation>
+ <translation>Välj den åtgärd som skall utföras</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="26"/>
<source>Press a hotkey</source>
- <translation type="finished">Tryck ned en snabbtangent</translation>
+ <translation>Tryck ner en snabbtangent</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="36"/>
<source>Release a hotkey</source>
- <translation type="finished">Släpp en snabbtangent</translation>
+ <translation>Släpp en snabbtangent</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="43"/>
<source>Press and release a hotkey</source>
- <translation type="finished">Tryck ned och släpp en snabbtangent</translation>
+ <translation>Tryck ner och släpp en snabbtangent</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="69"/>
<source>only on these screens</source>
- <translation type="finished">endast på dessa skärmar</translation>
+ <translation>endast på dessa skärmar</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="119"/>
<source>Switch to screen</source>
- <translation type="finished">Växla till skärm</translation>
+ <translation>Växla till skärm</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="150"/>
<source>Switch in direction</source>
- <translation type="finished">Växla i riktning</translation>
+ <translation>Växla i riktning</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="174"/>
<source>left</source>
- <translation type="finished">vänster</translation>
+ <translation>vänster</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="179"/>
<source>right</source>
- <translation type="finished">höger</translation>
+ <translation>höger</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="184"/>
<source>up</source>
- <translation type="finished">upp</translation>
+ <translation>upp</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="189"/>
<source>down</source>
- <translation type="finished">ner</translation>
+ <translation>ner</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="201"/>
<source>Lock cursor to screen</source>
- <translation type="finished">Lås muspekaren till skärm</translation>
+ <translation>Lås muspekaren till skärm</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="225"/>
<source>toggle</source>
- <translation type="finished">skifta</translation>
+ <translation>växla</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="230"/>
<source>on</source>
- <translation type="finished">på</translation>
+ <translation>på</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="235"/>
<source>off</source>
- <translation type="finished">Av</translation>
+ <translation>av</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="248"/>
<source>This action is performed when</source>
- <translation type="finished">Detta utförs när </translation>
+ <translation>Denna åtgärd utförs när</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="254"/>
<source>the hotkey is pressed</source>
- <translation type="finished">snabbtangenten trycks in</translation>
+ <translation>snabbtangenten trycks ner</translation>
</message>
<message>
<location filename="res/ActionDialogBase.ui" line="264"/>
<source>the hotkey is released</source>
- <translation type="finished">snabbtangenten släpps</translation>
+ <translation>snabbtangenten släpps</translation>
</message>
</context>
<context>
@@ -147,17 +157,17 @@ Visit our website for help and info (symless.com).
<message>
<location filename="res/AddClientDialogBase.ui" line="20"/>
<source>Dialog</source>
- <translation type="unfinished"></translation>
+ <translation>Dialog</translation>
</message>
<message>
<location filename="res/AddClientDialogBase.ui" line="35"/>
<source>TextLabel</source>
- <translation type="unfinished"></translation>
+ <translation>Textetikett</translation>
</message>
<message>
<location filename="res/AddClientDialogBase.ui" line="83"/>
<source>Ignore auto connect clients</source>
- <translation type="unfinished"></translation>
+ <translation>Ignorera klienter med automatisk anslutning</translation>
</message>
</context>
<context>
@@ -165,12 +175,12 @@ Visit our website for help and info (symless.com).
<message>
<location filename="res/HotkeyDialogBase.ui" line="14"/>
<source>Hotkey</source>
- <translation type="finished">Snabbtangent</translation>
+ <translation>Snabbtangent</translation>
</message>
<message>
<location filename="res/HotkeyDialogBase.ui" line="20"/>
<source>Enter the specification for the hotkey:</source>
- <translation type="finished">Beskriv snabbtangenten:</translation>
+ <translation>Beskriv snabbtangenten:</translation>
</message>
</context>
<context>
@@ -178,189 +188,193 @@ Visit our website for help and info (symless.com).
<message>
<location filename="src/MainWindow.cpp" line="790"/>
<source>&amp;Start</source>
- <translation type="finished">Start</translation>
+ <translation>&amp;Starta</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="237"/>
<source>&amp;File</source>
- <translation type="finished">Arkiv</translation>
+ <translation>&amp;Arkiv</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="238"/>
<source>&amp;Edit</source>
- <translation type="finished">&amp;Redigera</translation>
+ <translation>&amp;Redigera</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="239"/>
<source>&amp;Window</source>
- <translation type="finished">Fönster</translation>
+ <translation>&amp;Fönster</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="240"/>
<source>&amp;Help</source>
- <translation type="finished">Hjälp</translation>
+ <translation>&amp;Hjälp</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="364"/>
<source>&lt;p&gt;Your version of Barrier is out of date. Version &lt;b&gt;%1&lt;/b&gt; is now available to &lt;a href=&quot;%2&quot;&gt;download&lt;/a&gt;.&lt;/p&gt;</source>
<oldsource>&lt;p&gt;Version %1 is now available, &lt;a href=&quot;%2&quot;&gt;visit website&lt;/a&gt;.&lt;/p&gt;</oldsource>
- <translation type="finished">&lt;p&gt;Du kör inte den senaste versionen av Barrier. Version &lt;b&gt;%1&lt;/b&gt; finns tillgänglig för &lt;a href=&quot;%2&quot;&gt;nedladdning&lt;/a&gt;.&lt;/p&gt;</translation>
+ <translation>&lt;p&gt;Din version av Barrier är utdaterad. Version &lt;b&gt;%1&lt;/b&gt; finns nu tillgänglig för &lt;a href=&quot;%2&quot;&gt;nerladdning&lt;/a&gt;.&lt;/p&gt;</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="577"/>
<source>Program can not be started</source>
- <translation type="finished">Programmet kan inte startas</translation>
+ <translation>Programmet kan inte startas</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="577"/>
<source>The executable&lt;br&gt;&lt;br&gt;%1&lt;br&gt;&lt;br&gt;could not be successfully started, although it does exist. Please check if you have sufficient permissions to run this program.</source>
- <translation type="finished">Programmet&lt;br&gt;&lt;br&gt;%1&lt;br&gt;&lt;br&gt;kunde inte startas, men det finns. Var vänlig och kontrollera att du har tillräckliga rättigheter för att köra detta program.</translation>
+ <translation>Programmet&lt;br&gt;&lt;br&gt;%1&lt;br&gt;&lt;br&gt;kunde inte startas, men det finns tillgängligt. Kontrollera att du har tillräckliga rättigheter för att köra detta program.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="596"/>
<source>Barrier client not found</source>
- <translation type="finished">Barrierklienten hittades inte</translation>
+ <translation>Barrier-klienten hittades inte</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="597"/>
<source>The executable for the barrier client does not exist.</source>
- <translation type="finished">Den exekverbara filen för Barrierklienten existerar inte.</translation>
+ <translation>Barrier-klientens körbara fil saknas.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="625"/>
<source>Hostname is empty</source>
- <translation type="finished">Värddatornamnet är inte satt</translation>
+ <translation>Värdnamnet är tomt</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="626"/>
<source>Please fill in a hostname for the barrier client to connect to.</source>
- <translation type="finished">Fyll i det värddatornamn som Barrierklienten skall ansluta till.</translation>
+ <translation>Fyll i det värdnamn som Barrier-klienten skall ansluta till.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="646"/>
<source>Cannot write configuration file</source>
- <translation type="finished">Kan inte spara konfigurationsfilen</translation>
+ <translation>Kan inte skriva konfigurationsfilen</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="646"/>
<source>The temporary configuration file required to start barrier can not be written.</source>
- <translation type="finished">Den tillfälliga konfigurationsfilen som krävs för att kunna starta Barrier kan inte skapas.</translation>
+ <translation>Den tillfälliga konfigurationsfil som krävs för att starta Barrier, kan inte skrivas.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="659"/>
<source>Configuration filename invalid</source>
- <translation type="finished">Namnet på konfigurationsfilen är inte giltigt</translation>
+ <translation>Ogiltigt namn på konfigurationsfilen</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="660"/>
<source>You have not filled in a valid configuration file for the barrier server. Do you want to browse for the configuration file now?</source>
- <translation type="finished">Du har inte fyllt i en giltig konfigurationsfil för Barrierservern. Vill du bläddra efter konfigurationsfilen nu?</translation>
+ <translation>Du har inte fyllt i en giltig konfigurationsfil för Barrier-servern. Vill du bläddra efter konfigurationsfilen nu?</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="688"/>
<source>Barrier server not found</source>
- <translation type="finished">Barrierservern hittades inte</translation>
+ <translation>Barrier-servern hittades inte</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="689"/>
<source>The executable for the barrier server does not exist.</source>
- <translation type="finished">Den körbara filen för Barrierservern existerar inte.</translation>
+ <translation>Barrier-serverns körbara fil finns inte.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="764"/>
<source>Barrier terminated with an error</source>
- <translation type="finished">Barrier avslutades med ett fel</translation>
+ <translation>Barrier avslutades med ett fel</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="764"/>
<source>Barrier terminated unexpectedly with an exit code of %1.&lt;br&gt;&lt;br&gt;Please see the log output for details.</source>
- <translation type="finished">Barrierterminalen avslutades oväntat med avbrottskoden %1.&lt;br&gt;&lt;br&gt;Kontrollera loggdatan för detaljer.</translation>
+ <translation>Barrier avslutades oväntat med avbrottskoden %1.&lt;br&gt;&lt;br&gt;Se loggdata för detaljerad info.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="783"/>
<source>&amp;Stop</source>
- <translation type="finished">Stopp</translation>
+ <translation>&amp;Stopp</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1038"/>
<source>Please add the server (%1) to the grid.</source>
- <translation type="unfinished"></translation>
+ <translation>Lägg till servern (%1) i rutfältet.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1044"/>
<source>Please drag the new client screen (%1) to the desired position on the grid.</source>
- <translation type="unfinished"></translation>
+ <translation>Dra den nya klientskämen (%1) till önskad position i rutfältet.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1147"/>
<source>Failed to detect system architecture.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte identifiera systemarkitektur.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1165"/>
<source>Cancel</source>
- <translation type="unfinished"></translation>
+ <translation>Avbryt</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1189"/>
<source>Failed to download Bonjour installer to location: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte ladda ner Bonjour-installerare till platsen: %1</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1226"/>
<source>Do you want to enable auto config and install Bonjour?
This feature helps you establish the connection.</source>
- <translation type="unfinished"></translation>
+ <translation>Vill du aktivera automatisk konfiguration och installation av Bonjour?
+
+Denna funktion hjälper dig att etablera anslutningen.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1270"/>
<source>Auto config feature requires Bonjour.
Do you want to install Bonjour?</source>
- <translation type="unfinished"></translation>
+ <translation>Automatisk konfiguration kräver Bonjour.
+
+Vill du installera Bonjour?</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="815"/>
<source>Barrier is starting.</source>
- <translation type="finished">Barrier startas.</translation>
+ <translation>Barrier startar.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="809"/>
<source>Barrier is running.</source>
- <translation type="finished">Barrier körs.</translation>
+ <translation>Barrier körs.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="819"/>
<source>Barrier is not running.</source>
- <translation type="finished">Barrier körs inte.</translation>
+ <translation>Barrier körs inte.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="870"/>
<source>Unknown</source>
- <translation type="finished">Okänd</translation>
+ <translation>Okänd</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1146"/>
<location filename="src/MainWindow.cpp" line="1225"/>
<location filename="src/MainWindow.cpp" line="1269"/>
<source>Barrier</source>
- <translation type="finished">Barrier</translation>
+ <translation>Barrier</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="987"/>
<source>Browse for a barriers config file</source>
- <translation type="finished">Bläddra efter Barriers konfigurationsfil.</translation>
+ <translation>Bläddra efter Barriers konfigurationsfil</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="408"/>
<source>Barrier is now connected, You can close the config window. Barrier will remain connected in the background.</source>
- <translation type="unfinished"></translation>
+ <translation>Barrier är nu ansluten, du kan stänga konfigurationsfönstret. Barrier kommer att fortsätta vara ansluten i bakgrunden.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="434"/>
<source>Security question</source>
- <translation type="unfinished"></translation>
+ <translation>Säkerhetsfråga</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="435"/>
@@ -368,25 +382,31 @@ Do you want to install Bonjour?</source>
%1
-This is a server fingerprint. You should compare this fingerprint to the one on your server's screen. If the two don't match exactly, then it's probably not the server you're expecting (it could be a malicious user).
+This is a server fingerprint. You should compare this fingerprint to the one on your server&apos;s screen. If the two don&apos;t match exactly, then it&apos;s probably not the server you&apos;re expecting (it could be a malicious user).
To automatically trust this fingerprint for future connections, click Yes. To reject this fingerprint and disconnect from the server, click No.</source>
- <translation type="unfinished"></translation>
+ <translation>Litar du på fingeravtrycket?
+
+%1
+
+Detta är en servers fingeravtryck. Du bör jämföra det här fingeravtrycket med det på serverns skärm. Om de två inte stämmer exakt, så är det förmodligen inte den server du förväntar dig (det kan vara en skadlig användare).
+
+Klicka &quot;Ja&quot; för att automatiskt lita på fingeravtrycket i framtida anslutningar. Klicka &quot;Nej&quot; för att avvisa det här fingeravtrycket och koppla från servern.</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1000"/>
<source>Save configuration as...</source>
- <translation type="finished">Spara konfiguration som...</translation>
+ <translation>Spara konfigurationen som...</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1004"/>
<source>Save failed</source>
- <translation type="finished">Sparades inte</translation>
+ <translation>Kunde inte spara</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="1004"/>
<source>Could not save configuration to file.</source>
- <translation type="finished">Kunde inte spara konfiguration till fil.</translation>
+ <translation>Kunde inte spara konfigurationen till fil.</translation>
</message>
</context>
<context>
@@ -394,168 +414,168 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="res/MainWindowBase.ui" line="26"/>
<source>Barrier</source>
- <translation type="finished">Barrier</translation>
+ <translation>Barrier</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="90"/>
- <source>Ser&amp;ver (share this computer's mouse and keyboard):</source>
- <translation type="unfinished"></translation>
+ <source>Ser&amp;ver (share this computer&apos;s mouse and keyboard):</source>
+ <translation>Ser&amp;ver (dela den här datorns mus och tangentbord):</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="243"/>
<source>Screen name:</source>
- <translation type="finished">Skärmnamn:</translation>
+ <translation>Skärmnamn:</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="257"/>
<source>&amp;Server IP:</source>
- <translation type="finished">Serverns IP:</translation>
+ <translation>&amp;Serverns IP:</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="380"/>
<location filename="res/MainWindowBase.ui" line="409"/>
<source>&amp;Start</source>
- <translation type="finished">Start</translation>
+ <translation>&amp;Starta</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="181"/>
<source>Use existing configuration:</source>
- <translation type="finished">Använd befintlig konfiguration:</translation>
+ <translation>Använd befintlig konfiguration:</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="190"/>
<source>&amp;Configuration file:</source>
- <translation type="finished">Konfigurationsfil:</translation>
+ <translation>&amp;Konfigurationsfil:</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="210"/>
<source>&amp;Browse...</source>
- <translation type="finished">Bläddra...</translation>
+ <translation>&amp;Bläddra...</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="147"/>
<source>Configure interactively:</source>
- <translation type="finished">Konfigurera interaktivt:</translation>
+ <translation>Konfigurera interaktivt:</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="159"/>
<source>&amp;Configure Server...</source>
- <translation type="finished">Konfigurera server...</translation>
+ <translation>&amp;Konfigurera server...</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="350"/>
<source>Ready</source>
- <translation type="finished">Klar</translation>
+ <translation>Klar</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="296"/>
<source>Log</source>
- <translation type="finished">Logg</translation>
+ <translation>Logg</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="373"/>
<source>&amp;Reload</source>
- <translation type="finished">Verkställ</translation>
+ <translation>&amp;Uppdatera</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="107"/>
<source>IP addresses:</source>
- <translation type="finished">IP-adresser:</translation>
+ <translation>IP-adresser:</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="131"/>
<source>Fingerprint:</source>
- <translation type="unfinished"></translation>
+ <translation>Fingeravtryck:</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="228"/>
- <source>&amp;Client (use another computer's mouse and keyboard):</source>
- <translation type="unfinished"></translation>
+ <source>&amp;Client (use another computer&apos;s mouse and keyboard):</source>
+ <translation>&amp;Klient (använd en annan dators mus och tangenbord):</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="270"/>
<source>Auto config</source>
- <translation type="unfinished"></translation>
+ <translation>Konfigurera automatiskt</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="390"/>
<source>&amp;About Barrier...</source>
- <translation type="finished">Om Barrier...</translation>
+ <translation>&amp;Om Barrier...</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="398"/>
<source>&amp;Quit</source>
- <translation type="finished">Avsluta</translation>
+ <translation>A&amp;vsluta</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="401"/>
<source>Quit</source>
- <translation type="finished">Avsluta</translation>
+ <translation>Avsluta</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="412"/>
<source>Run</source>
- <translation type="finished">Kör</translation>
+ <translation>Kör</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="423"/>
<source>S&amp;top</source>
- <translation type="finished">S&amp;topp</translation>
+ <translation>S&amp;topp</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="426"/>
<source>Stop</source>
- <translation type="finished">Stopp</translation>
+ <translation>Stopp</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="434"/>
<source>S&amp;how Status</source>
- <translation type="finished">Visa Status</translation>
+ <translation>V&amp;isa status</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="442"/>
<source>&amp;Hide</source>
- <translation type="finished">Dölj</translation>
+ <translation>&amp;Dölj</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="445"/>
<source>Hide</source>
- <translation type="finished">Dölj</translation>
+ <translation>Dölj</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="453"/>
<source>&amp;Show</source>
- <translation type="finished">Visa</translation>
+ <translation>&amp;Visa</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="456"/>
<source>Show</source>
- <translation type="finished">Visa</translation>
+ <translation>Visa</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="464"/>
<source>Save configuration &amp;as...</source>
- <translation type="finished">Spara konfiguration som...</translation>
+ <translation>S&amp;para konfigurationen som...</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="467"/>
<source>Save the interactively generated server configuration to a file.</source>
- <translation type="finished">Spara den interaktivt genererade serverkonfigurationen till en fil.</translation>
+ <translation>Spara den interaktivt skapade serverkonfigurationen till en fil.</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="475"/>
<source>Settings</source>
- <translation type="finished">Inställningar</translation>
+ <translation>Inställningar</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="478"/>
<source>Edit settings</source>
- <translation type="finished">Ändra inställningar</translation>
+ <translation>Ändra inställningar</translation>
</message>
<message>
<location filename="res/MainWindowBase.ui" line="486"/>
<source>Run Wizard</source>
- <translation type="finished">Kör guiden</translation>
+ <translation>Kör guiden</translation>
</message>
</context>
<context>
@@ -563,7 +583,7 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="src/NewScreenWidget.cpp" line="32"/>
<source>Unnamed</source>
- <translation type="finished">Namnlös</translation>
+ <translation>Namnlös</translation>
</message>
</context>
<context>
@@ -571,28 +591,29 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="src/PluginManager.cpp" line="58"/>
<source>Failed to get plugin directory.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hämta mappen för insticksmoduler.</translation>
</message>
<message>
<location filename="src/PluginManager.cpp" line="63"/>
<source>Failed to get profile directory.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hämta profilmappen.</translation>
</message>
<message>
<location filename="src/PluginManager.cpp" line="136"/>
- <source>Failed to download plugin '%1' to: %2
+ <source>Failed to download plugin &apos;%1&apos; to: %2
%3</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte ladda ner insticksmodulen &quot;%1&quot; till: %2
+%3</translation>
</message>
<message>
<location filename="src/PluginManager.cpp" line="167"/>
<source>Could not get Windows architecture type.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hämta Windows arkitekturtyp.</translation>
</message>
<message>
<location filename="src/PluginManager.cpp" line="191"/>
<source>Could not get Linux architecture type.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hämta Linux arkitekturtyp.</translation>
</message>
</context>
<context>
@@ -600,48 +621,48 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="res/PluginWizardPageBase.ui" line="14"/>
<source>Setup Barrier</source>
- <translation type="finished">Ställ in Barrier</translation>
+ <translation>Ställ in Barrier</translation>
</message>
<message>
<location filename="res/PluginWizardPageBase.ui" line="101"/>
<source>Please wait...</source>
- <translation type="unfinished"></translation>
+ <translation>Vänta...</translation>
</message>
<message>
<location filename="src/PluginWizardPage.cpp" line="72"/>
<source>Error: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Fel: %1</translation>
</message>
<message>
<location filename="src/PluginWizardPage.cpp" line="80"/>
<location filename="src/PluginWizardPage.cpp" line="201"/>
<source>Setup complete.</source>
- <translation type="unfinished"></translation>
+ <translation>Inställning slutförd.</translation>
</message>
<message>
<location filename="src/PluginWizardPage.cpp" line="93"/>
- <source>Downloading '%1' plugin (%2/%3)...</source>
- <translation type="unfinished"></translation>
+ <source>Downloading &apos;%1&apos; plugin (%2/%3)...</source>
+ <translation>Laddar ner &quot;%1&quot; (%2/%3)...</translation>
</message>
<message>
<location filename="src/PluginWizardPage.cpp" line="104"/>
<source>Plugins installed successfully.</source>
- <translation type="unfinished"></translation>
+ <translation>Insticksmoduler korrekt installerade.</translation>
</message>
<message>
<location filename="src/PluginWizardPage.cpp" line="120"/>
<source>Generating SSL certificate...</source>
- <translation type="unfinished"></translation>
+ <translation>Genererar SSL-certifikat...</translation>
</message>
<message>
<location filename="src/PluginWizardPage.cpp" line="170"/>
<source>Downloading plugin: %1 (1/%2)</source>
- <translation type="unfinished"></translation>
+ <translation>Laddar ner insticksmodul: %1 (1/%2)</translation>
</message>
<message>
<location filename="src/PluginWizardPage.cpp" line="239"/>
<source>Getting plugin list...</source>
- <translation type="unfinished"></translation>
+ <translation>Hämtar instickslista...</translation>
</message>
</context>
<context>
@@ -649,17 +670,17 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="src/MainWindow.cpp" line="60"/>
<source>Barrier Configurations (*.sgc);;All files (*.*)</source>
- <translation type="finished">Barrier-konfigurationer (*.sgc);;Alla filer (*.*)</translation>
+ <translation>Barrier-konfigurationer (*.sgc);;Alla filer (*.*)</translation>
</message>
<message>
<location filename="src/MainWindow.cpp" line="67"/>
<source>Barrier Configurations (*.conf);;All files (*.*)</source>
- <translation type="finished">Barrier-konfigurationer (*.conf);;Alla filer (*.*)</translation>
+ <translation>Barrier-konfigurationer (*.conf);;Alla filer (*.*)</translation>
</message>
<message>
<location filename="src/main.cpp" line="119"/>
<source>System tray is unavailable, quitting.</source>
- <translation type="finished">Systemfältet otillgängligt, avslutar.</translation>
+ <translation>Systemfältet otillgängligt, avslutar.</translation>
</message>
</context>
<context>
@@ -667,22 +688,22 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="src/ScreenSettingsDialog.cpp" line="67"/>
<source>Screen name is empty</source>
- <translation type="finished">Skärmnamnet är tomt</translation>
+ <translation>Skärmnamnet är tomt</translation>
</message>
<message>
<location filename="src/ScreenSettingsDialog.cpp" line="68"/>
<source>The screen name cannot be empty. Please either fill in a name or cancel the dialog.</source>
- <translation type="finished">Skärmnamnet kan inte vara tomt. Fyll i ett namn eller avbryt dialogrutan.</translation>
+ <translation>Skärmnamnet kan inte vara tomt. Fyll i ett namn eller avbryt.</translation>
</message>
<message>
<location filename="src/ScreenSettingsDialog.cpp" line="83"/>
<source>Screen name matches alias</source>
- <translation type="finished">Skärmnamn matchar alias</translation>
+ <translation>Skärmnamnet är samma som alias</translation>
</message>
<message>
<location filename="src/ScreenSettingsDialog.cpp" line="84"/>
<source>The screen name cannot be the same as an alias. Please either remove the alias or change the screen name.</source>
- <translation type="finished">Skärmnamnet kan inte vara samma som en alias. Var vänlig att antingen ta bort alias eller ändra skärmnamnet.</translation>
+ <translation>Skärmnamnet kan inte vara samma som alias. Ta antingen bort alias eller ändra skärmnamnet.</translation>
</message>
</context>
<context>
@@ -690,37 +711,37 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="14"/>
<source>Screen Settings</source>
- <translation type="finished">Skärminställningar</translation>
+ <translation>Skärminställningar</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="22"/>
<source>Screen &amp;name:</source>
- <translation type="finished">Skärmnamn:</translation>
+ <translation>Skärm&amp;namn:</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="42"/>
<source>A&amp;liases</source>
- <translation type="finished">Alias</translation>
+ <translation>A&amp;lias</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="57"/>
<source>&amp;Add</source>
- <translation type="finished">Lägg till</translation>
+ <translation>&amp;Lägg till</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="74"/>
<source>&amp;Remove</source>
- <translation type="finished">Ta bort</translation>
+ <translation>&amp;Ta bort</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="97"/>
<source>&amp;Modifier keys</source>
- <translation type="finished">Modifieringstangenter</translation>
+ <translation>&amp;Modifieringstangenter</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="106"/>
<source>&amp;Shift:</source>
- <translation type="finished">Shift:</translation>
+ <translation>&amp;Shift:</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="117"/>
@@ -729,7 +750,7 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<location filename="res/ScreenSettingsDialogBase.ui" line="258"/>
<location filename="res/ScreenSettingsDialogBase.ui" line="305"/>
<source>Shift</source>
- <translation type="finished">Shift</translation>
+ <translation>Shift</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="122"/>
@@ -738,7 +759,7 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<location filename="res/ScreenSettingsDialogBase.ui" line="263"/>
<location filename="res/ScreenSettingsDialogBase.ui" line="310"/>
<source>Ctrl</source>
- <translation type="finished">Ctrl</translation>
+ <translation>Ctrl</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="127"/>
@@ -747,7 +768,7 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<location filename="res/ScreenSettingsDialogBase.ui" line="268"/>
<location filename="res/ScreenSettingsDialogBase.ui" line="315"/>
<source>Alt</source>
- <translation type="finished">Alt</translation>
+ <translation>Alt</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="132"/>
@@ -756,7 +777,7 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<location filename="res/ScreenSettingsDialogBase.ui" line="273"/>
<location filename="res/ScreenSettingsDialogBase.ui" line="320"/>
<source>Meta</source>
- <translation type="finished">Meta</translation>
+ <translation>Meta</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="137"/>
@@ -765,7 +786,7 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<location filename="res/ScreenSettingsDialogBase.ui" line="278"/>
<location filename="res/ScreenSettingsDialogBase.ui" line="325"/>
<source>Super</source>
- <translation type="finished">Super</translation>
+ <translation>Super</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="142"/>
@@ -774,82 +795,82 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<location filename="res/ScreenSettingsDialogBase.ui" line="283"/>
<location filename="res/ScreenSettingsDialogBase.ui" line="330"/>
<source>None</source>
- <translation type="finished">Ingen</translation>
+ <translation>Ingen</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="150"/>
<source>&amp;Ctrl:</source>
- <translation type="finished">&amp;Ctrl:</translation>
+ <translation>&amp;Ctrl:</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="197"/>
<source>Al&amp;t:</source>
- <translation type="finished">Alt:</translation>
+ <translation>Al&amp;t:</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="244"/>
<source>M&amp;eta:</source>
- <translation type="finished">Meta:</translation>
+ <translation>M%eta:</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="291"/>
<source>S&amp;uper:</source>
- <translation type="finished">Super:</translation>
+ <translation>S&amp;uper:</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="358"/>
<source>&amp;Dead corners</source>
- <translation type="finished">Döda hörn</translation>
+ <translation>&amp;Döda hörn</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="367"/>
<source>Top-left</source>
- <translation type="finished">Över vänster</translation>
+ <translation>Vänster överkant</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="374"/>
<source>Top-right</source>
- <translation type="finished">Över höger</translation>
+ <translation>Höger överkant</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="381"/>
<source>Bottom-left</source>
- <translation type="finished">Nedre vänstra hörnet</translation>
+ <translation>Vänster underkant</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="388"/>
<source>Bottom-right</source>
- <translation type="finished">Nedre höger</translation>
+ <translation>Höger underkant</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="397"/>
<source>Corner Si&amp;ze:</source>
- <translation type="finished">Hörnets storlek:</translation>
+ <translation>H&amp;örnstorlek:</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="428"/>
<source>&amp;Fixes</source>
- <translation type="finished">Korrigeringar</translation>
+ <translation>&amp;Korrigeringar</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="437"/>
<source>Fix CAPS LOCK key</source>
- <translation type="finished">Korrigera CAPS LOCK</translation>
+ <translation>Korrigera CAPS LOCK</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="444"/>
<source>Fix NUM LOCK key</source>
- <translation type="finished">Korrigera NUM LOCK</translation>
+ <translation>Korrigera NUM LOCK</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="451"/>
<source>Fix SCROLL LOCK key</source>
- <translation type="finished">Korrigera SCROLL LOCK</translation>
+ <translation>Korrigera SCROLL LOCK</translation>
</message>
<message>
<location filename="res/ScreenSettingsDialogBase.ui" line="458"/>
<source>Fix XTest for Xinerama</source>
- <translation type="finished">Korrigera XTest för Xinerama</translation>
+ <translation>Korrigera XTest för Xinerama</translation>
</message>
</context>
<context>
@@ -857,7 +878,7 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="src/ScreenSetupModel.cpp" line="51"/>
<source>&lt;center&gt;Screen: &lt;b&gt;%1&lt;/b&gt;&lt;/center&gt;&lt;br&gt;Double click to edit settings&lt;br&gt;Drag screen to the trashcan to remove it</source>
- <translation type="finished">&lt;center&gt;Skärm:&lt;b&gt;%1&lt;/b&gt;&lt;/center&gt;&lt;br&gt;Dubbelklicka för att ändra inställningar&lt;br&gt;Dra skärmen till papperskorgen för att ta bort den</translation>
+ <translation>&lt;center&gt;Skärm:&lt;b&gt;%1&lt;/b&gt;&lt;/center&gt;&lt;br&gt;Dubbelklicka för att ändra inställningar&lt;br&gt;Dra skärmen till papperskorgen för att ta bort den</translation>
</message>
</context>
<context>
@@ -865,7 +886,7 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="src/ServerConfigDialog.cpp" line="75"/>
<source>Configure server</source>
- <translation type="unfinished"></translation>
+ <translation>Konfigurera server</translation>
</message>
</context>
<context>
@@ -873,168 +894,168 @@ To automatically trust this fingerprint for future connections, click Yes. To re
<message>
<location filename="res/ServerConfigDialogBase.ui" line="14"/>
<source>Server Configuration</source>
- <translation type="finished">Serverkonfiguration</translation>
+ <translation>Serverkonfiguration</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="24"/>
<source>Screens and links</source>
- <translation type="finished">Skärmar och länkar</translation>
+ <translation>Skärmar och länkar</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="35"/>
<source>Drag a screen from the grid to the trashcan to remove it.</source>
- <translation type="finished">Dra en skärm från rutnätet till papperskorgen för att ta bort den.</translation>
+ <translation>Dra en skärm från rutfältet till papperskorgen för att ta bort den.</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="60"/>
<source>Configure the layout of your barrier server configuration.</source>
- <translation type="finished">Konfigurera layouten på din Barrier-konfiguration.</translation>
+ <translation>Konfigurera layouten på din Barrier serverkonfiguration.</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="73"/>
<source>Drag this button to the grid to add a new screen.</source>
- <translation type="finished">Dra den här knappen till rutnätet för att lägga till en ny skärm.</translation>
+ <translation>Dra den här knappen till rutfältet för att lägga till en ny skärm.</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="128"/>
<source>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.</source>
- <translation type="finished">Dra nya skärmar till rutnätet eller flytta runt existerande.
+ <translation>Dra nya skärmar till rutfältet eller flytta runt befintliga.
Dra en skärm till papperskorgen för att ta bort den.
Dubbelklicka på en skärm för att ändra dess inställningar.</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="157"/>
<source>Hotkeys</source>
- <translation type="finished">Snabbtangenter</translation>
+ <translation>Snabbtangenter</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="163"/>
<source>&amp;Hotkeys</source>
- <translation type="finished">Snabbtangenter</translation>
+ <translation>&amp;Snabbtangenter</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="175"/>
<source>&amp;New</source>
- <translation type="finished">Ny</translation>
+ <translation>&amp;Nytt</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="185"/>
<source>&amp;Edit</source>
- <translation type="finished">&amp;Redigera</translation>
+ <translation>&amp;Redigera</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="195"/>
<source>&amp;Remove</source>
- <translation type="finished">Ta bort</translation>
+ <translation>&amp;Ta bort</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="218"/>
<source>A&amp;ctions</source>
- <translation type="finished">Åtgärder</translation>
+ <translation>&amp;Åtgärder</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="230"/>
<source>Ne&amp;w</source>
- <translation type="finished">Ny</translation>
+ <translation>N&amp;ytt</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="240"/>
<source>E&amp;dit</source>
- <translation type="finished">Ändra</translation>
+ <translation>Re&amp;digera</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="250"/>
<source>Re&amp;move</source>
- <translation type="finished">Ta bort</translation>
+ <translation>Ta &amp;bort</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="274"/>
<source>Advanced server settings</source>
- <translation type="finished">Avancerade serverinställningar</translation>
+ <translation>Avancerade serverinställningar</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="280"/>
<source>&amp;Switch</source>
- <translation type="finished">Växla</translation>
+ <translation>&amp;Växla</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="291"/>
<source>Switch &amp;after waiting</source>
- <translation type="finished">Växla efter väntan</translation>
+ <translation>V&amp;äxla efter väntan</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="330"/>
<location filename="res/ServerConfigDialogBase.ui" line="383"/>
<location filename="res/ServerConfigDialogBase.ui" line="458"/>
<source>ms</source>
- <translation type="finished">ms</translation>
+ <translation>ms</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="344"/>
<source>Switch on double &amp;tap within</source>
- <translation type="finished">Växla eller dubbelklicka inuti</translation>
+ <translation>Växla vid &amp;dubbelklick inom</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="408"/>
<source>&amp;Options</source>
- <translation type="finished">Alternativ</translation>
+ <translation>&amp;Alternativ</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="419"/>
<source>&amp;Check clients every</source>
- <translation type="finished">Kontrollera klienter varje</translation>
+ <translation>&amp;Kontrollera klienter varje</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="470"/>
<source>Use &amp;relative mouse moves</source>
- <translation type="finished">Använd relativa musrörelser</translation>
+ <translation>Använd &amp;relativa musrörelser</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="480"/>
<source>S&amp;ynchronize screen savers</source>
- <translation type="finished">Synkronisera skärmsläckare</translation>
+ <translation>Synkr&amp;onisera skärmsläckare</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="490"/>
- <source>Don't take &amp;foreground window on Windows servers</source>
- <translation type="finished">Använd inte förgrundsfönster på Windowsservrar</translation>
+ <source>Don&apos;t take &amp;foreground window on Windows servers</source>
+ <translation>Använd inte &amp;förgrundsfönster på Windowsservrar</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="510"/>
<source>Ignore auto config clients</source>
- <translation type="unfinished"></translation>
+ <translation>Ignorera automatiskt konfigurerade klienter</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="520"/>
<source>&amp;Dead corners</source>
- <translation type="finished">Döda hörn</translation>
+ <translation>&amp;Döda hörn</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="529"/>
<source>To&amp;p-left</source>
- <translation type="finished">Övre vänstra hörnet</translation>
+ <translation>V&amp;änster överkant</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="536"/>
<source>Top-rig&amp;ht</source>
- <translation type="finished">Övre högra hörnet</translation>
+ <translation>H&amp;öger överkant</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="543"/>
<source>&amp;Bottom-left</source>
- <translation type="finished">Nedre vänstra hörnet</translation>
+ <translation>Vänster &amp;underkant</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="550"/>
<source>Bottom-ri&amp;ght</source>
- <translation type="finished">Nedre högra hörnet</translation>
+ <translation>Höger u&amp;nderkant</translation>
</message>
<message>
<location filename="res/ServerConfigDialogBase.ui" line="572"/>
<source>Cor&amp;ner Size:</source>
- <translation type="finished">Hörnstorlek:</translation>
+ <translation>Hö&amp;rnstorlek:</translation>
</message>
</context>
<context>
@@ -1042,20 +1063,20 @@ Dubbelklicka på en skärm för att ändra dess inställningar.</translation>
<message>
<location filename="src/SettingsDialog.cpp" line="131"/>
<source>Save log file to...</source>
- <translation type="finished">Spara loggfil till...</translation>
+ <translation>Spara loggfil till...</translation>
</message>
<message>
<location filename="src/SettingsDialog.cpp" line="151"/>
<source>Elevate Barrier</source>
- <translation type="finished">Förhöj Barriers behörighet</translation>
+ <translation>Höj Barriers behörighet</translation>
</message>
<message>
<location filename="src/SettingsDialog.cpp" line="152"/>
<source>Are you sure you want to elevate Barrier?
This allows Barrier to interact with elevated processes and the UAC dialog, but can cause problems with non-elevated processes. Elevate Barrier only if you really need to.</source>
- <translation type="finished">Är du säker på att du vill förhöja Barriers behörighet?
-Detta låter Barrier interagera med förhöjda processer och UAC-dialogen, men kan skapa program med processer som inte är förhöjda. Förhöj Barriers behörighet enbart om du verkligen måste.</translation>
+ <translation>Vill du verkligen höja Barriers behörighet?
+Detta låter Barrier interagera med förhöjda processer och UAC-dialogen, men kan skapa program med processer som inte är förhöjda. Höj Barriers behörighet enbart om du verkligen måste.</translation>
</message>
</context>
<context>
@@ -1063,107 +1084,107 @@ Detta låter Barrier interagera med förhöjda processer och UAC-dialogen, men k
<message>
<location filename="res/SettingsDialogBase.ui" line="14"/>
<source>Settings</source>
- <translation type="finished">Inställningar</translation>
+ <translation>Inställningar</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="32"/>
<source>Sc&amp;reen name:</source>
- <translation type="finished">Skärmnamn:</translation>
+ <translation>Sk&amp;ärmnamn:</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="49"/>
<source>P&amp;ort:</source>
- <translation type="finished">Port:</translation>
+ <translation>P&amp;ort:</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="78"/>
<source>&amp;Interface:</source>
- <translation type="finished">Gränssnitt:</translation>
+ <translation>G&amp;ränssnitt:</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="120"/>
<source>Elevate mode</source>
- <translation type="unfinished"></translation>
+ <translation>Rättighetsläge</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="127"/>
<source>&amp;Hide on startup</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Dölj vid programstart</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="146"/>
<source>&amp;Network Security</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Nätverkssäkerhet</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="155"/>
<source>Use &amp;SSL encryption (unique certificate)</source>
- <translation type="unfinished"></translation>
+ <translation>Använd &amp;SSL-kryptering (unikt certifikat)</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="184"/>
<source>Logging</source>
- <translation type="finished">Loggning</translation>
+ <translation>Loggning</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="202"/>
<source>&amp;Logging level:</source>
- <translation type="finished">Loggningsnivå:</translation>
+ <translation>&amp;Loggningsnivå:</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="251"/>
<source>Log to file:</source>
- <translation type="finished">Logga till fil:</translation>
+ <translation>Logga till fil:</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="268"/>
<source>Browse...</source>
- <translation type="finished">Bläddra:</translation>
+ <translation>Bläddra...</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="213"/>
<source>Error</source>
- <translation type="finished">Fel</translation>
+ <translation>Fel</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="107"/>
<source>&amp;Language:</source>
- <translation type="finished">Språk:</translation>
+ <translation>&amp;Språk:</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="20"/>
<source>&amp;Miscellaneous</source>
- <translation type="finished">&amp;Övrigt</translation>
+ <translation>&amp;Diverse</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="218"/>
<source>Warning</source>
- <translation type="finished">Varning</translation>
+ <translation>Varning</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="223"/>
<source>Note</source>
- <translation type="finished">Notering</translation>
+ <translation>Anteckning</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="228"/>
<source>Info</source>
- <translation type="finished">Info</translation>
+ <translation>Information</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="233"/>
<source>Debug</source>
- <translation type="finished">Felsök</translation>
+ <translation>Felsök</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="238"/>
<source>Debug1</source>
- <translation type="finished">Felsök1</translation>
+ <translation>Felsök1</translation>
</message>
<message>
<location filename="res/SettingsDialogBase.ui" line="243"/>
<source>Debug2</source>
- <translation type="finished">Felsök2</translation>
+ <translation>Felsök2</translation>
</message>
</context>
<context>
@@ -1171,17 +1192,17 @@ Detta låter Barrier interagera med förhöjda processer och UAC-dialogen, men k
<message>
<location filename="src/SetupWizard.cpp" line="72"/>
<source>Setup Barrier</source>
- <translation type="finished">Ställ in Barrier</translation>
+ <translation>Ställ in Barrier</translation>
</message>
<message>
<location filename="src/SetupWizard.cpp" line="113"/>
<source>Please select an option.</source>
- <translation type="finished">Välj ett alternativ.</translation>
+ <translation>Välj ett alternativ.</translation>
</message>
<message>
<location filename="src/SetupWizard.cpp" line="80"/>
<source>Please enter your email address and password.</source>
- <translation type="finished">Var vänlig skriv din e-postaddress och lösenord.</translation>
+ <translation>Ange din e-postadress och lösenord.</translation>
</message>
</context>
<context>
@@ -1189,85 +1210,93 @@ Detta låter Barrier interagera med förhöjda processer och UAC-dialogen, men k
<message>
<location filename="res/SetupWizardBase.ui" line="26"/>
<source>Setup Barrier</source>
- <translation type="finished">Ställ in Barrier</translation>
+ <translation>Installera Barrier</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="30"/>
<source>Welcome</source>
- <translation type="finished">Välkommen</translation>
+ <translation>Välkommen</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="39"/>
<source>Thanks for installing Barrier!</source>
- <translation type="finished">Tack för att du installerar Barrier!</translation>
+ <translation>Tack för att du installerar Barrier!</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="114"/>
- <source>Barrier lets you easily share your mouse and keyboard between multiple computers on your desk, and it's Free and Open Source. Just move your mouse off the edge of one computer's screen on to another. You can even share all of your clipboards. All you need is a network connection. Barrier is cross-platform (works on Windows, Mac OS X and Linux).</source>
- <translation type="finished">Med Barrier kan du enkelt dela din mus och ditt tangentbord med flera datorer på ditt skrivbord, och det är Fri och Öppen mjukvara. För bara muspekaren över kanten på en datorskärm för att den skall dyka upp på nästa. Du kan till och med dela utklipp. Allt du behöver är en nätverksanslutning. Barrier är multiplattform (fungerar på både Windows, Mac OS X och Linux).</translation>
+ <source>Barrier lets you easily share your mouse and keyboard between multiple computers on your desk, and it&apos;s Free and Open Source. Just move your mouse off the edge of one computer&apos;s screen on to another. You can even share all of your clipboards. All you need is a network connection. Barrier is cross-platform (works on Windows, Mac OS X and Linux).</source>
+ <translation>Med Barrier kan du enkelt dela din mus och ditt tangentbord mellan flera datorer på ditt skrivbord, och det är fri och öppen källkod. För bara muspekaren över kanten på en datorskärm till en annan. Du kan till och med dela urklipp. Allt du behöver är en nätverksanslutning. Barrier är multiplattform (fungerar på både Windows, OSX och Linux).</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="125"/>
<source>Activate</source>
- <translation type="unfinished"></translation>
+ <translation>Aktivera</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="131"/>
<source>&amp;Activate now...</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Aktivera nu...</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="152"/>
<source>Email:</source>
- <translation type="unfinished"></translation>
+ <translation>E-post:</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="178"/>
<source>Password:</source>
- <translation type="unfinished"></translation>
+ <translation>Lösenord:</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="204"/>
<source>&lt;a href=&quot;https://symless.com/account/reset/&quot;&gt;Forgot password&lt;/a&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;a href=&quot;https://symless.com/account/reset/&quot;&gt;Glömt lösenord&lt;/a&gt;</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="232"/>
<source>&amp;Skip activation</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Skippa aktivering</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="277"/>
- <source>&amp;Server (share this computer's mouse and keyboard)</source>
- <translation type="unfinished"></translation>
+ <source>&amp;Server (share this computer&apos;s mouse and keyboard)</source>
+ <translation>&amp;Server (dela denna dators mus och tangentbord)</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="290"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;My main mouse and keyboard are connected to this computer. This will allow you to move your mouse over to another computer's screen. There can only be one server in your setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;My main mouse and keyboard are connected to this computer. This will allow you to move your mouse over to another computer&apos;s screen. There can only be one server in your setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Min primära mus och tangentbord är anslutna till den här datorn. Detta låter dig flytta musen över till en annan dators skärm. Det kan bara finnas en server i din installation.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="326"/>
- <source>&amp;Client (use another computer's mouse and keyboard)</source>
- <translation type="unfinished"></translation>
+ <source>&amp;Client (use another computer&apos;s mouse and keyboard)</source>
+ <translation>&amp;Klient (använd en annan dators mus och tangentbord)</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="339"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;You have already set up a server. This computer will be controlled using the server's mouse and keyboard. There can be many clients in your setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;You have already set up a server. This computer will be controlled using the server&apos;s mouse and keyboard. There can be many clients in your setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Du har redan installerat en server. Den här datorn styrs med hjälp av serverns mus och tangentbord. Det kan finnas många klienter i din installation.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location filename="res/SetupWizardBase.ui" line="262"/>
<source>Server or Client?</source>
- <translation type="finished">Server eller klient?</translation>
+ <translation>Server eller klient?</translation>
</message>
</context>
<context>
@@ -1275,22 +1304,22 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="src/SslCertificate.cpp" line="42"/>
<source>Failed to get profile directory.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hämta profilmappen.</translation>
</message>
<message>
<location filename="src/SslCertificate.cpp" line="141"/>
<source>SSL certificate generated.</source>
- <translation type="unfinished"></translation>
+ <translation>SSL-certifikat genererat.</translation>
</message>
<message>
<location filename="src/SslCertificate.cpp" line="170"/>
<source>SSL fingerprint generated.</source>
- <translation type="unfinished"></translation>
+ <translation>SSL-fingeravtryck genererat.</translation>
</message>
<message>
<location filename="src/SslCertificate.cpp" line="173"/>
<source>Failed to find SSL fingerprint.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hitta SSL-fingeravtryck.</translation>
</message>
</context>
<context>
@@ -1298,7 +1327,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="src/VersionChecker.cpp" line="102"/>
<source>Unknown</source>
- <translation type="finished">Okänd</translation>
+ <translation>Okänd</translation>
</message>
</context>
<context>
@@ -1308,19 +1337,22 @@ p, li { white-space: pre-wrap; }
<source>An error occurred while trying to sign in. Please contact the helpdesk, and provide the following details.
%1</source>
- <translation type="unfinished"></translation>
+ <translation>Ett fel uppstod när du försökte logga in. Kontakta supporten och ange följande uppgifter.
+
+%1</translation>
</message>
<message>
<location filename="src/WebClient.cpp" line="65"/>
<source>Login failed, invalid email or password.</source>
- <translation type="finished">Inloggning misslyckades, ogiltig e-postaddress eller lösenord.</translation>
+ <translation>Inloggning misslyckades. Ogiltig e-postaddress eller lösenord.</translation>
</message>
<message>
<location filename="src/WebClient.cpp" line="78"/>
<source>Login failed, an error occurred.
%1</source>
- <translation type="finished">Inloggning misslyckades, ett problem inträffade.
+ <translation>Inloggning misslyckades. Ett fel uppstod.
+
%1</translation>
</message>
<message>
@@ -1330,8 +1362,10 @@ p, li { white-space: pre-wrap; }
Server response:
%1</source>
- <translation type="finished">Inloggning misslyckades, ett problem inträffade.
-Server svar:
+ <translation>Inloggning misslyckades. Ett fel uppstod.
+
+Serversvar:
+
%1</translation>
</message>
<message>
@@ -1339,19 +1373,23 @@ Server svar:
<source>An error occurred while trying to query the plugin list. Please contact the help desk, and provide the following details.
%1</source>
- <translation type="unfinished"></translation>
+ <translation>Ett fel uppstod när instickslistan anropades. Kontakta supporten och ange följande uppgifter.
+
+%1</translation>
</message>
<message>
<location filename="src/WebClient.cpp" line="120"/>
<source>Get plugin list failed, invalid user email or password.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hämta instickslistan. Ogiltig e-postadress eller lösenord.</translation>
</message>
<message>
<location filename="src/WebClient.cpp" line="131"/>
<source>Get plugin list failed, an error occurred.
%1</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hämta instickslistan. Ett fel uppstod.
+
+%1</translation>
</message>
<message>
<location filename="src/WebClient.cpp" line="137"/>
@@ -1360,7 +1398,11 @@ Server svar:
Server response:
%1</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte hämta instickslistan. Ett fel uppstod.
+
+Serversvar:
+
+%1</translation>
</message>
</context>
<context>
@@ -1368,44 +1410,44 @@ Server response:
<message>
<location filename="src/ZeroconfService.cpp" line="82"/>
<source>zeroconf server detected: %1</source>
- <translation type="unfinished"></translation>
+ <translation>zeroconf-server identifierad: %1</translation>
</message>
<message>
<location filename="src/ZeroconfService.cpp" line="91"/>
<source>zeroconf client detected: %1</source>
- <translation type="unfinished"></translation>
+ <translation>zeroconf-klient identifierad: %1</translation>
</message>
<message>
<location filename="src/ZeroconfService.cpp" line="99"/>
<location filename="src/ZeroconfService.cpp" line="130"/>
<source>Zero configuration service</source>
- <translation type="unfinished"></translation>
+ <translation>Zero konfigurationstjänst</translation>
</message>
<message>
<location filename="src/ZeroconfService.cpp" line="100"/>
<source>Error code: %1.</source>
- <translation type="unfinished"></translation>
+ <translation>Felkod:%1.</translation>
</message>
<message>
<location filename="src/ZeroconfService.cpp" line="131"/>
<source>Unable to start the zeroconf: %1.</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte starta zeroconf: %1.</translation>
</message>
<message>
<location filename="src/ZeroconfService.cpp" line="140"/>
<source>Barrier</source>
- <translation type="finished">Barrier</translation>
+ <translation>Barrier</translation>
</message>
<message>
<location filename="src/ZeroconfService.cpp" line="141"/>
<source>Failed to get local IP address. Please manually type in server address on your clients</source>
- <translation type="unfinished"></translation>
+ <translation>Kunde inte inhämta lokal IP-adress. Skriv in serveradressen manuellt, på dina klienter.</translation>
</message>
<message>
<location filename="src/ZeroconfService.cpp" line="147"/>
<location filename="src/ZeroconfService.cpp" line="154"/>
<source>%1</source>
- <translation type="unfinished"></translation>
+ <translation>%1</translation>
</message>
</context>
-</TS> \ No newline at end of file
+</TS>
diff --git a/src/gui/src/Action.cpp b/src/gui/src/Action.cpp
index 2e0f339..909e983 100644
--- a/src/gui/src/Action.cpp
+++ b/src/gui/src/Action.cpp
@@ -24,7 +24,8 @@
const char* Action::m_ActionTypeNames[] =
{
"keyDown", "keyUp", "keystroke",
- "switchToScreen", "switchInDirection", "lockCursorToScreen",
+ "switchToScreen", "toggleScreen",
+ "switchInDirection", "lockCursorToScreen",
"mouseDown", "mouseUp", "mousebutton"
};
@@ -45,7 +46,13 @@ Action::Action() :
QString Action::text() const
{
- QString text = QString(m_ActionTypeNames[keySequence().isMouseButton() ? type() + 6 : type() ]) + "(";
+ /* This function is used to save to config file which is for barriers to
+ * read. However the server config parse does not support functions with ()
+ * in the end but now argument inside. If you need a function with no
+ * argument, it can not have () in the end.
+ */
+ QString text = QString(m_ActionTypeNames[keySequence().isMouseButton() ?
+ type() + int(mouseDown) : type()]);
switch (type())
{
@@ -53,6 +60,7 @@ QString Action::text() const
case keyUp:
case keystroke:
{
+ text += "(";
text += keySequence().toString();
if (!keySequence().isMouseButton())
@@ -72,19 +80,29 @@ QString Action::text() const
else
text += ",*";
}
+ text += ")";
}
break;
case switchToScreen:
+ text += "(";
text += switchScreenName();
+ text += ")";
+ break;
+
+ case toggleScreen:
break;
case switchInDirection:
+ text += "(";
text += m_SwitchDirectionNames[m_SwitchDirection];
+ text += ")";
break;
case lockCursorToScreen:
+ text += "(";
text += m_LockCursorModeNames[m_LockCursorMode];
+ text += ")";
break;
default:
@@ -92,7 +110,6 @@ QString Action::text() const
break;
}
- text += ")";
return text;
}
diff --git a/src/gui/src/Action.h b/src/gui/src/Action.h
index 2786842..b738f3b 100644
--- a/src/gui/src/Action.h
+++ b/src/gui/src/Action.h
@@ -36,7 +36,9 @@ class Action
friend QTextStream& operator<<(QTextStream& outStream, const Action& action);
public:
- enum ActionType { keyDown, keyUp, keystroke, switchToScreen, switchInDirection, lockCursorToScreen, mouseDown, mouseUp, mousebutton };
+ enum ActionType { keyDown, keyUp, keystroke,
+ switchToScreen, toggleScreen, switchInDirection,
+ lockCursorToScreen, mouseDown, mouseUp, mousebutton };
enum SwitchDirection { switchLeft, switchRight, switchUp, switchDown };
enum LockCursorMode { lockCursorToggle, lockCursonOn, lockCursorOff };
diff --git a/src/gui/src/ActionDialog.cpp b/src/gui/src/ActionDialog.cpp
index 3565cfb..2796885 100644
--- a/src/gui/src/ActionDialog.cpp
+++ b/src/gui/src/ActionDialog.cpp
@@ -39,7 +39,7 @@ ActionDialog::ActionDialog(QWidget* parent, ServerConfig& config, Hotkey& hotkey
// 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 };
+ QRadioButton* const typeButtons[] = { m_pRadioPress, m_pRadioRelease, m_pRadioPressAndRelease, m_pRadioSwitchToScreen, m_pRadioToggleScreen, m_pRadioSwitchInDirection, m_pRadioLockCursorToScreen };
for (unsigned int i = 0; i < sizeof(typeButtons) / sizeof(typeButtons[0]); i++)
m_pButtonGroupType->addButton(typeButtons[i], i);
diff --git a/src/gui/src/ActionDialogBase.ui b/src/gui/src/ActionDialogBase.ui
index f6dff78..9c6ad0a 100644
--- a/src/gui/src/ActionDialogBase.ui
+++ b/src/gui/src/ActionDialogBase.ui
@@ -145,6 +145,17 @@
<item>
<layout class="QHBoxLayout">
<item>
+ <widget class="QRadioButton" name="m_pRadioToggleScreen">
+ <property name="text">
+ <string>Toggle screen</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout">
+ <item>
<widget class="QRadioButton" name="m_pRadioSwitchInDirection">
<property name="text">
<string>Switch in direction</string>
diff --git a/src/gui/src/BaseConfig.h b/src/gui/src/BaseConfig.h
index 2a34969..cf41ac6 100644
--- a/src/gui/src/BaseConfig.h
+++ b/src/gui/src/BaseConfig.h
@@ -26,61 +26,97 @@
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, PreserveFocus, NumFixes };
+public:
+ enum class Modifier {
+ DefaultMod = -1,
+ Shift,
+ Ctrl,
+ Alt,
+ Meta,
+ Super,
+ None,
+ Count
+ };
+
+ enum class SwitchCorner {
+ TopLeft,
+ TopRight,
+ BottomLeft,
+ BottomRight,
+ Count
+ };
+
+ enum class Fix {
+ CapsLock,
+ NumLock,
+ ScrollLock,
+ XTest,
+ PreserveFocus,
+ Count
+ };
protected:
BaseConfig() {}
virtual ~BaseConfig() {}
protected:
- template<typename T1, typename T2>
- void readSettings(QSettings& settings, T1& array, const QString& arrayName, const T2& deflt)
+ template<class SettingType, class T>
+ void readSettings(QSettings& settings, QList<T>& array, const QString& arrayName,
+ const T& 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<T2>());
+ QVariant v = settings.value(arrayName, static_cast<SettingType>(deflt));
+ array.append(static_cast<T>(v.value<SettingType>()));
}
settings.endArray();
}
- template<typename T1, typename T2>
- void readSettings(QSettings& settings, T1& array, const QString& arrayName, const T2& deflt, int entries)
+ template<class SettingType, class T>
+ void readSettings(QSettings& settings, QList<T>& array, const QString& arrayName,
+ const T& 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<T2>();
+ QVariant v = settings.value(arrayName, static_cast<SettingType>(deflt));
+ array[i] = static_cast<T>(v.value<SettingType>());
}
settings.endArray();
}
- template<typename T>
- void writeSettings(QSettings& settings, const T& array, const QString& arrayName) const
+ template<class SettingType, class T>
+ void writeSettings(QSettings& settings, const QList<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.setValue(arrayName, static_cast<SettingType>(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]; }
+ static const char* modifierName(Modifier idx)
+ {
+ return m_ModifierNames[static_cast<int>(idx)];
+ }
+ static const char* fixName(Fix idx)
+ {
+ return m_FixNames[static_cast<int>(idx)];
+ }
+ static const char* switchCornerName(SwitchCorner idx)
+ {
+ return m_SwitchCornerNames[static_cast<int>(idx)];
+ }
private:
static const char* m_ModifierNames[];
diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp
index bcbb15b..01133bf 100644
--- a/src/gui/src/MainWindow.cpp
+++ b/src/gui/src/MainWindow.cpp
@@ -67,10 +67,17 @@ static const QString barrierConfigFilter(QObject::tr("Barrier Configurations (*.
static const char* barrierIconFiles[] =
{
+#if defined(Q_OS_MAC)
+ ":/res/icons/32x32/barrier-disconnected-mask.png",
+ ":/res/icons/32x32/barrier-disconnected-mask.png",
+ ":/res/icons/32x32/barrier-connected-mask.png",
+ ":/res/icons/32x32/barrier-transfering-mask.png"
+#else
":/res/icons/16x16/barrier-disconnected.png",
":/res/icons/16x16/barrier-disconnected.png",
":/res/icons/16x16/barrier-connected.png",
":/res/icons/16x16/barrier-transfering.png"
+#endif
};
static const char* barrierLargeIcon = ":/res/icons/256x256/barrier.ico";
@@ -288,8 +295,13 @@ void MainWindow::saveSettings()
void MainWindow::setIcon(qBarrierState state)
{
- if (m_pTrayIcon)
- m_pTrayIcon->setIcon(QIcon(barrierIconFiles[state]));
+ if (m_pTrayIcon) {
+ QIcon icon = QIcon(barrierIconFiles[state]);
+#if defined(Q_OS_MAC)
+ icon.setIsMask(true);
+#endif
+ m_pTrayIcon->setIcon(icon);
+ }
}
void MainWindow::trayActivated(QSystemTrayIcon::ActivationReason reason)
@@ -333,7 +345,9 @@ void MainWindow::logError()
void MainWindow::appendLogInfo(const QString& text)
{
- m_pLogWindow->appendInfo(text);
+ if (appConfig().logLevel() >= 3) {
+ m_pLogWindow->appendInfo(text);
+ }
}
void MainWindow::appendLogDebug(const QString& text) {
@@ -524,10 +538,7 @@ void MainWindow::startBarrier()
qDebug() << args;
- // show command if debug log level...
- if (appConfig().logLevel() >= 4) {
- appendLogInfo(QString("command: %1 %2").arg(app, args.join(" ")));
- }
+ appendLogDebug(QString("command: %1 %2").arg(app, args.join(" ")));
appendLogInfo("config file: " + configFilename());
appendLogInfo("log level: " + appConfig().logLevelText());
@@ -584,9 +595,7 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
args << "[" + serverIp + "]:" + QString::number(appConfig().port());
return true;
}
- }
-
- if (m_pLineEditHostname->text().isEmpty()) {
+ } else if (m_pLineEditHostname->text().isEmpty()) {
show();
if (!m_SuppressEmptyServerWarning) {
QMessageBox::warning(this, tr("Hostname is empty"),
@@ -944,6 +953,7 @@ void MainWindow::updateSSLFingerprint()
}
if (m_AppConfig->getCryptoEnabled() && Fingerprint::local().fileExists()) {
m_pLabelLocalFingerprint->setText(Fingerprint::local().readFirst());
+ m_pLabelLocalFingerprint->setTextInteractionFlags(Qt::TextSelectableByMouse);
} else {
m_pLabelLocalFingerprint->setText("Disabled");
}
diff --git a/src/gui/src/Screen.cpp b/src/gui/src/Screen.cpp
index 880e78c..38d02e8 100644
--- a/src/gui/src/Screen.cpp
+++ b/src/gui/src/Screen.cpp
@@ -47,13 +47,13 @@ void Screen::init()
// 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 < static_cast<int>(Modifier::Count); i++)
+ modifiers() << static_cast<Modifier>(i);
- for (int i = 0; i < NumSwitchCorners; i++)
+ for (int i = 0; i < static_cast<int>(SwitchCorner::Count); i++)
switchCorners() << false;
- for (int i = 0; i < NumFixes; i++)
+ for (int i = 0; i < static_cast<int>(Fix::Count); i++)
fixes() << false;
}
@@ -66,10 +66,12 @@ void Screen::loadSettings(QSettings& settings)
setSwitchCornerSize(settings.value("switchCornerSize").toInt());
- readSettings(settings, aliases(), "alias", QString(""));
- readSettings(settings, modifiers(), "modifier", static_cast<int>(DefaultMod), NumModifiers);
- readSettings(settings, switchCorners(), "switchCorner", false, NumSwitchCorners);
- readSettings(settings, fixes(), "fix", false, NumFixes);
+ readSettings<QString>(settings, aliases(), "alias", QString(""));
+ readSettings<int>(settings, modifiers(), "modifier", Modifier::DefaultMod,
+ static_cast<int>(Modifier::Count));
+ readSettings<bool>(settings, switchCorners(), "switchCorner", false,
+ static_cast<int>(SwitchCorner::Count));
+ readSettings<bool>(settings, fixes(), "fix", false, static_cast<int>(Fix::Count));
}
void Screen::saveSettings(QSettings& settings) const
@@ -81,27 +83,35 @@ void Screen::saveSettings(QSettings& settings) const
settings.setValue("switchCornerSize", switchCornerSize());
- writeSettings(settings, aliases(), "alias");
- writeSettings(settings, modifiers(), "modifier");
- writeSettings(settings, switchCorners(), "switchCorner");
- writeSettings(settings, fixes(), "fix");
+ writeSettings<QString>(settings, aliases(), "alias");
+ writeSettings<int>(settings, modifiers(), "modifier");
+ writeSettings<bool>(settings, switchCorners(), "switchCorner");
+ writeSettings<bool>(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 < modifiers().size(); i++) {
+ auto mod = static_cast<Modifier>(i);
+ if (modifier(mod) != mod) {
+ outStream << "\t\t" << modifierName(mod) << " = " << modifierName(modifier(mod))
+ << endl;
+ }
+ }
- for (int i = 0; i < fixes().size(); i++)
- outStream << "\t\t" << fixName(i) << " = " << (fixes()[i] ? "true" : "false") << endl;
+ for (int i = 0; i < fixes().size(); i++) {
+ auto fix = static_cast<Fix>(i);
+ outStream << "\t\t" << fixName(fix) << " = " << (fixes()[i] ? "true" : "false") << endl;
+ }
outStream << "\t\t" << "switchCorners = none ";
- for (int i = 0; i < switchCorners().size(); i++)
- if (switchCorners()[i])
- outStream << "+" << switchCornerName(i) << " ";
+ for (int i = 0; i < switchCorners().size(); i++) {
+ if (switchCorners()[i]) {
+ outStream << "+" << switchCornerName(static_cast<SwitchCorner>(i)) << " ";
+ }
+ }
outStream << endl;
outStream << "\t\t" << "switchCornerSize = " << switchCornerSize() << endl;
@@ -124,11 +134,16 @@ QTextStream& Screen::writeAliasesSection(QTextStream& outStream) const
QDataStream& operator<<(QDataStream& outStream, const Screen& screen)
{
+ QList<int> modifiers;
+ for (auto mod : screen.modifiers()) {
+ modifiers.push_back(static_cast<int>(mod));
+ }
+
return outStream
<< screen.name()
<< screen.switchCornerSize()
<< screen.aliases()
- << screen.modifiers()
+ << modifiers
<< screen.switchCorners()
<< screen.fixes()
;
@@ -136,12 +151,18 @@ QDataStream& operator<<(QDataStream& outStream, const Screen& screen)
QDataStream& operator>>(QDataStream& inStream, Screen& screen)
{
+ QList<int> modifiers;
return inStream
>> screen.m_Name
>> screen.m_SwitchCornerSize
>> screen.m_Aliases
- >> screen.m_Modifiers
+ >> modifiers
>> screen.m_SwitchCorners
>> screen.m_Fixes
;
+
+ screen.m_Modifiers.clear();
+ for (auto mod : modifiers) {
+ screen.m_Modifiers.push_back(static_cast<Screen::Modifier>(mod));
+ }
}
diff --git a/src/gui/src/Screen.h b/src/gui/src/Screen.h
index 6d9c668..d728af1 100644
--- a/src/gui/src/Screen.h
+++ b/src/gui/src/Screen.h
@@ -50,12 +50,17 @@ class Screen : public BaseConfig
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<int>& modifiers() const { return m_Modifiers; }
- bool switchCorner(int c) const { return m_SwitchCorners[c]; }
+ Modifier modifier(Modifier m) const
+ {
+ Modifier overriddenModifier = m_Modifiers[static_cast<int>(m)];
+ return overriddenModifier == Modifier::DefaultMod ? m : overriddenModifier;
+ }
+
+ const QList<Modifier>& modifiers() const { return m_Modifiers; }
+ bool switchCorner(SwitchCorner c) const { return m_SwitchCorners[static_cast<int>(c)]; }
const QList<bool>& switchCorners() const { return m_SwitchCorners; }
int switchCornerSize() const { return m_SwitchCornerSize; }
- bool fix(Fix f) const { return m_Fixes[f]; }
+ bool fix(Fix f) const { return m_Fixes[static_cast<int>(f)]; }
const QList<bool>& fixes() const { return m_Fixes; }
void loadSettings(QSettings& settings);
@@ -73,13 +78,13 @@ class Screen : public BaseConfig
void setPixmap(const QPixmap& pixmap) { m_Pixmap = pixmap; }
QStringList& aliases() { return m_Aliases; }
- void setModifier(int m, int n) { m_Modifiers[m] = n; }
- QList<int>& modifiers() { return m_Modifiers; }
+ void setModifier(Modifier m, Modifier n) { m_Modifiers[static_cast<int>(m)] = n; }
+ QList<Modifier>& modifiers() { return m_Modifiers; }
void addAlias(const QString& alias) { m_Aliases.append(alias); }
- void setSwitchCorner(int c, bool on) { m_SwitchCorners[c] = on; }
+ void setSwitchCorner(SwitchCorner c, bool on) { m_SwitchCorners[static_cast<int>(c)] = on; }
QList<bool>& switchCorners() { return m_SwitchCorners; }
void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; }
- void setFix(int f, bool on) { m_Fixes[f] = on; }
+ void setFix(Fix f, bool on) { m_Fixes[static_cast<int>(f)] = on; }
QList<bool>& fixes() { return m_Fixes; }
void setSwapped(bool on) { m_Swapped = on; }
@@ -88,7 +93,7 @@ class Screen : public BaseConfig
QString m_Name;
QStringList m_Aliases;
- QList<int> m_Modifiers;
+ QList<Modifier> m_Modifiers;
QList<bool> m_SwitchCorners;
int m_SwitchCornerSize;
QList<bool> m_Fixes;
diff --git a/src/gui/src/ScreenSettingsDialog.cpp b/src/gui/src/ScreenSettingsDialog.cpp
index 3023b6d..123bb8a 100644
--- a/src/gui/src/ScreenSettingsDialog.cpp
+++ b/src/gui/src/ScreenSettingsDialog.cpp
@@ -52,23 +52,23 @@ ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen) :
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_pComboBoxShift->setCurrentIndex(static_cast<int>(m_pScreen->modifier(Screen::Modifier::Shift)));
+ m_pComboBoxCtrl->setCurrentIndex(static_cast<int>(m_pScreen->modifier(Screen::Modifier::Ctrl)));
+ m_pComboBoxAlt->setCurrentIndex(static_cast<int>(m_pScreen->modifier(Screen::Modifier::Alt)));
+ m_pComboBoxMeta->setCurrentIndex(static_cast<int>(m_pScreen->modifier(Screen::Modifier::Meta)));
+ m_pComboBoxSuper->setCurrentIndex(static_cast<int>(m_pScreen->modifier(Screen::Modifier::Super)));
+
+ m_pCheckBoxCornerTopLeft->setChecked(m_pScreen->switchCorner(Screen::SwitchCorner::TopLeft));
+ m_pCheckBoxCornerTopRight->setChecked(m_pScreen->switchCorner(Screen::SwitchCorner::TopRight));
+ m_pCheckBoxCornerBottomLeft->setChecked(m_pScreen->switchCorner(Screen::SwitchCorner::BottomLeft));
+ m_pCheckBoxCornerBottomRight->setChecked(m_pScreen->switchCorner(Screen::SwitchCorner::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));
- m_pCheckBoxPreserveFocus->setChecked(m_pScreen->fix(Screen::PreserveFocus));
+ m_pCheckBoxCapsLock->setChecked(m_pScreen->fix(Screen::Fix::CapsLock));
+ m_pCheckBoxNumLock->setChecked(m_pScreen->fix(Screen::Fix::NumLock));
+ m_pCheckBoxScrollLock->setChecked(m_pScreen->fix(Screen::Fix::ScrollLock));
+ m_pCheckBoxXTest->setChecked(m_pScreen->fix(Screen::Fix::XTest));
+ m_pCheckBoxPreserveFocus->setChecked(m_pScreen->fix(Screen::Fix::PreserveFocus));
}
void ScreenSettingsDialog::accept()
@@ -100,23 +100,28 @@ void ScreenSettingsDialog::accept()
m_pScreen->addAlias(alias);
}
- 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->setModifier(Screen::Modifier::Shift,
+ static_cast<Screen::Modifier>(m_pComboBoxShift->currentIndex()));
+ m_pScreen->setModifier(Screen::Modifier::Ctrl,
+ static_cast<Screen::Modifier>(m_pComboBoxCtrl->currentIndex()));
+ m_pScreen->setModifier(Screen::Modifier::Alt,
+ static_cast<Screen::Modifier>(m_pComboBoxAlt->currentIndex()));
+ m_pScreen->setModifier(Screen::Modifier::Meta,
+ static_cast<Screen::Modifier>(m_pComboBoxMeta->currentIndex()));
+ m_pScreen->setModifier(Screen::Modifier::Super,
+ static_cast<Screen::Modifier>(m_pComboBoxSuper->currentIndex()));
+
+ m_pScreen->setSwitchCorner(Screen::SwitchCorner::TopLeft, m_pCheckBoxCornerTopLeft->isChecked());
+ m_pScreen->setSwitchCorner(Screen::SwitchCorner::TopRight, m_pCheckBoxCornerTopRight->isChecked());
+ m_pScreen->setSwitchCorner(Screen::SwitchCorner::BottomLeft, m_pCheckBoxCornerBottomLeft->isChecked());
+ m_pScreen->setSwitchCorner(Screen::SwitchCorner::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());
- m_pScreen->setFix(Screen::PreserveFocus, m_pCheckBoxPreserveFocus->isChecked());
+ m_pScreen->setFix(Screen::Fix::CapsLock, m_pCheckBoxCapsLock->isChecked());
+ m_pScreen->setFix(Screen::Fix::NumLock, m_pCheckBoxNumLock->isChecked());
+ m_pScreen->setFix(Screen::Fix::ScrollLock, m_pCheckBoxScrollLock->isChecked());
+ m_pScreen->setFix(Screen::Fix::XTest, m_pCheckBoxXTest->isChecked());
+ m_pScreen->setFix(Screen::Fix::PreserveFocus, m_pCheckBoxPreserveFocus->isChecked());
QDialog::accept();
}
diff --git a/src/gui/src/ServerConfig.cpp b/src/gui/src/ServerConfig.cpp
index d7d1a77..9fedd1e 100644
--- a/src/gui/src/ServerConfig.cpp
+++ b/src/gui/src/ServerConfig.cpp
@@ -88,8 +88,9 @@ void ServerConfig::init()
screens().clear();
// m_NumSwitchCorners is used as a fixed size array. See Screen::init()
- for (int i = 0; i < NumSwitchCorners; i++)
+ for (int i = 0; i < static_cast<int>(SwitchCorner::Count); 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.
@@ -119,7 +120,7 @@ void ServerConfig::saveSettings()
settings().setValue("enableDragAndDrop", enableDragAndDrop());
settings().setValue("clipboardSharing", clipboardSharing());
- writeSettings(settings(), switchCorners(), "switchCorner");
+ writeSettings<bool>(settings(), switchCorners(), "switchCorner");
settings().beginWriteArray("screens");
for (int i = 0; i < screens().size(); i++)
@@ -164,7 +165,8 @@ void ServerConfig::loadSettings()
setEnableDragAndDrop(settings().value("enableDragAndDrop", true).toBool());
setClipboardSharing(settings().value("clipboardSharing", true).toBool());
- readSettings(settings(), switchCorners(), "switchCorner", false, NumSwitchCorners);
+ readSettings<bool>(settings(), switchCorners(), "switchCorner", false,
+ static_cast<int>(SwitchCorner::Count));
int numScreens = settings().beginReadArray("screens");
Q_ASSERT(numScreens <= screens().size());
@@ -258,9 +260,12 @@ QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config)
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) << " ";
+ for (int i = 0; i < config.switchCorners().size(); i++) {
+ auto corner = static_cast<Screen::SwitchCorner>(i);
+ if (config.switchCorners()[i]) {
+ outStream << "+" << config.switchCornerName(corner) << " ";
+ }
+ }
outStream << endl;
outStream << "\t" << "switchCornerSize = " << config.switchCornerSize() << endl;
diff --git a/src/gui/src/ServerConfig.h b/src/gui/src/ServerConfig.h
index 65cbbac..c9648b0 100644
--- a/src/gui/src/ServerConfig.h
+++ b/src/gui/src/ServerConfig.h
@@ -56,7 +56,7 @@ class ServerConfig : public BaseConfig
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]; }
+ bool switchCorner(SwitchCorner c) const { return m_SwitchCorners[static_cast<int>(c)]; }
int switchCornerSize() const { return m_SwitchCornerSize; }
const QList<bool>& switchCorners() const { return m_SwitchCorners; }
const HotkeyList& hotkeys() const { return m_Hotkeys; }
@@ -87,7 +87,7 @@ class ServerConfig : public BaseConfig
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 setSwitchCorner(SwitchCorner c, bool on) { m_SwitchCorners[static_cast<int>(c)] = on; }
void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; }
void setIgnoreAutoConfigClient(bool on) { m_IgnoreAutoConfigClient = on; }
void setEnableDragAndDrop(bool on) { m_EnableDragAndDrop = on; }
diff --git a/src/gui/src/ServerConfigDialog.cpp b/src/gui/src/ServerConfigDialog.cpp
index 799cfc8..2e7ffc9 100644
--- a/src/gui/src/ServerConfigDialog.cpp
+++ b/src/gui/src/ServerConfigDialog.cpp
@@ -48,10 +48,10 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, co
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_pCheckBoxCornerTopLeft->setChecked(serverConfig().switchCorner(BaseConfig::SwitchCorner::TopLeft));
+ m_pCheckBoxCornerTopRight->setChecked(serverConfig().switchCorner(BaseConfig::SwitchCorner::TopRight));
+ m_pCheckBoxCornerBottomLeft->setChecked(serverConfig().switchCorner(BaseConfig::SwitchCorner::BottomLeft));
+ m_pCheckBoxCornerBottomRight->setChecked(serverConfig().switchCorner(BaseConfig::SwitchCorner::BottomRight));
m_pSpinBoxSwitchCornerSize->setValue(serverConfig().switchCornerSize());
m_pCheckBoxIgnoreAutoConfigClient->setChecked(serverConfig().ignoreAutoConfigClient());
@@ -95,10 +95,14 @@ void ServerConfigDialog::accept()
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().setSwitchCorner(BaseConfig::SwitchCorner::TopLeft,
+ m_pCheckBoxCornerTopLeft->isChecked());
+ serverConfig().setSwitchCorner(BaseConfig::SwitchCorner::TopRight,
+ m_pCheckBoxCornerTopRight->isChecked());
+ serverConfig().setSwitchCorner(BaseConfig::SwitchCorner::BottomLeft,
+ m_pCheckBoxCornerBottomLeft->isChecked());
+ serverConfig().setSwitchCorner(BaseConfig::SwitchCorner::BottomRight,
+ m_pCheckBoxCornerBottomRight->isChecked());
serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
serverConfig().setIgnoreAutoConfigClient(m_pCheckBoxIgnoreAutoConfigClient->isChecked());
serverConfig().setEnableDragAndDrop(m_pCheckBoxEnableDragAndDrop->isChecked());
diff --git a/src/gui/src/ServerConfigDialogBase.ui b/src/gui/src/ServerConfigDialogBase.ui
index c360420..9c2e747 100644
--- a/src/gui/src/ServerConfigDialogBase.ui
+++ b/src/gui/src/ServerConfigDialogBase.ui
@@ -334,53 +334,67 @@ Double click on a screen to edit its settings.</string>
</layout>
</item>
<item>
- <layout class="QHBoxLayout">
+ <layout class="QVBoxLayout">
<item>
- <widget class="QCheckBox" name="m_pCheckBoxSwitchDoubleTap">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="text">
- <string>Switch on double &amp;tap within</string>
- </property>
- </widget>
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QCheckBox" name="m_pCheckBoxSwitchDoubleTap">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Switch on double &amp;tap within</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="m_pSpinBoxSwitchDoubleTap">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>10</number>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="singleStep">
+ <number>10</number>
+ </property>
+ <property name="value">
+ <number>250</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="m_pLabel_15">
+ <property name="text">
+ <string>ms</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
<item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QSpinBox" name="m_pSpinBoxSwitchDoubleTap">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="minimum">
- <number>10</number>
- </property>
- <property name="maximum">
- <number>10000</number>
- </property>
- <property name="singleStep">
- <number>10</number>
- </property>
- <property name="value">
- <number>250</number>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="m_pLabel_15">
+ <widget class="QLabel" name="label_4">
<property name="text">
- <string>ms</string>
+ <string>Bump against the screen edge with the mouse pointer twice in quick succession.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
</property>
</widget>
</item>
diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp
index 15f7067..24bb86c 100644
--- a/src/gui/src/SettingsDialog.cpp
+++ b/src/gui/src/SettingsDialog.cpp
@@ -31,8 +31,6 @@
#include <QFileDialog>
#include <QDir>
-static const char networkSecurity[] = "ns";
-
SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::SettingsDialogBase(),
@@ -136,4 +134,4 @@ void SettingsDialog::on_m_pComboLanguage_currentIndexChanged(int index)
{
QString ietfCode = m_pComboLanguage->itemData(index).toString();
QBarrierApplication::getInstance()->switchTranslator(ietfCode);
-} \ No newline at end of file
+}
diff --git a/src/lib/arch/Arch.h b/src/lib/arch/Arch.h
index c062d6f..940a2e3 100644
--- a/src/lib/arch/Arch.h
+++ b/src/lib/arch/Arch.h
@@ -54,9 +54,7 @@
# include "arch/unix/ArchConsoleUnix.h"
# include "arch/unix/ArchDaemonUnix.h"
# include "arch/unix/ArchLogUnix.h"
-# if HAVE_PTHREAD
-# include "arch/unix/ArchMultithreadPosix.h"
-# endif
+# include "arch/unix/ArchMultithreadPosix.h"
# include "arch/unix/ArchNetworkBSD.h"
# include "arch/unix/ArchSleepUnix.h"
# include "arch/unix/ArchStringUnix.h"
diff --git a/src/lib/arch/ArchDaemonNone.h b/src/lib/arch/ArchDaemonNone.h
index fd59758..e02405f 100644
--- a/src/lib/arch/ArchDaemonNone.h
+++ b/src/lib/arch/ArchDaemonNone.h
@@ -19,6 +19,7 @@
#pragma once
#include "arch/IArchDaemon.h"
+#include <string>
#define ARCH_DAEMON ArchDaemonNone
@@ -46,5 +47,5 @@ public:
virtual bool isDaemonInstalled(const char* name);
virtual void installDaemon();
virtual void uninstallDaemon();
- virtual std::string commandLine() const;
+ virtual std::string commandLine() const;
};
diff --git a/src/lib/arch/IArchDaemon.h b/src/lib/arch/IArchDaemon.h
index a4983d3..23a34f2 100644
--- a/src/lib/arch/IArchDaemon.h
+++ b/src/lib/arch/IArchDaemon.h
@@ -19,7 +19,7 @@
#pragma once
#include "common/IInterface.h"
-#include "base/String.h"
+#include <string>
//! Interface for architecture dependent daemonizing
/*!
@@ -122,7 +122,7 @@ public:
/*!
Gets the command line with which the application was started.
*/
- virtual std::string commandLine() const = 0;
+ virtual std::string commandLine() const = 0;
//@}
};
diff --git a/src/lib/arch/IArchTaskBarReceiver.h b/src/lib/arch/IArchTaskBarReceiver.h
index 8a925b4..997c8ae 100644
--- a/src/lib/arch/IArchTaskBarReceiver.h
+++ b/src/lib/arch/IArchTaskBarReceiver.h
@@ -18,8 +18,8 @@
#pragma once
-#include "base/String.h"
#include "common/IInterface.h"
+#include <string>
class IScreen;
class INode;
@@ -88,9 +88,9 @@ public:
to set the tooltip is left to sublclasses. Getting and setting
the icon must be thread safe.
*/
- virtual std::string getToolTip() const = 0;
+ virtual std::string getToolTip() const = 0;
- virtual void updateStatus(INode*, const String& errorMsg) = 0;
+ virtual void updateStatus(INode*, const std::string& errorMsg) = 0;
virtual void cleanup() {}
diff --git a/src/lib/arch/XArch.h b/src/lib/arch/XArch.h
index 457c620..8484d06 100644
--- a/src/lib/arch/XArch.h
+++ b/src/lib/arch/XArch.h
@@ -20,7 +20,7 @@
#include "common/common.h"
#include "common/stdstring.h"
-#include "common/stdexcept.h"
+#include <stdexcept>
//! Generic thread exception
/*!
@@ -56,7 +56,7 @@ string for that error code.
class XArchEval {
public:
XArchEval() { }
- virtual ~XArchEval() _NOEXCEPT { }
+ virtual ~XArchEval() noexcept { }
virtual std::string eval() const = 0;
};
@@ -66,7 +66,7 @@ class XArch : public std::runtime_error {
public:
XArch(XArchEval* adopted) : std::runtime_error(adopted->eval()) { delete adopted; }
XArch(const std::string& msg) : std::runtime_error(msg) { }
- virtual ~XArch() _NOEXCEPT { }
+ virtual ~XArch() noexcept { }
};
// Macro to declare XArch derived types
diff --git a/src/lib/arch/unix/ArchInternetUnix.cpp b/src/lib/arch/unix/ArchInternetUnix.cpp
index fd1e135..76966dc 100644
--- a/src/lib/arch/unix/ArchInternetUnix.cpp
+++ b/src/lib/arch/unix/ArchInternetUnix.cpp
@@ -28,8 +28,8 @@ class CurlFacade {
public:
CurlFacade();
~CurlFacade();
- String get(const String& url);
- String urlEncode(const String& url);
+ std::string get(const std::string& url);
+ std::string urlEncode(const std::string& url);
private:
CURL* m_curl;
@@ -39,15 +39,13 @@ private:
// ArchInternetUnix
//
-String
-ArchInternetUnix::get(const String& url)
+std::string ArchInternetUnix::get(const std::string& url)
{
CurlFacade curl;
return curl.get(url);
}
-String
-ArchInternetUnix::urlEncode(const String& url)
+std::string ArchInternetUnix::urlEncode(const std::string& url)
{
CurlFacade curl;
return curl.urlEncode(url);
@@ -87,8 +85,7 @@ CurlFacade::~CurlFacade()
curl_global_cleanup();
}
-String
-CurlFacade::get(const String& url)
+std::string CurlFacade::get(const std::string& url)
{
curl_easy_setopt(m_curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION, curlWriteCallback);
@@ -110,8 +107,7 @@ CurlFacade::get(const String& url)
return result;
}
-String
-CurlFacade::urlEncode(const String& url)
+std::string CurlFacade::urlEncode(const std::string& url)
{
char* resultCStr = curl_easy_escape(m_curl, url.c_str(), 0);
diff --git a/src/lib/arch/unix/ArchInternetUnix.h b/src/lib/arch/unix/ArchInternetUnix.h
index 2413d8f..66de656 100644
--- a/src/lib/arch/unix/ArchInternetUnix.h
+++ b/src/lib/arch/unix/ArchInternetUnix.h
@@ -19,10 +19,10 @@
#define ARCH_INTERNET ArchInternetUnix
-#include "base/String.h"
+#include <string>
class ArchInternetUnix {
public:
- String get(const String& url);
- String urlEncode(const String& url);
+ std::string get(const std::string& url);
+ std::string urlEncode(const std::string& url);
};
diff --git a/src/lib/arch/unix/ArchMultithreadPosix.cpp b/src/lib/arch/unix/ArchMultithreadPosix.cpp
index c9ddc6c..4866edc 100644
--- a/src/lib/arch/unix/ArchMultithreadPosix.cpp
+++ b/src/lib/arch/unix/ArchMultithreadPosix.cpp
@@ -36,17 +36,6 @@
#define SIGWAKEUP SIGUSR1
-#if !HAVE_PTHREAD_SIGNAL
- // boy, is this platform broken. forget about pthread signal
- // handling and let signals through to every process. barrier
- // 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)
@@ -344,9 +333,7 @@ ArchMultithreadPosix::newThread(ThreadFunc func, void* data)
// can't tell the difference.
if (!m_newThreadCalled) {
m_newThreadCalled = true;
-#if HAVE_PTHREAD_SIGNAL
startSignalHandler();
-#endif
}
// note that the child thread will wait until we release this mutex
diff --git a/src/lib/arch/unix/ArchNetworkBSD.cpp b/src/lib/arch/unix/ArchNetworkBSD.cpp
index 2a9259c..496c988 100644
--- a/src/lib/arch/unix/ArchNetworkBSD.cpp
+++ b/src/lib/arch/unix/ArchNetworkBSD.cpp
@@ -690,7 +690,6 @@ ArchNetworkBSD::nameToAddr(const std::string& name)
// allocate address
ArchNetAddressImpl* addr = new ArchNetAddressImpl;
- char ipstr[INET6_ADDRSTRLEN];
struct addrinfo hints;
struct addrinfo *p;
int ret;
diff --git a/src/lib/arch/unix/XArchUnix.h b/src/lib/arch/unix/XArchUnix.h
index ae62f4c..93d6d62 100644
--- a/src/lib/arch/unix/XArchUnix.h
+++ b/src/lib/arch/unix/XArchUnix.h
@@ -24,7 +24,7 @@
class XArchEvalUnix : public XArchEval {
public:
XArchEvalUnix(int error) : m_error(error) { }
- virtual ~XArchEvalUnix() _NOEXCEPT { }
+ virtual ~XArchEvalUnix() noexcept { }
virtual std::string eval() const;
diff --git a/src/lib/arch/win32/ArchInternetWindows.cpp b/src/lib/arch/win32/ArchInternetWindows.cpp
index 7f69c7f..8a28fde 100644
--- a/src/lib/arch/win32/ArchInternetWindows.cpp
+++ b/src/lib/arch/win32/ArchInternetWindows.cpp
@@ -18,6 +18,7 @@
#include "arch/win32/ArchInternetWindows.h"
#include "arch/win32/XArchWindows.h"
#include "arch/Arch.h"
+#include "base/String.h"
#include "common/Version.h"
#include <sstream>
@@ -25,19 +26,19 @@
#include <Shlwapi.h>
struct WinINetUrl {
- String m_scheme;
- String m_host;
- String m_path;
+ std::string m_scheme;
+ std::string m_host;
+ std::string m_path;
INTERNET_PORT m_port;
DWORD m_flags;
};
class WinINetRequest {
public:
- WinINetRequest(const String& url);
+ WinINetRequest(const std::string& url);
~WinINetRequest();
- String send();
+ std::string send();
void openSession();
void connect();
void openRequest();
@@ -54,15 +55,13 @@ private:
// ArchInternetWindows
//
-String
-ArchInternetWindows::get(const String& url)
+std::string ArchInternetWindows::get(const std::string& url)
{
WinINetRequest request(url);
return request.send();
}
-String
-ArchInternetWindows::urlEncode(const String& url)
+std::string ArchInternetWindows::urlEncode(const std::string& url)
{
TCHAR buffer[1024];
DWORD bufferSize = sizeof(buffer);
@@ -71,7 +70,7 @@ ArchInternetWindows::urlEncode(const String& url)
throw XArch(new XArchEvalWindows());
}
- String result(buffer);
+ std::string result(buffer);
// the win32 url encoding funcitons are pretty useless (to us) and only
// escape "unsafe" chars, but not + or =, so we need to replace these
@@ -86,9 +85,9 @@ ArchInternetWindows::urlEncode(const String& url)
// WinINetRequest
//
-static WinINetUrl parseUrl(const String& url);
+static WinINetUrl parseUrl(const std::string& url);
-WinINetRequest::WinINetRequest(const String& url) :
+WinINetRequest::WinINetRequest(const std::string& url) :
m_session(NULL),
m_connect(NULL),
m_request(NULL),
@@ -112,8 +111,7 @@ WinINetRequest::~WinINetRequest()
}
}
-String
-WinINetRequest::send()
+std::string WinINetRequest::send()
{
if (m_used) {
throw XArch("class is one time use.");
@@ -124,7 +122,7 @@ WinINetRequest::send()
connect();
openRequest();
- String headers("Content-Type: text/html");
+ std::string headers("Content-Type: text/html");
if (!HttpSendRequest(m_request, headers.c_str(), (DWORD)headers.length(), NULL, NULL)) {
throw XArch(new XArchEvalWindows());
}
@@ -142,8 +140,7 @@ WinINetRequest::send()
return result.str();
}
-void
-WinINetRequest::openSession()
+void WinINetRequest::openSession()
{
std::stringstream userAgent;
userAgent << "Barrier ";
@@ -200,8 +197,7 @@ WinINetRequest::openRequest()
// nb: i tried to use InternetCrackUrl here, but couldn't quite get that to
// work. here's some (less robust) code to split the url into components.
// this works fine with simple urls, but doesn't consider the full url spec.
-static WinINetUrl
-parseUrl(const String& url)
+static WinINetUrl parseUrl(const std::string& url)
{
WinINetUrl parsed;
@@ -215,7 +211,7 @@ parseUrl(const String& url)
parsed.m_port = INTERNET_DEFAULT_HTTP_PORT;
parsed.m_flags = 0;
- if (parsed.m_scheme.find("https") != String::npos) {
+ if (parsed.m_scheme.find("https") != std::string::npos) {
parsed.m_port = INTERNET_DEFAULT_HTTPS_PORT;
parsed.m_flags = INTERNET_FLAG_SECURE;
}
diff --git a/src/lib/arch/win32/ArchInternetWindows.h b/src/lib/arch/win32/ArchInternetWindows.h
index bab8d3c..3ef5747 100644
--- a/src/lib/arch/win32/ArchInternetWindows.h
+++ b/src/lib/arch/win32/ArchInternetWindows.h
@@ -19,10 +19,10 @@
#define ARCH_INTERNET ArchInternetWindows
-#include "base/String.h"
+#include <string>
class ArchInternetWindows {
public:
- String get(const String& url);
- String urlEncode(const String& url);
+ std::string get(const std::string& url);
+ std::string urlEncode(const std::string& url);
};
diff --git a/src/lib/arch/win32/ArchMiscWindows.cpp b/src/lib/arch/win32/ArchMiscWindows.cpp
index 924afa2..2c022b1 100644
--- a/src/lib/arch/win32/ArchMiscWindows.cpp
+++ b/src/lib/arch/win32/ArchMiscWindows.cpp
@@ -431,7 +431,7 @@ ArchMiscWindows::wakeupDisplay()
bool
ArchMiscWindows::wasLaunchedAsService()
{
- String name;
+ std::string name;
if (!getParentProcessName(name)) {
LOG((CLOG_ERR "cannot determine if process was launched as service"));
return false;
@@ -440,8 +440,7 @@ ArchMiscWindows::wasLaunchedAsService()
return (name == SERVICE_LAUNCHER);
}
-bool
-ArchMiscWindows::getParentProcessName(String &name)
+bool ArchMiscWindows::getParentProcessName(std::string &name)
{
PROCESSENTRY32 parentEntry;
if (!getParentProcessEntry(parentEntry)){
@@ -521,4 +520,4 @@ ArchMiscWindows::setInstanceWin32(HINSTANCE instance)
{
assert(instance != NULL);
s_instanceWin32 = instance;
-} \ No newline at end of file
+}
diff --git a/src/lib/arch/win32/ArchMiscWindows.h b/src/lib/arch/win32/ArchMiscWindows.h
index 0ecd79d..91cd8f5 100644
--- a/src/lib/arch/win32/ArchMiscWindows.h
+++ b/src/lib/arch/win32/ArchMiscWindows.h
@@ -21,7 +21,6 @@
#include "common/common.h"
#include "common/stdstring.h"
#include "common/stdset.h"
-#include "base/String.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
@@ -163,7 +162,7 @@ public:
static bool wasLaunchedAsService();
//! Returns true if we got the parent process name.
- static bool getParentProcessName(String &name);
+ static bool getParentProcessName(std::string &name);
static HINSTANCE instanceWin32();
diff --git a/src/lib/arch/win32/XArchWindows.cpp b/src/lib/arch/win32/XArchWindows.cpp
index eeec0e1..e116eda 100644
--- a/src/lib/arch/win32/XArchWindows.cpp
+++ b/src/lib/arch/win32/XArchWindows.cpp
@@ -25,7 +25,7 @@
//
std::string
-XArchEvalWindows::eval() const throw()
+XArchEvalWindows::eval() const noexcept
{
char* cmsg;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
@@ -51,7 +51,7 @@ XArchEvalWindows::eval() const throw()
//
std::string
-XArchEvalWinsock::eval() const throw()
+XArchEvalWinsock::eval() const noexcept
{
// built-in windows function for looking up error message strings
// may not look up network error messages correctly. we'll have
diff --git a/src/lib/arch/win32/XArchWindows.h b/src/lib/arch/win32/XArchWindows.h
index 10106b1..4fb2a23 100644
--- a/src/lib/arch/win32/XArchWindows.h
+++ b/src/lib/arch/win32/XArchWindows.h
@@ -30,7 +30,7 @@ public:
XArchEvalWindows(DWORD error) : m_error(error) { }
virtual ~XArchEvalWindows() { }
- virtual std::string eval() const;
+ virtual std::string eval() const noexcept;
private:
DWORD m_error;
@@ -42,7 +42,7 @@ public:
XArchEvalWinsock(int error) : m_error(error) { }
virtual ~XArchEvalWinsock() { }
- virtual std::string eval() const;
+ virtual std::string eval() const noexcept;
private:
int m_error;
diff --git a/src/lib/barrier/ClientApp.cpp b/src/lib/barrier/ClientApp.cpp
index a91312d..b1a7661 100644
--- a/src/lib/barrier/ClientApp.cpp
+++ b/src/lib/barrier/ClientApp.cpp
@@ -282,7 +282,9 @@ ClientApp::scheduleClientRestart(double retryTime)
void
ClientApp::handleClientConnected(const Event&, void*)
{
- LOG((CLOG_NOTE "connected to server"));
+ // using CLOG_PRINT here allows the GUI to see that the client is connected
+ // regardless of which log level is set
+ LOG((CLOG_PRINT "connected to server"));
resetRestartTimeout();
updateStatus();
}
diff --git a/src/lib/barrier/PlatformScreen.h b/src/lib/barrier/PlatformScreen.h
index 82cbfaa..38bf8de 100644
--- a/src/lib/barrier/PlatformScreen.h
+++ b/src/lib/barrier/PlatformScreen.h
@@ -20,7 +20,7 @@
#include "barrier/IPlatformScreen.h"
#include "barrier/DragInformation.h"
-#include "common/stdexcept.h"
+#include <stdexcept>
//! Base screen implementation
/*!
diff --git a/src/lib/barrier/ProtocolUtil.cpp b/src/lib/barrier/ProtocolUtil.cpp
index 42fe69c..e742687 100644
--- a/src/lib/barrier/ProtocolUtil.cpp
+++ b/src/lib/barrier/ProtocolUtil.cpp
@@ -20,6 +20,7 @@
#include "io/IStream.h"
#include "base/Log.h"
#include "common/stdvector.h"
+#include "base/String.h"
#include <cctype>
#include <cstring>
@@ -538,7 +539,7 @@ ProtocolUtil::read(barrier::IStream* stream, void* vbuffer, UInt32 count)
//
String
-XIOReadMismatch::getWhat() const throw()
+XIOReadMismatch::getWhat() const noexcept
{
return format("XIOReadMismatch", "ProtocolUtil::readf() mismatch");
}
diff --git a/src/lib/barrier/ProtocolUtil.h b/src/lib/barrier/ProtocolUtil.h
index 78bb5ca..9930cfc 100644
--- a/src/lib/barrier/ProtocolUtil.h
+++ b/src/lib/barrier/ProtocolUtil.h
@@ -47,7 +47,7 @@ public:
- \%1I -- converts std::vector<UInt8>* to 1 byte integers
- \%2I -- converts std::vector<UInt16>* to 2 byte integers in NBO
- \%4I -- converts std::vector<UInt32>* to 4 byte integers in NBO
- - \%s -- converts String* to stream of bytes
+ - \%s -- converts std::string* to stream of bytes
- \%S -- converts integer N and const UInt8* to stream of N bytes
*/
static void writef(barrier::IStream*,
@@ -67,7 +67,7 @@ public:
- \%1I -- reads 1 byte integers; arg is std::vector<UInt8>*
- \%2I -- reads NBO 2 byte integers; arg is std::vector<UInt16>*
- \%4I -- reads NBO 4 byte integers; arg is std::vector<UInt32>*
- - \%s -- reads bytes; argument must be a String*, \b not a char*
+ - \%s -- reads bytes; argument must be a std::string*, \b not a char*
*/
static bool readf(barrier::IStream*,
const char* fmt, ...);
@@ -92,5 +92,5 @@ match the format.
class XIOReadMismatch : public XIO {
public:
// XBase overrides
- virtual String getWhat() const throw();
+ virtual std::string getWhat() const noexcept;
};
diff --git a/src/lib/barrier/ServerApp.cpp b/src/lib/barrier/ServerApp.cpp
index 318673c..18cf935 100644
--- a/src/lib/barrier/ServerApp.cpp
+++ b/src/lib/barrier/ServerApp.cpp
@@ -555,15 +555,18 @@ ServerApp::startServer()
m_server->setListener(listener);
m_listener = listener;
updateStatus();
- LOG((CLOG_NOTE "started server (%s), waiting for clients", family));
+
+ // using CLOG_PRINT here allows the GUI to see that the server is started
+ // regardless of which log level is set
+ LOG((CLOG_PRINT "started server (%s), waiting for clients", family));
m_serverState = kStarted;
return true;
}
catch (XSocketAddressInUse& e) {
- LOG((CLOG_WARN "cannot listen for clients: %s", e.what()));
+ LOG((CLOG_ERR "cannot listen for clients: %s", e.what()));
closeClientListener(listener);
updateStatus(String("cannot listen for clients: ") + e.what());
- retryTime = 10.0;
+ retryTime = 1.0;
}
catch (XBase& e) {
LOG((CLOG_CRIT "failed to start server: %s", e.what()));
@@ -684,9 +687,9 @@ ServerApp::handleNoClients(const Event&, void*)
void
ServerApp::handleScreenSwitched(const Event& e, void*)
{
- Server::SwitchToScreenInfo* info = (Server::SwitchToScreenInfo*)(e.getData());
-
#ifdef WINAPI_XWINDOWS
+ Server::SwitchToScreenInfo* info = (Server::SwitchToScreenInfo*)(e.getData());
+
if (!args().m_screenChangeScript.empty()) {
LOG((CLOG_INFO "Running shell script for screen \"%s\"", info->m_screen));
diff --git a/src/lib/barrier/StreamChunker.cpp b/src/lib/barrier/StreamChunker.cpp
index 8b8971c..579d02f 100644
--- a/src/lib/barrier/StreamChunker.cpp
+++ b/src/lib/barrier/StreamChunker.cpp
@@ -29,9 +29,9 @@
#include "base/Log.h"
#include "base/Stopwatch.h"
#include "base/String.h"
-#include "common/stdexcept.h"
#include <fstream>
+#include <stdexcept>
using namespace std;
diff --git a/src/lib/barrier/XBarrier.cpp b/src/lib/barrier/XBarrier.cpp
index 49a015e..7fe3577 100644
--- a/src/lib/barrier/XBarrier.cpp
+++ b/src/lib/barrier/XBarrier.cpp
@@ -23,8 +23,7 @@
// XBadClient
//
-String
-XBadClient::getWhat() const throw()
+String XBadClient::getWhat() const noexcept
{
return "XBadClient";
}
@@ -41,20 +40,17 @@ XIncompatibleClient::XIncompatibleClient(int major, int minor) :
// do nothing
}
-int
-XIncompatibleClient::getMajor() const throw()
+int XIncompatibleClient::getMajor() const noexcept
{
return m_major;
}
-int
-XIncompatibleClient::getMinor() const throw()
+int XIncompatibleClient::getMinor() const noexcept
{
return m_minor;
}
-String
-XIncompatibleClient::getWhat() const throw()
+String XIncompatibleClient::getWhat() const noexcept
{
return format("XIncompatibleClient", "incompatible client %{1}.%{2}",
barrier::string::sprintf("%d", m_major).c_str(),
@@ -72,14 +68,12 @@ XDuplicateClient::XDuplicateClient(const String& name) :
// do nothing
}
-const String&
-XDuplicateClient::getName() const throw()
+const String& XDuplicateClient::getName() const noexcept
{
return m_name;
}
-String
-XDuplicateClient::getWhat() const throw()
+String XDuplicateClient::getWhat() const noexcept
{
return format("XDuplicateClient", "duplicate client %{1}", m_name.c_str());
}
@@ -95,14 +89,12 @@ XUnknownClient::XUnknownClient(const String& name) :
// do nothing
}
-const String&
-XUnknownClient::getName() const throw()
+const String& XUnknownClient::getName() const noexcept
{
return m_name;
}
-String
-XUnknownClient::getWhat() const throw()
+String XUnknownClient::getWhat() const noexcept
{
return format("XUnknownClient", "unknown client %{1}", m_name.c_str());
}
@@ -118,14 +110,12 @@ XExitApp::XExitApp(int code) :
// do nothing
}
-int
-XExitApp::getCode() const throw()
+int XExitApp::getCode() const noexcept
{
return m_code;
}
-String
-XExitApp::getWhat() const throw()
+String XExitApp::getWhat() const noexcept
{
return format(
"XExitApp", "exiting with code %{1}",
diff --git a/src/lib/barrier/XBarrier.h b/src/lib/barrier/XBarrier.h
index fdf5213..fef931e 100644
--- a/src/lib/barrier/XBarrier.h
+++ b/src/lib/barrier/XBarrier.h
@@ -47,14 +47,14 @@ public:
//@{
//! Get client's major version number
- int getMajor() const throw();
+ int getMajor() const noexcept;
//! Get client's minor version number
- int getMinor() const throw();
+ int getMinor() const noexcept;
//@}
protected:
- virtual String getWhat() const throw();
+ virtual std::string getWhat() const noexcept;
private:
int m_major;
@@ -68,23 +68,22 @@ a client that is already connected.
*/
class XDuplicateClient : public XBarrier {
public:
- XDuplicateClient(const String& name);
- virtual ~XDuplicateClient() _NOEXCEPT { }
+ XDuplicateClient(const std::string& name);
+ virtual ~XDuplicateClient() noexcept { }
//! @name accessors
//@{
//! Get client's name
- virtual const String&
- getName() const throw();
+ virtual const std::string& getName() const noexcept;
//@}
protected:
- virtual String getWhat() const throw();
+ virtual std::string getWhat() const noexcept;
private:
- String m_name;
+ std::string m_name;
};
//! Client not in map exception
@@ -94,23 +93,22 @@ unknown to the server.
*/
class XUnknownClient : public XBarrier {
public:
- XUnknownClient(const String& name);
- virtual ~XUnknownClient() _NOEXCEPT { }
+ XUnknownClient(const std::string& name);
+ virtual ~XUnknownClient() noexcept { }
//! @name accessors
//@{
//! Get the client's name
- virtual const String&
- getName() const throw();
+ virtual const std::string& getName() const noexcept;
//@}
protected:
- virtual String getWhat() const throw();
+ virtual std::string getWhat() const noexcept;
private:
- String m_name;
+ std::string m_name;
};
//! Generic exit eception
@@ -122,13 +120,13 @@ exit(int).
class XExitApp : public XBarrier {
public:
XExitApp(int code);
- virtual ~XExitApp() _NOEXCEPT { }
+ virtual ~XExitApp() noexcept { }
//! Get the exit code
- int getCode() const throw();
+ int getCode() const noexcept;
protected:
- virtual String getWhat() const throw();
+ virtual std::string getWhat() const noexcept;
private:
int m_code;
diff --git a/src/lib/barrier/XScreen.cpp b/src/lib/barrier/XScreen.cpp
index a202240..3398423 100644
--- a/src/lib/barrier/XScreen.cpp
+++ b/src/lib/barrier/XScreen.cpp
@@ -22,8 +22,7 @@
// XScreenOpenFailure
//
-String
-XScreenOpenFailure::getWhat() const throw()
+std::string XScreenOpenFailure::getWhat() const noexcept
{
return format("XScreenOpenFailure", "unable to open screen");
}
@@ -33,8 +32,7 @@ XScreenOpenFailure::getWhat() const throw()
// XScreenXInputFailure
//
-String
-XScreenXInputFailure::getWhat() const throw()
+std::string XScreenXInputFailure::getWhat() const noexcept
{
return "";
}
@@ -50,7 +48,7 @@ XScreenUnavailable::XScreenUnavailable(double timeUntilRetry) :
// do nothing
}
-XScreenUnavailable::~XScreenUnavailable() _NOEXCEPT
+XScreenUnavailable::~XScreenUnavailable() noexcept
{
// do nothing
}
@@ -61,8 +59,7 @@ XScreenUnavailable::getRetryTime() const
return m_timeUntilRetry;
}
-String
-XScreenUnavailable::getWhat() const throw()
+std::string XScreenUnavailable::getWhat() const noexcept
{
return format("XScreenUnavailable", "unable to open screen");
}
diff --git a/src/lib/barrier/XScreen.h b/src/lib/barrier/XScreen.h
index 0cb511e..f8fe7a7 100644
--- a/src/lib/barrier/XScreen.h
+++ b/src/lib/barrier/XScreen.h
@@ -47,7 +47,7 @@ public:
trying to open the screen again.
*/
XScreenUnavailable(double timeUntilRetry);
- virtual ~XScreenUnavailable() _NOEXCEPT;
+ virtual ~XScreenUnavailable() noexcept;
//! @name manipulators
//@{
@@ -61,7 +61,7 @@ public:
//@}
protected:
- virtual String getWhat() const throw();
+ virtual std::string getWhat() const noexcept;
private:
double m_timeUntilRetry;
diff --git a/src/lib/barrier/win32/DaemonApp.cpp b/src/lib/barrier/win32/DaemonApp.cpp
index eafd893..482c465 100644
--- a/src/lib/barrier/win32/DaemonApp.cpp
+++ b/src/lib/barrier/win32/DaemonApp.cpp
@@ -353,7 +353,10 @@ DaemonApp::handleIpcMessage(const Event& e, void*)
LOG((CLOG_DEBUG "ipc hello, type=%s", type.c_str()));
const char * serverstatus = m_watchdog->isProcessActive() ? "active" : "not active";
- LOG((CLOG_INFO "server status: %s", serverstatus));
+
+ // using CLOG_PRINT here allows the GUI to see that the server status
+ // regardless of which log level is set
+ LOG((CLOG_PRINT "server status: %s", serverstatus));
m_ipcLogOutputter->notifyBuffer();
break;
diff --git a/src/lib/base/EventQueue.cpp b/src/lib/base/EventQueue.cpp
index fe8cff5..2429522 100644
--- a/src/lib/base/EventQueue.cpp
+++ b/src/lib/base/EventQueue.cpp
@@ -436,12 +436,6 @@ EventQueue::removeHandlers(void* target)
}
}
-bool
-EventQueue::isEmpty() const
-{
- return (m_buffer->isEmpty() && getNextTimerTimeout() != 0.0);
-}
-
IEventJob*
EventQueue::getHandler(Event::Type type, void* target) const
{
@@ -553,8 +547,7 @@ EventQueue::getNextTimerTimeout() const
return m_timerQueue.top();
}
-Event::Type
-EventQueue::getRegisteredType(const String& name) const
+Event::Type EventQueue::getRegisteredType(const std::string& name) const
{
NameMap::const_iterator found = m_nameMap.find(name);
if (found != m_nameMap.end())
diff --git a/src/lib/base/EventQueue.h b/src/lib/base/EventQueue.h
index 0a2179b..842c5ca 100644
--- a/src/lib/base/EventQueue.h
+++ b/src/lib/base/EventQueue.h
@@ -58,11 +58,9 @@ public:
virtual void removeHandlers(void* target);
virtual Event::Type
registerTypeOnce(Event::Type& type, const char* name);
- virtual bool isEmpty() const;
virtual IEventJob* getHandler(Event::Type type, void* target) const;
virtual const char* getTypeName(Event::Type type);
- virtual Event::Type
- getRegisteredType(const String& name) const;
+ virtual Event::Type getRegisteredType(const std::string& name) const;
void* getSystemTarget();
virtual void waitForReady() const;
@@ -108,7 +106,7 @@ private:
typedef std::map<UInt32, Event> EventTable;
typedef std::vector<UInt32> EventIDList;
typedef std::map<Event::Type, const char*> TypeMap;
- typedef std::map<String, Event::Type> NameMap;
+ typedef std::map<std::string, Event::Type> NameMap;
typedef std::map<Event::Type, IEventJob*> TypeHandlerTable;
typedef std::map<void*, TypeHandlerTable> HandlerTable;
diff --git a/src/lib/base/EventTypes.cpp b/src/lib/base/EventTypes.cpp
index 9a3e46c..2ba2077 100644
--- a/src/lib/base/EventTypes.cpp
+++ b/src/lib/base/EventTypes.cpp
@@ -133,6 +133,7 @@ REGISTER_EVENT(Server, error)
REGISTER_EVENT(Server, connected)
REGISTER_EVENT(Server, disconnected)
REGISTER_EVENT(Server, switchToScreen)
+REGISTER_EVENT(Server, toggleScreen)
REGISTER_EVENT(Server, switchInDirection)
REGISTER_EVENT(Server, keyboardBroadcast)
REGISTER_EVENT(Server, lockCursorToScreen)
diff --git a/src/lib/base/EventTypes.h b/src/lib/base/EventTypes.h
index d044c86..f81617e 100644
--- a/src/lib/base/EventTypes.h
+++ b/src/lib/base/EventTypes.h
@@ -432,6 +432,7 @@ public:
m_connected(Event::kUnknown),
m_disconnected(Event::kUnknown),
m_switchToScreen(Event::kUnknown),
+ m_toggleScreen(Event::kUnknown),
m_switchInDirection(Event::kUnknown),
m_keyboardBroadcast(Event::kUnknown),
m_lockCursorToScreen(Event::kUnknown),
@@ -470,6 +471,13 @@ public:
*/
Event::Type switchToScreen();
+ //! Get toggle screen event type
+ /*!
+ Returns the toggle screen event type. The server responds to this
+ by toggling screens. These is no event data.
+ */
+ Event::Type toggleScreen();
+
//! Get switch in direction event type
/*!
Returns the switch in direction event type. The server responds to this
@@ -508,6 +516,7 @@ private:
Event::Type m_connected;
Event::Type m_disconnected;
Event::Type m_switchToScreen;
+ Event::Type m_toggleScreen;
Event::Type m_switchInDirection;
Event::Type m_keyboardBroadcast;
Event::Type m_lockCursorToScreen;
diff --git a/src/lib/base/IEventQueue.h b/src/lib/base/IEventQueue.h
index cd4f0b3..150595c 100644
--- a/src/lib/base/IEventQueue.h
+++ b/src/lib/base/IEventQueue.h
@@ -20,7 +20,7 @@
#include "common/IInterface.h"
#include "base/Event.h"
-#include "base/String.h"
+#include <string>
class IEventJob;
class IEventQueueBuffer;
@@ -189,13 +189,6 @@ public:
//! @name accessors
//@{
- //! Test if queue is empty
- /*!
- Returns true iff the queue has no events in it, including timer
- events.
- */
- virtual bool isEmpty() const = 0;
-
//! Get an event handler
/*!
Finds and returns the event handler for the \p type, \p target pair
@@ -214,7 +207,7 @@ public:
/*!
Returns the registered type for an event for a given name.
*/
- virtual Event::Type getRegisteredType(const String& name) const = 0;
+ virtual Event::Type getRegisteredType(const std::string& name) const = 0;
//! Get the system event type target
/*!
diff --git a/src/lib/base/Log.cpp b/src/lib/base/Log.cpp
index 1252ed9..a3b328d 100644
--- a/src/lib/base/Log.cpp
+++ b/src/lib/base/Log.cpp
@@ -19,7 +19,6 @@
#include "arch/Arch.h"
#include "arch/XArch.h"
#include "base/Log.h"
-#include "base/String.h"
#include "base/log_outputters.h"
#include "common/Version.h"
diff --git a/src/lib/base/String.cpp b/src/lib/base/String.cpp
index 97b8997..1ab3623 100644
--- a/src/lib/base/String.cpp
+++ b/src/lib/base/String.cpp
@@ -35,17 +35,17 @@
namespace barrier {
namespace string {
-String
+std::string
format(const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
- String result = vformat(fmt, args);
+ std::string result = vformat(fmt, args);
va_end(args);
return result;
}
-String
+std::string
vformat(const char* fmt, va_list args)
{
// find highest indexed substitution and the locations of substitutions
@@ -111,7 +111,7 @@ vformat(const char* fmt, va_list args)
}
// substitute
- String result;
+ std::string result;
result.reserve(resultLength);
size_t src = 0;
for (int i = 0; i < n; ++i) {
@@ -124,13 +124,13 @@ vformat(const char* fmt, va_list args)
return result;
}
-String
+std::string
sprintf(const char* fmt, ...)
{
char tmp[1024];
char* buffer = tmp;
int len = (int)(sizeof(tmp) / sizeof(tmp[0]));
- String result;
+ std::string result;
while (buffer != NULL) {
// try printing into the buffer
va_list args;
@@ -162,23 +162,23 @@ sprintf(const char* fmt, ...)
void
findReplaceAll(
- String& subject,
- const String& find,
- const String& replace)
+ std::string& subject,
+ const std::string& find,
+ const std::string& replace)
{
size_t pos = 0;
- while ((pos = subject.find(find, pos)) != String::npos) {
+ while ((pos = subject.find(find, pos)) != std::string::npos) {
subject.replace(pos, find.length(), replace);
pos += replace.length();
}
}
-String
-removeFileExt(String filename)
+std::string
+removeFileExt(std::string filename)
{
size_t dot = filename.find_last_of('.');
- if (dot == String::npos) {
+ if (dot == std::string::npos) {
return filename;
}
@@ -186,7 +186,7 @@ removeFileExt(String filename)
}
void
-toHex(String& subject, int width, const char fill)
+toHex(std::string& subject, int width, const char fill)
{
std::stringstream ss;
ss << std::hex;
@@ -198,18 +198,18 @@ toHex(String& subject, int width, const char fill)
}
void
-uppercase(String& subject)
+uppercase(std::string& subject)
{
std::transform(subject.begin(), subject.end(), subject.begin(), ::toupper);
}
void
-removeChar(String& subject, const char c)
+removeChar(std::string& subject, const char c)
{
subject.erase(std::remove(subject.begin(), subject.end(), c), subject.end());
}
-String
+std::string
sizeTypeToString(size_t n)
{
std::stringstream ss;
@@ -218,7 +218,7 @@ sizeTypeToString(size_t n)
}
size_t
-stringToSizeType(String string)
+stringToSizeType(std::string string)
{
std::istringstream iss(string);
size_t value;
@@ -226,14 +226,14 @@ stringToSizeType(String string)
return value;
}
-std::vector<String>
-splitString(String string, const char c)
+std::vector<std::string>
+splitString(std::string string, const char c)
{
- std::vector<String> results;
+ std::vector<std::string> results;
size_t head = 0;
size_t separator = string.find(c);
- while (separator != String::npos) {
+ while (separator != std::string::npos) {
if (head!=separator) {
results.push_back(string.substr(head, separator - head));
}
@@ -252,26 +252,22 @@ splitString(String string, const char c)
// CaselessCmp
//
-bool
-CaselessCmp::cmpEqual(
- const String::value_type& a,
- const String::value_type& b)
+bool CaselessCmp::cmpEqual(const std::string::value_type& a,
+ const std::string::value_type& b)
{
// should use std::tolower but not in all versions of libstdc++ have it
return tolower(a) == tolower(b);
}
-bool
-CaselessCmp::cmpLess(
- const String::value_type& a,
- const String::value_type& b)
+bool CaselessCmp::cmpLess(const std::string::value_type& a,
+ const std::string::value_type& b)
{
// should use std::tolower but not in all versions of libstdc++ have it
return tolower(a) < tolower(b);
}
bool
-CaselessCmp::less(const String& a, const String& b)
+CaselessCmp::less(const std::string& a, const std::string& b)
{
return std::lexicographical_compare(
a.begin(), a.end(),
@@ -280,13 +276,13 @@ CaselessCmp::less(const String& a, const String& b)
}
bool
-CaselessCmp::equal(const String& a, const String& b)
+CaselessCmp::equal(const std::string& a, const std::string& b)
{
return !(less(a, b) || less(b, a));
}
bool
-CaselessCmp::operator()(const String& a, const String& b) const
+CaselessCmp::operator()(const std::string& a, const std::string& b) const
{
return less(a, b);
}
diff --git a/src/lib/base/String.h b/src/lib/base/String.h
index 3661461..73526b4 100644
--- a/src/lib/base/String.h
+++ b/src/lib/base/String.h
@@ -29,7 +29,7 @@ typedef std::string String;
namespace barrier {
-//! String utilities
+//! std::string utilities
/*!
Provides functions for string manipulation.
*/
@@ -45,67 +45,67 @@ characters and conversion specifications introduced by `\%':
All arguments in the variable list are const char*. Positional
elements are indexed from 1.
*/
-String format(const char* fmt, ...);
+std::string format(const char* fmt, ...);
//! Format positional arguments
/*!
Same as format() except takes va_list.
*/
-String vformat(const char* fmt, va_list);
+std::string vformat(const char* fmt, va_list);
//! Print a string using sprintf-style formatting
/*!
-Equivalent to sprintf() except the result is returned as a String.
+Equivalent to sprintf() except the result is returned as a std::string.
*/
-String sprintf(const char* fmt, ...);
+std::string sprintf(const char* fmt, ...);
//! Find and replace all
/*!
Finds \c find inside \c subject and replaces it with \c replace
*/
-void findReplaceAll(String& subject, const String& find, const String& replace);
+void findReplaceAll(std::string& subject, const std::string& find, const std::string& replace);
//! Remove file extension
/*!
Finds the last dot and remove all characters from the dot to the end
*/
-String removeFileExt(String filename);
+std::string removeFileExt(std::string filename);
//! Convert into hexdecimal
/*!
Convert each character in \c subject into hexdecimal form with \c width
*/
-void toHex(String& subject, int width, const char fill = '0');
+void toHex(std::string& subject, int width, const char fill = '0');
//! Convert to all uppercase
/*!
Convert each character in \c subject to uppercase
*/
-void uppercase(String& subject);
+void uppercase(std::string& subject);
//! Remove all specific char in suject
/*!
Remove all specific \c c in \c suject
*/
-void removeChar(String& subject, const char c);
+void removeChar(std::string& subject, const char c);
//! Convert a size type to a string
/*!
Convert an size type to a string
*/
-String sizeTypeToString(size_t n);
+std::string sizeTypeToString(size_t n);
//! Convert a string to a size type
/*!
Convert an a \c string to an size type
*/
-size_t stringToSizeType(String string);
+size_t stringToSizeType(std::string string);
//! Split a string into substrings
/*!
Split a \c string that separated by a \c c into substrings
*/
-std::vector<String> splitString(String string, const char c);
+std::vector<std::string> splitString(std::string string, const char c);
//! Case-insensitive comparisons
/*!
@@ -114,21 +114,21 @@ This class provides case-insensitve comparison functions.
class CaselessCmp {
public:
//! Same as less()
- bool operator()(const String& a, const String& b) const;
+ bool operator()(const std::string& a, const std::string& b) const;
//! Returns true iff \c a is lexicographically less than \c b
- static bool less(const String& a, const String& b);
+ static bool less(const std::string& a, const std::string& b);
//! Returns true iff \c a is lexicographically equal to \c b
- static bool equal(const String& a, const String& b);
+ static bool equal(const std::string& a, const std::string& b);
//! Returns true iff \c a is lexicographically less than \c b
- static bool cmpLess(const String::value_type& a,
- const String::value_type& b);
+ static bool cmpLess(const std::string::value_type& a,
+ const std::string::value_type& b);
//! Returns true iff \c a is lexicographically equal to \c b
- static bool cmpEqual(const String::value_type& a,
- const String::value_type& b);
+ static bool cmpEqual(const std::string::value_type& a,
+ const std::string::value_type& b);
};
}
diff --git a/src/lib/base/Unicode.cpp b/src/lib/base/Unicode.cpp
index 90a166f..05b0212 100644
--- a/src/lib/base/Unicode.cpp
+++ b/src/lib/base/Unicode.cpp
@@ -98,7 +98,7 @@ UInt32 Unicode::s_invalid = 0x0000ffff;
UInt32 Unicode::s_replacement = 0x0000fffd;
bool
-Unicode::isUTF8(const String& src)
+Unicode::isUTF8(const std::string& src)
{
// convert and test each character
const UInt8* data = reinterpret_cast<const UInt8*>(src.c_str());
@@ -110,15 +110,14 @@ Unicode::isUTF8(const String& src)
return true;
}
-String
-Unicode::UTF8ToUCS2(const String& src, bool* errors)
+std::string Unicode::UTF8ToUCS2(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
// get size of input string and reserve some space in output
UInt32 n = (UInt32)src.size();
- String dst;
+ std::string dst;
dst.reserve(2 * n);
// convert each character
@@ -139,15 +138,15 @@ Unicode::UTF8ToUCS2(const String& src, bool* errors)
return dst;
}
-String
-Unicode::UTF8ToUCS4(const String& src, bool* errors)
+std::string
+Unicode::UTF8ToUCS4(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
// get size of input string and reserve some space in output
UInt32 n = (UInt32)src.size();
- String dst;
+ std::string dst;
dst.reserve(4 * n);
// convert each character
@@ -163,15 +162,15 @@ Unicode::UTF8ToUCS4(const String& src, bool* errors)
return dst;
}
-String
-Unicode::UTF8ToUTF16(const String& src, bool* errors)
+std::string
+Unicode::UTF8ToUTF16(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
// get size of input string and reserve some space in output
UInt32 n = (UInt32)src.size();
- String dst;
+ std::string dst;
dst.reserve(2 * n);
// convert each character
@@ -201,15 +200,15 @@ Unicode::UTF8ToUTF16(const String& src, bool* errors)
return dst;
}
-String
-Unicode::UTF8ToUTF32(const String& src, bool* errors)
+std::string
+Unicode::UTF8ToUTF32(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
// get size of input string and reserve some space in output
UInt32 n = (UInt32)src.size();
- String dst;
+ std::string dst;
dst.reserve(4 * n);
// convert each character
@@ -229,8 +228,8 @@ Unicode::UTF8ToUTF32(const String& src, bool* errors)
return dst;
}
-String
-Unicode::UTF8ToText(const String& src, bool* errors)
+std::string
+Unicode::UTF8ToText(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
@@ -243,7 +242,7 @@ Unicode::UTF8ToText(const String& src, bool* errors)
int len = ARCH->convStringWCToMB(NULL, tmp, size, errors);
char* mbs = new char[len + 1];
ARCH->convStringWCToMB(mbs, tmp, size, errors);
- String text(mbs, len);
+ std::string text(mbs, len);
// clean up
delete[] mbs;
@@ -252,8 +251,8 @@ Unicode::UTF8ToText(const String& src, bool* errors)
return text;
}
-String
-Unicode::UCS2ToUTF8(const String& src, bool* errors)
+std::string
+Unicode::UCS2ToUTF8(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
@@ -263,8 +262,8 @@ Unicode::UCS2ToUTF8(const String& src, bool* errors)
return doUCS2ToUTF8(reinterpret_cast<const UInt8*>(src.data()), n, errors);
}
-String
-Unicode::UCS4ToUTF8(const String& src, bool* errors)
+std::string
+Unicode::UCS4ToUTF8(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
@@ -274,8 +273,8 @@ Unicode::UCS4ToUTF8(const String& src, bool* errors)
return doUCS4ToUTF8(reinterpret_cast<const UInt8*>(src.data()), n, errors);
}
-String
-Unicode::UTF16ToUTF8(const String& src, bool* errors)
+std::string
+Unicode::UTF16ToUTF8(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
@@ -285,8 +284,8 @@ Unicode::UTF16ToUTF8(const String& src, bool* errors)
return doUTF16ToUTF8(reinterpret_cast<const UInt8*>(src.data()), n, errors);
}
-String
-Unicode::UTF32ToUTF8(const String& src, bool* errors)
+std::string
+Unicode::UTF32ToUTF8(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
@@ -296,8 +295,8 @@ Unicode::UTF32ToUTF8(const String& src, bool* errors)
return doUTF32ToUTF8(reinterpret_cast<const UInt8*>(src.data()), n, errors);
}
-String
-Unicode::textToUTF8(const String& src, bool* errors)
+std::string
+Unicode::textToUTF8(const std::string& src, bool* errors)
{
// default to success
resetError(errors);
@@ -309,7 +308,7 @@ Unicode::textToUTF8(const String& src, bool* errors)
ARCH->convStringMBToWC(wcs, src.c_str(), n, errors);
// convert to UTF8
- String utf8 = wideCharToUTF8(wcs, len, errors);
+ std::string utf8 = wideCharToUTF8(wcs, len, errors);
// clean up
delete[] wcs;
@@ -318,10 +317,10 @@ Unicode::textToUTF8(const String& src, bool* errors)
}
wchar_t*
-Unicode::UTF8ToWideChar(const String& src, UInt32& size, bool* errors)
+Unicode::UTF8ToWideChar(const std::string& src, UInt32& size, bool* errors)
{
// convert to platform's wide character encoding
- String tmp;
+ std::string tmp;
switch (ARCH->getWideCharEncoding()) {
case IArchString::kUCS2:
tmp = UTF8ToUCS2(src, errors);
@@ -353,12 +352,12 @@ Unicode::UTF8ToWideChar(const String& src, UInt32& size, bool* errors)
return dst;
}
-String
+std::string
Unicode::wideCharToUTF8(const wchar_t* src, UInt32 size, bool* errors)
{
// convert from platform's wide character encoding.
// note -- this must include a wide nul character (independent of
- // the String's nul character).
+ // the std::string's nul character).
switch (ARCH->getWideCharEncoding()) {
case IArchString::kUCS2:
return doUCS2ToUTF8(reinterpret_cast<const UInt8*>(src), size, errors);
@@ -374,15 +373,15 @@ Unicode::wideCharToUTF8(const wchar_t* src, UInt32 size, bool* errors)
default:
assert(0 && "unknown wide character encoding");
- return String();
+ return std::string();
}
}
-String
+std::string
Unicode::doUCS2ToUTF8(const UInt8* data, UInt32 n, bool* errors)
{
// make some space
- String dst;
+ std::string dst;
dst.reserve(n);
// check if first character is 0xfffe or 0xfeff
@@ -414,11 +413,11 @@ Unicode::doUCS2ToUTF8(const UInt8* data, UInt32 n, bool* errors)
return dst;
}
-String
+std::string
Unicode::doUCS4ToUTF8(const UInt8* data, UInt32 n, bool* errors)
{
// make some space
- String dst;
+ std::string dst;
dst.reserve(n);
// check if first character is 0xfffe or 0xfeff
@@ -450,11 +449,11 @@ Unicode::doUCS4ToUTF8(const UInt8* data, UInt32 n, bool* errors)
return dst;
}
-String
+std::string
Unicode::doUTF16ToUTF8(const UInt8* data, UInt32 n, bool* errors)
{
// make some space
- String dst;
+ std::string dst;
dst.reserve(n);
// check if first character is 0xfffe or 0xfeff
@@ -512,11 +511,11 @@ Unicode::doUTF16ToUTF8(const UInt8* data, UInt32 n, bool* errors)
return dst;
}
-String
+std::string
Unicode::doUTF32ToUTF8(const UInt8* data, UInt32 n, bool* errors)
{
// make some space
- String dst;
+ std::string dst;
dst.reserve(n);
// check if first character is 0xfffe or 0xfeff
@@ -728,7 +727,7 @@ Unicode::fromUTF8(const UInt8*& data, UInt32& n)
}
void
-Unicode::toUTF8(String& dst, UInt32 c, bool* errors)
+Unicode::toUTF8(std::string& dst, UInt32 c, bool* errors)
{
UInt8 data[6];
diff --git a/src/lib/base/Unicode.h b/src/lib/base/Unicode.h
index 1391c1e..9bf83ae 100644
--- a/src/lib/base/Unicode.h
+++ b/src/lib/base/Unicode.h
@@ -18,8 +18,8 @@
#pragma once
-#include "base/String.h"
#include "common/basic_types.h"
+#include <string>
//! Unicode utility functions
/*!
@@ -36,7 +36,7 @@ public:
Returns true iff the string contains a valid sequence of UTF-8
encoded characters.
*/
- static bool isUTF8(const String&);
+ static bool isUTF8(const std::string&);
//! Convert from UTF-8 to UCS-2 encoding
/*!
@@ -44,7 +44,7 @@ public:
is set to true iff any character could not be encoded in UCS-2.
Decoding errors do not set *errors.
*/
- static String UTF8ToUCS2(const String&, bool* errors = NULL);
+ static std::string UTF8ToUCS2(const std::string&, bool* errors = NULL);
//! Convert from UTF-8 to UCS-4 encoding
/*!
@@ -52,7 +52,7 @@ public:
is set to true iff any character could not be encoded in UCS-4.
Decoding errors do not set *errors.
*/
- static String UTF8ToUCS4(const String&, bool* errors = NULL);
+ static std::string UTF8ToUCS4(const std::string&, bool* errors = NULL);
//! Convert from UTF-8 to UTF-16 encoding
/*!
@@ -60,7 +60,7 @@ public:
is set to true iff any character could not be encoded in UTF-16.
Decoding errors do not set *errors.
*/
- static String UTF8ToUTF16(const String&, bool* errors = NULL);
+ static std::string UTF8ToUTF16(const std::string&, bool* errors = NULL);
//! Convert from UTF-8 to UTF-32 encoding
/*!
@@ -68,7 +68,7 @@ public:
is set to true iff any character could not be encoded in UTF-32.
Decoding errors do not set *errors.
*/
- static String UTF8ToUTF32(const String&, bool* errors = NULL);
+ static std::string UTF8ToUTF32(const std::string&, bool* errors = NULL);
//! Convert from UTF-8 to the current locale encoding
/*!
@@ -76,42 +76,42 @@ public:
NULL then *errors is set to true iff any character could not be encoded.
Decoding errors do not set *errors.
*/
- static String UTF8ToText(const String&, bool* errors = NULL);
+ static std::string UTF8ToText(const std::string&, bool* errors = NULL);
//! Convert from UCS-2 to UTF-8
/*!
Convert from UCS-2 to UTF-8. If errors is not NULL then *errors is
set to true iff any character could not be decoded.
*/
- static String UCS2ToUTF8(const String&, bool* errors = NULL);
+ static std::string UCS2ToUTF8(const std::string&, bool* errors = NULL);
//! Convert from UCS-4 to UTF-8
/*!
Convert from UCS-4 to UTF-8. If errors is not NULL then *errors is
set to true iff any character could not be decoded.
*/
- static String UCS4ToUTF8(const String&, bool* errors = NULL);
+ static std::string UCS4ToUTF8(const std::string&, bool* errors = NULL);
//! Convert from UTF-16 to UTF-8
/*!
Convert from UTF-16 to UTF-8. If errors is not NULL then *errors is
set to true iff any character could not be decoded.
*/
- static String UTF16ToUTF8(const String&, bool* errors = NULL);
+ static std::string UTF16ToUTF8(const std::string&, bool* errors = NULL);
//! Convert from UTF-32 to UTF-8
/*!
Convert from UTF-32 to UTF-8. If errors is not NULL then *errors is
set to true iff any character could not be decoded.
*/
- static String UTF32ToUTF8(const String&, bool* errors = NULL);
+ static std::string UTF32ToUTF8(const std::string&, bool* errors = NULL);
//! Convert from the current locale encoding to UTF-8
/*!
Convert from the current locale encoding to UTF-8. If errors is not
NULL then *errors is set to true iff any character could not be decoded.
*/
- static String textToUTF8(const String&, bool* errors = NULL);
+ static std::string textToUTF8(const std::string&, bool* errors = NULL);
//@}
@@ -120,23 +120,21 @@ private:
// to the platform). caller must delete[] the returned string. the
// string is *not* nul terminated; the length (in characters) is
// returned in size.
- static wchar_t* UTF8ToWideChar(const String&,
- UInt32& size, bool* errors);
+ static wchar_t* UTF8ToWideChar(const std::string&, UInt32& size, bool* errors);
// convert nul terminated wchar_t string (in platform's native
// encoding) to UTF8.
- static String wideCharToUTF8(const wchar_t*,
- UInt32 size, bool* errors);
+ static std::string wideCharToUTF8(const wchar_t*, UInt32 size, bool* errors);
// internal conversion to UTF8
- static String doUCS2ToUTF8(const UInt8* src, UInt32 n, bool* errors);
- static String doUCS4ToUTF8(const UInt8* src, UInt32 n, bool* errors);
- static String doUTF16ToUTF8(const UInt8* src, UInt32 n, bool* errors);
- static String doUTF32ToUTF8(const UInt8* src, UInt32 n, bool* errors);
+ static std::string doUCS2ToUTF8(const UInt8* src, UInt32 n, bool* errors);
+ static std::string doUCS4ToUTF8(const UInt8* src, UInt32 n, bool* errors);
+ static std::string doUTF16ToUTF8(const UInt8* src, UInt32 n, bool* errors);
+ static std::string doUTF32ToUTF8(const UInt8* src, UInt32 n, bool* errors);
// convert characters to/from UTF8
- static UInt32 fromUTF8(const UInt8*& src, UInt32& size);
- static void toUTF8(String& dst, UInt32 c, bool* errors);
+ static UInt32 fromUTF8(const UInt8*& src, UInt32& size);
+ static void toUTF8(std::string& dst, UInt32 c, bool* errors);
private:
static UInt32 s_invalid;
diff --git a/src/lib/base/XBase.cpp b/src/lib/base/XBase.cpp
index 29ae927..cb0db2e 100644
--- a/src/lib/base/XBase.cpp
+++ b/src/lib/base/XBase.cpp
@@ -32,19 +32,19 @@ XBase::XBase() :
// do nothing
}
-XBase::XBase(const String& msg) :
+XBase::XBase(const std::string& msg) :
std::runtime_error(msg)
{
// do nothing
}
-XBase::~XBase() _NOEXCEPT
+XBase::~XBase() noexcept
{
// do nothing
}
const char*
-XBase::what() const _NOEXCEPT
+XBase::what() const noexcept
{
const char* what = std::runtime_error::what();
if (strlen(what) == 0) {
@@ -54,14 +54,13 @@ XBase::what() const _NOEXCEPT
return what;
}
-String
-XBase::format(const char* /*id*/, const char* fmt, ...) const throw()
+std::string XBase::format(const char* /*id*/, const char* fmt, ...) const noexcept
{
// FIXME -- lookup message string using id as an index. set
// fmt to that string if it exists.
// format
- String result;
+ std::string result;
va_list args;
va_start(args, fmt);
try {
diff --git a/src/lib/base/XBase.h b/src/lib/base/XBase.h
index 3064b6c..59b700e 100644
--- a/src/lib/base/XBase.h
+++ b/src/lib/base/XBase.h
@@ -18,8 +18,8 @@
#pragma once
-#include "base/String.h"
-#include "common/stdexcept.h"
+#include <stdexcept>
+#include <string>
//! Exception base class
/*!
@@ -30,15 +30,15 @@ public:
//! Use getWhat() as the result of what()
XBase();
//! Use \c msg as the result of what()
- XBase(const String& msg);
- virtual ~XBase() _NOEXCEPT;
+ XBase(const std::string& msg);
+ virtual ~XBase() noexcept;
//! Reason for exception
- virtual const char* what() const _NOEXCEPT;
+ virtual const char* what() const noexcept;
protected:
//! Get a human readable string describing the exception
- virtual String getWhat() const throw() { return ""; }
+ virtual std::string getWhat() const noexcept { return ""; }
//! Format a string
/*!
@@ -46,47 +46,46 @@ protected:
no format can be found, then replaces positional parameters in
the format string and returns the result.
*/
- virtual String format(const char* id,
- const char* defaultFormat, ...) const throw();
+ virtual std::string format(const char* id, const char* defaultFormat, ...) const noexcept;
private:
- mutable String m_what;
+ mutable std::string m_what;
};
/*!
\def XBASE_SUBCLASS
Convenience macro to subclass from XBase (or a subclass of it),
-providing the c'tor taking a const String&. getWhat() is not
+providing the c'tor taking a const std::string&. getWhat() is not
declared.
*/
#define XBASE_SUBCLASS(name_, super_) \
class name_ : public super_ { \
public: \
name_() : super_() { } \
- name_(const String& msg) : super_(msg) { } \
- virtual ~name_() _NOEXCEPT { } \
+ name_(const std::string& msg) : super_(msg) { } \
+ virtual ~name_() noexcept { } \
}
/*!
\def XBASE_SUBCLASS
Convenience macro to subclass from XBase (or a subclass of it),
-providing the c'tor taking a const String&. getWhat() must be
+providing the c'tor taking a const std::string&. getWhat() must be
implemented.
*/
#define XBASE_SUBCLASS_WHAT(name_, super_) \
class name_ : public super_ { \
public: \
name_() : super_() { } \
- name_(const String& msg) : super_(msg) { } \
- virtual ~name_() _NOEXCEPT { } \
+ name_(const std::string& msg) : super_(msg) { } \
+ virtual ~name_() noexcept { } \
\
protected: \
- virtual String getWhat() const throw(); \
+ virtual std::string getWhat() const noexcept; \
}
/*!
\def XBASE_SUBCLASS_FORMAT
Convenience macro to subclass from XBase (or a subclass of it),
-providing the c'tor taking a const String&. what() is overridden
+providing the c'tor taking a const std::string&. what() is overridden
to call getWhat() when first called; getWhat() can format the
error message and can call what() to get the message passed to the
c'tor.
@@ -98,10 +97,10 @@ private: \
\
public: \
name_() : super_(), m_state(kDone) { } \
- name_(const String& msg) : super_(msg), m_state(kFirst) { } \
- virtual ~name_() _NOEXCEPT { } \
+ name_(const std::string& msg) : super_(msg), m_state(kFirst) { } \
+ virtual ~name_() noexcept { } \
\
- virtual const char* what() const _NOEXCEPT \
+ virtual const char* what() const noexcept \
{ \
if (m_state == kFirst) { \
m_state = kFormat; \
@@ -117,7 +116,7 @@ public: \
} \
\
protected: \
- virtual String getWhat() const throw(); \
+ virtual std::string getWhat() const noexcept; \
\
private: \
mutable EState m_state; \
diff --git a/src/lib/base/log_outputters.cpp b/src/lib/base/log_outputters.cpp
index 8e56c26..af53192 100644
--- a/src/lib/base/log_outputters.cpp
+++ b/src/lib/base/log_outputters.cpp
@@ -19,6 +19,7 @@
#include "base/log_outputters.h"
#include "base/TMethodJob.h"
#include "arch/Arch.h"
+#include "base/String.h"
#include <fstream>
@@ -228,7 +229,7 @@ BufferedLogOutputter::write(ELevel, const char* message)
while (m_buffer.size() >= m_maxBufferSize) {
m_buffer.pop_front();
}
- m_buffer.push_back(String(message));
+ m_buffer.push_back(std::string(message));
return true;
}
@@ -272,7 +273,7 @@ FileLogOutputter::write(ELevel level, const char *message)
m_handle.close();
if (moveFile) {
- String oldLogFilename = barrier::string::sprintf("%s.1", m_fileName.c_str());
+ std::string oldLogFilename = barrier::string::sprintf("%s.1", m_fileName.c_str());
remove(oldLogFilename.c_str());
rename(m_fileName.c_str(), oldLogFilename.c_str());
}
diff --git a/src/lib/base/log_outputters.h b/src/lib/base/log_outputters.h
index c4940aa..15f1e7a 100644
--- a/src/lib/base/log_outputters.h
+++ b/src/lib/base/log_outputters.h
@@ -20,12 +20,12 @@
#include "mt/Thread.h"
#include "base/ILogOutputter.h"
-#include "base/String.h"
#include "common/basic_types.h"
#include "common/stddeque.h"
#include <list>
#include <fstream>
+#include <string>
//! Stop traversing log chain outputter
/*!
@@ -126,7 +126,7 @@ This outputter records the last N log messages.
*/
class BufferedLogOutputter : public ILogOutputter {
private:
- typedef std::deque<String> Buffer;
+ typedef std::deque<std::string> Buffer;
public:
typedef Buffer::const_iterator const_iterator;
diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp
index 2158ee2..96d2c67 100644
--- a/src/lib/client/Client.cpp
+++ b/src/lib/client/Client.cpp
@@ -38,23 +38,21 @@
#include "base/IEventQueue.h"
#include "base/TMethodEventJob.h"
#include "base/TMethodJob.h"
-#include "common/stdexcept.h"
#include <cstring>
#include <cstdlib>
#include <sstream>
+#include <stdexcept>
#include <fstream>
//
// Client
//
-Client::Client(
- IEventQueue* events,
- const String& name, const NetworkAddress& address,
- ISocketFactory* socketFactory,
- barrier::Screen* screen,
- ClientArgs const& args) :
+Client::Client(IEventQueue* events, const std::string& name, const NetworkAddress& address,
+ ISocketFactory* socketFactory,
+ barrier::Screen* screen,
+ ClientArgs const& args) :
m_mock(false),
m_name(name),
m_serverAddress(address),
@@ -373,7 +371,7 @@ Client::setOptions(const OptionsList& options)
m_screen->setOptions(options);
}
-String
+std::string
Client::getName() const
{
return m_name;
@@ -403,7 +401,7 @@ Client::sendClipboard(ClipboardID id)
m_timeClipboard[id] = clipboard.getTime();
// marshall the data
- String data = clipboard.marshall();
+ std::string data = clipboard.marshall();
// save and send data if different or not yet sent
if (!m_sentClipboard[id] || data != m_dataClipboard[id]) {
@@ -783,7 +781,7 @@ Client::writeToDropDirThread(void*)
}
void
-Client::dragInfoReceived(UInt32 fileNum, String data)
+Client::dragInfoReceived(UInt32 fileNum, std::string data)
{
// TODO: fix duplicate function from CServer
if (!m_args.m_enableDragDrop) {
@@ -830,7 +828,7 @@ Client::sendFileThread(void* filename)
}
void
-Client::sendDragInfo(UInt32 fileCount, String& info, size_t size)
+Client::sendDragInfo(UInt32 fileCount, std::string& info, size_t size)
{
m_server->sendDragInfo(fileCount, info.c_str(), size);
}
diff --git a/src/lib/client/Client.h b/src/lib/client/Client.h
index 7ac515d..7e566be 100644
--- a/src/lib/client/Client.h
+++ b/src/lib/client/Client.h
@@ -48,7 +48,7 @@ public:
public:
FailInfo(const char* what) : m_retry(false), m_what(what) { }
bool m_retry;
- String m_what;
+ std::string m_what;
};
public:
@@ -57,7 +57,7 @@ public:
as its name and \p address as the server's address and \p factory
to create the socket. \p screen is the local screen.
*/
- Client(IEventQueue* events, const String& name,
+ Client(IEventQueue* events, const std::string& name,
const NetworkAddress& address, ISocketFactory* socketFactory,
barrier::Screen* screen, ClientArgs const& args);
@@ -86,13 +86,13 @@ public:
virtual void handshakeComplete();
//! Received drag information
- void dragInfoReceived(UInt32 fileNum, String data);
+ void dragInfoReceived(UInt32 fileNum, std::string data);
//! Create a new thread and use it to send file to Server
void sendFileToServer(const char* filename);
//! Send dragging file information back to server
- void sendDragInfo(UInt32 fileCount, String& info, size_t size);
+ void sendDragInfo(UInt32 fileCount, std::string& info, size_t size);
//@}
@@ -126,7 +126,7 @@ public:
size_t& getExpectedFileSize() { return m_expectedFileSize; }
//! Return received file data
- String& getReceivedFileData() { return m_receivedFileData; }
+ std::string& getReceivedFileData() { return m_receivedFileData; }
//! Return drag file list
DragFileList getDragFileList() { return m_dragFileList; }
@@ -160,7 +160,7 @@ public:
virtual void screensaver(bool activate);
virtual void resetOptions();
virtual void setOptions(const OptionsList& options);
- virtual String getName() const;
+ virtual std::string getName() const;
private:
void sendClipboard(ClipboardID);
@@ -198,7 +198,7 @@ public:
bool m_mock;
private:
- String m_name;
+ std::string m_name;
NetworkAddress m_serverAddress;
ISocketFactory* m_socketFactory;
barrier::Screen* m_screen;
@@ -212,12 +212,12 @@ private:
bool m_ownClipboard[kClipboardEnd];
bool m_sentClipboard[kClipboardEnd];
IClipboard::Time m_timeClipboard[kClipboardEnd];
- String m_dataClipboard[kClipboardEnd];
+ std::string m_dataClipboard[kClipboardEnd];
IEventQueue* m_events;
std::size_t m_expectedFileSize;
- String m_receivedFileData;
+ std::string m_receivedFileData;
DragFileList m_dragFileList;
- String m_dragFileExt;
+ std::string m_dragFileExt;
Thread* m_sendFileThread;
Thread* m_writeToDropDirThread;
TCPSocket* m_socket;
diff --git a/src/lib/client/ServerProxy.cpp b/src/lib/client/ServerProxy.cpp
index 4fbf76a..c067f13 100644
--- a/src/lib/client/ServerProxy.cpp
+++ b/src/lib/client/ServerProxy.cpp
@@ -361,7 +361,7 @@ ServerProxy::onGrabClipboard(ClipboardID id)
void
ServerProxy::onClipboardChanged(ClipboardID id, const IClipboard* clipboard)
{
- String data = IClipboard::marshall(clipboard);
+ std::string data = IClipboard::marshall(clipboard);
LOG((CLOG_DEBUG "sending clipboard %d seqnum=%d", id, m_seqNum));
StreamChunker::sendClipboard(data, data.size(), id, m_seqNum, m_events, this);
@@ -550,7 +550,7 @@ void
ServerProxy::setClipboard()
{
// parse
- static String dataCached;
+ static std::string dataCached;
ClipboardID id;
UInt32 seq;
@@ -872,7 +872,7 @@ ServerProxy::fileChunkReceived()
}
else if (result == kStart) {
if (m_client->getDragFileList().size() > 0) {
- String filename = m_client->getDragFileList().at(0).getFilename();
+ std::string filename = m_client->getDragFileList().at(0).getFilename();
LOG((CLOG_DEBUG "start receiving %s", filename.c_str()));
}
}
@@ -883,7 +883,7 @@ ServerProxy::dragInfoReceived()
{
// parse
UInt32 fileNum = 0;
- String content;
+ std::string content;
ProtocolUtil::readf(m_stream, kMsgDDragInfo + 4, &fileNum, &content);
m_client->dragInfoReceived(fileNum, content);
@@ -904,6 +904,6 @@ ServerProxy::fileChunkSending(UInt8 mark, char* data, size_t dataSize)
void
ServerProxy::sendDragInfo(UInt32 fileCount, const char* info, size_t size)
{
- String data(info, size);
+ std::string data(info, size);
ProtocolUtil::writef(m_stream, kMsgDDragInfo, fileCount, &data);
}
diff --git a/src/lib/client/ServerProxy.h b/src/lib/client/ServerProxy.h
index 2ad711a..abca4c3 100644
--- a/src/lib/client/ServerProxy.h
+++ b/src/lib/client/ServerProxy.h
@@ -22,7 +22,6 @@
#include "barrier/key_types.h"
#include "base/Event.h"
#include "base/Stopwatch.h"
-#include "base/String.h"
class Client;
class ClientInfo;
diff --git a/src/lib/common/stdexcept.h b/src/lib/common/stdexcept.h
deleted file mode 100644
index 2bd96b3..0000000
--- a/src/lib/common/stdexcept.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * barrier -- mouse and keyboard sharing utility
- * Copyright (C) 2014-2016 Symless Ltd.
- *
- * This package is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * found in the file LICENSE that should have accompanied this file.
- *
- * This package is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdexcept>
-
-// apple declares _NOEXCEPT
-#ifndef _NOEXCEPT
-# define _NOEXCEPT throw()
-#endif
diff --git a/src/lib/io/XIO.cpp b/src/lib/io/XIO.cpp
index 1299d23..911fa87 100644
--- a/src/lib/io/XIO.cpp
+++ b/src/lib/io/XIO.cpp
@@ -22,8 +22,7 @@
// XIOClosed
//
-String
-XIOClosed::getWhat() const throw()
+std::string XIOClosed::getWhat() const noexcept
{
return format("XIOClosed", "already closed");
}
@@ -33,8 +32,7 @@ XIOClosed::getWhat() const throw()
// XIOEndOfStream
//
-String
-XIOEndOfStream::getWhat() const throw()
+std::string XIOEndOfStream::getWhat() const noexcept
{
return format("XIOEndOfStream", "reached end of stream");
}
@@ -44,8 +42,7 @@ XIOEndOfStream::getWhat() const throw()
// XIOWouldBlock
//
-String
-XIOWouldBlock::getWhat() const throw()
+std::string XIOWouldBlock::getWhat() const noexcept
{
return format("XIOWouldBlock", "stream operation would block");
}
diff --git a/src/lib/ipc/IpcClientProxy.cpp b/src/lib/ipc/IpcClientProxy.cpp
index 5104277..432cc8c 100644
--- a/src/lib/ipc/IpcClientProxy.cpp
+++ b/src/lib/ipc/IpcClientProxy.cpp
@@ -141,7 +141,7 @@ IpcClientProxy::send(const IpcMessage& message)
switch (message.type()) {
case kIpcLogLine: {
const IpcLogLineMessage& llm = static_cast<const IpcLogLineMessage&>(message);
- const String logLine = llm.logLine();
+ const std::string logLine = llm.logLine();
ProtocolUtil::writef(&m_stream, kIpcMsgLogLine, &logLine);
break;
}
@@ -171,7 +171,7 @@ IpcClientProxy::parseHello()
IpcCommandMessage*
IpcClientProxy::parseCommand()
{
- String command;
+ std::string command;
UInt8 elevate;
ProtocolUtil::readf(&m_stream, kIpcMsgCommand + 4, &command, &elevate);
diff --git a/src/lib/ipc/IpcLogOutputter.cpp b/src/lib/ipc/IpcLogOutputter.cpp
index b62c76a..44ecdba 100644
--- a/src/lib/ipc/IpcLogOutputter.cpp
+++ b/src/lib/ipc/IpcLogOutputter.cpp
@@ -44,8 +44,8 @@ IpcLogOutputter::IpcLogOutputter(IpcServer& ipcServer, EIpcClientType clientType
m_running(false),
m_notifyCond(ARCH->newCondVar()),
m_notifyMutex(ARCH->newMutex()),
- m_bufferThreadId(0),
m_bufferWaiting(false),
+ m_bufferThreadId(0),
m_bufferMaxSize(kBufferMaxSize),
m_bufferRateWriteLimit(kBufferRateWriteLimit),
m_bufferRateTimeLimit(kBufferRateTimeLimit),
@@ -109,8 +109,7 @@ IpcLogOutputter::write(ELevel, const char* text)
return true;
}
-void
-IpcLogOutputter::appendBuffer(const String& text)
+void IpcLogOutputter::appendBuffer(const std::string& text)
{
std::lock_guard<std::mutex> lock(m_bufferMutex);
@@ -173,8 +172,7 @@ IpcLogOutputter::notifyBuffer()
ARCH->broadcastCondVar(m_notifyCond);
}
-String
-IpcLogOutputter::getChunk(size_t count)
+std::string IpcLogOutputter::getChunk(size_t count)
{
std::lock_guard<std::mutex> lock(m_bufferMutex);
@@ -182,7 +180,7 @@ IpcLogOutputter::getChunk(size_t count)
count = m_buffer.size();
}
- String chunk;
+ std::string chunk;
for (size_t i = 0; i < count; i++) {
chunk.append(m_buffer.front());
chunk.append("\n");
diff --git a/src/lib/ipc/IpcLogOutputter.h b/src/lib/ipc/IpcLogOutputter.h
index 2f1b98c..cc7b2fe 100644
--- a/src/lib/ipc/IpcLogOutputter.h
+++ b/src/lib/ipc/IpcLogOutputter.h
@@ -21,6 +21,7 @@
#include "arch/Arch.h"
#include "arch/IArchMultithread.h"
#include "base/ILogOutputter.h"
+#include "base/String.h"
#include "ipc/Ipc.h"
#include <deque>
@@ -92,12 +93,12 @@ public:
private:
void init();
void bufferThread(void*);
- String getChunk(size_t count);
- void appendBuffer(const String& text);
+ std::string getChunk(size_t count);
+ void appendBuffer(const std::string& text);
bool isRunning();
private:
- typedef std::deque<String> Buffer;
+ typedef std::deque<std::string> Buffer;
IpcServer& m_ipcServer;
Buffer m_buffer;
diff --git a/src/lib/ipc/IpcMessage.cpp b/src/lib/ipc/IpcMessage.cpp
index deef22d..9c321cb 100644
--- a/src/lib/ipc/IpcMessage.cpp
+++ b/src/lib/ipc/IpcMessage.cpp
@@ -47,9 +47,9 @@ IpcShutdownMessage::~IpcShutdownMessage()
{
}
-IpcLogLineMessage::IpcLogLineMessage(const String& logLine) :
-IpcMessage(kIpcLogLine),
-m_logLine(logLine)
+IpcLogLineMessage::IpcLogLineMessage(const std::string& logLine) :
+ IpcMessage(kIpcLogLine),
+ m_logLine(logLine)
{
}
@@ -57,10 +57,10 @@ IpcLogLineMessage::~IpcLogLineMessage()
{
}
-IpcCommandMessage::IpcCommandMessage(const String& command, bool elevate) :
-IpcMessage(kIpcCommand),
-m_command(command),
-m_elevate(elevate)
+IpcCommandMessage::IpcCommandMessage(const std::string& command, bool elevate) :
+ IpcMessage(kIpcCommand),
+ m_command(command),
+ m_elevate(elevate)
{
}
diff --git a/src/lib/ipc/IpcMessage.h b/src/lib/ipc/IpcMessage.h
index 5cc3d79..d37ebc3 100644
--- a/src/lib/ipc/IpcMessage.h
+++ b/src/lib/ipc/IpcMessage.h
@@ -20,8 +20,8 @@
#include "ipc/Ipc.h"
#include "base/EventTypes.h"
-#include "base/String.h"
#include "base/Event.h"
+#include <string>
class IpcMessage : public EventData {
public:
@@ -58,28 +58,28 @@ public:
class IpcLogLineMessage : public IpcMessage {
public:
- IpcLogLineMessage(const String& logLine);
+ IpcLogLineMessage(const std::string& logLine);
virtual ~IpcLogLineMessage();
//! Gets the log line.
- String logLine() const { return m_logLine; }
+ std::string logLine() const { return m_logLine; }
private:
- String m_logLine;
+ std::string m_logLine;
};
class IpcCommandMessage : public IpcMessage {
public:
- IpcCommandMessage(const String& command, bool elevate);
+ IpcCommandMessage(const std::string& command, bool elevate);
virtual ~IpcCommandMessage();
//! Gets the command.
- String command() const { return m_command; }
+ std::string command() const { return m_command; }
//! Gets whether or not the process should be elevated on MS Windows.
bool elevate() const { return m_elevate; }
private:
- String m_command;
+ std::string m_command;
bool m_elevate;
};
diff --git a/src/lib/ipc/IpcServerProxy.cpp b/src/lib/ipc/IpcServerProxy.cpp
index 820e1ab..49b3e00 100644
--- a/src/lib/ipc/IpcServerProxy.cpp
+++ b/src/lib/ipc/IpcServerProxy.cpp
@@ -94,7 +94,7 @@ IpcServerProxy::send(const IpcMessage& message)
case kIpcCommand: {
const IpcCommandMessage& cm = static_cast<const IpcCommandMessage&>(message);
- const String command = cm.command();
+ std::string command = cm.command();
ProtocolUtil::writef(&m_stream, kIpcMsgCommand, &command);
break;
}
@@ -108,7 +108,7 @@ IpcServerProxy::send(const IpcMessage& message)
IpcLogLineMessage*
IpcServerProxy::parseLogLine()
{
- String logLine;
+ std::string logLine;
ProtocolUtil::readf(&m_stream, kIpcMsgLogLine + 4, &logLine);
// must be deleted by event handler.
diff --git a/src/lib/mt/XMT.cpp b/src/lib/mt/XMT.cpp
index 9aa5852..2274a6b 100644
--- a/src/lib/mt/XMT.cpp
+++ b/src/lib/mt/XMT.cpp
@@ -22,8 +22,7 @@
// XMTThreadUnavailable
//
-String
-XMTThreadUnavailable::getWhat() const throw()
+std::string XMTThreadUnavailable::getWhat() const noexcept
{
return format("XMTThreadUnavailable", "cannot create thread");
}
diff --git a/src/lib/net/IDataSocket.h b/src/lib/net/IDataSocket.h
index dc07df5..c77a99c 100644
--- a/src/lib/net/IDataSocket.h
+++ b/src/lib/net/IDataSocket.h
@@ -20,8 +20,8 @@
#include "net/ISocket.h"
#include "io/IStream.h"
-#include "base/String.h"
#include "base/EventTypes.h"
+#include <string>
//! Data stream socket interface
/*!
@@ -33,7 +33,7 @@ public:
class ConnectionFailedInfo {
public:
ConnectionFailedInfo(const char* what) : m_what(what) { }
- String m_what;
+ std::string m_what;
};
IDataSocket(IEventQueue* events) { }
diff --git a/src/lib/net/NetworkAddress.cpp b/src/lib/net/NetworkAddress.cpp
index 8d60567..c8ea9c6 100644
--- a/src/lib/net/NetworkAddress.cpp
+++ b/src/lib/net/NetworkAddress.cpp
@@ -96,7 +96,7 @@ NetworkAddress::NetworkAddress(const NetworkAddress& addr) :
// do nothing
}
-NetworkAddress::NetworkAddress(const String& hostname, int port) :
+NetworkAddress::NetworkAddress(const std::string& hostname, int port) :
m_address(NULL),
m_hostname(hostname),
m_port(port)
@@ -196,8 +196,7 @@ NetworkAddress::getPort() const
return m_port;
}
-String
-NetworkAddress::getHostname() const
+std::string NetworkAddress::getHostname() const
{
return m_hostname;
}
diff --git a/src/lib/net/NetworkAddress.h b/src/lib/net/NetworkAddress.h
index cbd15f5..87dc1e4 100644
--- a/src/lib/net/NetworkAddress.h
+++ b/src/lib/net/NetworkAddress.h
@@ -18,7 +18,6 @@
#pragma once
-#include "base/String.h"
#include "base/EventTypes.h"
#include "arch/IArchNetwork.h"
@@ -49,7 +48,7 @@ public:
is thrown with an error of \c XSocketAddress::kBadPort. The hostname
is not resolved by the c'tor; use \c resolve to do that.
*/
- NetworkAddress(const String& hostname, int port);
+ NetworkAddress(const std::string& hostname, int port);
NetworkAddress(const NetworkAddress&);
@@ -109,7 +108,7 @@ public:
/*!
Returns the hostname passed to the c'tor sans any port suffix.
*/
- String getHostname() const;
+ std::string getHostname() const;
//@}
@@ -118,6 +117,6 @@ private:
private:
ArchNetAddress m_address;
- String m_hostname;
+ std::string m_hostname;
int m_port;
};
diff --git a/src/lib/net/SecureListenSocket.cpp b/src/lib/net/SecureListenSocket.cpp
index 7af905e..a137f39 100644
--- a/src/lib/net/SecureListenSocket.cpp
+++ b/src/lib/net/SecureListenSocket.cpp
@@ -23,6 +23,7 @@
#include "net/TSocketMultiplexerMethodJob.h"
#include "arch/XArch.h"
#include "common/DataDirectories.h"
+#include "base/String.h"
static const char s_certificateDir[] = { "SSL" };
static const char s_certificateFilename[] = { "Barrier.pem" };
@@ -54,7 +55,7 @@ SecureListenSocket::accept()
setListeningJob();
}
- String certificateFilename = barrier::string::sprintf("%s/%s/%s",
+ std::string certificateFilename = barrier::string::sprintf("%s/%s/%s",
DataDirectories::profile().c_str(),
s_certificateDir,
s_certificateFilename);
diff --git a/src/lib/net/SecureSocket.cpp b/src/lib/net/SecureSocket.cpp
index 99f626e..855e16b 100644
--- a/src/lib/net/SecureSocket.cpp
+++ b/src/lib/net/SecureSocket.cpp
@@ -23,6 +23,7 @@
#include "mt/Lock.h"
#include "arch/XArch.h"
#include "base/Log.h"
+#include "base/String.h"
#include "common/DataDirectories.h"
#include <openssl/ssl.h>
@@ -328,8 +329,7 @@ SecureSocket::initSsl(bool server)
initContext(server);
}
-bool
-SecureSocket::loadCertificates(String& filename)
+bool SecureSocket::loadCertificates(std::string& filename)
{
if (filename.empty()) {
showError("ssl certificate is not specified");
@@ -341,7 +341,7 @@ SecureSocket::loadCertificates(String& filename)
file.close();
if (!exist) {
- String errorMsg("ssl certificate doesn't exist: ");
+ std::string errorMsg("ssl certificate doesn't exist: ");
errorMsg.append(filename);
showError(errorMsg.c_str());
return false;
@@ -630,14 +630,13 @@ SecureSocket::showError(const char* reason)
LOG((CLOG_ERR "%s", reason));
}
- String error = getError();
+ std::string error = getError();
if (!error.empty()) {
LOG((CLOG_ERR "%s", error.c_str()));
}
}
-String
-SecureSocket::getError()
+std::string SecureSocket::getError()
{
unsigned long e = ERR_get_error();
@@ -659,8 +658,7 @@ SecureSocket::disconnect()
sendEvent(getEvents()->forIStream().inputShutdown());
}
-void
-SecureSocket::formatFingerprint(String& fingerprint, bool hex, bool separator)
+void SecureSocket::formatFingerprint(std::string& fingerprint, bool hex, bool separator)
{
if (hex) {
// to hexidecimal
@@ -696,11 +694,11 @@ SecureSocket::verifyCertFingerprint()
}
// format fingerprint into hexdecimal format with colon separator
- String fingerprint(reinterpret_cast<char*>(tempFingerprint), tempFingerprintLen);
+ std::string fingerprint(reinterpret_cast<char*>(tempFingerprint), tempFingerprintLen);
formatFingerprint(fingerprint);
LOG((CLOG_NOTE "server fingerprint: %s", fingerprint.c_str()));
- String trustedServersFilename;
+ std::string trustedServersFilename;
trustedServersFilename = barrier::string::sprintf(
"%s/%s/%s",
DataDirectories::profile().c_str(),
@@ -711,7 +709,7 @@ SecureSocket::verifyCertFingerprint()
LOG((CLOG_NOTE "trustedServersFilename: %s", trustedServersFilename.c_str() ));
// check if this fingerprint exist
- String fileLine;
+ std::string fileLine;
std::ifstream file;
file.open(trustedServersFilename.c_str());
@@ -761,7 +759,7 @@ MultiplexerJobStatus SecureSocket::serviceConnect(ISocketMultiplexerJob* job,
// If status > 0, success
if (status > 0) {
sendEvent(m_events->forIDataSocket().secureConnected());
- return {true, newJob()};
+ return newJobOrStopServicing();
}
// Retry case
@@ -793,7 +791,7 @@ MultiplexerJobStatus SecureSocket::serviceAccept(ISocketMultiplexerJob* job,
// If status > 0, success
if (status > 0) {
sendEvent(m_events->forClientListener().accepted());
- return {true, newJob()};
+ return newJobOrStopServicing();
}
// Retry case
diff --git a/src/lib/net/SecureSocket.h b/src/lib/net/SecureSocket.h
index 773b508..c602e2d 100644
--- a/src/lib/net/SecureSocket.h
+++ b/src/lib/net/SecureSocket.h
@@ -39,23 +39,23 @@ public:
~SecureSocket();
// ISocket overrides
- void close();
+ void close() override;
// IDataSocket overrides
- virtual void connect(const NetworkAddress&);
+ virtual void connect(const NetworkAddress&) override;
std::unique_ptr<ISocketMultiplexerJob> newJob() override;
- bool isFatal() const { return m_fatal; }
+ bool isFatal() const override { return m_fatal; }
void isFatal(bool b) { m_fatal = b; }
bool isSecureReady();
void secureConnect();
void secureAccept();
int secureRead(void* buffer, int size, int& read);
int secureWrite(const void* buffer, int size, int& wrote);
- EJobResult doRead();
- EJobResult doWrite();
+ EJobResult doRead() override;
+ EJobResult doWrite() override;
void initSsl(bool server);
- bool loadCertificates(String& CertFile);
+ bool loadCertificates(std::string& CertFile);
private:
// SSL
@@ -66,11 +66,9 @@ private:
bool showCertificate();
void checkResult(int n, int& retry);
void showError(const char* reason = NULL);
- String getError();
+ std::string getError();
void disconnect();
- void formatFingerprint(String& fingerprint,
- bool hex = true,
- bool separator = true);
+ void formatFingerprint(std::string& fingerprint, bool hex = true, bool separator = true);
bool verifyCertFingerprint();
MultiplexerJobStatus serviceConnect(ISocketMultiplexerJob*, bool, bool, bool);
diff --git a/src/lib/net/TCPSocket.cpp b/src/lib/net/TCPSocket.cpp
index 4f4251a..09a8f17 100644
--- a/src/lib/net/TCPSocket.cpp
+++ b/src/lib/net/TCPSocket.cpp
@@ -403,6 +403,15 @@ void TCPSocket::setJob(std::unique_ptr<ISocketMultiplexerJob>&& job)
}
}
+MultiplexerJobStatus TCPSocket::newJobOrStopServicing()
+{
+ auto new_job = newJob();
+ if (new_job)
+ return {true, std::move(new_job)};
+ else
+ return {false, {}};
+}
+
std::unique_ptr<ISocketMultiplexerJob> TCPSocket::newJob()
{
// note -- must have m_mutex locked on entry
@@ -519,22 +528,14 @@ MultiplexerJobStatus TCPSocket::serviceConnecting(ISocketMultiplexerJob* job, bo
catch (XArchNetwork& e) {
sendConnectionFailedEvent(e.what());
onDisconnected();
- auto new_job = newJob();
- if (new_job)
- return {true, std::move(new_job)};
- else
- return {false, {}};
+ return newJobOrStopServicing();
}
}
if (write) {
sendEvent(m_events->forIDataSocket().connected());
onConnected();
- auto new_job = newJob();
- if (new_job)
- return {true, std::move(new_job)};
- else
- return {false, {}};
+ return newJobOrStopServicing();
}
return {true, {}};
@@ -548,7 +549,7 @@ MultiplexerJobStatus TCPSocket::serviceConnected(ISocketMultiplexerJob* job,
if (error) {
sendEvent(m_events->forISocket().disconnected());
onDisconnected();
- return {true, newJob()};
+ return newJobOrStopServicing();
}
EJobResult writeResult = kRetry;
@@ -603,7 +604,7 @@ MultiplexerJobStatus TCPSocket::serviceConnected(ISocketMultiplexerJob* job,
if (writeResult == kBreak || readResult == kBreak) {
return {false, {}};
} else if (writeResult == kNew || readResult == kNew) {
- return {true, newJob()};
+ return newJobOrStopServicing();
} else {
return {true, {}};
}
diff --git a/src/lib/net/TCPSocket.h b/src/lib/net/TCPSocket.h
index 2889135..0b98888 100644
--- a/src/lib/net/TCPSocket.h
+++ b/src/lib/net/TCPSocket.h
@@ -76,7 +76,8 @@ protected:
void removeJob();
void setJob(std::unique_ptr<ISocketMultiplexerJob>&& job);
-
+ MultiplexerJobStatus newJobOrStopServicing();
+
bool isReadable() { return m_readable; }
bool isWritable() { return m_writable; }
diff --git a/src/lib/net/XSocket.cpp b/src/lib/net/XSocket.cpp
index 13e0fc3..eed7a26 100644
--- a/src/lib/net/XSocket.cpp
+++ b/src/lib/net/XSocket.cpp
@@ -23,8 +23,7 @@
// XSocketAddress
//
-XSocketAddress::XSocketAddress(EError error,
- const String& hostname, int port) _NOEXCEPT :
+XSocketAddress::XSocketAddress(EError error, const std::string& hostname, int port) noexcept :
m_error(error),
m_hostname(hostname),
m_port(port)
@@ -32,26 +31,22 @@ XSocketAddress::XSocketAddress(EError error,
// do nothing
}
-XSocketAddress::EError
-XSocketAddress::getError() const throw()
+XSocketAddress::EError XSocketAddress::getError() const noexcept
{
return m_error;
}
-String
-XSocketAddress::getHostname() const throw()
+std::string XSocketAddress::getHostname() const noexcept
{
return m_hostname;
}
-int
-XSocketAddress::getPort() const throw()
+int XSocketAddress::getPort() const noexcept
{
return m_port;
}
-String
-XSocketAddress::getWhat() const throw()
+std::string XSocketAddress::getWhat() const noexcept
{
static const char* s_errorID[] = {
"XSocketAddressUnknown",
@@ -77,8 +72,7 @@ XSocketAddress::getWhat() const throw()
// XSocketIOClose
//
-String
-XSocketIOClose::getWhat() const throw()
+std::string XSocketIOClose::getWhat() const noexcept
{
return format("XSocketIOClose", "close: %{1}", what());
}
@@ -88,8 +82,7 @@ XSocketIOClose::getWhat() const throw()
// XSocketBind
//
-String
-XSocketBind::getWhat() const throw()
+std::string XSocketBind::getWhat() const noexcept
{
return format("XSocketBind", "cannot bind address: %{1}", what());
}
@@ -99,8 +92,7 @@ XSocketBind::getWhat() const throw()
// XSocketConnect
//
-String
-XSocketConnect::getWhat() const throw()
+std::string XSocketConnect::getWhat() const noexcept
{
return format("XSocketConnect", "cannot connect socket: %{1}", what());
}
@@ -110,8 +102,7 @@ XSocketConnect::getWhat() const throw()
// XSocketCreate
//
-String
-XSocketCreate::getWhat() const throw()
+std::string XSocketCreate::getWhat() const noexcept
{
return format("XSocketCreate", "cannot create socket: %{1}", what());
}
diff --git a/src/lib/net/XSocket.h b/src/lib/net/XSocket.h
index be02b5b..d12278e 100644
--- a/src/lib/net/XSocket.h
+++ b/src/lib/net/XSocket.h
@@ -20,7 +20,6 @@
#include "io/XIO.h"
#include "base/XBase.h"
-#include "base/String.h"
#include "common/basic_types.h"
//! Generic socket exception
@@ -41,28 +40,28 @@ public:
kBadPort //!< The port is invalid
};
- XSocketAddress(EError, const String& hostname, int port) _NOEXCEPT;
- virtual ~XSocketAddress() _NOEXCEPT { }
+ XSocketAddress(EError, const std::string& hostname, int port) noexcept;
+ virtual ~XSocketAddress() noexcept { }
//! @name accessors
//@{
//! Get the error code
- EError getError() const throw();
+ EError getError() const noexcept;
//! Get the hostname
- String getHostname() const throw();
+ std::string getHostname() const noexcept;
//! Get the port
- int getPort() const throw();
+ int getPort() const noexcept;
//@}
protected:
// XBase overrides
- virtual String getWhat() const throw();
+ virtual std::string getWhat() const noexcept;
private:
EError m_error;
- String m_hostname;
+ std::string m_hostname;
int m_port;
};
diff --git a/src/lib/platform/MSWindowsClipboard.cpp b/src/lib/platform/MSWindowsClipboard.cpp
index 8ab50df..20445d4 100644
--- a/src/lib/platform/MSWindowsClipboard.cpp
+++ b/src/lib/platform/MSWindowsClipboard.cpp
@@ -98,7 +98,7 @@ MSWindowsClipboard::empty()
}
void
-MSWindowsClipboard::add(EFormat format, const String& data)
+MSWindowsClipboard::add(EFormat format, const std::string& data)
{
LOG((CLOG_DEBUG "add %d bytes to clipboard format: %d", data.size(), format));
@@ -165,8 +165,7 @@ MSWindowsClipboard::has(EFormat format) const
return false;
}
-String
-MSWindowsClipboard::get(EFormat format) const
+std::string MSWindowsClipboard::get(EFormat format) const
{
// find the converter for the first clipboard format we can handle
IMSWindowsClipboardConverter* converter = NULL;
@@ -183,7 +182,7 @@ MSWindowsClipboard::get(EFormat format) const
// if no converter then we don't recognize any formats
if (converter == NULL) {
LOG((CLOG_WARN "no converter for format %d", format));
- return String();
+ return {};
}
// get a handle to the clipboard data
@@ -192,7 +191,7 @@ MSWindowsClipboard::get(EFormat format) const
// nb: can't cause this using integ tests; this is only caused when
// the selected converter returns an invalid format -- which you
// cannot cause using public functions.
- return String();
+ return {};
}
// convert
diff --git a/src/lib/platform/MSWindowsClipboard.h b/src/lib/platform/MSWindowsClipboard.h
index 3e92a39..35ccb56 100644
--- a/src/lib/platform/MSWindowsClipboard.h
+++ b/src/lib/platform/MSWindowsClipboard.h
@@ -55,21 +55,21 @@ public:
// IClipboard overrides
virtual bool empty();
- virtual void add(EFormat, const String& data);
+ virtual void add(EFormat, const std::string& data);
virtual bool open(Time) const;
virtual void close() const;
virtual Time getTime() const;
virtual bool has(EFormat) const;
- virtual String get(EFormat) const;
+ virtual std::string get(EFormat) const;
void setFacade(IMSWindowsClipboardFacade& facade);
private:
void clearConverters();
- UINT convertFormatToWin32(EFormat) const;
- HANDLE convertTextToWin32(const String& data) const;
- String convertTextFromWin32(HANDLE) const;
+ UINT convertFormatToWin32(EFormat) const;
+ HANDLE convertTextToWin32(const std::string& data) const;
+ std::string convertTextFromWin32(HANDLE) const;
static UINT getOwnershipFormat();
@@ -105,9 +105,9 @@ public:
// the input data must be in the IClipboard format returned by
// getFormat(). the return data will be in the win32 clipboard
// format returned by getWin32Format(), allocated by GlobalAlloc().
- virtual HANDLE fromIClipboard(const String&) const = 0;
+ virtual HANDLE fromIClipboard(const std::string&) const = 0;
// convert from the win32 clipboard format to the IClipboard format
// (i.e., the reverse of fromIClipboard()).
- virtual String toIClipboard(HANDLE data) const = 0;
+ virtual std::string toIClipboard(HANDLE data) const = 0;
};
diff --git a/src/lib/platform/MSWindowsClipboardAnyTextConverter.cpp b/src/lib/platform/MSWindowsClipboardAnyTextConverter.cpp
index decbad6..85a7dbe 100644
--- a/src/lib/platform/MSWindowsClipboardAnyTextConverter.cpp
+++ b/src/lib/platform/MSWindowsClipboardAnyTextConverter.cpp
@@ -38,11 +38,10 @@ MSWindowsClipboardAnyTextConverter::getFormat() const
return IClipboard::kText;
}
-HANDLE
-MSWindowsClipboardAnyTextConverter::fromIClipboard(const String& data) const
+HANDLE MSWindowsClipboardAnyTextConverter::fromIClipboard(const std::string& data) const
{
// convert linefeeds and then convert to desired encoding
- String text = doFromIClipboard(convertLinefeedToWin32(data));
+ std::string text = doFromIClipboard(convertLinefeedToWin32(data));
UInt32 size = (UInt32)text.size();
// copy to memory handle
@@ -63,18 +62,17 @@ MSWindowsClipboardAnyTextConverter::fromIClipboard(const String& data) const
return gData;
}
-String
-MSWindowsClipboardAnyTextConverter::toIClipboard(HANDLE data) const
+std::string MSWindowsClipboardAnyTextConverter::toIClipboard(HANDLE data) const
{
// get datator
const char* src = (const char*)GlobalLock(data);
UInt32 srcSize = (UInt32)GlobalSize(data);
if (src == NULL || srcSize <= 1) {
- return String();
+ return {};
}
// convert text
- String text = doToIClipboard(String(src, srcSize));
+ std::string text = doToIClipboard(std::string(src, srcSize));
// release handle
GlobalUnlock(data);
@@ -83,9 +81,7 @@ MSWindowsClipboardAnyTextConverter::toIClipboard(HANDLE data) const
return convertLinefeedToUnix(text);
}
-String
-MSWindowsClipboardAnyTextConverter::convertLinefeedToWin32(
- const String& src) const
+std::string MSWindowsClipboardAnyTextConverter::convertLinefeedToWin32(const std::string& src) const
{
// note -- we assume src is a valid UTF-8 string
@@ -102,7 +98,7 @@ MSWindowsClipboardAnyTextConverter::convertLinefeedToWin32(
}
// allocate new string
- String dst;
+ std::string dst;
dst.reserve(src.size() + numNewlines);
// copy string, converting newlines
@@ -117,9 +113,7 @@ MSWindowsClipboardAnyTextConverter::convertLinefeedToWin32(
return dst;
}
-String
-MSWindowsClipboardAnyTextConverter::convertLinefeedToUnix(
- const String& src) const
+std::string MSWindowsClipboardAnyTextConverter::convertLinefeedToUnix(const std::string& src) const
{
// count newlines in string
UInt32 numNewlines = 0;
@@ -134,7 +128,7 @@ MSWindowsClipboardAnyTextConverter::convertLinefeedToUnix(
}
// allocate new string
- String dst;
+ std::string dst;
dst.reserve(src.size());
// copy string, converting newlines
diff --git a/src/lib/platform/MSWindowsClipboardAnyTextConverter.h b/src/lib/platform/MSWindowsClipboardAnyTextConverter.h
index cabdb0b..622d281 100644
--- a/src/lib/platform/MSWindowsClipboardAnyTextConverter.h
+++ b/src/lib/platform/MSWindowsClipboardAnyTextConverter.h
@@ -31,8 +31,8 @@ public:
virtual IClipboard::EFormat
getFormat() const;
virtual UINT getWin32Format() const = 0;
- virtual HANDLE fromIClipboard(const String&) const;
- virtual String toIClipboard(HANDLE) const;
+ virtual HANDLE fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(HANDLE) const;
protected:
//! Convert from IClipboard format
@@ -40,18 +40,18 @@ protected:
Do UTF-8 conversion only. Memory handle allocation and
linefeed conversion is done by this class. doFromIClipboard()
must include the nul terminator in the returned string (not
- including the String's nul terminator).
+ including the std::string's nul terminator).
*/
- virtual String doFromIClipboard(const String&) const = 0;
+ virtual std::string doFromIClipboard(const std::string&) const = 0;
//! Convert to IClipboard format
/*!
Do UTF-8 conversion only. Memory handle allocation and
linefeed conversion is done by this class.
*/
- virtual String doToIClipboard(const String&) const = 0;
+ virtual std::string doToIClipboard(const std::string&) const = 0;
private:
- String convertLinefeedToWin32(const String&) const;
- String convertLinefeedToUnix(const String&) const;
+ std::string convertLinefeedToWin32(const std::string&) const;
+ std::string convertLinefeedToUnix(const std::string&) const;
};
diff --git a/src/lib/platform/MSWindowsClipboardBitmapConverter.cpp b/src/lib/platform/MSWindowsClipboardBitmapConverter.cpp
index 16bd4bf..7d38fda 100644
--- a/src/lib/platform/MSWindowsClipboardBitmapConverter.cpp
+++ b/src/lib/platform/MSWindowsClipboardBitmapConverter.cpp
@@ -46,8 +46,7 @@ MSWindowsClipboardBitmapConverter::getWin32Format() const
return CF_DIB;
}
-HANDLE
-MSWindowsClipboardBitmapConverter::fromIClipboard(const String& data) const
+HANDLE MSWindowsClipboardBitmapConverter::fromIClipboard(const std::string& data) const
{
// copy to memory handle
HGLOBAL gData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, data.size());
@@ -67,13 +66,12 @@ MSWindowsClipboardBitmapConverter::fromIClipboard(const String& data) const
return gData;
}
-String
-MSWindowsClipboardBitmapConverter::toIClipboard(HANDLE data) const
+std::string MSWindowsClipboardBitmapConverter::toIClipboard(HANDLE data) const
{
// get datator
LPVOID src = GlobalLock(data);
if (src == NULL) {
- return String();
+ return {};
}
UInt32 srcSize = (UInt32)GlobalSize(data);
@@ -85,7 +83,7 @@ MSWindowsClipboardBitmapConverter::toIClipboard(HANDLE data) const
bitmap->bmiHeader.biBitCount == 32) &&
bitmap->bmiHeader.biCompression == BI_RGB) {
// already in canonical form
- String image(static_cast<char const*>(src), srcSize);
+ std::string image(static_cast<char const*>(src), srcSize);
GlobalUnlock(data);
return image;
}
@@ -138,7 +136,7 @@ MSWindowsClipboardBitmapConverter::toIClipboard(HANDLE data) const
GdiFlush();
// extract data
- String image((const char*)&info, info.biSize);
+ std::string image((const char*)&info, info.biSize);
image.append((const char*)raw, 4 * w * h);
// clean up GDI
diff --git a/src/lib/platform/MSWindowsClipboardBitmapConverter.h b/src/lib/platform/MSWindowsClipboardBitmapConverter.h
index 52b5547..2733884 100644
--- a/src/lib/platform/MSWindowsClipboardBitmapConverter.h
+++ b/src/lib/platform/MSWindowsClipboardBitmapConverter.h
@@ -31,6 +31,6 @@ public:
virtual IClipboard::EFormat
getFormat() const;
virtual UINT getWin32Format() const;
- virtual HANDLE fromIClipboard(const String&) const;
- virtual String toIClipboard(HANDLE) const;
+ virtual HANDLE fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(HANDLE) const;
};
diff --git a/src/lib/platform/MSWindowsClipboardHTMLConverter.cpp b/src/lib/platform/MSWindowsClipboardHTMLConverter.cpp
index 347a224..a1f1212 100644
--- a/src/lib/platform/MSWindowsClipboardHTMLConverter.cpp
+++ b/src/lib/platform/MSWindowsClipboardHTMLConverter.cpp
@@ -46,15 +46,14 @@ MSWindowsClipboardHTMLConverter::getWin32Format() const
return m_format;
}
-String
-MSWindowsClipboardHTMLConverter::doFromIClipboard(const String& data) const
+std::string MSWindowsClipboardHTMLConverter::doFromIClipboard(const std::string& data) const
{
// prepare to CF_HTML format prefix and suffix
- String prefix("Version:0.9\r\nStartHTML:0000000105\r\n"
+ std::string prefix("Version:0.9\r\nStartHTML:0000000105\r\n"
"EndHTML:ZZZZZZZZZZ\r\n"
"StartFragment:XXXXXXXXXX\r\nEndFragment:YYYYYYYYYY\r\n"
"<!DOCTYPE><HTML><BODY><!--StartFragment-->");
- String suffix("<!--EndFragment--></BODY></HTML>\r\n");
+ std::string suffix("<!--EndFragment--></BODY></HTML>\r\n");
// Get byte offsets for header
UInt32 StartFragment = (UInt32)prefix.size();
@@ -75,45 +74,43 @@ MSWindowsClipboardHTMLConverter::doFromIClipboard(const String& data) const
return prefix;
}
-String
-MSWindowsClipboardHTMLConverter::doToIClipboard(const String& data) const
+std::string MSWindowsClipboardHTMLConverter::doToIClipboard(const std::string& data) const
{
// get fragment start/end args
- String startArg = findArg(data, "StartFragment");
- String endArg = findArg(data, "EndFragment");
+ std::string startArg = findArg(data, "StartFragment");
+ std::string endArg = findArg(data, "EndFragment");
if (startArg.empty() || endArg.empty()) {
- return String();
+ return std::string();
}
// convert args to integers
SInt32 start = (SInt32)atoi(startArg.c_str());
SInt32 end = (SInt32)atoi(endArg.c_str());
if (start <= 0 || end <= 0 || start >= end) {
- return String();
+ return std::string();
}
// extract the fragment
return data.substr(start, end - start);
}
-String
-MSWindowsClipboardHTMLConverter::findArg(
- const String& data, const String& name) const
+std::string MSWindowsClipboardHTMLConverter::findArg(const std::string& data,
+ const std::string& name) const
{
- String::size_type i = data.find(name);
- if (i == String::npos) {
- return String();
+ std::string::size_type i = data.find(name);
+ if (i == std::string::npos) {
+ return std::string();
}
i = data.find_first_of(":\r\n", i);
- if (i == String::npos || data[i] != ':') {
- return String();
+ if (i == std::string::npos || data[i] != ':') {
+ return std::string();
}
i = data.find_first_of("0123456789\r\n", i + 1);
- if (i == String::npos || data[i] == '\r' || data[i] == '\n') {
- return String();
+ if (i == std::string::npos || data[i] == '\r' || data[i] == '\n') {
+ return std::string();
}
- String::size_type j = data.find_first_not_of("0123456789", i);
- if (j == String::npos) {
+ std::string::size_type j = data.find_first_not_of("0123456789", i);
+ if (j == std::string::npos) {
j = data.size();
}
return data.substr(i, j - i);
diff --git a/src/lib/platform/MSWindowsClipboardHTMLConverter.h b/src/lib/platform/MSWindowsClipboardHTMLConverter.h
index 66c8045..51607a7 100644
--- a/src/lib/platform/MSWindowsClipboardHTMLConverter.h
+++ b/src/lib/platform/MSWindowsClipboardHTMLConverter.h
@@ -34,11 +34,11 @@ public:
protected:
// MSWindowsClipboardAnyTextConverter overrides
- virtual String doFromIClipboard(const String&) const;
- virtual String doToIClipboard(const String&) const;
+ virtual std::string doFromIClipboard(const std::string&) const;
+ virtual std::string doToIClipboard(const std::string&) const;
private:
- String findArg(const String& data, const String& name) const;
+ std::string findArg(const std::string& data, const std::string& name) const;
private:
UINT m_format;
diff --git a/src/lib/platform/MSWindowsClipboardTextConverter.cpp b/src/lib/platform/MSWindowsClipboardTextConverter.cpp
index 360c72c..1500e7e 100644
--- a/src/lib/platform/MSWindowsClipboardTextConverter.cpp
+++ b/src/lib/platform/MSWindowsClipboardTextConverter.cpp
@@ -40,20 +40,18 @@ MSWindowsClipboardTextConverter::getWin32Format() const
return CF_TEXT;
}
-String
-MSWindowsClipboardTextConverter::doFromIClipboard(const String& data) const
+std::string MSWindowsClipboardTextConverter::doFromIClipboard(const std::string& data) const
{
// convert and add nul terminator
return Unicode::UTF8ToText(data) += '\0';
}
-String
-MSWindowsClipboardTextConverter::doToIClipboard(const String& data) const
+std::string MSWindowsClipboardTextConverter::doToIClipboard(const std::string& data) const
{
// convert and truncate at first nul terminator
- String dst = Unicode::textToUTF8(data);
- String::size_type n = dst.find('\0');
- if (n != String::npos) {
+ std::string dst = Unicode::textToUTF8(data);
+ std::string::size_type n = dst.find('\0');
+ if (n != std::string::npos) {
dst.erase(n);
}
return dst;
diff --git a/src/lib/platform/MSWindowsClipboardTextConverter.h b/src/lib/platform/MSWindowsClipboardTextConverter.h
index fb081c3..6e265a2 100644
--- a/src/lib/platform/MSWindowsClipboardTextConverter.h
+++ b/src/lib/platform/MSWindowsClipboardTextConverter.h
@@ -32,6 +32,6 @@ public:
protected:
// MSWindowsClipboardAnyTextConverter overrides
- virtual String doFromIClipboard(const String&) const;
- virtual String doToIClipboard(const String&) const;
+ virtual std::string doFromIClipboard(const std::string&) const;
+ virtual std::string doToIClipboard(const std::string&) const;
};
diff --git a/src/lib/platform/MSWindowsClipboardUTF16Converter.cpp b/src/lib/platform/MSWindowsClipboardUTF16Converter.cpp
index 0f8642a..4b72717 100644
--- a/src/lib/platform/MSWindowsClipboardUTF16Converter.cpp
+++ b/src/lib/platform/MSWindowsClipboardUTF16Converter.cpp
@@ -40,20 +40,18 @@ MSWindowsClipboardUTF16Converter::getWin32Format() const
return CF_UNICODETEXT;
}
-String
-MSWindowsClipboardUTF16Converter::doFromIClipboard(const String& data) const
+std::string MSWindowsClipboardUTF16Converter::doFromIClipboard(const std::string& data) const
{
// convert and add nul terminator
return Unicode::UTF8ToUTF16(data).append(sizeof(wchar_t), 0);
}
-String
-MSWindowsClipboardUTF16Converter::doToIClipboard(const String& data) const
+std::string MSWindowsClipboardUTF16Converter::doToIClipboard(const std::string& data) const
{
// convert and strip nul terminator
- String dst = Unicode::UTF16ToUTF8(data);
- String::size_type n = dst.find('\0');
- if (n != String::npos) {
+ std::string dst = Unicode::UTF16ToUTF8(data);
+ std::string::size_type n = dst.find('\0');
+ if (n != std::string::npos) {
dst.erase(n);
}
return dst;
diff --git a/src/lib/platform/MSWindowsClipboardUTF16Converter.h b/src/lib/platform/MSWindowsClipboardUTF16Converter.h
index e7222bc..1a9d435 100644
--- a/src/lib/platform/MSWindowsClipboardUTF16Converter.h
+++ b/src/lib/platform/MSWindowsClipboardUTF16Converter.h
@@ -32,6 +32,6 @@ public:
protected:
// MSWindowsClipboardAnyTextConverter overrides
- virtual String doFromIClipboard(const String&) const;
- virtual String doToIClipboard(const String&) const;
+ virtual std::string doFromIClipboard(const std::string&) const;
+ virtual std::string doToIClipboard(const std::string&) const;
};
diff --git a/src/lib/platform/MSWindowsDesks.cpp b/src/lib/platform/MSWindowsDesks.cpp
index e47aeaa..768ccb4 100644
--- a/src/lib/platform/MSWindowsDesks.cpp
+++ b/src/lib/platform/MSWindowsDesks.cpp
@@ -746,8 +746,7 @@ MSWindowsDesks::deskThread(void* vdesk)
}
}
-MSWindowsDesks::Desk*
-MSWindowsDesks::addDesk(const String& name, HDESK hdesk)
+MSWindowsDesks::Desk* MSWindowsDesks::addDesk(const std::string& name, HDESK hdesk)
{
Desk* desk = new Desk;
desk->m_name = name;
@@ -782,7 +781,7 @@ MSWindowsDesks::checkDesk()
// get current desktop. if we already know about it then return.
Desk* desk;
HDESK hdesk = openInputDesktop();
- String name = getDesktopName(hdesk);
+ std::string name = getDesktopName(hdesk);
Desks::const_iterator index = m_desks.find(name);
if (index == m_desks.end()) {
desk = addDesk(name, hdesk);
@@ -900,18 +899,17 @@ MSWindowsDesks::closeDesktop(HDESK desk)
}
}
-String
-MSWindowsDesks::getDesktopName(HDESK desk)
+std::string MSWindowsDesks::getDesktopName(HDESK desk)
{
if (desk == NULL) {
- return String();
+ return {};
}
else {
DWORD size;
GetUserObjectInformation(desk, UOI_NAME, NULL, 0, &size);
TCHAR* name = (TCHAR*)alloca(size + sizeof(TCHAR));
GetUserObjectInformation(desk, UOI_NAME, name, size, &size);
- String result(name);
+ std::string result(name);
return result;
}
}
diff --git a/src/lib/platform/MSWindowsDesks.h b/src/lib/platform/MSWindowsDesks.h
index da93c34..6e5e709 100644
--- a/src/lib/platform/MSWindowsDesks.h
+++ b/src/lib/platform/MSWindowsDesks.h
@@ -25,8 +25,8 @@
#include "barrier/option_types.h"
#include "mt/CondVar.h"
#include "mt/Mutex.h"
-#include "base/String.h"
#include "common/stdmap.h"
+#include <string>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
@@ -195,7 +195,7 @@ public:
private:
class Desk {
public:
- String m_name;
+ std::string m_name;
Thread* m_thread;
DWORD m_threadID;
DWORD m_targetID;
@@ -204,7 +204,7 @@ private:
HWND m_foregroundWindow;
bool m_lowLevel;
};
- typedef std::map<String, Desk*> Desks;
+ typedef std::map<std::string, Desk*> Desks;
// initialization and shutdown operations
HCURSOR createBlankCursor() const;
@@ -222,7 +222,7 @@ private:
void deskThread(void* vdesk);
// desk switch checking and handling
- Desk* addDesk(const String& name, HDESK hdesk);
+ Desk* addDesk(const std::string& name, HDESK hdesk);
void removeDesks();
void checkDesk();
bool isDeskAccessible(const Desk* desk) const;
@@ -238,7 +238,7 @@ private:
// desk API wrappers
HDESK openInputDesktop();
void closeDesktop(HDESK);
- String getDesktopName(HDESK);
+ std::string getDesktopName(HDESK);
// our desk window procs
static LRESULT CALLBACK primaryDeskProc(HWND, UINT, WPARAM, LPARAM);
@@ -276,7 +276,7 @@ private:
// the current desk and it's name
Desk* m_activeDesk;
- String m_activeDeskName;
+ std::string m_activeDeskName;
// one desk per desktop and a cond var to communicate with it
Mutex m_mutex;
diff --git a/src/lib/platform/MSWindowsEventQueueBuffer.cpp b/src/lib/platform/MSWindowsEventQueueBuffer.cpp
index f6de157..3111367 100644
--- a/src/lib/platform/MSWindowsEventQueueBuffer.cpp
+++ b/src/lib/platform/MSWindowsEventQueueBuffer.cpp
@@ -21,6 +21,7 @@
#include "arch/win32/ArchMiscWindows.h"
#include "mt/Thread.h"
#include "base/IEventQueue.h"
+#include <VersionHelpers.h>
//
// EventQueueTimer
@@ -48,6 +49,15 @@ MSWindowsEventQueueBuffer::MSWindowsEventQueueBuffer(IEventQueue* events) :
// make sure this thread has a message queue
MSG dummy;
PeekMessage(&dummy, NULL, WM_USER, WM_USER, PM_NOREMOVE);
+
+ m_os_supported_message_types = QS_ALLINPUT;
+ if (!IsWindows8OrGreater())
+ {
+ // don't use QS_POINTER, QS_TOUCH
+ // because they can cause GetQueueStatus() to always return 0 and we miss events
+ // since those flags are confusing Windows 7. See QTBUG-29097 for related info
+ m_os_supported_message_types &= ~(QS_TOUCH | QS_POINTER);
+ }
}
MSWindowsEventQueueBuffer::~MSWindowsEventQueueBuffer()
@@ -79,7 +89,7 @@ MSWindowsEventQueueBuffer::waitForEvent(double timeout)
// cancellation but that's okay because we're run in the main
// thread and we never cancel that thread.
HANDLE dummy[1];
- MsgWaitForMultipleObjects(0, dummy, FALSE, t, QS_ALLINPUT);
+ MsgWaitForMultipleObjects(0, dummy, FALSE, t, m_os_supported_message_types);
}
IEventQueueBuffer::Type
@@ -128,9 +138,7 @@ MSWindowsEventQueueBuffer::addEvent(UInt32 dataID)
bool
MSWindowsEventQueueBuffer::isEmpty() const
{
- // don't use QS_POINTER, QS_TOUCH, or any meta-flags that include them (like QS_ALLINPUT)
- // because they can cause GetQueueStatus() to always return 0 and we miss events
- return (HIWORD(GetQueueStatus(QS_POSTMESSAGE)) == 0);
+ return (HIWORD(GetQueueStatus(m_os_supported_message_types)) == 0);
}
EventQueueTimer*
diff --git a/src/lib/platform/MSWindowsEventQueueBuffer.h b/src/lib/platform/MSWindowsEventQueueBuffer.h
index 6a0f9f9..bc9bde1 100644
--- a/src/lib/platform/MSWindowsEventQueueBuffer.h
+++ b/src/lib/platform/MSWindowsEventQueueBuffer.h
@@ -47,4 +47,5 @@ private:
MSG m_event;
UINT m_daemonQuit;
IEventQueue* m_events;
+ UINT m_os_supported_message_types;
};
diff --git a/src/lib/platform/MSWindowsKeyState.h b/src/lib/platform/MSWindowsKeyState.h
index b226d8b..3c5fa40 100644
--- a/src/lib/platform/MSWindowsKeyState.h
+++ b/src/lib/platform/MSWindowsKeyState.h
@@ -19,7 +19,6 @@
#pragma once
#include "barrier/KeyState.h"
-#include "base/String.h"
#include "common/stdvector.h"
#define WIN32_LEAN_AND_MEAN
diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp
index 2717034..df10270 100644
--- a/src/lib/platform/MSWindowsScreen.cpp
+++ b/src/lib/platform/MSWindowsScreen.cpp
@@ -38,7 +38,6 @@
#include "arch/Arch.h"
#include "base/FunctionJob.h"
#include "base/Log.h"
-#include "base/String.h"
#include "base/IEventQueue.h"
#include "base/TMethodEventJob.h"
#include "base/TMethodJob.h"
@@ -150,7 +149,7 @@ MSWindowsScreen::MSWindowsScreen(
// SHGetFolderPath is deprecated in vista, but use it for xp support.
char desktopPath[MAX_PATH];
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_DESKTOP, NULL, 0, desktopPath))) {
- m_desktopPath = String(desktopPath);
+ m_desktopPath = std::string(desktopPath);
LOG((CLOG_DEBUG "using desktop for drop target: %s", m_desktopPath.c_str()));
}
else {
@@ -378,7 +377,7 @@ MSWindowsScreen::leave()
void
MSWindowsScreen::sendDragThread(void*)
{
- String& draggingFilename = getDraggingFilename();
+ std::string& draggingFilename = getDraggingFilename();
size_t size = draggingFilename.size();
if (draggingFilename.empty() == false) {
@@ -1867,8 +1866,7 @@ MSWindowsScreen::fakeDraggingFiles(DragFileList fileList)
// exception from being thrown.
}
-String&
-MSWindowsScreen::getDraggingFilename()
+std::string& MSWindowsScreen::getDraggingFilename()
{
if (m_draggingStarted) {
m_dropTarget->clearDraggingFilename();
@@ -1894,7 +1892,7 @@ MSWindowsScreen::getDraggingFilename()
fakeKeyUp(1);
fakeMouseButton(kButtonLeft, false);
- String filename;
+ std::string filename;
DOUBLE timeout = ARCH->time() + .5f;
while (ARCH->time() < timeout) {
ARCH->sleep(.05f);
@@ -1923,8 +1921,7 @@ MSWindowsScreen::getDraggingFilename()
return m_draggingFilename;
}
-const String&
-MSWindowsScreen::getDropTarget() const
+const std::string& MSWindowsScreen::getDropTarget() const
{
return m_desktopPath;
}
diff --git a/src/lib/platform/MSWindowsScreen.h b/src/lib/platform/MSWindowsScreen.h
index 14cd505..49e09df 100644
--- a/src/lib/platform/MSWindowsScreen.h
+++ b/src/lib/platform/MSWindowsScreen.h
@@ -25,7 +25,7 @@
#include "platform/synwinhk.h"
#include "mt/CondVar.h"
#include "mt/Mutex.h"
-#include "base/String.h"
+#include <string>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
@@ -118,9 +118,8 @@ public:
virtual void setSequenceNumber(UInt32);
virtual bool isPrimary() const;
virtual void fakeDraggingFiles(DragFileList fileList);
- virtual String& getDraggingFilename();
- virtual const String&
- getDropTarget() const;
+ virtual std::string& getDraggingFilename();
+ virtual const std::string& getDropTarget() const;
protected:
// IPlatformScreen overrides
@@ -333,7 +332,7 @@ private:
IEventQueue* m_events;
- String m_desktopPath;
+ std::string m_desktopPath;
MSWindowsDropTarget*
m_dropTarget;
diff --git a/src/lib/platform/MSWindowsScreenSaver.h b/src/lib/platform/MSWindowsScreenSaver.h
index 91df181..a117370 100644
--- a/src/lib/platform/MSWindowsScreenSaver.h
+++ b/src/lib/platform/MSWindowsScreenSaver.h
@@ -19,7 +19,6 @@
#pragma once
#include "barrier/IScreenSaver.h"
-#include "base/String.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
diff --git a/src/lib/platform/MSWindowsSession.cpp b/src/lib/platform/MSWindowsSession.cpp
index 63e8d8f..8d4f8ce 100644
--- a/src/lib/platform/MSWindowsSession.cpp
+++ b/src/lib/platform/MSWindowsSession.cpp
@@ -172,10 +172,9 @@ MSWindowsSession::nextProcessEntry(HANDLE snapshot, LPPROCESSENTRY32 entry)
return gotEntry;
}
-String
-MSWindowsSession::getActiveDesktopName()
+std::string MSWindowsSession::getActiveDesktopName()
{
- String result;
+ std::string result;
try {
HDESK hd = OpenInputDesktop(0, TRUE, GENERIC_READ);
if (hd != NULL) {
diff --git a/src/lib/platform/MSWindowsSession.h b/src/lib/platform/MSWindowsSession.h
index d777141..e14d7e2 100644
--- a/src/lib/platform/MSWindowsSession.h
+++ b/src/lib/platform/MSWindowsSession.h
@@ -17,7 +17,7 @@
#pragma once
-#include "base/String.h"
+#include <string>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
@@ -42,7 +42,7 @@ public:
void updateActiveSession();
- String getActiveDesktopName();
+ std::string getActiveDesktopName();
private:
BOOL nextProcessEntry(HANDLE snapshot, LPPROCESSENTRY32 entry);
diff --git a/src/lib/platform/MSWindowsUtil.cpp b/src/lib/platform/MSWindowsUtil.cpp
index b657906..b6b809f 100644
--- a/src/lib/platform/MSWindowsUtil.cpp
+++ b/src/lib/platform/MSWindowsUtil.cpp
@@ -18,29 +18,26 @@
#include "platform/MSWindowsUtil.h"
-#include "base/String.h"
-
#include <stdio.h>
+#include "base/String.h"
//
// MSWindowsUtil
//
-String
-MSWindowsUtil::getString(HINSTANCE instance, DWORD id)
+std::string MSWindowsUtil::getString(HINSTANCE instance, DWORD id)
{
char* msg = NULL;
int n = LoadString(instance, id, reinterpret_cast<LPSTR>(&msg), 0);
if (n <= 0) {
- return String();
+ return {};
}
- return String (msg, n);
+ return std::string (msg, n);
}
-String
-MSWindowsUtil::getErrorString(HINSTANCE hinstance, DWORD error, DWORD id)
+std::string MSWindowsUtil::getErrorString(HINSTANCE hinstance, DWORD error, DWORD id)
{
char* buffer;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
@@ -52,12 +49,12 @@ MSWindowsUtil::getErrorString(HINSTANCE hinstance, DWORD error, DWORD id)
(LPTSTR)&buffer,
0,
NULL) == 0) {
- String errorString = barrier::string::sprintf("%d", error);
+ std::string errorString = barrier::string::sprintf("%d", error);
return barrier::string::format(getString(hinstance, id).c_str(),
errorString.c_str());
}
else {
- String result(buffer);
+ std::string result(buffer);
LocalFree(buffer);
return result;
}
diff --git a/src/lib/platform/MSWindowsUtil.h b/src/lib/platform/MSWindowsUtil.h
index 29eef2e..59f2eac 100644
--- a/src/lib/platform/MSWindowsUtil.h
+++ b/src/lib/platform/MSWindowsUtil.h
@@ -18,7 +18,7 @@
#pragma once
-#include "base/String.h"
+#include <string>
#define WINDOWS_LEAN_AND_MEAN
#include <Windows.h>
@@ -29,14 +29,14 @@ public:
/*!
Gets a string for \p id from the string table of \p instance.
*/
- static String getString(HINSTANCE instance, DWORD id);
+ static std::string getString(HINSTANCE instance, DWORD id);
//! Get error string
/*!
Gets a system error message for \p error. If the error cannot be
found return the string for \p id, replacing ${1} with \p error.
*/
- static String getErrorString(HINSTANCE, DWORD error, DWORD id);
+ static std::string getErrorString(HINSTANCE, DWORD error, DWORD id);
//! Create directory
/*!
diff --git a/src/lib/platform/MSWindowsWatchdog.cpp b/src/lib/platform/MSWindowsWatchdog.cpp
index 9856b5d..0aa5505 100644
--- a/src/lib/platform/MSWindowsWatchdog.cpp
+++ b/src/lib/platform/MSWindowsWatchdog.cpp
@@ -327,8 +327,7 @@ MSWindowsWatchdog::startProcess()
}
}
-BOOL
-MSWindowsWatchdog::doStartProcessAsSelf(String& command)
+BOOL MSWindowsWatchdog::doStartProcessAsSelf(std::string& command)
{
DWORD creationFlags =
NORMAL_PRIORITY_CLASS |
@@ -347,8 +346,8 @@ MSWindowsWatchdog::doStartProcessAsSelf(String& command)
return CreateProcess(NULL, LPSTR(command.c_str()), NULL, NULL, FALSE, creationFlags, NULL, NULL, &si, &m_processInfo);
}
-BOOL
-MSWindowsWatchdog::doStartProcessAsUser(String& command, HANDLE userToken, LPSECURITY_ATTRIBUTES sa)
+BOOL MSWindowsWatchdog::doStartProcessAsUser(std::string& command, HANDLE userToken,
+ LPSECURITY_ATTRIBUTES sa)
{
// clear, as we're reusing process info struct
ZeroMemory(&m_processInfo, sizeof(PROCESS_INFORMATION));
diff --git a/src/lib/platform/MSWindowsWatchdog.h b/src/lib/platform/MSWindowsWatchdog.h
index 7a1f661..0a81521 100644
--- a/src/lib/platform/MSWindowsWatchdog.h
+++ b/src/lib/platform/MSWindowsWatchdog.h
@@ -55,8 +55,8 @@ private:
HANDLE duplicateProcessToken(HANDLE process, LPSECURITY_ATTRIBUTES security);
HANDLE getUserToken(LPSECURITY_ATTRIBUTES security);
void startProcess();
- BOOL doStartProcessAsUser(String& command, HANDLE userToken, LPSECURITY_ATTRIBUTES sa);
- BOOL doStartProcessAsSelf(String& command);
+ BOOL doStartProcessAsUser(std::string& command, HANDLE userToken, LPSECURITY_ATTRIBUTES sa);
+ BOOL doStartProcessAsSelf(std::string& command);
private:
Thread* m_thread;
@@ -85,8 +85,8 @@ An error occured in the process watchdog.
*/
class XMSWindowsWatchdogError : public XBarrier {
public:
- XMSWindowsWatchdogError(const String& msg) : XBarrier(msg) { }
+ XMSWindowsWatchdogError(const std::string& msg) : XBarrier(msg) { }
// XBase overrides
- virtual String getWhat() const throw() { return what(); }
+ virtual std::string getWhat() const noexcept { return what(); }
};
diff --git a/src/lib/platform/OSXClipboard.cpp b/src/lib/platform/OSXClipboard.cpp
index 710b471..e55c8e0 100644
--- a/src/lib/platform/OSXClipboard.cpp
+++ b/src/lib/platform/OSXClipboard.cpp
@@ -92,8 +92,7 @@ OSXClipboard::synchronize()
return false;
}
- void
-OSXClipboard::add(EFormat format, const String & data)
+void OSXClipboard::add(EFormat format, const std::string& data)
{
if (m_pboard == NULL)
return;
@@ -116,7 +115,7 @@ OSXClipboard::add(EFormat format, const String & data)
// skip converters for other formats
if (converter->getFormat() == format) {
- String osXData = converter->fromIClipboard(data);
+ std::string osXData = converter->fromIClipboard(data);
CFStringRef flavorType = converter->getOSXFormat();
CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, (UInt8 *)osXData.data(), osXData.size());
PasteboardItemID itemID = 0;
@@ -185,12 +184,11 @@ OSXClipboard::has(EFormat format) const
return false;
}
-String
-OSXClipboard::get(EFormat format) const
+std::string OSXClipboard::get(EFormat format) const
{
CFStringRef type;
PasteboardItemID item;
- String result;
+ std::string result;
if (m_pboard == NULL)
return result;
@@ -229,7 +227,7 @@ OSXClipboard::get(EFormat format) const
throw err;
}
- result = String((char *) CFDataGetBytePtr(buffer), CFDataGetLength(buffer));
+ result = std::string((char *) CFDataGetBytePtr(buffer), CFDataGetLength(buffer));
}
catch (OSStatus err) {
LOG((CLOG_DEBUG "exception thrown in OSXClipboard::get MacError (%d)", err));
diff --git a/src/lib/platform/OSXClipboard.h b/src/lib/platform/OSXClipboard.h
index ba25c32..b1f9801 100644
--- a/src/lib/platform/OSXClipboard.h
+++ b/src/lib/platform/OSXClipboard.h
@@ -21,6 +21,7 @@
#include "barrier/IClipboard.h"
#include <Carbon/Carbon.h>
+#include <string>
#include <vector>
class IOSXClipboardConverter;
@@ -36,12 +37,12 @@ public:
// IClipboard overrides
virtual bool empty();
- virtual void add(EFormat, const String& data);
+ virtual void add(EFormat, const std::string& data);
virtual bool open(Time) const;
virtual void close() const;
virtual Time getTime() const;
virtual bool has(EFormat) const;
- virtual String get(EFormat) const;
+ virtual std::string get(EFormat) const;
bool synchronize();
private:
@@ -72,8 +73,7 @@ public:
getFormat() const = 0;
//! returns the scrap flavor type that this object converts from/to
- virtual CFStringRef
- getOSXFormat() const = 0;
+ virtual CFStringRef getOSXFormat() const = 0;
//! Convert from IClipboard format
/*!
@@ -82,14 +82,14 @@ public:
getFormat(). The return data will be in the scrap
format returned by getOSXFormat().
*/
- virtual String fromIClipboard(const String&) const = 0;
+ virtual std::string fromIClipboard(const std::string&) const = 0;
//! Convert to IClipboard format
/*!
Convert from the carbon scrap format to the IClipboard format
(i.e., the reverse of fromIClipboard()).
*/
- virtual String toIClipboard(const String&) const = 0;
+ virtual std::string toIClipboard(const std::string&) const = 0;
//@}
};
diff --git a/src/lib/platform/OSXClipboardAnyBitmapConverter.cpp b/src/lib/platform/OSXClipboardAnyBitmapConverter.cpp
index 73f64c7..8b1b6d4 100644
--- a/src/lib/platform/OSXClipboardAnyBitmapConverter.cpp
+++ b/src/lib/platform/OSXClipboardAnyBitmapConverter.cpp
@@ -35,14 +35,12 @@ OSXClipboardAnyBitmapConverter::getFormat() const
return IClipboard::kBitmap;
}
-String
-OSXClipboardAnyBitmapConverter::fromIClipboard(const String& data) const
+std::string OSXClipboardAnyBitmapConverter::fromIClipboard(const std::string& data) const
{
return doFromIClipboard(data);
}
-String
-OSXClipboardAnyBitmapConverter::toIClipboard(const String& data) const
+std::string OSXClipboardAnyBitmapConverter::toIClipboard(const std::string& data) const
{
return doToIClipboard(data);
}
diff --git a/src/lib/platform/OSXClipboardAnyBitmapConverter.h b/src/lib/platform/OSXClipboardAnyBitmapConverter.h
index 277e75d..78f7809 100644
--- a/src/lib/platform/OSXClipboardAnyBitmapConverter.h
+++ b/src/lib/platform/OSXClipboardAnyBitmapConverter.h
@@ -30,19 +30,19 @@ public:
virtual IClipboard::EFormat
getFormat() const;
virtual CFStringRef getOSXFormat() const = 0;
- virtual String fromIClipboard(const String &) const;
- virtual String toIClipboard(const String &) const;
+ virtual std::string fromIClipboard(const std::string &) const;
+ virtual std::string toIClipboard(const std::string &) const;
protected:
//! Convert from IClipboard format
/*!
Do UTF-8 conversion and linefeed conversion.
*/
- virtual String doFromIClipboard(const String&) const = 0;
+ virtual std::string doFromIClipboard(const std::string&) const = 0;
//! Convert to IClipboard format
/*!
Do UTF-8 conversion and Linefeed conversion.
*/
- virtual String doToIClipboard(const String&) const = 0;
+ virtual std::string doToIClipboard(const std::string&) const = 0;
};
diff --git a/src/lib/platform/OSXClipboardAnyTextConverter.cpp b/src/lib/platform/OSXClipboardAnyTextConverter.cpp
index 7095006..ae8dc4a 100644
--- a/src/lib/platform/OSXClipboardAnyTextConverter.cpp
+++ b/src/lib/platform/OSXClipboardAnyTextConverter.cpp
@@ -40,15 +40,13 @@ OSXClipboardAnyTextConverter::getFormat() const
return IClipboard::kText;
}
-String
-OSXClipboardAnyTextConverter::fromIClipboard(const String& data) const
+std::string OSXClipboardAnyTextConverter::fromIClipboard(const std::string& data) const
{
// convert linefeeds and then convert to desired encoding
return doFromIClipboard(convertLinefeedToMacOS(data));
}
-String
-OSXClipboardAnyTextConverter::toIClipboard(const String& data) const
+std::string OSXClipboardAnyTextConverter::toIClipboard(const std::string& data) const
{
// convert text then newlines
return convertLinefeedToUnix(doToIClipboard(data));
@@ -68,21 +66,19 @@ isCR(char ch)
return (ch == '\r');
}
-String
-OSXClipboardAnyTextConverter::convertLinefeedToMacOS(const String& src)
+std::string OSXClipboardAnyTextConverter::convertLinefeedToMacOS(const std::string& src)
{
// note -- we assume src is a valid UTF-8 string
- String copy = src;
+ std::string copy = src;
std::replace_if(copy.begin(), copy.end(), isLF, '\r');
return copy;
}
-String
-OSXClipboardAnyTextConverter::convertLinefeedToUnix(const String& src)
+std::string OSXClipboardAnyTextConverter::convertLinefeedToUnix(const std::string& src)
{
- String copy = src;
+ std::string copy = src;
std::replace_if(copy.begin(), copy.end(), isCR, '\n');
diff --git a/src/lib/platform/OSXClipboardAnyTextConverter.h b/src/lib/platform/OSXClipboardAnyTextConverter.h
index ea42994..f057bae 100644
--- a/src/lib/platform/OSXClipboardAnyTextConverter.h
+++ b/src/lib/platform/OSXClipboardAnyTextConverter.h
@@ -29,25 +29,24 @@ public:
// IOSXClipboardConverter overrides
virtual IClipboard::EFormat
getFormat() const;
- virtual CFStringRef
- getOSXFormat() const = 0;
- virtual String fromIClipboard(const String &) const;
- virtual String toIClipboard(const String &) const;
+ virtual CFStringRef getOSXFormat() const = 0;
+ virtual std::string fromIClipboard(const std::string &) const;
+ virtual std::string toIClipboard(const std::string &) const;
protected:
//! Convert from IClipboard format
/*!
Do UTF-8 conversion and linefeed conversion.
*/
- virtual String doFromIClipboard(const String&) const = 0;
+ virtual std::string doFromIClipboard(const std::string&) const = 0;
//! Convert to IClipboard format
/*!
Do UTF-8 conversion and Linefeed conversion.
*/
- virtual String doToIClipboard(const String&) const = 0;
+ virtual std::string doToIClipboard(const std::string&) const = 0;
private:
- static String convertLinefeedToMacOS(const String&);
- static String convertLinefeedToUnix(const String&);
+ static std::string convertLinefeedToMacOS(const std::string&);
+ static std::string convertLinefeedToUnix(const std::string&);
};
diff --git a/src/lib/platform/OSXClipboardBMPConverter.cpp b/src/lib/platform/OSXClipboardBMPConverter.cpp
index 51c44ec..ac74fbb 100644
--- a/src/lib/platform/OSXClipboardBMPConverter.cpp
+++ b/src/lib/platform/OSXClipboardBMPConverter.cpp
@@ -91,8 +91,7 @@ OSXClipboardBMPConverter::getOSXFormat() const
return CFSTR("com.microsoft.bmp");
}
-String
-OSXClipboardBMPConverter::fromIClipboard(const String& bmp) const
+std::string OSXClipboardBMPConverter::fromIClipboard(const std::string& bmp) const
{
LOG((CLOG_DEBUG1 "ENTER OSXClipboardBMPConverter::doFromIClipboard()"));
// create BMP image
@@ -104,21 +103,20 @@ OSXClipboardBMPConverter::fromIClipboard(const String& bmp) const
toLE(dst, static_cast<UInt16>(0));
toLE(dst, static_cast<UInt16>(0));
toLE(dst, static_cast<UInt32>(14 + 40));
- return String(reinterpret_cast<const char*>(header), 14) + bmp;
+ return std::string(reinterpret_cast<const char*>(header), 14) + bmp;
}
-String
-OSXClipboardBMPConverter::toIClipboard(const String& bmp) const
+std::string OSXClipboardBMPConverter::toIClipboard(const std::string& bmp) const
{
// make sure data is big enough for a BMP file
if (bmp.size() <= 14 + 40) {
- return String();
+ return {};
}
// check BMP file header
const UInt8* rawBMPHeader = reinterpret_cast<const UInt8*>(bmp.data());
if (rawBMPHeader[0] != 'B' || rawBMPHeader[1] != 'M') {
- return String();
+ return {};
}
// get offset to image data
diff --git a/src/lib/platform/OSXClipboardBMPConverter.h b/src/lib/platform/OSXClipboardBMPConverter.h
index 400831d..f841bee 100644
--- a/src/lib/platform/OSXClipboardBMPConverter.h
+++ b/src/lib/platform/OSXClipboardBMPConverter.h
@@ -34,11 +34,10 @@ public:
getOSXFormat() const;
// OSXClipboardAnyBMPConverter overrides
- virtual String fromIClipboard(const String&) const;
- virtual String toIClipboard(const String&) const;
+ virtual std::string fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(const std::string&) const;
// generic encoding converter
- static String convertString(const String& data,
- CFStringEncoding fromEncoding,
- CFStringEncoding toEncoding);
+ static std::string convertString(const std::string& data, CFStringEncoding fromEncoding,
+ CFStringEncoding toEncoding);
};
diff --git a/src/lib/platform/OSXClipboardHTMLConverter.cpp b/src/lib/platform/OSXClipboardHTMLConverter.cpp
index b5fdb77..46a3d0f 100644
--- a/src/lib/platform/OSXClipboardHTMLConverter.cpp
+++ b/src/lib/platform/OSXClipboardHTMLConverter.cpp
@@ -42,18 +42,16 @@ OSXClipboardHTMLConverter::getOSXFormat() const
return CFSTR("public.html");
}
-String
-OSXClipboardHTMLConverter::convertString(
- const String& data,
- CFStringEncoding fromEncoding,
- CFStringEncoding toEncoding)
+std::string OSXClipboardHTMLConverter::convertString(const std::string& data,
+ CFStringEncoding fromEncoding,
+ CFStringEncoding toEncoding)
{
CFStringRef stringRef = CFStringCreateWithCString(
kCFAllocatorDefault,
data.c_str(), fromEncoding);
if (stringRef == NULL) {
- return String();
+ return {};
}
CFIndex buffSize;
@@ -66,13 +64,13 @@ OSXClipboardHTMLConverter::convertString(
if (buffer == NULL) {
CFRelease(stringRef);
- return String();
+ return {};
}
CFStringGetBytes(stringRef, entireString, toEncoding,
0, false, (UInt8*)buffer, buffSize, NULL);
- String result(buffer, buffSize);
+ std::string result(buffer, buffSize);
delete[] buffer;
CFRelease(stringRef);
@@ -80,15 +78,13 @@ OSXClipboardHTMLConverter::convertString(
return result;
}
-String
-OSXClipboardHTMLConverter::doFromIClipboard(const String& data) const
+std::string OSXClipboardHTMLConverter::doFromIClipboard(const std::string& data) const
{
return convertString(data, kCFStringEncodingUTF8,
CFStringGetSystemEncoding());
}
-String
-OSXClipboardHTMLConverter::doToIClipboard(const String& data) const
+std::string OSXClipboardHTMLConverter::doToIClipboard(const std::string& data) const
{
return convertString(data, CFStringGetSystemEncoding(),
kCFStringEncodingUTF8);
diff --git a/src/lib/platform/OSXClipboardHTMLConverter.h b/src/lib/platform/OSXClipboardHTMLConverter.h
index 21c2b82..a821e25 100644
--- a/src/lib/platform/OSXClipboardHTMLConverter.h
+++ b/src/lib/platform/OSXClipboardHTMLConverter.h
@@ -34,11 +34,10 @@ public:
protected:
// OSXClipboardAnyTextConverter overrides
- virtual String doFromIClipboard(const String&) const;
- virtual String doToIClipboard(const String&) const;
+ virtual std::string doFromIClipboard(const std::string&) const;
+ virtual std::string doToIClipboard(const std::string&) const;
// generic encoding converter
- static String convertString(const String& data,
- CFStringEncoding fromEncoding,
- CFStringEncoding toEncoding);
+ static std::string convertString(const std::string& data, CFStringEncoding fromEncoding,
+ CFStringEncoding toEncoding);
};
diff --git a/src/lib/platform/OSXClipboardTextConverter.cpp b/src/lib/platform/OSXClipboardTextConverter.cpp
index c18ad3f..a68258d 100644
--- a/src/lib/platform/OSXClipboardTextConverter.cpp
+++ b/src/lib/platform/OSXClipboardTextConverter.cpp
@@ -40,18 +40,16 @@ OSXClipboardTextConverter::getOSXFormat() const
return CFSTR("public.plain-text");
}
-String
-OSXClipboardTextConverter::convertString(
- const String& data,
- CFStringEncoding fromEncoding,
- CFStringEncoding toEncoding)
+std::string OSXClipboardTextConverter::convertString(const std::string& data,
+ CFStringEncoding fromEncoding,
+ CFStringEncoding toEncoding)
{
CFStringRef stringRef =
CFStringCreateWithCString(kCFAllocatorDefault,
data.c_str(), fromEncoding);
if (stringRef == NULL) {
- return String();
+ return {};
}
CFIndex buffSize;
@@ -64,13 +62,13 @@ OSXClipboardTextConverter::convertString(
if (buffer == NULL) {
CFRelease(stringRef);
- return String();
+ return {};
}
CFStringGetBytes(stringRef, entireString, toEncoding,
0, false, (UInt8*)buffer, buffSize, NULL);
- String result(buffer, buffSize);
+ std::string result(buffer, buffSize);
delete[] buffer;
CFRelease(stringRef);
@@ -78,15 +76,13 @@ OSXClipboardTextConverter::convertString(
return result;
}
-String
-OSXClipboardTextConverter::doFromIClipboard(const String& data) const
+std::string OSXClipboardTextConverter::doFromIClipboard(const std::string& data) const
{
return convertString(data, kCFStringEncodingUTF8,
CFStringGetSystemEncoding());
}
-String
-OSXClipboardTextConverter::doToIClipboard(const String& data) const
+std::string OSXClipboardTextConverter::doToIClipboard(const std::string& data) const
{
return convertString(data, CFStringGetSystemEncoding(),
kCFStringEncodingUTF8);
diff --git a/src/lib/platform/OSXClipboardTextConverter.h b/src/lib/platform/OSXClipboardTextConverter.h
index 55d82ce..8211f1e 100644
--- a/src/lib/platform/OSXClipboardTextConverter.h
+++ b/src/lib/platform/OSXClipboardTextConverter.h
@@ -32,11 +32,10 @@ public:
protected:
// OSXClipboardAnyTextConverter overrides
- virtual String doFromIClipboard(const String&) const;
- virtual String doToIClipboard(const String&) const;
+ virtual std::string doFromIClipboard(const std::string&) const;
+ virtual std::string doToIClipboard(const std::string&) const;
// generic encoding converter
- static String convertString(const String& data,
- CFStringEncoding fromEncoding,
- CFStringEncoding toEncoding);
+ static std::string convertString(const std::string& data, CFStringEncoding fromEncoding,
+ CFStringEncoding toEncoding);
};
diff --git a/src/lib/platform/OSXClipboardUTF16Converter.cpp b/src/lib/platform/OSXClipboardUTF16Converter.cpp
index 02d8fa3..8411e92 100644
--- a/src/lib/platform/OSXClipboardUTF16Converter.cpp
+++ b/src/lib/platform/OSXClipboardUTF16Converter.cpp
@@ -40,15 +40,13 @@ OSXClipboardUTF16Converter::getOSXFormat() const
return CFSTR("public.utf16-plain-text");
}
-String
-OSXClipboardUTF16Converter::doFromIClipboard(const String& data) const
+std::string OSXClipboardUTF16Converter::doFromIClipboard(const std::string& data) const
{
// convert and add nul terminator
return Unicode::UTF8ToUTF16(data);
}
-String
-OSXClipboardUTF16Converter::doToIClipboard(const String& data) const
+std::string OSXClipboardUTF16Converter::doToIClipboard(const std::string& data) const
{
// convert and strip nul terminator
return Unicode::UTF16ToUTF8(data);
diff --git a/src/lib/platform/OSXClipboardUTF16Converter.h b/src/lib/platform/OSXClipboardUTF16Converter.h
index 10bb595..b279c99 100644
--- a/src/lib/platform/OSXClipboardUTF16Converter.h
+++ b/src/lib/platform/OSXClipboardUTF16Converter.h
@@ -32,6 +32,6 @@ public:
protected:
// OSXClipboardAnyTextConverter overrides
- virtual String doFromIClipboard(const String&) const;
- virtual String doToIClipboard(const String&) const;
+ virtual std::string doFromIClipboard(const std::string&) const;
+ virtual std::string doToIClipboard(const std::string&) const;
};
diff --git a/src/lib/platform/OSXDragView.m b/src/lib/platform/OSXDragView.m
index 9f77499..67dac56 100644
--- a/src/lib/platform/OSXDragView.m
+++ b/src/lib/platform/OSXDragView.m
@@ -129,13 +129,13 @@ draggingSourceOperationMask
- (NSPoint)draggingLocation
{
- NSPoint point;
+ NSPoint point = NSMakePoint(0, 0);
return point;
}
- (NSPoint)draggedImageLocation
{
- NSPoint point;
+ NSPoint point = NSMakePoint(0, 0);
return point;
}
diff --git a/src/lib/platform/OSXKeyState.cpp b/src/lib/platform/OSXKeyState.cpp
index 9d8f429..9db3c5d 100644
--- a/src/lib/platform/OSXKeyState.cpp
+++ b/src/lib/platform/OSXKeyState.cpp
@@ -337,26 +337,26 @@ OSXKeyState::fakeMediaKey(KeyID id)
CGEventFlags
OSXKeyState::getModifierStateAsOSXFlags()
{
- CGEventFlags modifiers = 0;
+ CGEventFlags modifiers = CGEventFlags(0);
if (m_shiftPressed) {
- modifiers |= kCGEventFlagMaskShift;
+ modifiers |= CGEventFlags(kCGEventFlagMaskShift);
}
if (m_controlPressed) {
- modifiers |= kCGEventFlagMaskControl;
+ modifiers |= CGEventFlags(kCGEventFlagMaskControl);
}
if (m_altPressed) {
- modifiers |= kCGEventFlagMaskAlternate;
+ modifiers |= CGEventFlags(kCGEventFlagMaskAlternate);
}
if (m_superPressed) {
- modifiers |= kCGEventFlagMaskCommand;
+ modifiers |= CGEventFlags(kCGEventFlagMaskCommand);
}
if (m_capsPressed) {
- modifiers |= kCGEventFlagMaskAlphaShift;
+ modifiers |= CGEventFlags(kCGEventFlagMaskAlphaShift);
}
return modifiers;
diff --git a/src/lib/platform/OSXScreen.h b/src/lib/platform/OSXScreen.h
index bbddfb9..68c7c68 100644
--- a/src/lib/platform/OSXScreen.h
+++ b/src/lib/platform/OSXScreen.h
@@ -97,9 +97,9 @@ public:
virtual void setSequenceNumber(UInt32);
virtual bool isPrimary() const;
virtual void fakeDraggingFiles(DragFileList fileList);
- virtual String& getDraggingFilename();
+ virtual std::string& getDraggingFilename();
- const String& getDropTarget() const { return m_dropTarget; }
+ const std::string& getDropTarget() const { return m_dropTarget; }
void waitForCarbonLoop() const;
protected:
@@ -338,7 +338,7 @@ private:
IEventQueue* m_events;
Thread* m_getDropTargetThread;
- String m_dropTarget;
+ std::string m_dropTarget;
#if defined(MAC_OS_X_VERSION_10_7)
Mutex* m_carbonLoopMutex;
diff --git a/src/lib/platform/XWindowsClipboard.cpp b/src/lib/platform/XWindowsClipboard.cpp
index b2c17f9..b0da695 100644
--- a/src/lib/platform/XWindowsClipboard.cpp
+++ b/src/lib/platform/XWindowsClipboard.cpp
@@ -170,7 +170,7 @@ XWindowsClipboard::addSimpleRequest(Window requestor,
}
// handle targets
- String data;
+ std::string data;
Atom type = None;
int format = 0;
if (target == m_atomTargets) {
@@ -303,8 +303,7 @@ XWindowsClipboard::empty()
return true;
}
-void
-XWindowsClipboard::add(EFormat format, const String& data)
+void XWindowsClipboard::add(EFormat format, const std::string& data)
{
assert(m_open);
assert(m_owner);
@@ -387,8 +386,7 @@ XWindowsClipboard::has(EFormat format) const
return m_added[format];
}
-String
-XWindowsClipboard::get(EFormat format) const
+std::string XWindowsClipboard::get(EFormat format) const
{
assert(m_open);
@@ -513,7 +511,7 @@ XWindowsClipboard::icccmFillCache()
// instead of the correct type ATOM; allow either.
const Atom atomTargets = m_atomTargets;
Atom target;
- String data;
+ std::string data;
if (!icccmGetSelection(atomTargets, &target, &data) ||
(target != m_atomAtom && target != m_atomTargets)) {
LOG((CLOG_DEBUG1 "selection doesn't support TARGETS"));
@@ -557,7 +555,7 @@ XWindowsClipboard::icccmFillCache()
// get the data
Atom actualTarget;
- String targetData;
+ std::string targetData;
if (!icccmGetSelection(target, &actualTarget, &targetData)) {
LOG((CLOG_DEBUG1 " no data for target %s", XWindowsUtil::atomToString(m_display, target).c_str()));
continue;
@@ -573,7 +571,7 @@ XWindowsClipboard::icccmFillCache()
bool
XWindowsClipboard::icccmGetSelection(Atom target,
- Atom* actualTarget, String* data) const
+ Atom* actualTarget, std::string* data) const
{
assert(actualTarget != NULL);
assert(data != NULL);
@@ -597,7 +595,7 @@ IClipboard::Time
XWindowsClipboard::icccmGetTime() const
{
Atom actualTarget;
- String data;
+ std::string data;
if (icccmGetSelection(m_atomTimestamp, &actualTarget, &data) &&
actualTarget == m_atomInteger) {
Time time = *reinterpret_cast<const Time*>(data.data());
@@ -668,7 +666,7 @@ XWindowsClipboard::motifOwnsClipboard() const
// get the Motif clipboard header property from the root window
Atom target;
SInt32 format;
- String data;
+ std::string data;
Window root = RootWindow(m_display, DefaultScreen(m_display));
if (!XWindowsUtil::getWindowProperty(m_display, root,
m_atomMotifClipHeader,
@@ -697,7 +695,7 @@ XWindowsClipboard::motifFillCache()
// get the Motif clipboard header property from the root window
Atom target;
SInt32 format;
- String data;
+ std::string data;
Window root = RootWindow(m_display, DefaultScreen(m_display));
if (!XWindowsUtil::getWindowProperty(m_display, root,
m_atomMotifClipHeader,
@@ -741,13 +739,13 @@ XWindowsClipboard::motifFillCache()
static_cast<const char*>(data.data()));
// get the available formats
- typedef std::map<Atom, String> MotifFormatMap;
+ typedef std::map<Atom, std::string> MotifFormatMap;
MotifFormatMap motifFormats;
for (SInt32 i = 0; i < numFormats; ++i) {
// get Motif format property from the root window
sprintf(name, "_MOTIF_CLIP_ITEM_%d", formats[i]);
Atom atomFormat = m_impl->XInternAtom(m_display, name, False);
- String data;
+ std::string data;
if (!XWindowsUtil::getWindowProperty(m_display, root,
atomFormat, &data,
&target, &format, False)) {
@@ -797,7 +795,7 @@ XWindowsClipboard::motifFillCache()
// get the data (finally)
Atom actualTarget;
- String targetData;
+ std::string targetData;
if (!motifGetSelection(&motifFormat, &actualTarget, &targetData)) {
LOG((CLOG_DEBUG1 " no data for target %s", XWindowsUtil::atomToString(m_display, target).c_str()));
continue;
@@ -813,7 +811,7 @@ XWindowsClipboard::motifFillCache()
bool
XWindowsClipboard::motifGetSelection(const MotifClipFormat* format,
- Atom* actualTarget, String* data) const
+ Atom* actualTarget, std::string* data) const
{
// if the current clipboard owner and the owner indicated by the
// motif clip header are the same then transfer via a property on
@@ -849,7 +847,7 @@ XWindowsClipboard::insertMultipleReply(Window requestor,
// get the requested targets
Atom target;
SInt32 format;
- String data;
+ std::string data;
if (!XWindowsUtil::getWindowProperty(m_display, requestor,
property, &data, &target, &format, False)) {
// can't get the requested targets
@@ -887,7 +885,7 @@ XWindowsClipboard::insertMultipleReply(Window requestor,
// add reply for MULTIPLE request
insertReply(new Reply(requestor, m_atomMultiple,
- time, property, String(), None, 32));
+ time, property, std::string(), None, 32));
return true;
}
@@ -1101,7 +1099,7 @@ XWindowsClipboard::sendReply(Reply* reply)
LOG((CLOG_DEBUG2 "properties of 0x%08x:", reply->m_requestor));
for (int i = 0; i < n; ++i) {
Atom target;
- String data;
+ std::string data;
char* name = m_impl->XGetAtomName(m_display, props[i]);
if (!XWindowsUtil::getWindowProperty(m_display,
reply->m_requestor,
@@ -1112,9 +1110,9 @@ XWindowsClipboard::sendReply(Reply* reply)
// if there are any non-ascii characters in string
// then print the binary data.
static const char* hex = "0123456789abcdef";
- for (String::size_type j = 0; j < data.size(); ++j) {
+ for (std::string::size_type j = 0; j < data.size(); ++j) {
if (data[j] < 32 || data[j] > 126) {
- String tmp;
+ std::string tmp;
tmp.reserve(data.size() * 3);
for (j = 0; j < data.size(); ++j) {
unsigned char v = (unsigned char)data[j];
@@ -1221,8 +1219,7 @@ XWindowsClipboard::wasOwnedAtTime(::Time time) const
return (/*when >= 0 &&*/ when <= duration);
}
-Atom
-XWindowsClipboard::getTargetsData(String& data, int* format) const
+Atom XWindowsClipboard::getTargetsData(std::string& data, int* format) const
{
assert(format != NULL);
@@ -1246,8 +1243,7 @@ XWindowsClipboard::getTargetsData(String& data, int* format) const
return m_atomAtom;
}
-Atom
-XWindowsClipboard::getTimestampData(String& data, int* format) const
+Atom XWindowsClipboard::getTimestampData(std::string& data, int* format) const
{
assert(format != NULL);
@@ -1285,7 +1281,7 @@ XWindowsClipboard::CICCCMGetClipboard::~CICCCMGetClipboard()
bool
XWindowsClipboard::CICCCMGetClipboard::readClipboard(Display* display,
- Atom selection, Atom target, Atom* actualTarget, String* data)
+ Atom selection, Atom target, Atom* actualTarget, std::string* data)
{
assert(actualTarget != NULL);
assert(data != NULL);
@@ -1430,7 +1426,7 @@ XWindowsClipboard::CICCCMGetClipboard::processEvent(
// get the data from the property
Atom target;
- const String::size_type oldSize = m_data->size();
+ const std::string::size_type oldSize = m_data->size();
if (!XWindowsUtil::getWindowProperty(display, m_requestor,
m_property, m_data, &target, NULL, True)) {
// unable to read property
@@ -1515,7 +1511,7 @@ XWindowsClipboard::Reply::Reply(Window requestor, Atom target, ::Time time) :
}
XWindowsClipboard::Reply::Reply(Window requestor, Atom target, ::Time time,
- Atom property, const String& data, Atom type, int format) :
+ Atom property, const std::string& data, Atom type, int format) :
m_requestor(requestor),
m_target(target),
m_time(time),
diff --git a/src/lib/platform/XWindowsClipboard.h b/src/lib/platform/XWindowsClipboard.h
index f00c3fc..091036e 100644
--- a/src/lib/platform/XWindowsClipboard.h
+++ b/src/lib/platform/XWindowsClipboard.h
@@ -90,12 +90,12 @@ public:
// IClipboard overrides
virtual bool empty();
- virtual void add(EFormat, const String& data);
+ virtual void add(EFormat, const std::string& data);
virtual bool open(Time) const;
virtual void close() const;
virtual Time getTime() const;
virtual bool has(EFormat) const;
- virtual String get(EFormat) const;
+ virtual std::string get(EFormat) const;
private:
// remove all converters from our list
@@ -148,7 +148,7 @@ private:
// cannot be performed (in which case *actualTarget == None).
bool readClipboard(Display* display,
Atom selection, Atom target,
- Atom* actualTarget, String* data);
+ Atom* actualTarget, std::string* data);
private:
bool processEvent(Display* display, XEvent* event);
@@ -169,7 +169,7 @@ private:
bool m_reading;
// the converted selection data
- String* m_data;
+ std::string* m_data;
// the actual type of the data. if this is None then the
// selection owner cannot convert to the requested type.
@@ -224,8 +224,8 @@ private:
class Reply {
public:
Reply(Window, Atom target, ::Time);
- Reply(Window, Atom target, ::Time, Atom property,
- const String& data, Atom type, int format);
+ Reply(Window, Atom target, ::Time, Atom property, const std::string& data,
+ Atom type, int format);
public:
// information about the request
@@ -241,7 +241,7 @@ private:
bool m_done;
// the data to send and its type and format
- String m_data;
+ std::string m_data;
Atom m_type;
int m_format;
@@ -254,8 +254,7 @@ private:
// ICCCM interoperability methods
void icccmFillCache();
- bool icccmGetSelection(Atom target,
- Atom* actualTarget, String* data) const;
+ bool icccmGetSelection(Atom target, Atom* actualTarget, std::string* data) const;
Time icccmGetTime() const;
// motif interoperability methods
@@ -263,8 +262,7 @@ private:
void motifUnlockClipboard() const;
bool motifOwnsClipboard() const;
void motifFillCache();
- bool motifGetSelection(const MotifClipFormat*,
- Atom* actualTarget, String* data) const;
+ bool motifGetSelection(const MotifClipFormat*, Atom* actualTarget, std::string* data) const;
Time motifGetTime() const;
// reply methods
@@ -281,8 +279,8 @@ private:
bool wasOwnedAtTime(::Time) const;
// data conversion methods
- Atom getTargetsData(String&, int* format) const;
- Atom getTimestampData(String&, int* format) const;
+ Atom getTargetsData(std::string&, int* format) const;
+ Atom getTimestampData(std::string&, int* format) const;
private:
typedef std::vector<IXWindowsClipboardConverter*> ConverterList;
@@ -306,7 +304,7 @@ private:
bool m_cached;
Time m_cacheTime;
bool m_added[kNumFormats];
- String m_data[kNumFormats];
+ std::string m_data[kNumFormats];
// conversion request replies
ReplyMap m_replies;
@@ -368,14 +366,14 @@ public:
getFormat(). The return data will be in the X selection
format returned by getAtom().
*/
- virtual String fromIClipboard(const String&) const = 0;
+ virtual std::string fromIClipboard(const std::string&) const = 0;
//! Convert to IClipboard format
/*!
Convert from the X selection format to the IClipboard format
(i.e., the reverse of fromIClipboard()).
*/
- virtual String toIClipboard(const String&) const = 0;
+ virtual std::string toIClipboard(const std::string&) const = 0;
//@}
};
diff --git a/src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp b/src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp
index 493b1e8..f6fed1c 100644
--- a/src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp
+++ b/src/lib/platform/XWindowsClipboardAnyBitmapConverter.cpp
@@ -122,8 +122,7 @@ XWindowsClipboardAnyBitmapConverter::getDataSize() const
return 8;
}
-String
-XWindowsClipboardAnyBitmapConverter::fromIClipboard(const String& bmp) const
+std::string XWindowsClipboardAnyBitmapConverter::fromIClipboard(const std::string& bmp) const
{
// fill BMP info header with native-endian data
CBMPInfoHeader infoHeader;
@@ -145,7 +144,7 @@ XWindowsClipboardAnyBitmapConverter::fromIClipboard(const String& bmp) const
infoHeader.biWidth == 0 || infoHeader.biHeight == 0 ||
infoHeader.biPlanes != 0 || infoHeader.biCompression != 0 ||
(infoHeader.biBitCount != 24 && infoHeader.biBitCount != 32)) {
- return String();
+ return {};
}
// convert to image format
@@ -160,14 +159,13 @@ XWindowsClipboardAnyBitmapConverter::fromIClipboard(const String& bmp) const
}
}
-String
-XWindowsClipboardAnyBitmapConverter::toIClipboard(const String& image) const
+std::string XWindowsClipboardAnyBitmapConverter::toIClipboard(const std::string& image) const
{
// convert to raw BMP data
UInt32 w, h, depth;
- String rawBMP = doToIClipboard(image, w, h, depth);
+ std::string rawBMP = doToIClipboard(image, w, h, depth);
if (rawBMP.empty() || w == 0 || h == 0 || (depth != 24 && depth != 32)) {
- return String();
+ return {};
}
// fill BMP info header with little-endian data
@@ -186,6 +184,6 @@ XWindowsClipboardAnyBitmapConverter::toIClipboard(const String& image) const
toLE(dst, static_cast<UInt32>(0));
// construct image
- return String(reinterpret_cast<const char*>(infoHeader),
- sizeof(infoHeader)) + rawBMP;
+ return std::string(reinterpret_cast<const char*>(infoHeader),
+ sizeof(infoHeader)) + rawBMP;
}
diff --git a/src/lib/platform/XWindowsClipboardAnyBitmapConverter.h b/src/lib/platform/XWindowsClipboardAnyBitmapConverter.h
index d723a33..861b1b6 100644
--- a/src/lib/platform/XWindowsClipboardAnyBitmapConverter.h
+++ b/src/lib/platform/XWindowsClipboardAnyBitmapConverter.h
@@ -32,29 +32,27 @@ public:
getFormat() const;
virtual Atom getAtom() const = 0;
virtual int getDataSize() const;
- virtual String fromIClipboard(const String&) const;
- virtual String toIClipboard(const String&) const;
+ virtual std::string fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(const std::string&) const;
protected:
//! Convert from IClipboard format
/*!
Convert raw BGR pixel data to another image format.
*/
- virtual String doBGRFromIClipboard(const UInt8* bgrData,
- UInt32 w, UInt32 h) const = 0;
+ virtual std::string doBGRFromIClipboard(const UInt8* bgrData, UInt32 w, UInt32 h) const = 0;
//! Convert from IClipboard format
/*!
Convert raw BGRA pixel data to another image format.
*/
- virtual String doBGRAFromIClipboard(const UInt8* bgrData,
- UInt32 w, UInt32 h) const = 0;
+ virtual std::string doBGRAFromIClipboard(const UInt8* bgrData, UInt32 w, UInt32 h) const = 0;
//! Convert to IClipboard format
/*!
Convert an image into raw BGR or BGRA image data and store the
width, height, and image depth (24 or 32).
*/
- virtual String doToIClipboard(const String&,
- UInt32& w, UInt32& h, UInt32& depth) const = 0;
+ virtual std::string doToIClipboard(const std::string&, UInt32& w, UInt32& h,
+ UInt32& depth) const = 0;
};
diff --git a/src/lib/platform/XWindowsClipboardBMPConverter.cpp b/src/lib/platform/XWindowsClipboardBMPConverter.cpp
index b4def5b..fcfdc69 100644
--- a/src/lib/platform/XWindowsClipboardBMPConverter.cpp
+++ b/src/lib/platform/XWindowsClipboardBMPConverter.cpp
@@ -101,8 +101,7 @@ XWindowsClipboardBMPConverter::getDataSize() const
return 8;
}
-String
-XWindowsClipboardBMPConverter::fromIClipboard(const String& bmp) const
+std::string XWindowsClipboardBMPConverter::fromIClipboard(const std::string& bmp) const
{
// create BMP image
UInt8 header[14];
@@ -113,21 +112,20 @@ XWindowsClipboardBMPConverter::fromIClipboard(const String& bmp) const
toLE(dst, static_cast<UInt16>(0));
toLE(dst, static_cast<UInt16>(0));
toLE(dst, static_cast<UInt32>(14 + 40));
- return String(reinterpret_cast<const char*>(header), 14) + bmp;
+ return std::string(reinterpret_cast<const char*>(header), 14) + bmp;
}
-String
-XWindowsClipboardBMPConverter::toIClipboard(const String& bmp) const
+std::string XWindowsClipboardBMPConverter::toIClipboard(const std::string& bmp) const
{
// make sure data is big enough for a BMP file
if (bmp.size() <= 14 + 40) {
- return String();
+ return {};
}
// check BMP file header
const UInt8* rawBMPHeader = reinterpret_cast<const UInt8*>(bmp.data());
if (rawBMPHeader[0] != 'B' || rawBMPHeader[1] != 'M') {
- return String();
+ return {};
}
// get offset to image data
diff --git a/src/lib/platform/XWindowsClipboardBMPConverter.h b/src/lib/platform/XWindowsClipboardBMPConverter.h
index d7813a0..4afa788 100644
--- a/src/lib/platform/XWindowsClipboardBMPConverter.h
+++ b/src/lib/platform/XWindowsClipboardBMPConverter.h
@@ -32,8 +32,8 @@ public:
getFormat() const;
virtual Atom getAtom() const;
virtual int getDataSize() const;
- virtual String fromIClipboard(const String&) const;
- virtual String toIClipboard(const String&) const;
+ virtual std::string fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(const std::string&) const;
private:
Atom m_atom;
diff --git a/src/lib/platform/XWindowsClipboardHTMLConverter.cpp b/src/lib/platform/XWindowsClipboardHTMLConverter.cpp
index 32db724..6ae98a7 100644
--- a/src/lib/platform/XWindowsClipboardHTMLConverter.cpp
+++ b/src/lib/platform/XWindowsClipboardHTMLConverter.cpp
@@ -54,14 +54,12 @@ XWindowsClipboardHTMLConverter::getDataSize() const
return 8;
}
-String
-XWindowsClipboardHTMLConverter::fromIClipboard(const String& data) const
+std::string XWindowsClipboardHTMLConverter::fromIClipboard(const std::string& data) const
{
return Unicode::UTF8ToUTF16(data);
}
-String
-XWindowsClipboardHTMLConverter::toIClipboard(const String& data) const
+std::string XWindowsClipboardHTMLConverter::toIClipboard(const std::string& data) const
{
return Unicode::UTF16ToUTF8(data);
}
diff --git a/src/lib/platform/XWindowsClipboardHTMLConverter.h b/src/lib/platform/XWindowsClipboardHTMLConverter.h
index 013aa99..9a4ce61 100644
--- a/src/lib/platform/XWindowsClipboardHTMLConverter.h
+++ b/src/lib/platform/XWindowsClipboardHTMLConverter.h
@@ -34,8 +34,8 @@ public:
getFormat() const;
virtual Atom getAtom() const;
virtual int getDataSize() const;
- virtual String fromIClipboard(const String&) const;
- virtual String toIClipboard(const String&) const;
+ virtual std::string fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(const std::string&) const;
private:
Atom m_atom;
diff --git a/src/lib/platform/XWindowsClipboardTextConverter.cpp b/src/lib/platform/XWindowsClipboardTextConverter.cpp
index 71b7a84..2e18d91 100644
--- a/src/lib/platform/XWindowsClipboardTextConverter.cpp
+++ b/src/lib/platform/XWindowsClipboardTextConverter.cpp
@@ -54,18 +54,16 @@ XWindowsClipboardTextConverter::getDataSize() const
return 8;
}
-String
-XWindowsClipboardTextConverter::fromIClipboard(const String& data) const
+std::string XWindowsClipboardTextConverter::fromIClipboard(const std::string& data) const
{
return Unicode::UTF8ToText(data);
}
-String
-XWindowsClipboardTextConverter::toIClipboard(const String& data) const
+std::string XWindowsClipboardTextConverter::toIClipboard(const std::string& data) const
{
// convert to UTF-8
bool errors;
- String utf8 = Unicode::textToUTF8(data, &errors);
+ std::string utf8 = Unicode::textToUTF8(data, &errors);
// if there were decoding errors then, to support old applications
// that don't understand UTF-8 but can report the exact binary
diff --git a/src/lib/platform/XWindowsClipboardTextConverter.h b/src/lib/platform/XWindowsClipboardTextConverter.h
index 0e6d598..99cdbcb 100644
--- a/src/lib/platform/XWindowsClipboardTextConverter.h
+++ b/src/lib/platform/XWindowsClipboardTextConverter.h
@@ -34,8 +34,8 @@ public:
getFormat() const;
virtual Atom getAtom() const;
virtual int getDataSize() const;
- virtual String fromIClipboard(const String&) const;
- virtual String toIClipboard(const String&) const;
+ virtual std::string fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(const std::string&) const;
private:
Atom m_atom;
diff --git a/src/lib/platform/XWindowsClipboardUCS2Converter.cpp b/src/lib/platform/XWindowsClipboardUCS2Converter.cpp
index 988b909..d3d5e04 100644
--- a/src/lib/platform/XWindowsClipboardUCS2Converter.cpp
+++ b/src/lib/platform/XWindowsClipboardUCS2Converter.cpp
@@ -54,14 +54,12 @@ XWindowsClipboardUCS2Converter::getDataSize() const
return 16;
}
-String
-XWindowsClipboardUCS2Converter::fromIClipboard(const String& data) const
+std::string XWindowsClipboardUCS2Converter::fromIClipboard(const std::string& data) const
{
return Unicode::UTF8ToUCS2(data);
}
-String
-XWindowsClipboardUCS2Converter::toIClipboard(const String& data) const
+std::string XWindowsClipboardUCS2Converter::toIClipboard(const std::string& data) const
{
return Unicode::UCS2ToUTF8(data);
}
diff --git a/src/lib/platform/XWindowsClipboardUCS2Converter.h b/src/lib/platform/XWindowsClipboardUCS2Converter.h
index 6491408..16d880a 100644
--- a/src/lib/platform/XWindowsClipboardUCS2Converter.h
+++ b/src/lib/platform/XWindowsClipboardUCS2Converter.h
@@ -34,8 +34,8 @@ public:
getFormat() const;
virtual Atom getAtom() const;
virtual int getDataSize() const;
- virtual String fromIClipboard(const String&) const;
- virtual String toIClipboard(const String&) const;
+ virtual std::string fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(const std::string&) const;
private:
Atom m_atom;
diff --git a/src/lib/platform/XWindowsClipboardUTF8Converter.cpp b/src/lib/platform/XWindowsClipboardUTF8Converter.cpp
index 0e43cce..f470cf1 100644
--- a/src/lib/platform/XWindowsClipboardUTF8Converter.cpp
+++ b/src/lib/platform/XWindowsClipboardUTF8Converter.cpp
@@ -52,14 +52,12 @@ XWindowsClipboardUTF8Converter::getDataSize() const
return 8;
}
-String
-XWindowsClipboardUTF8Converter::fromIClipboard(const String& data) const
+std::string XWindowsClipboardUTF8Converter::fromIClipboard(const std::string& data) const
{
return data;
}
-String
-XWindowsClipboardUTF8Converter::toIClipboard(const String& data) const
+std::string XWindowsClipboardUTF8Converter::toIClipboard(const std::string& data) const
{
return data;
}
diff --git a/src/lib/platform/XWindowsClipboardUTF8Converter.h b/src/lib/platform/XWindowsClipboardUTF8Converter.h
index e3eeca0..2219ed2 100644
--- a/src/lib/platform/XWindowsClipboardUTF8Converter.h
+++ b/src/lib/platform/XWindowsClipboardUTF8Converter.h
@@ -34,8 +34,8 @@ public:
getFormat() const;
virtual Atom getAtom() const;
virtual int getDataSize() const;
- virtual String fromIClipboard(const String&) const;
- virtual String toIClipboard(const String&) const;
+ virtual std::string fromIClipboard(const std::string&) const;
+ virtual std::string toIClipboard(const std::string&) const;
private:
Atom m_atom;
diff --git a/src/lib/platform/XWindowsEventQueueBuffer.cpp b/src/lib/platform/XWindowsEventQueueBuffer.cpp
index 78f0e5a..8b8c3b5 100644
--- a/src/lib/platform/XWindowsEventQueueBuffer.cpp
+++ b/src/lib/platform/XWindowsEventQueueBuffer.cpp
@@ -82,6 +82,19 @@ XWindowsEventQueueBuffer::~XWindowsEventQueueBuffer()
close(m_pipefd[1]);
}
+int XWindowsEventQueueBuffer::getPendingCountLocked()
+{
+ Lock lock(&m_mutex);
+ // work around a bug in old libx11 which causes the first XPending not to read events under
+ // certain conditions. The issue happens when libx11 has not yet received replies for all
+ // flushed events. In that case, internally XPending will not try to process received events
+ // as the reply for the last event was not found. As a result, XPending will return the number
+ // of pending events without regard to the events it has just read.
+ // https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/1 fixes this on libx11 side.
+ m_impl->XPending(m_display);
+ return m_impl->XPending(m_display);
+}
+
void
XWindowsEventQueueBuffer::waitForEvent(double dtimeout)
{
@@ -163,7 +176,7 @@ XWindowsEventQueueBuffer::waitForEvent(double dtimeout)
// we want to give the cpu a chance s owe up this to 25ms
#define TIMEOUT_DELAY 25
- while (((dtimeout < 0.0) || (remaining > 0)) && QLength(m_display)==0 && retval==0){
+ while (((dtimeout < 0.0) || (remaining > 0)) && getPendingCountLocked() == 0 && retval == 0) {
#if HAVE_POLL
retval = poll(pfds, 2, TIMEOUT_DELAY); //16ms = 60hz, but we make it > to play nicely with the cpu
if (pfds[1].revents & POLLIN) {
diff --git a/src/lib/platform/XWindowsEventQueueBuffer.h b/src/lib/platform/XWindowsEventQueueBuffer.h
index e49b282..13f6b16 100644
--- a/src/lib/platform/XWindowsEventQueueBuffer.h
+++ b/src/lib/platform/XWindowsEventQueueBuffer.h
@@ -51,6 +51,8 @@ public:
private:
void flush();
+ int getPendingCountLocked();
+
private:
typedef std::vector<XEvent> EventList;
IXWindowsImpl* m_impl;
diff --git a/src/lib/platform/XWindowsKeyState.cpp b/src/lib/platform/XWindowsKeyState.cpp
index 37fd5e8..9fb71ca 100644
--- a/src/lib/platform/XWindowsKeyState.cpp
+++ b/src/lib/platform/XWindowsKeyState.cpp
@@ -20,7 +20,6 @@
#include "platform/XWindowsUtil.h"
#include "base/Log.h"
-#include "base/String.h"
#include "common/stdmap.h"
#include <cstddef>
diff --git a/src/lib/platform/XWindowsKeyState.h b/src/lib/platform/XWindowsKeyState.h
index f42f7ac..f790390 100644
--- a/src/lib/platform/XWindowsKeyState.h
+++ b/src/lib/platform/XWindowsKeyState.h
@@ -173,6 +173,6 @@ private:
public:
SInt32 group() const { return m_group; }
void group(const SInt32& group) { m_group = group; }
- KeyModifierMaskList modifierFromX() const { return m_modifierFromX; }
+ KeyModifierMaskList& modifierFromX() { return m_modifierFromX; }
#endif
};
diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp
index e5db1a3..5f1724c 100644
--- a/src/lib/platform/XWindowsScreen.cpp
+++ b/src/lib/platform/XWindowsScreen.cpp
@@ -30,7 +30,6 @@
#include "arch/Arch.h"
#include "base/Log.h"
#include "base/Stopwatch.h"
-#include "base/String.h"
#include "base/IEventQueue.h"
#include "base/TMethodEventJob.h"
diff --git a/src/lib/platform/XWindowsUtil.cpp b/src/lib/platform/XWindowsUtil.cpp
index 65448e8..3c90bd6 100644
--- a/src/lib/platform/XWindowsUtil.cpp
+++ b/src/lib/platform/XWindowsUtil.cpp
@@ -1294,7 +1294,7 @@ XWindowsUtil::KeySymMap XWindowsUtil::s_keySymToUCS4;
bool
XWindowsUtil::getWindowProperty(Display* display, Window window,
- Atom property, String* data, Atom* type,
+ Atom property, std::string* data, Atom* type,
SInt32* format, bool deleteProperty)
{
assert(display != NULL);
@@ -1608,8 +1608,7 @@ XWindowsUtil::getModifierBitForKeySym(KeySym keysym)
}
}
-String
-XWindowsUtil::atomToString(Display* display, Atom atom)
+std::string XWindowsUtil::atomToString(Display* display, Atom atom)
{
if (atom == 0) {
return "None";
@@ -1622,20 +1621,19 @@ XWindowsUtil::atomToString(Display* display, Atom atom)
return barrier::string::sprintf("<UNKNOWN> (%d)", (int)atom);
}
else {
- String msg = barrier::string::sprintf("%s (%d)", name, (int)atom);
+ std::string msg = barrier::string::sprintf("%s (%d)", name, (int)atom);
XFree(name);
return msg;
}
}
-String
-XWindowsUtil::atomsToString(Display* display, const Atom* atom, UInt32 num)
+std::string XWindowsUtil::atomsToString(Display* display, const Atom* atom, UInt32 num)
{
char** names = new char*[num];
bool error = false;
XWindowsUtil::ErrorLock lock(display, &error);
XGetAtomNames(display, const_cast<Atom*>(atom), (int)num, names);
- String msg;
+ std::string msg;
if (error) {
for (UInt32 i = 0; i < num; ++i) {
msg += barrier::string::sprintf("<UNKNOWN> (%d), ", (int)atom[i]);
@@ -1654,8 +1652,7 @@ XWindowsUtil::atomsToString(Display* display, const Atom* atom, UInt32 num)
return msg;
}
-void
-XWindowsUtil::convertAtomProperty(String& data)
+void XWindowsUtil::convertAtomProperty(std::string& data)
{
// as best i can tell, 64-bit systems don't pack Atoms into properties
// as 32-bit numbers but rather as the 64-bit numbers they are. that
@@ -1669,22 +1666,19 @@ XWindowsUtil::convertAtomProperty(String& data)
}
}
-void
-XWindowsUtil::appendAtomData(String& data, Atom atom)
+void XWindowsUtil::appendAtomData(std::string& data, Atom atom)
{
data.append(reinterpret_cast<char*>(&atom), sizeof(Atom));
}
-void
-XWindowsUtil::replaceAtomData(String& data, UInt32 index, Atom atom)
+void XWindowsUtil::replaceAtomData(std::string& data, UInt32 index, Atom atom)
{
data.replace(index * sizeof(Atom), sizeof(Atom),
reinterpret_cast<const char*>(&atom),
sizeof(Atom));
}
-void
-XWindowsUtil::appendTimeData(String& data, Time time)
+void XWindowsUtil::appendTimeData(std::string& data, Time time)
{
data.append(reinterpret_cast<char*>(&time), sizeof(Time));
}
diff --git a/src/lib/platform/XWindowsUtil.h b/src/lib/platform/XWindowsUtil.h
index 4df888f..f5b3ea8 100644
--- a/src/lib/platform/XWindowsUtil.h
+++ b/src/lib/platform/XWindowsUtil.h
@@ -18,7 +18,6 @@
#pragma once
-#include "base/String.h"
#include "base/EventTypes.h"
#include "common/stdmap.h"
#include "common/stdvector.h"
@@ -29,6 +28,8 @@
# include <X11/Xlib.h>
#endif
+#include <string>
+
//! X11 utility functions
class XWindowsUtil {
public:
@@ -42,10 +43,9 @@ public:
if \c format is not NULL. If \c deleteProperty is true then the
property is deleted after being read.
*/
- static bool getWindowProperty(Display*,
- Window window, Atom property,
- String* data, Atom* type,
- SInt32* format, bool deleteProperty);
+ static bool getWindowProperty(Display*, Window window, Atom property,
+ std::string* data, Atom* type,
+ SInt32* format, bool deleteProperty);
//! Set property
/*!
@@ -81,44 +81,42 @@ public:
/*!
Converts \p atom to its string representation.
*/
- static String atomToString(Display*, Atom atom);
+ static std::string atomToString(Display*, Atom atom);
//! Convert several Atoms to a string
/*!
Converts each atom in \p atoms to its string representation and
concatenates the results.
*/
- static String atomsToString(Display* display,
- const Atom* atom, UInt32 num);
+ static std::string atomsToString(Display* display, const Atom* atom, UInt32 num);
//! Prepare a property of atoms for use
/*!
64-bit systems may need to modify a property's data if it's a
list of Atoms before using it.
*/
- static void convertAtomProperty(String& data);
+ static void convertAtomProperty(std::string& data);
//! Append an Atom to property data
/*!
Converts \p atom to a 32-bit on-the-wire format and appends it to
\p data.
*/
- static void appendAtomData(String& data, Atom atom);
+ static void appendAtomData(std::string& data, Atom atom);
//! Replace an Atom in property data
/*!
Converts \p atom to a 32-bit on-the-wire format and replaces the atom
at index \p index in \p data.
*/
- static void replaceAtomData(String& data,
- UInt32 index, Atom atom);
+ static void replaceAtomData(std::string& data, UInt32 index, Atom atom);
//! Append an Time to property data
/*!
Converts \p time to a 32-bit on-the-wire format and appends it to
\p data.
*/
- static void appendTimeData(String& data, Time time);
+ static void appendTimeData(std::string& data, Time time);
//! X11 error handler
/*!
diff --git a/src/lib/server/BaseClientProxy.cpp b/src/lib/server/BaseClientProxy.cpp
index b9c5339..6ccd251 100644
--- a/src/lib/server/BaseClientProxy.cpp
+++ b/src/lib/server/BaseClientProxy.cpp
@@ -22,7 +22,7 @@
// BaseClientProxy
//
-BaseClientProxy::BaseClientProxy(const String& name) :
+BaseClientProxy::BaseClientProxy(const std::string& name) :
m_name(name),
m_x(0),
m_y(0)
@@ -49,8 +49,7 @@ BaseClientProxy::getJumpCursorPos(SInt32& x, SInt32& y) const
y = m_y;
}
-String
-BaseClientProxy::getName() const
+std::string BaseClientProxy::getName() const
{
return m_name;
}
diff --git a/src/lib/server/BaseClientProxy.h b/src/lib/server/BaseClientProxy.h
index c7c23ff..a2c9459 100644
--- a/src/lib/server/BaseClientProxy.h
+++ b/src/lib/server/BaseClientProxy.h
@@ -19,7 +19,6 @@
#pragma once
#include "barrier/IClient.h"
-#include "base/String.h"
namespace barrier { class IStream; }
@@ -29,7 +28,7 @@ public:
/*!
\c name is the name of the client.
*/
- BaseClientProxy(const String& name);
+ BaseClientProxy(const std::string& name);
~BaseClientProxy();
//! @name manipulators
@@ -89,11 +88,11 @@ public:
virtual void sendDragInfo(UInt32 fileCount, const char* info,
size_t size) = 0;
virtual void fileChunkSending(UInt8 mark, char* data, size_t dataSize) = 0;
- virtual String getName() const;
+ virtual std::string getName() const;
virtual barrier::IStream*
getStream() const = 0;
private:
- String m_name;
+ std::string m_name;
SInt32 m_x, m_y;
};
diff --git a/src/lib/server/ClientProxy.cpp b/src/lib/server/ClientProxy.cpp
index 5a28248..d91e186 100644
--- a/src/lib/server/ClientProxy.cpp
+++ b/src/lib/server/ClientProxy.cpp
@@ -27,7 +27,7 @@
// ClientProxy
//
-ClientProxy::ClientProxy(const String& name, barrier::IStream* stream) :
+ClientProxy::ClientProxy(const std::string& name, barrier::IStream* stream) :
BaseClientProxy(name),
m_stream(stream)
{
diff --git a/src/lib/server/ClientProxy.h b/src/lib/server/ClientProxy.h
index 726ded4..a3d87cb 100644
--- a/src/lib/server/ClientProxy.h
+++ b/src/lib/server/ClientProxy.h
@@ -20,7 +20,6 @@
#include "server/BaseClientProxy.h"
#include "base/Event.h"
-#include "base/String.h"
#include "base/EventTypes.h"
namespace barrier { class IStream; }
@@ -31,7 +30,7 @@ public:
/*!
\c name is the name of the client.
*/
- ClientProxy(const String& name, barrier::IStream* adoptedStream);
+ ClientProxy(const std::string& name, barrier::IStream* adoptedStream);
~ClientProxy();
//! @name manipulators
diff --git a/src/lib/server/ClientProxy1_0.cpp b/src/lib/server/ClientProxy1_0.cpp
index ee805c6..5cbaac2 100644
--- a/src/lib/server/ClientProxy1_0.cpp
+++ b/src/lib/server/ClientProxy1_0.cpp
@@ -31,7 +31,8 @@
// ClientProxy1_0
//
-ClientProxy1_0::ClientProxy1_0(const String& name, barrier::IStream* stream, IEventQueue* events) :
+ClientProxy1_0::ClientProxy1_0(const std::string& name, barrier::IStream* stream,
+ IEventQueue* events) :
ClientProxy(name, stream),
m_heartbeatTimer(NULL),
m_parser(&ClientProxy1_0::parseHandshakeMessage),
diff --git a/src/lib/server/ClientProxy1_0.h b/src/lib/server/ClientProxy1_0.h
index 0720232..98c68f3 100644
--- a/src/lib/server/ClientProxy1_0.h
+++ b/src/lib/server/ClientProxy1_0.h
@@ -29,7 +29,7 @@ class IEventQueue;
//! Proxy for client implementing protocol version 1.0
class ClientProxy1_0 : public ClientProxy {
public:
- ClientProxy1_0(const String& name, barrier::IStream* adoptedStream, IEventQueue* events);
+ ClientProxy1_0(const std::string& name, barrier::IStream* adoptedStream, IEventQueue* events);
~ClientProxy1_0();
// IScreen
diff --git a/src/lib/server/ClientProxy1_1.cpp b/src/lib/server/ClientProxy1_1.cpp
index b7eb4c4..bb33ac1 100644
--- a/src/lib/server/ClientProxy1_1.cpp
+++ b/src/lib/server/ClientProxy1_1.cpp
@@ -27,7 +27,8 @@
// ClientProxy1_1
//
-ClientProxy1_1::ClientProxy1_1(const String& name, barrier::IStream* stream, IEventQueue* events) :
+ClientProxy1_1::ClientProxy1_1(const std::string& name, barrier::IStream* stream,
+ IEventQueue* events) :
ClientProxy1_0(name, stream, events)
{
// do nothing
diff --git a/src/lib/server/ClientProxy1_1.h b/src/lib/server/ClientProxy1_1.h
index cdb674d..ada4dcc 100644
--- a/src/lib/server/ClientProxy1_1.h
+++ b/src/lib/server/ClientProxy1_1.h
@@ -23,7 +23,7 @@
//! Proxy for client implementing protocol version 1.1
class ClientProxy1_1 : public ClientProxy1_0 {
public:
- ClientProxy1_1(const String& name, barrier::IStream* adoptedStream, IEventQueue* events);
+ ClientProxy1_1(const std::string& name, barrier::IStream* adoptedStream, IEventQueue* events);
~ClientProxy1_1();
// IClient overrides
diff --git a/src/lib/server/ClientProxy1_2.cpp b/src/lib/server/ClientProxy1_2.cpp
index 2dd13cf..e9527ef 100644
--- a/src/lib/server/ClientProxy1_2.cpp
+++ b/src/lib/server/ClientProxy1_2.cpp
@@ -25,7 +25,8 @@
// ClientProxy1_1
//
-ClientProxy1_2::ClientProxy1_2(const String& name, barrier::IStream* stream, IEventQueue* events) :
+ClientProxy1_2::ClientProxy1_2(const std::string& name, barrier::IStream* stream,
+ IEventQueue* events) :
ClientProxy1_1(name, stream, events)
{
// do nothing
diff --git a/src/lib/server/ClientProxy1_2.h b/src/lib/server/ClientProxy1_2.h
index f6ffe94..12d6b92 100644
--- a/src/lib/server/ClientProxy1_2.h
+++ b/src/lib/server/ClientProxy1_2.h
@@ -25,7 +25,7 @@ class IEventQueue;
//! Proxy for client implementing protocol version 1.2
class ClientProxy1_2 : public ClientProxy1_1 {
public:
- ClientProxy1_2(const String& name, barrier::IStream* adoptedStream, IEventQueue* events);
+ ClientProxy1_2(const std::string& name, barrier::IStream* adoptedStream, IEventQueue* events);
~ClientProxy1_2();
// IClient overrides
diff --git a/src/lib/server/ClientProxy1_3.cpp b/src/lib/server/ClientProxy1_3.cpp
index 34ea0c8..d0031ce 100644
--- a/src/lib/server/ClientProxy1_3.cpp
+++ b/src/lib/server/ClientProxy1_3.cpp
@@ -30,7 +30,8 @@
// ClientProxy1_3
//
-ClientProxy1_3::ClientProxy1_3(const String& name, barrier::IStream* stream, IEventQueue* events) :
+ClientProxy1_3::ClientProxy1_3(const std::string& name, barrier::IStream* stream,
+ IEventQueue* events) :
ClientProxy1_2(name, stream, events),
m_keepAliveRate(kKeepAliveRate),
m_keepAliveTimer(NULL),
diff --git a/src/lib/server/ClientProxy1_3.h b/src/lib/server/ClientProxy1_3.h
index ff2ed0a..ad46cea 100644
--- a/src/lib/server/ClientProxy1_3.h
+++ b/src/lib/server/ClientProxy1_3.h
@@ -23,7 +23,7 @@
//! Proxy for client implementing protocol version 1.3
class ClientProxy1_3 : public ClientProxy1_2 {
public:
- ClientProxy1_3(const String& name, barrier::IStream* adoptedStream, IEventQueue* events);
+ ClientProxy1_3(const std::string& name, barrier::IStream* adoptedStream, IEventQueue* events);
~ClientProxy1_3();
// IClient overrides
diff --git a/src/lib/server/ClientProxy1_4.cpp b/src/lib/server/ClientProxy1_4.cpp
index 43c708d..9b12976 100644
--- a/src/lib/server/ClientProxy1_4.cpp
+++ b/src/lib/server/ClientProxy1_4.cpp
@@ -31,7 +31,8 @@
// ClientProxy1_4
//
-ClientProxy1_4::ClientProxy1_4(const String& name, barrier::IStream* stream, Server* server, IEventQueue* events) :
+ClientProxy1_4::ClientProxy1_4(const std::string& name, barrier::IStream* stream, Server* server,
+ IEventQueue* events) :
ClientProxy1_3(name, stream, events), m_server(server)
{
assert(m_server != NULL);
diff --git a/src/lib/server/ClientProxy1_4.h b/src/lib/server/ClientProxy1_4.h
index 6c55965..cda090b 100644
--- a/src/lib/server/ClientProxy1_4.h
+++ b/src/lib/server/ClientProxy1_4.h
@@ -25,7 +25,8 @@ class Server;
//! Proxy for client implementing protocol version 1.4
class ClientProxy1_4 : public ClientProxy1_3 {
public:
- ClientProxy1_4(const String& name, barrier::IStream* adoptedStream, Server* server, IEventQueue* events);
+ ClientProxy1_4(const std::string& name, barrier::IStream* adoptedStream, Server* server,
+ IEventQueue* events);
~ClientProxy1_4();
//! @name accessors
diff --git a/src/lib/server/ClientProxy1_5.cpp b/src/lib/server/ClientProxy1_5.cpp
index 43fd0b7..40bba08 100644
--- a/src/lib/server/ClientProxy1_5.cpp
+++ b/src/lib/server/ClientProxy1_5.cpp
@@ -31,7 +31,8 @@
// ClientProxy1_5
//
-ClientProxy1_5::ClientProxy1_5(const String& name, barrier::IStream* stream, Server* server, IEventQueue* events) :
+ClientProxy1_5::ClientProxy1_5(const std::string& name, barrier::IStream* stream, Server* server,
+ IEventQueue* events) :
ClientProxy1_4(name, stream, server, events),
m_events(events)
{
@@ -50,7 +51,7 @@ ClientProxy1_5::~ClientProxy1_5()
void
ClientProxy1_5::sendDragInfo(UInt32 fileCount, const char* info, size_t size)
{
- String data(info, size);
+ std::string data(info, size);
ProtocolUtil::writef(getStream(), kMsgDDragInfo, fileCount, &data);
}
@@ -92,7 +93,7 @@ ClientProxy1_5::fileChunkReceived()
}
else if (result == kStart) {
if (server->getFakeDragFileList().size() > 0) {
- String filename = server->getFakeDragFileList().at(0).getFilename();
+ std::string filename = server->getFakeDragFileList().at(0).getFilename();
LOG((CLOG_DEBUG "start receiving %s", filename.c_str()));
}
}
@@ -103,7 +104,7 @@ ClientProxy1_5::dragInfoReceived()
{
// parse
UInt32 fileNum = 0;
- String content;
+ std::string content;
ProtocolUtil::readf(getStream(), kMsgDDragInfo + 4, &fileNum, &content);
m_server->dragInfoReceived(fileNum, content);
diff --git a/src/lib/server/ClientProxy1_5.h b/src/lib/server/ClientProxy1_5.h
index 776de03..4087730 100644
--- a/src/lib/server/ClientProxy1_5.h
+++ b/src/lib/server/ClientProxy1_5.h
@@ -27,7 +27,8 @@ class IEventQueue;
//! Proxy for client implementing protocol version 1.5
class ClientProxy1_5 : public ClientProxy1_4 {
public:
- ClientProxy1_5(const String& name, barrier::IStream* adoptedStream, Server* server, IEventQueue* events);
+ ClientProxy1_5(const std::string& name, barrier::IStream* adoptedStream, Server* server,
+ IEventQueue* events);
~ClientProxy1_5();
virtual void sendDragInfo(UInt32 fileCount, const char* info, size_t size);
diff --git a/src/lib/server/ClientProxy1_6.cpp b/src/lib/server/ClientProxy1_6.cpp
index a0d2621..c829e84 100644
--- a/src/lib/server/ClientProxy1_6.cpp
+++ b/src/lib/server/ClientProxy1_6.cpp
@@ -29,7 +29,8 @@
// ClientProxy1_6
//
-ClientProxy1_6::ClientProxy1_6(const String& name, barrier::IStream* stream, Server* server, IEventQueue* events) :
+ClientProxy1_6::ClientProxy1_6(const std::string& name, barrier::IStream* stream, Server* server,
+ IEventQueue* events) :
ClientProxy1_5(name, stream, server, events),
m_events(events)
{
@@ -52,7 +53,7 @@ ClientProxy1_6::setClipboard(ClipboardID id, const IClipboard* clipboard)
m_clipboard[id].m_dirty = false;
Clipboard::copy(&m_clipboard[id].m_clipboard, clipboard);
- String data = m_clipboard[id].m_clipboard.marshall();
+ std::string data = m_clipboard[id].m_clipboard.marshall();
size_t size = data.size();
LOG((CLOG_DEBUG "sending clipboard %d to \"%s\"", id, getName().c_str()));
@@ -71,7 +72,7 @@ bool
ClientProxy1_6::recvClipboard()
{
// parse message
- static String dataCached;
+ static std::string dataCached;
ClipboardID id;
UInt32 seq;
diff --git a/src/lib/server/ClientProxy1_6.h b/src/lib/server/ClientProxy1_6.h
index 838cb02..830696a 100644
--- a/src/lib/server/ClientProxy1_6.h
+++ b/src/lib/server/ClientProxy1_6.h
@@ -25,7 +25,8 @@ class IEventQueue;
//! Proxy for client implementing protocol version 1.6
class ClientProxy1_6 : public ClientProxy1_5 {
public:
- ClientProxy1_6(const String& name, barrier::IStream* adoptedStream, Server* server, IEventQueue* events);
+ ClientProxy1_6(const std::string& name, barrier::IStream* adoptedStream, Server* server,
+ IEventQueue* events);
~ClientProxy1_6();
virtual void setClipboard(ClipboardID id, const IClipboard* clipboard);
diff --git a/src/lib/server/ClientProxyUnknown.cpp b/src/lib/server/ClientProxyUnknown.cpp
index f929108..dc79da7 100644
--- a/src/lib/server/ClientProxyUnknown.cpp
+++ b/src/lib/server/ClientProxyUnknown.cpp
@@ -32,7 +32,6 @@
#include "io/IStream.h"
#include "io/XIO.h"
#include "base/Log.h"
-#include "base/String.h"
#include "base/IEventQueue.h"
#include "base/TMethodEventJob.h"
@@ -176,7 +175,7 @@ ClientProxyUnknown::handleData(const Event&, void*)
{
LOG((CLOG_DEBUG1 "parsing hello reply"));
- String name("<unknown>");
+ std::string name("<unknown>");
try {
// limit the maximum length of the hello
UInt32 n = m_stream->getSize();
diff --git a/src/lib/server/Config.cpp b/src/lib/server/Config.cpp
index 3cf60a5..a47a391 100644
--- a/src/lib/server/Config.cpp
+++ b/src/lib/server/Config.cpp
@@ -48,7 +48,7 @@ Config::~Config()
}
bool
-Config::addScreen(const String& name)
+Config::addScreen(const std::string& name)
{
// alias name must not exist
if (m_nameToCanonicalName.find(name) != m_nameToCanonicalName.end()) {
@@ -64,12 +64,10 @@ Config::addScreen(const String& name)
return true;
}
-bool
-Config::renameScreen(const String& oldName,
- const String& newName)
+bool Config::renameScreen(const std::string& oldName, const std::string& newName)
{
// get canonical name and find cell
- String oldCanonical = getCanonicalName(oldName);
+ std::string oldCanonical = getCanonicalName(oldName);
CellMap::iterator index = m_map.find(oldCanonical);
if (index == m_map.end()) {
return false;
@@ -111,11 +109,10 @@ Config::renameScreen(const String& oldName,
return true;
}
-void
-Config::removeScreen(const String& name)
+void Config::removeScreen(const std::string& name)
{
// get canonical name and find cell
- String canonical = getCanonicalName(name);
+ std::string canonical = getCanonicalName(name);
CellMap::iterator index = m_map.find(canonical);
if (index == m_map.end()) {
return;
@@ -149,8 +146,7 @@ Config::removeAllScreens()
m_nameToCanonicalName.clear();
}
-bool
-Config::addAlias(const String& canonical, const String& alias)
+bool Config::addAlias(const std::string& canonical, const std::string& alias)
{
// alias name must not exist
if (m_nameToCanonicalName.find(alias) != m_nameToCanonicalName.end()) {
@@ -168,8 +164,7 @@ Config::addAlias(const String& canonical, const String& alias)
return true;
}
-bool
-Config::removeAlias(const String& alias)
+bool Config::removeAlias(const std::string& alias)
{
// must not be a canonical name
if (m_map.find(alias) != m_map.end()) {
@@ -188,8 +183,7 @@ Config::removeAlias(const String& alias)
return true;
}
-bool
-Config::removeAliases(const String& canonical)
+bool Config::removeAliases(const std::string& canonical)
{
// must be a canonical name
if (m_map.find(canonical) == m_map.end()) {
@@ -224,12 +218,9 @@ Config::removeAllAliases()
}
}
-bool
-Config::connect(const String& srcName,
- EDirection srcSide,
- float srcStart, float srcEnd,
- const String& dstName,
- float dstStart, float dstEnd)
+bool Config::connect(const std::string& srcName, EDirection srcSide,
+ float srcStart, float srcEnd, const std::string& dstName,
+ float dstStart, float dstEnd)
{
assert(srcSide >= kFirstDirection && srcSide <= kLastDirection);
@@ -245,8 +236,7 @@ Config::connect(const String& srcName,
return index->second.add(srcEdge, dstEdge);
}
-bool
-Config::disconnect(const String& srcName, EDirection srcSide)
+bool Config::disconnect(const std::string& srcName, EDirection srcSide)
{
assert(srcSide >= kFirstDirection && srcSide <= kLastDirection);
@@ -262,8 +252,7 @@ Config::disconnect(const String& srcName, EDirection srcSide)
return true;
}
-bool
-Config::disconnect(const String& srcName, EDirection srcSide, float position)
+bool Config::disconnect(const std::string& srcName, EDirection srcSide, float position)
{
assert(srcSide >= kFirstDirection && srcSide <= kLastDirection);
@@ -285,8 +274,7 @@ Config::setBarrierAddress(const NetworkAddress& addr)
m_barrierAddress = addr;
}
-bool
-Config::addOption(const String& name, OptionID option, OptionValue value)
+bool Config::addOption(const std::string& name, OptionID option, OptionValue value)
{
// find options
ScreenOptions* options = NULL;
@@ -308,8 +296,7 @@ Config::addOption(const String& name, OptionID option, OptionValue value)
return true;
}
-bool
-Config::removeOption(const String& name, OptionID option)
+bool Config::removeOption(const std::string& name, OptionID option)
{
// find options
ScreenOptions* options = NULL;
@@ -331,8 +318,7 @@ Config::removeOption(const String& name, OptionID option)
return true;
}
-bool
-Config::removeOptions(const String& name)
+bool Config::removeOptions(const std::string& name)
{
// find options
ScreenOptions* options = NULL;
@@ -354,8 +340,7 @@ Config::removeOptions(const String& name)
return true;
}
-bool
-Config::isValidScreenName(const String& name) const
+bool Config::isValidScreenName(const std::string& name) const
{
// name is valid if matches validname
// name ::= [_A-Za-z0-9] | [_A-Za-z0-9][-_A-Za-z0-9]*[_A-Za-z0-9]
@@ -370,7 +355,7 @@ Config::isValidScreenName(const String& name) const
}
// check each dot separated part
- String::size_type b = 0;
+ std::string::size_type b = 0;
for (;;) {
// accept trailing .
if (b == name.size()) {
@@ -378,8 +363,8 @@ Config::isValidScreenName(const String& name) const
}
// find end of part
- String::size_type e = name.find('.', b);
- if (e == String::npos) {
+ std::string::size_type e = name.find('.', b);
+ if (e == std::string::npos) {
e = name.size();
}
@@ -395,7 +380,7 @@ Config::isValidScreenName(const String& name) const
}
// check interior characters
- for (String::size_type i = b; i < e; ++i) {
+ for (std::string::size_type i = b; i < e; ++i) {
if (!isalnum(name[i]) && name[i] != '_' && name[i] != '-') {
return false;
}
@@ -437,40 +422,38 @@ Config::endAll() const
}
bool
-Config::isScreen(const String& name) const
+Config::isScreen(const std::string& name) const
{
return (m_nameToCanonicalName.count(name) > 0);
}
bool
-Config::isCanonicalName(const String& name) const
+Config::isCanonicalName(const std::string& name) const
{
return (!name.empty() &&
CaselessCmp::equal(getCanonicalName(name), name));
}
-String
-Config::getCanonicalName(const String& name) const
+std::string Config::getCanonicalName(const std::string& name) const
{
NameMap::const_iterator index = m_nameToCanonicalName.find(name);
if (index == m_nameToCanonicalName.end()) {
- return String();
+ return std::string();
}
else {
return index->second;
}
}
-String
-Config::getNeighbor(const String& srcName, EDirection srcSide,
- float position, float* positionOut) const
+std::string Config::getNeighbor(const std::string& srcName, EDirection srcSide,
+ float position, float* positionOut) const
{
assert(srcSide >= kFirstDirection && srcSide <= kLastDirection);
// find source cell
CellMap::const_iterator index = m_map.find(getCanonicalName(srcName));
if (index == m_map.end()) {
- return String();
+ return std::string();
}
// find edge
@@ -491,15 +474,13 @@ Config::getNeighbor(const String& srcName, EDirection srcSide,
}
}
-bool
-Config::hasNeighbor(const String& srcName, EDirection srcSide) const
+bool Config::hasNeighbor(const std::string& srcName, EDirection srcSide) const
{
return hasNeighbor(srcName, srcSide, 0.0f, 1.0f);
}
-bool
-Config::hasNeighbor(const String& srcName, EDirection srcSide,
- float start, float end) const
+bool Config::hasNeighbor(const std::string& srcName, EDirection srcSide,
+ float start, float end) const
{
assert(srcSide >= kFirstDirection && srcSide <= kLastDirection);
@@ -512,16 +493,14 @@ Config::hasNeighbor(const String& srcName, EDirection srcSide,
return index->second.overlaps(CellEdge(srcSide, Interval(start, end)));
}
-Config::link_const_iterator
-Config::beginNeighbor(const String& srcName) const
+Config::link_const_iterator Config::beginNeighbor(const std::string& srcName) const
{
CellMap::const_iterator index = m_map.find(getCanonicalName(srcName));
assert(index != m_map.end());
return index->second.begin();
}
-Config::link_const_iterator
-Config::endNeighbor(const String& srcName) const
+Config::link_const_iterator Config::endNeighbor(const std::string& srcName) const
{
CellMap::const_iterator index = m_map.find(getCanonicalName(srcName));
assert(index != m_map.end());
@@ -534,8 +513,7 @@ Config::getBarrierAddress() const
return m_barrierAddress;
}
-const Config::ScreenOptions*
-Config::getOptions(const String& name) const
+const Config::ScreenOptions* Config::getOptions(const std::string& name) const
{
// find options
const ScreenOptions* options = NULL;
@@ -641,8 +619,7 @@ Config::getInputFilter()
return &m_inputFilter;
}
-String
-Config::formatInterval(const Interval& x)
+std::string Config::formatInterval(const Interval& x)
{
if (x.first == 0.0f && x.second == 1.0f) {
return "";
@@ -660,7 +637,7 @@ Config::readSection(ConfigReadContext& s)
static const char s_links[] = "links";
static const char s_aliases[] = "aliases";
- String line;
+ std::string line;
if (!s.readLine(line)) {
// no more sections
return;
@@ -672,13 +649,13 @@ Config::readSection(ConfigReadContext& s)
}
// get section name
- String::size_type i = line.find_first_not_of(" \t", sizeof(s_section) - 1);
- if (i == String::npos) {
+ std::string::size_type i = line.find_first_not_of(" \t", sizeof(s_section) - 1);
+ if (i == std::string::npos) {
throw XConfigRead(s, "section name is missing");
}
- String name = line.substr(i);
+ std::string name = line.substr(i);
i = name.find_first_of(" \t");
- if (i != String::npos) {
+ if (i != std::string::npos) {
throw XConfigRead(s, "unexpected data after section name");
}
@@ -703,7 +680,7 @@ Config::readSection(ConfigReadContext& s)
void
Config::readSectionOptions(ConfigReadContext& s)
{
- String line;
+ std::string line;
while (s.readLine(line)) {
// check for end of section
if (line == "end") {
@@ -714,8 +691,8 @@ Config::readSectionOptions(ConfigReadContext& s)
// nameAndArgs := <name>[(arg[,...])]
// values := valueAndArgs[,valueAndArgs]...
// valueAndArgs := <value>[(arg[,...])]
- String::size_type i = 0;
- String name, value;
+ std::string::size_type i = 0;
+ std::string name, value;
ConfigReadContext::ArgList nameArgs, valueArgs;
s.parseNameWithArgs("name", line, "=", i, name, nameArgs);
++i;
@@ -728,8 +705,7 @@ Config::readSectionOptions(ConfigReadContext& s)
m_barrierAddress.resolve();
}
catch (XSocketAddress& e) {
- throw XConfigRead(s,
- String("invalid address argument ") + e.what());
+ throw XConfigRead(s, std::string("invalid address argument ") + e.what());
}
}
else if (name == "heartbeat") {
@@ -799,7 +775,7 @@ Config::readSectionOptions(ConfigReadContext& s)
if (i < line.length() && line[i] == ';') {
// allow trailing ';'
i = line.find_first_not_of(" \t", i + 1);
- if (i == String::npos) {
+ if (i == std::string::npos) {
i = line.length();
}
else {
@@ -825,9 +801,9 @@ Config::readSectionOptions(ConfigReadContext& s)
void
Config::readSectionScreens(ConfigReadContext& s)
{
- String line;
- String screen;
- while (s.readLine(line)) {
+ std::string line;
+ std::string screen;
+ while (s.readLine(line)) {
// check for end of section
if (line == "end") {
return;
@@ -853,21 +829,21 @@ Config::readSectionScreens(ConfigReadContext& s)
}
else {
// parse argument: `<name>=<value>'
- String::size_type i = line.find_first_of(" \t=");
+ std::string::size_type i = line.find_first_of(" \t=");
if (i == 0) {
throw XConfigRead(s, "missing argument name");
}
- if (i == String::npos) {
+ if (i == std::string::npos) {
throw XConfigRead(s, "missing =");
}
- String name = line.substr(0, i);
+ std::string name = line.substr(0, i);
i = line.find_first_not_of(" \t", i);
- if (i == String::npos || line[i] != '=') {
+ if (i == std::string::npos || line[i] != '=') {
throw XConfigRead(s, "missing =");
}
i = line.find_first_not_of(" \t", i + 1);
- String value;
- if (i != String::npos) {
+ std::string value;
+ if (i != std::string::npos) {
value = line.substr(i);
}
@@ -936,8 +912,8 @@ Config::readSectionScreens(ConfigReadContext& s)
void
Config::readSectionLinks(ConfigReadContext& s)
{
- String line;
- String screen;
+ std::string line;
+ std::string screen;
while (s.readLine(line)) {
// check for end of section
if (line == "end") {
@@ -965,8 +941,8 @@ Config::readSectionLinks(ConfigReadContext& s)
// the stuff in brackets is optional. interval values must be
// in the range [0,100] and start < end. if not given the
// interval is taken to be (0,100).
- String::size_type i = 0;
- String side, dstScreen, srcArgString, dstArgString;
+ std::string::size_type i = 0;
+ std::string side, dstScreen, srcArgString, dstArgString;
ConfigReadContext::ArgList srcArgs, dstArgs;
s.parseNameWithArgs("link", line, "=", i, side, srcArgs);
++i;
@@ -1009,8 +985,8 @@ Config::readSectionLinks(ConfigReadContext& s)
void
Config::readSectionAliases(ConfigReadContext& s)
{
- String line;
- String screen;
+ std::string line;
+ std::string screen;
while (s.readLine(line)) {
// check for end of section
if (line == "end") {
@@ -1049,9 +1025,8 @@ Config::readSectionAliases(ConfigReadContext& s)
}
-InputFilter::Condition*
-Config::parseCondition(ConfigReadContext& s,
- const String& name, const std::vector<String>& args)
+InputFilter::Condition* Config::parseCondition(ConfigReadContext& s, const std::string& name,
+ const std::vector<std::string>& args)
{
if (name == "keystroke") {
if (args.size() != 1) {
@@ -1078,7 +1053,7 @@ Config::parseCondition(ConfigReadContext& s,
throw XConfigRead(s, "syntax for condition: connect([screen])");
}
- String screen = args[0];
+ std::string screen = args[0];
if (isScreen(screen)) {
screen = getCanonicalName(screen);
}
@@ -1092,10 +1067,9 @@ Config::parseCondition(ConfigReadContext& s,
throw XConfigRead(s, "unknown argument \"%{1}\"", name);
}
-void
-Config::parseAction(ConfigReadContext& s,
- const String& name, const std::vector<String>& args,
- InputFilter::Rule& rule, bool activate)
+void Config::parseAction(ConfigReadContext& s, const std::string& name,
+ const std::vector<std::string>& args,
+ InputFilter::Rule& rule, bool activate)
{
InputFilter::Action* action;
@@ -1109,7 +1083,7 @@ Config::parseAction(ConfigReadContext& s,
keyInfo = s.parseKeystroke(args[0]);
}
else {
- std::set<String> screens;
+ std::set<std::string> screens;
parseScreens(s, args[1], screens);
keyInfo = s.parseKeystroke(args[0], screens);
}
@@ -1171,7 +1145,7 @@ Config::parseAction(ConfigReadContext& s,
throw XConfigRead(s, "syntax for action: switchToScreen(name)");
}
- String screen = args[0];
+ std::string screen = args[0];
if (isScreen(screen)) {
screen = getCanonicalName(screen);
}
@@ -1182,6 +1156,10 @@ Config::parseAction(ConfigReadContext& s,
action = new InputFilter::SwitchToScreenAction(m_events, screen);
}
+ else if (name == "toggleScreen") {
+ action = new InputFilter::ToggleScreenAction(m_events);
+ }
+
else if (name == "switchInDirection") {
if (args.size() != 1) {
throw XConfigRead(s, "syntax for action: switchInDirection(<left|right|up|down>)");
@@ -1258,7 +1236,7 @@ Config::parseAction(ConfigReadContext& s,
}
}
- std::set<String> screens;
+ std::set<std::string> screens;
if (args.size() >= 2) {
parseScreens(s, args[1], screens);
}
@@ -1273,22 +1251,21 @@ Config::parseAction(ConfigReadContext& s,
rule.adoptAction(action, activate);
}
-void
-Config::parseScreens(ConfigReadContext& c,
- const String& s, std::set<String>& screens) const
+void Config::parseScreens(ConfigReadContext& c, const std::string& s,
+ std::set<std::string>& screens) const
{
screens.clear();
- String::size_type i = 0;
+ std::string::size_type i = 0;
while (i < s.size()) {
// find end of next screen name
- String::size_type j = s.find(':', i);
- if (j == String::npos) {
+ std::string::size_type j = s.find(':', i);
+ if (j == std::string::npos) {
j = s.size();
}
// extract name
- String rawName;
+ std::string rawName;
i = s.find_first_not_of(" \t", i);
if (i < j) {
rawName = s.substr(i, s.find_last_not_of(" \t", j - 1) - i + 1);
@@ -1299,7 +1276,7 @@ Config::parseScreens(ConfigReadContext& c,
screens.insert("*");
}
else if (!rawName.empty()) {
- String name = getCanonicalName(rawName);
+ std::string name = getCanonicalName(rawName);
if (name.empty()) {
throw XConfigRead(c, "unknown screen name \"%{1}\"", rawName);
}
@@ -1386,8 +1363,7 @@ Config::getOptionName(OptionID id)
return NULL;
}
-String
-Config::getOptionValue(OptionID id, OptionValue value)
+std::string Config::getOptionValue(OptionID id, OptionValue value)
{
if (id == kOptionHalfDuplexCapsLock ||
id == kOptionHalfDuplexNumLock ||
@@ -1463,17 +1439,16 @@ Config::getOptionValue(OptionID id, OptionValue value)
// Config::Name
//
-Config::Name::Name(Config* config, const String& name) :
+Config::Name::Name(Config* config, const std::string& name) :
m_config(config),
m_name(config->getCanonicalName(name))
{
// do nothing
}
-bool
-Config::Name::operator==(const String& name) const
+bool Config::Name::operator==(const std::string& name) const
{
- String canonical = m_config->getCanonicalName(name);
+ std::string canonical = m_config->getCanonicalName(name);
return CaselessCmp::equal(canonical, m_name);
}
@@ -1496,8 +1471,7 @@ Config::CellEdge::CellEdge(EDirection side, const Interval& interval)
init("", side, interval);
}
-Config::CellEdge::CellEdge(const String& name,
- EDirection side, const Interval& interval)
+Config::CellEdge::CellEdge(const std::string& name, EDirection side, const Interval& interval)
{
assert(interval.first >= 0.0f);
assert(interval.second <= 1.0f);
@@ -1511,9 +1485,7 @@ Config::CellEdge::~CellEdge()
// do nothing
}
-void
-Config::CellEdge::init(const String& name, EDirection side,
- const Interval& interval)
+void Config::CellEdge::init(const std::string& name, EDirection side, const Interval& interval)
{
assert(side != kNoDirection);
@@ -1528,14 +1500,12 @@ Config::CellEdge::getInterval() const
return m_interval;
}
-void
-Config::CellEdge::setName(const String& newName)
+void Config::CellEdge::setName(const std::string& newName)
{
m_name = newName;
}
-String
-Config::CellEdge::getName() const
+std::string Config::CellEdge::getName() const
{
return m_name;
}
@@ -1662,8 +1632,7 @@ Config::Cell::remove(const Name& name)
}
}
-void
-Config::Cell::rename(const Name& oldName, const String& newName)
+void Config::Cell::rename(const Name& oldName, const std::string& newName)
{
for (EdgeLinks::iterator j = m_neighbors.begin();
j != m_neighbors.end(); ++j) {
@@ -1789,8 +1758,7 @@ operator<<(std::ostream& s, const Config& config)
option = options->begin();
option != options->end(); ++option) {
const char* name = Config::getOptionName(option->first);
- String value = Config::getOptionValue(option->first,
- option->second);
+ std::string value = Config::getOptionValue(option->first, option->second);
if (name != NULL && !value.empty()) {
s << "\t\t" << name << " = " << value << std::endl;
}
@@ -1800,7 +1768,7 @@ operator<<(std::ostream& s, const Config& config)
s << "end" << std::endl;
// links section
- String neighbor;
+ std::string neighbor;
s << "section: links" << std::endl;
for (Config::const_iterator screen = config.begin();
screen != config.end(); ++screen) {
@@ -1821,8 +1789,7 @@ operator<<(std::ostream& s, const Config& config)
// aliases section (if there are any)
if (config.m_map.size() != config.m_nameToCanonicalName.size()) {
// map canonical to alias
- typedef std::multimap<String, String,
- CaselessCmp> CMNameMap;
+ typedef std::multimap<std::string, std::string, CaselessCmp> CMNameMap;
CMNameMap aliases;
for (Config::NameMap::const_iterator
index = config.m_nameToCanonicalName.begin();
@@ -1834,7 +1801,7 @@ operator<<(std::ostream& s, const Config& config)
}
// dump it
- String screen;
+ std::string screen;
s << "section: aliases" << std::endl;
for (CMNameMap::const_iterator index = aliases.begin();
index != aliases.end(); ++index) {
@@ -1855,8 +1822,7 @@ operator<<(std::ostream& s, const Config& config)
option = options->begin();
option != options->end(); ++option) {
const char* name = Config::getOptionName(option->first);
- String value = Config::getOptionValue(option->first,
- option->second);
+ std::string value = Config::getOptionValue(option->first, option->second);
if (name != NULL && !value.empty()) {
s << "\t" << name << " = " << value << std::endl;
}
@@ -1889,24 +1855,23 @@ ConfigReadContext::~ConfigReadContext()
// do nothing
}
-bool
-ConfigReadContext::readLine(String& line)
+bool ConfigReadContext::readLine(std::string& line)
{
++m_line;
while (std::getline(m_stream, line)) {
// strip leading whitespace
- String::size_type i = line.find_first_not_of(" \t");
- if (i != String::npos) {
- line.erase(0, i);
+ std::string::size_type i = line.find_first_not_of(" \t");
+ if (i != std::string::npos) {
+ line.erase(0, i);
}
// strip comments and then trailing whitespace
i = line.find('#');
- if (i != String::npos) {
+ if (i != std::string::npos) {
line.erase(i);
}
i = line.find_last_not_of(" \r\t");
- if (i != String::npos) {
+ if (i != std::string::npos) {
line.erase(i + 1);
}
@@ -1942,8 +1907,7 @@ ConfigReadContext::operator!() const
return !m_stream;
}
-OptionValue
-ConfigReadContext::parseBoolean(const String& arg) const
+OptionValue ConfigReadContext::parseBoolean(const std::string& arg) const
{
if (CaselessCmp::equal(arg, "true")) {
return static_cast<OptionValue>(true);
@@ -1954,8 +1918,7 @@ ConfigReadContext::parseBoolean(const String& arg) const
throw XConfigRead(*this, "invalid boolean argument \"%{1}\"", arg);
}
-OptionValue
-ConfigReadContext::parseInt(const String& arg) const
+OptionValue ConfigReadContext::parseInt(const std::string& arg) const
{
const char* s = arg.c_str();
char* end;
@@ -1972,8 +1935,7 @@ ConfigReadContext::parseInt(const String& arg) const
return value;
}
-OptionValue
-ConfigReadContext::parseModifierKey(const String& arg) const
+OptionValue ConfigReadContext::parseModifierKey(const std::string& arg) const
{
if (CaselessCmp::equal(arg, "shift")) {
return static_cast<OptionValue>(kKeyModifierIDShift);
@@ -1999,8 +1961,7 @@ ConfigReadContext::parseModifierKey(const String& arg) const
throw XConfigRead(*this, "invalid argument \"%{1}\"", arg);
}
-OptionValue
-ConfigReadContext::parseCorner(const String& arg) const
+OptionValue ConfigReadContext::parseCorner(const std::string& arg) const
{
if (CaselessCmp::equal(arg, "left")) {
return kTopLeftMask | kBottomLeftMask;
@@ -2035,22 +1996,21 @@ ConfigReadContext::parseCorner(const String& arg) const
throw XConfigRead(*this, "invalid argument \"%{1}\"", arg);
}
-OptionValue
-ConfigReadContext::parseCorners(const String& args) const
+OptionValue ConfigReadContext::parseCorners(const std::string& args) const
{
// find first token
- String::size_type i = args.find_first_not_of(" \t", 0);
- if (i == String::npos) {
+ std::string::size_type i = args.find_first_not_of(" \t", 0);
+ if (i == std::string::npos) {
throw XConfigRead(*this, "missing corner argument");
}
- String::size_type j = args.find_first_of(" \t", i);
+ std::string::size_type j = args.find_first_of(" \t", i);
// parse first corner token
OptionValue corners = parseCorner(args.substr(i, j - i));
// get +/-
i = args.find_first_not_of(" \t", j);
- while (i != String::npos) {
+ while (i != std::string::npos) {
// parse +/-
bool add;
if (args[i] == '-') {
@@ -2060,15 +2020,14 @@ ConfigReadContext::parseCorners(const String& args) const
add = true;
}
else {
- throw XConfigRead(*this,
- "invalid corner operator \"%{1}\"",
- String(args.c_str() + i, 1));
+ throw XConfigRead(*this, "invalid corner operator \"%{1}\"",
+ std::string(args.c_str() + i, 1));
}
// get next corner token
i = args.find_first_not_of(" \t", i + 1);
j = args.find_first_of(" \t", i);
- if (i == String::npos) {
+ if (i == std::string::npos) {
throw XConfigRead(*this, "missing corner argument");
}
@@ -2114,21 +2073,19 @@ ConfigReadContext::parseInterval(const ArgList& args) const
return Config::Interval(startValue / 100.0f, endValue / 100.0f);
}
-void
-ConfigReadContext::parseNameWithArgs(
- const String& type, const String& line,
- const String& delim, String::size_type& index,
- String& name, ArgList& args) const
+void ConfigReadContext::parseNameWithArgs(const std::string& type, const std::string& line,
+ const std::string& delim, std::string::size_type& index,
+ std::string& name, ArgList& args) const
{
// skip leading whitespace
- String::size_type i = line.find_first_not_of(" \t", index);
- if (i == String::npos) {
- throw XConfigRead(*this, String("missing ") + type);
+ std::string::size_type i = line.find_first_not_of(" \t", index);
+ if (i == std::string::npos) {
+ throw XConfigRead(*this, std::string("missing ") + type);
}
// find end of name
- String::size_type j = line.find_first_of(" \t(" + delim, i);
- if (j == String::npos) {
+ std::string::size_type j = line.find_first_of(" \t(" + delim, i);
+ if (j == std::string::npos) {
j = line.length();
}
@@ -2137,15 +2094,15 @@ ConfigReadContext::parseNameWithArgs(
args.clear();
// is it okay to not find a delimiter?
- bool needDelim = (!delim.empty() && delim.find('\n') == String::npos);
+ bool needDelim = (!delim.empty() && delim.find('\n') == std::string::npos);
// skip whitespace
i = line.find_first_not_of(" \t", j);
- if (i == String::npos && needDelim) {
+ if (i == std::string::npos && needDelim) {
// expected delimiter but didn't find it
- throw XConfigRead(*this, String("missing ") + delim[0]);
+ throw XConfigRead(*this, std::string("missing ") + delim[0]);
}
- if (i == String::npos) {
+ if (i == std::string::npos) {
// no arguments
index = line.length();
return;
@@ -2161,18 +2118,18 @@ ConfigReadContext::parseNameWithArgs(
// parse arguments
j = line.find_first_of(",)", i);
- while (j != String::npos) {
+ while (j != std::string::npos) {
// extract arg
- String arg(line.substr(i, j - i));
+ std::string arg(line.substr(i, j - i));
i = j;
// trim whitespace
j = arg.find_first_not_of(" \t");
- if (j != String::npos) {
+ if (j != std::string::npos) {
arg.erase(0, j);
}
j = arg.find_last_not_of(" \t");
- if (j != String::npos) {
+ if (j != std::string::npos) {
arg.erase(j + 1);
}
@@ -2192,7 +2149,7 @@ ConfigReadContext::parseNameWithArgs(
}
// verify ')'
- if (j == String::npos) {
+ if (j == std::string::npos) {
// expected )
throw XConfigRead(*this, "missing )");
}
@@ -2202,17 +2159,17 @@ ConfigReadContext::parseNameWithArgs(
// skip whitespace
j = line.find_first_not_of(" \t", i);
- if (j == String::npos && needDelim) {
+ if (j == std::string::npos && needDelim) {
// expected delimiter but didn't find it
- throw XConfigRead(*this, String("missing ") + delim[0]);
+ throw XConfigRead(*this, std::string("missing ") + delim[0]);
}
// verify delimiter
- if (needDelim && delim.find(line[j]) == String::npos) {
- throw XConfigRead(*this, String("expected ") + delim[0]);
+ if (needDelim && delim.find(line[j]) == std::string::npos) {
+ throw XConfigRead(*this, std::string("expected ") + delim[0]);
}
- if (j == String::npos) {
+ if (j == std::string::npos) {
j = line.length();
}
@@ -2220,17 +2177,15 @@ ConfigReadContext::parseNameWithArgs(
return;
}
-IPlatformScreen::KeyInfo*
-ConfigReadContext::parseKeystroke(const String& keystroke) const
+IPlatformScreen::KeyInfo* ConfigReadContext::parseKeystroke(const std::string& keystroke) const
{
- return parseKeystroke(keystroke, std::set<String>());
+ return parseKeystroke(keystroke, std::set<std::string>());
}
-IPlatformScreen::KeyInfo*
-ConfigReadContext::parseKeystroke(const String& keystroke,
- const std::set<String>& screens) const
+IPlatformScreen::KeyInfo* ConfigReadContext::parseKeystroke(const std::string& keystroke,
+ const std::set<std::string>& screens) const
{
- String s = keystroke;
+ std::string s = keystroke;
KeyModifierMask mask;
if (!barrier::KeyMap::parseModifiers(s, mask)) {
@@ -2250,9 +2205,9 @@ ConfigReadContext::parseKeystroke(const String& keystroke,
}
IPlatformScreen::ButtonInfo*
-ConfigReadContext::parseMouse(const String& mouse) const
+ConfigReadContext::parseMouse(const std::string& mouse) const
{
- String s = mouse;
+ std::string s = mouse;
KeyModifierMask mask;
if (!barrier::KeyMap::parseModifiers(s, mask)) {
@@ -2271,10 +2226,9 @@ ConfigReadContext::parseMouse(const String& mouse) const
return IPlatformScreen::ButtonInfo::alloc(button, mask);
}
-KeyModifierMask
-ConfigReadContext::parseModifier(const String& modifiers) const
+KeyModifierMask ConfigReadContext::parseModifier(const std::string& modifiers) const
{
- String s = modifiers;
+ std::string s = modifiers;
KeyModifierMask mask;
if (!barrier::KeyMap::parseModifiers(s, mask)) {
@@ -2288,10 +2242,9 @@ ConfigReadContext::parseModifier(const String& modifiers) const
return mask;
}
-String
-ConfigReadContext::concatArgs(const ArgList& args)
+std::string ConfigReadContext::concatArgs(const ArgList& args)
{
- String s("(");
+ std::string s("(");
for (size_t i = 0; i < args.size(); ++i) {
if (i != 0) {
s += ",";
@@ -2307,29 +2260,27 @@ ConfigReadContext::concatArgs(const ArgList& args)
// Config I/O exceptions
//
-XConfigRead::XConfigRead(const ConfigReadContext& context,
- const String& error) :
+XConfigRead::XConfigRead(const ConfigReadContext& context, const std::string& error) :
m_error(barrier::string::sprintf("line %d: %s",
context.getLineNumber(), error.c_str()))
{
// do nothing
}
-XConfigRead::XConfigRead(const ConfigReadContext& context,
- const char* errorFmt, const String& arg) :
+XConfigRead::XConfigRead(const ConfigReadContext& context, const char* errorFmt,
+ const std::string& arg) :
m_error(barrier::string::sprintf("line %d: ", context.getLineNumber()) +
barrier::string::format(errorFmt, arg.c_str()))
{
// do nothing
}
-XConfigRead::~XConfigRead() _NOEXCEPT
+XConfigRead::~XConfigRead() noexcept
{
// do nothing
}
-String
-XConfigRead::getWhat() const throw()
+std::string XConfigRead::getWhat() const noexcept
{
return format("XConfigRead", "read error: %{1}", m_error.c_str());
}
diff --git a/src/lib/server/Config.h b/src/lib/server/Config.h
index 69b01c4..c459393 100644
--- a/src/lib/server/Config.h
+++ b/src/lib/server/Config.h
@@ -23,7 +23,6 @@
#include "barrier/protocol_types.h"
#include "barrier/IPlatformScreen.h"
#include "net/NetworkAddress.h"
-#include "base/String.h"
#include "base/XBase.h"
#include "common/stdmap.h"
#include "common/stdset.h"
@@ -37,11 +36,11 @@ class IEventQueue;
namespace std {
template <>
struct iterator_traits<Config> {
- typedef String value_type;
+ typedef std::string value_type;
typedef ptrdiff_t difference_type;
typedef bidirectional_iterator_tag iterator_category;
- typedef String* pointer;
- typedef String& reference;
+ typedef std::string* pointer;
+ typedef std::string& reference;
};
};
@@ -64,12 +63,12 @@ public:
public:
CellEdge(EDirection side, float position);
CellEdge(EDirection side, const Interval&);
- CellEdge(const String& name, EDirection side, const Interval&);
+ CellEdge(const std::string& name, EDirection side, const Interval&);
~CellEdge();
Interval getInterval() const;
- void setName(const String& newName);
- String getName() const;
+ void setName(const std::string& newName);
+ std::string getName() const;
EDirection getSide() const;
bool overlaps(const CellEdge&) const;
bool isInside(float x) const;
@@ -88,11 +87,10 @@ public:
bool operator!=(const CellEdge&) const;
private:
- void init(const String& name, EDirection side,
- const Interval&);
+ void init(const std::string& name, EDirection side, const Interval&);
private:
- String m_name;
+ std::string m_name;
EDirection m_side;
Interval m_interval;
};
@@ -100,13 +98,13 @@ public:
private:
class Name {
public:
- Name(Config*, const String& name);
+ Name(Config*, const std::string& name);
- bool operator==(const String& name) const;
+ bool operator==(const std::string& name) const;
private:
Config* m_config;
- String m_name;
+ std::string m_name;
};
class Cell {
@@ -120,7 +118,7 @@ private:
void remove(EDirection side);
void remove(EDirection side, float position);
void remove(const Name& destinationName);
- void rename(const Name& oldName, const String& newName);
+ void rename(const Name& oldName, const std::string& newName);
bool hasEdge(const CellEdge&) const;
bool overlaps(const CellEdge&) const;
@@ -140,8 +138,8 @@ private:
public:
ScreenOptions m_options;
};
- typedef std::map<String, Cell, barrier::string::CaselessCmp> CellMap;
- typedef std::map<String, String, barrier::string::CaselessCmp> NameMap;
+ typedef std::map<std::string, Cell, barrier::string::CaselessCmp> CellMap;
+ typedef std::map<std::string, std::string, barrier::string::CaselessCmp> NameMap;
public:
typedef Cell::const_iterator link_const_iterator;
@@ -156,8 +154,8 @@ public:
m_i = i.m_i;
return *this;
}
- String operator*() { return m_i->first; }
- const String* operator->() { return &(m_i->first); }
+ std::string operator*() { return m_i->first; }
+ const std::string* operator->() { return &(m_i->first); }
const_iterator& operator++() { ++m_i; return *this; }
const_iterator operator++(int) { return const_iterator(m_i++); }
const_iterator& operator--() { --m_i; return *this; }
@@ -188,15 +186,14 @@ public:
Adds a screen, returning true iff successful. If a screen or
alias with the given name exists then it fails.
*/
- bool addScreen(const String& name);
+ bool addScreen(const std::string& name);
//! Rename screen
/*!
Renames a screen. All references to the name are updated.
Returns true iff successful.
*/
- bool renameScreen(const String& oldName,
- const String& newName);
+ bool renameScreen(const std::string& oldName, const std::string& newName);
//! Remove screen
/*!
@@ -204,7 +201,7 @@ public:
disconnects any connections to the screen. \c name may be an
alias.
*/
- void removeScreen(const String& name);
+ void removeScreen(const std::string& name);
//! Remove all screens
/*!
@@ -219,22 +216,21 @@ public:
Returns false if the alias name already exists or the canonical
name is unknown, otherwise returns true.
*/
- bool addAlias(const String& canonical,
- const String& alias);
+ bool addAlias(const std::string& canonical, const std::string& alias);
//! Remove alias
/*!
Removes an alias for a screen name. It returns false if the
alias is unknown or a canonical name, otherwise returns true.
*/
- bool removeAlias(const String& alias);
+ bool removeAlias(const std::string& alias);
//! Remove aliases
/*!
Removes all aliases for a canonical screen name. It returns false
if the canonical name is unknown, otherwise returns true.
*/
- bool removeAliases(const String& canonical);
+ bool removeAliases(const std::string& canonical);
//! Remove all aliases
/*!
@@ -258,19 +254,15 @@ public:
and all of \c srcStart, \c srcEnd, \c dstStart, or \c dstEnd must
be inside the range [0,1].
*/
- bool connect(const String& srcName,
- EDirection srcSide,
- float srcStart, float srcEnd,
- const String& dstName,
- float dstStart, float dstEnd);
+ bool connect(const std::string& srcName, EDirection srcSide, float srcStart, float srcEnd,
+ const std::string& dstName, float dstStart, float dstEnd);
//! Disconnect screens
/*!
Removes all connections created by connect() on side \c srcSide.
Returns false if \c srcName is unknown.
*/
- bool disconnect(const String& srcName,
- EDirection srcSide);
+ bool disconnect(const std::string& srcName, EDirection srcSide);
//! Disconnect screens
/*!
@@ -278,8 +270,7 @@ public:
covering position \c position. Returns false if \c srcName is
unknown.
*/
- bool disconnect(const String& srcName,
- EDirection srcSide, float position);
+ bool disconnect(const std::string& srcName, EDirection srcSide, float position);
//! Set server address
/*!
@@ -294,8 +285,7 @@ public:
existing option's value if there is one. Returns true iff \c name
is a known screen.
*/
- bool addOption(const String& name,
- OptionID option, OptionValue value);
+ bool addOption(const std::string& name, OptionID option, OptionValue value);
//! Remove a screen option
/*!
@@ -303,14 +293,14 @@ public:
nothing if the option doesn't exist on the screen. Returns true
iff \c name is a known screen.
*/
- bool removeOption(const String& name, OptionID option);
+ bool removeOption(const std::string& name, OptionID option);
//! Remove a screen options
/*!
Removes all options and values from the named screen. Returns true
iff \c name is a known screen.
*/
- bool removeOptions(const String& name);
+ bool removeOptions(const std::string& name);
//! Get the hot key input filter
/*!
@@ -328,7 +318,7 @@ public:
/*!
Returns true iff \c name is a valid screen name.
*/
- bool isValidScreenName(const String& name) const;
+ bool isValidScreenName(const std::string& name) const;
//! Get beginning (canonical) screen name iterator
const_iterator begin() const;
@@ -344,20 +334,20 @@ public:
/*!
Returns true iff \c name names a screen.
*/
- virtual bool isScreen(const String& name) const;
+ virtual bool isScreen(const std::string& name) const;
//! Test for canonical screen name
/*!
Returns true iff \c name is the canonical name of a screen.
*/
- bool isCanonicalName(const String& name) const;
+ bool isCanonicalName(const std::string& name) const;
//! Get canonical name
/*!
Returns the canonical name of a screen or the empty string if
the name is unknown. Returns the canonical name if one is given.
*/
- String getCanonicalName(const String& name) const;
+ std::string getCanonicalName(const std::string& name) const;
//! Get neighbor
/*!
@@ -367,7 +357,7 @@ public:
saves the position on the neighbor in \c positionOut if it's not
\c NULL.
*/
- String getNeighbor(const String&, EDirection,
+ std::string getNeighbor(const std::string&, EDirection,
float position, float* positionOut) const;
//! Check for neighbor
@@ -375,20 +365,19 @@ public:
Returns \c true if the screen has a neighbor anywhere along the edge
given by the direction.
*/
- bool hasNeighbor(const String&, EDirection) const;
+ bool hasNeighbor(const std::string&, EDirection) const;
//! Check for neighbor
/*!
Returns \c true if the screen has a neighbor in the given range along
the edge given by the direction.
*/
- bool hasNeighbor(const String&, EDirection,
- float start, float end) const;
+ bool hasNeighbor(const std::string&, EDirection, float start, float end) const;
//! Get beginning neighbor iterator
- link_const_iterator beginNeighbor(const String&) const;
+ link_const_iterator beginNeighbor(const std::string&) const;
//! Get ending neighbor iterator
- link_const_iterator endNeighbor(const String&) const;
+ link_const_iterator endNeighbor(const std::string&) const;
//! Get the server address
const NetworkAddress&
@@ -400,8 +389,7 @@ public:
if the screen is unknown and an empty collection if there are no
options.
*/
- const ScreenOptions*
- getOptions(const String& name) const;
+ const ScreenOptions* getOptions(const std::string& name) const;
//! Check for lock to screen action
/*!
@@ -446,7 +434,7 @@ public:
/*!
Returns an interval as a parseable string.
*/
- static String formatInterval(const Interval&);
+ static std::string formatInterval(const Interval&);
//@}
@@ -457,19 +445,16 @@ private:
void readSectionLinks(ConfigReadContext&);
void readSectionAliases(ConfigReadContext&);
- InputFilter::Condition*
- parseCondition(ConfigReadContext&,
- const String& condition,
- const std::vector<String>& args);
- void parseAction(ConfigReadContext&,
- const String& action,
- const std::vector<String>& args,
- InputFilter::Rule&, bool activate);
-
- void parseScreens(ConfigReadContext&, const String&,
- std::set<String>& screens) const;
+ InputFilter::Condition* parseCondition(ConfigReadContext&, const std::string& condition,
+ const std::vector<std::string>& args);
+
+ void parseAction(ConfigReadContext&, const std::string& action,
+ const std::vector<std::string>& args, InputFilter::Rule&, bool activate);
+
+ void parseScreens(ConfigReadContext&, const std::string&, std::set<std::string>& screens) const;
+
static const char* getOptionName(OptionID);
- static String getOptionValue(OptionID, OptionValue);
+ static std::string getOptionValue(OptionID, OptionValue);
private:
CellMap m_map;
@@ -487,42 +472,41 @@ Maintains a context when reading a configuration from a stream.
*/
class ConfigReadContext {
public:
- typedef std::vector<String> ArgList;
+ typedef std::vector<std::string> ArgList;
ConfigReadContext(std::istream&, SInt32 firstLine = 1);
~ConfigReadContext();
- bool readLine(String&);
+ bool readLine(std::string&);
UInt32 getLineNumber() const;
bool operator!() const;
- OptionValue parseBoolean(const String&) const;
- OptionValue parseInt(const String&) const;
- OptionValue parseModifierKey(const String&) const;
- OptionValue parseCorner(const String&) const;
- OptionValue parseCorners(const String&) const;
- Config::Interval
- parseInterval(const ArgList& args) const;
- void parseNameWithArgs(
- const String& type, const String& line,
- const String& delim, String::size_type& index,
- String& name, ArgList& args) const;
- IPlatformScreen::KeyInfo*
- parseKeystroke(const String& keystroke) const;
- IPlatformScreen::KeyInfo*
- parseKeystroke(const String& keystroke,
- const std::set<String>& screens) const;
- IPlatformScreen::ButtonInfo*
- parseMouse(const String& mouse) const;
- KeyModifierMask parseModifier(const String& modifiers) const;
+ OptionValue parseBoolean(const std::string&) const;
+ OptionValue parseInt(const std::string&) const;
+ OptionValue parseModifierKey(const std::string&) const;
+ OptionValue parseCorner(const std::string&) const;
+ OptionValue parseCorners(const std::string&) const;
+
+ Config::Interval parseInterval(const ArgList& args) const;
+
+ void parseNameWithArgs(const std::string& type, const std::string& line,
+ const std::string& delim, std::string::size_type& index,
+ std::string& name, ArgList& args) const;
+
+ IPlatformScreen::KeyInfo* parseKeystroke(const std::string& keystroke) const;
+ IPlatformScreen::KeyInfo* parseKeystroke(const std::string& keystroke,
+ const std::set<std::string>& screens) const;
+ IPlatformScreen::ButtonInfo* parseMouse(const std::string& mouse) const;
+ KeyModifierMask parseModifier(const std::string& modifiers) const;
+
std::istream& getStream() const { return m_stream; };
private:
// not implemented
ConfigReadContext& operator=(const ConfigReadContext&);
- static String concatArgs(const ArgList& args);
+ static std::string concatArgs(const ArgList& args);
private:
std::istream& m_stream;
@@ -535,15 +519,14 @@ Thrown when a configuration stream cannot be parsed.
*/
class XConfigRead : public XBase {
public:
- XConfigRead(const ConfigReadContext& context, const String&);
- XConfigRead(const ConfigReadContext& context,
- const char* errorFmt, const String& arg);
- virtual ~XConfigRead() _NOEXCEPT;
+ XConfigRead(const ConfigReadContext& context, const std::string&);
+ XConfigRead(const ConfigReadContext& contex, const char* errorFmt, const std::string& arg);
+ virtual ~XConfigRead() noexcept;
protected:
// XBase overrides
- virtual String getWhat() const throw();
+ virtual std::string getWhat() const noexcept;
private:
- String m_error;
+ std::string m_error;
};
diff --git a/src/lib/server/InputFilter.cpp b/src/lib/server/InputFilter.cpp
index 9e73f45..38d9a84 100644
--- a/src/lib/server/InputFilter.cpp
+++ b/src/lib/server/InputFilter.cpp
@@ -95,8 +95,7 @@ InputFilter::KeystrokeCondition::clone() const
return new KeystrokeCondition(m_events, m_key, m_mask);
}
-String
-InputFilter::KeystrokeCondition::format() const
+std::string InputFilter::KeystrokeCondition::format() const
{
return barrier::string::sprintf("keystroke(%s)",
barrier::KeyMap::formatKey(m_key, m_mask).c_str());
@@ -183,10 +182,9 @@ InputFilter::MouseButtonCondition::clone() const
return new MouseButtonCondition(m_events, m_button, m_mask);
}
-String
-InputFilter::MouseButtonCondition::format() const
+std::string InputFilter::MouseButtonCondition::format() const
{
- String key = barrier::KeyMap::formatKey(kKeyNone, m_mask);
+ std::string key = barrier::KeyMap::formatKey(kKeyNone, m_mask);
if (!key.empty()) {
key += "+";
}
@@ -226,8 +224,8 @@ InputFilter::MouseButtonCondition::match(const Event& event)
return status;
}
-InputFilter::ScreenConnectedCondition::ScreenConnectedCondition(
- IEventQueue* events, const String& screen) :
+InputFilter::ScreenConnectedCondition::ScreenConnectedCondition(IEventQueue* events,
+ const std::string& screen) :
m_screen(screen),
m_events(events)
{
@@ -245,8 +243,7 @@ InputFilter::ScreenConnectedCondition::clone() const
return new ScreenConnectedCondition(m_events, m_screen);
}
-String
-InputFilter::ScreenConnectedCondition::format() const
+std::string InputFilter::ScreenConnectedCondition::format() const
{
return barrier::string::sprintf("connect(%s)", m_screen.c_str());
}
@@ -298,8 +295,7 @@ InputFilter::LockCursorToScreenAction::clone() const
return new LockCursorToScreenAction(*this);
}
-String
-InputFilter::LockCursorToScreenAction::format() const
+std::string InputFilter::LockCursorToScreenAction::format() const
{
static const char* s_mode[] = { "off", "on", "toggle" };
@@ -323,16 +319,15 @@ InputFilter::LockCursorToScreenAction::perform(const Event& event)
Event::kDeliverImmediately));
}
-InputFilter::SwitchToScreenAction::SwitchToScreenAction(
- IEventQueue* events, const String& screen) :
+InputFilter::SwitchToScreenAction::SwitchToScreenAction(IEventQueue* events,
+ const std::string& screen) :
m_screen(screen),
m_events(events)
{
// do nothing
}
-String
-InputFilter::SwitchToScreenAction::getScreen() const
+std::string InputFilter::SwitchToScreenAction::getScreen() const
{
return m_screen;
}
@@ -343,8 +338,7 @@ InputFilter::SwitchToScreenAction::clone() const
return new SwitchToScreenAction(*this);
}
-String
-InputFilter::SwitchToScreenAction::format() const
+std::string InputFilter::SwitchToScreenAction::format() const
{
return barrier::string::sprintf("switchToScreen(%s)", m_screen.c_str());
}
@@ -354,7 +348,7 @@ InputFilter::SwitchToScreenAction::perform(const Event& event)
{
// pick screen name. if m_screen is empty then use the screen from
// event if it has one.
- String screen = m_screen;
+ std::string screen = m_screen;
if (screen.empty() && event.getType() == m_events->forServer().connected()) {
Server::ScreenConnectedInfo* info =
static_cast<Server::ScreenConnectedInfo*>(event.getData());
@@ -369,6 +363,32 @@ InputFilter::SwitchToScreenAction::perform(const Event& event)
Event::kDeliverImmediately));
}
+InputFilter::ToggleScreenAction::ToggleScreenAction(IEventQueue* events) :
+ m_events(events)
+{
+ // do nothing
+}
+
+InputFilter::Action*
+InputFilter::ToggleScreenAction::clone() const
+{
+ return new ToggleScreenAction(*this);
+}
+
+String
+InputFilter::ToggleScreenAction::format() const
+{
+ return barrier::string::sprintf("toggleScreen");
+}
+
+void
+InputFilter::ToggleScreenAction::perform(const Event& event)
+{
+ m_events->addEvent(Event(m_events->forServer().toggleScreen(),
+ event.getTarget(), NULL,
+ Event::kDeliverImmediately));
+}
+
InputFilter::SwitchInDirectionAction::SwitchInDirectionAction(
IEventQueue* events, EDirection direction) :
m_direction(direction),
@@ -389,8 +409,7 @@ InputFilter::SwitchInDirectionAction::clone() const
return new SwitchInDirectionAction(*this);
}
-String
-InputFilter::SwitchInDirectionAction::format() const
+std::string InputFilter::SwitchInDirectionAction::format() const
{
static const char* s_names[] = {
"",
@@ -421,10 +440,8 @@ InputFilter::KeyboardBroadcastAction::KeyboardBroadcastAction(
// do nothing
}
-InputFilter::KeyboardBroadcastAction::KeyboardBroadcastAction(
- IEventQueue* events,
- Mode mode,
- const std::set<String>& screens) :
+InputFilter::KeyboardBroadcastAction::KeyboardBroadcastAction(IEventQueue* events, Mode mode,
+ const std::set<std::string>& screens) :
m_mode(mode),
m_screens(IKeyState::KeyInfo::join(screens)),
m_events(events)
@@ -438,10 +455,9 @@ InputFilter::KeyboardBroadcastAction::getMode() const
return m_mode;
}
-std::set<String>
-InputFilter::KeyboardBroadcastAction::getScreens() const
+std::set<std::string> InputFilter::KeyboardBroadcastAction::getScreens() const
{
- std::set<String> screens;
+ std::set<std::string> screens;
IKeyState::KeyInfo::split(m_screens.c_str(), screens);
return screens;
}
@@ -452,8 +468,7 @@ InputFilter::KeyboardBroadcastAction::clone() const
return new KeyboardBroadcastAction(*this);
}
-String
-InputFilter::KeyboardBroadcastAction::format() const
+std::string InputFilter::KeyboardBroadcastAction::format() const
{
static const char* s_mode[] = { "off", "on", "toggle" };
static const char* s_name = "keyboardBroadcast";
@@ -525,8 +540,7 @@ InputFilter::KeystrokeAction::clone() const
return new KeystrokeAction(m_events, info, m_press);
}
-String
-InputFilter::KeystrokeAction::format() const
+std::string InputFilter::KeystrokeAction::format() const
{
const char* type = formatName();
@@ -607,12 +621,11 @@ InputFilter::MouseButtonAction::clone() const
return new MouseButtonAction(m_events, info, m_press);
}
-String
-InputFilter::MouseButtonAction::format() const
+std::string InputFilter::MouseButtonAction::format() const
{
const char* type = formatName();
- String key = barrier::KeyMap::formatKey(kKeyNone, m_buttonInfo->m_mask);
+ std::string key = barrier::KeyMap::formatKey(kKeyNone, m_buttonInfo->m_mask);
return barrier::string::sprintf("%s(%s%s%d)", type,
key.c_str(), key.empty() ? "" : "+",
m_buttonInfo->m_button);
@@ -820,10 +833,9 @@ InputFilter::Rule::handleEvent(const Event& event)
return true;
}
-String
-InputFilter::Rule::format() const
+std::string InputFilter::Rule::format() const
{
- String s;
+ std::string s;
if (m_condition != NULL) {
// condition
s += m_condition->format();
@@ -1019,10 +1031,9 @@ InputFilter::setPrimaryClient(PrimaryClient* client)
}
}
-String
-InputFilter::format(const String& linePrefix) const
+std::string InputFilter::format(const std::string& linePrefix) const
{
- String s;
+ std::string s;
for (RuleList::const_iterator i = m_ruleList.begin();
i != m_ruleList.end(); ++i) {
s += linePrefix;
@@ -1048,7 +1059,7 @@ InputFilter::operator==(const InputFilter& x) const
// compare rule lists. the easiest way to do that is to format each
// rule into a string, sort the strings, then compare the results.
- std::vector<String> aList, bList;
+ std::vector<std::string> aList, bList;
for (RuleList::const_iterator i = m_ruleList.begin();
i != m_ruleList.end(); ++i) {
aList.push_back(i->format());
diff --git a/src/lib/server/InputFilter.h b/src/lib/server/InputFilter.h
index 73afe97..0cb99da 100644
--- a/src/lib/server/InputFilter.h
+++ b/src/lib/server/InputFilter.h
@@ -22,7 +22,6 @@
#include "barrier/mouse_types.h"
#include "barrier/protocol_types.h"
#include "barrier/IPlatformScreen.h"
-#include "base/String.h"
#include "common/stdmap.h"
#include "common/stdset.h"
@@ -47,7 +46,7 @@ public:
virtual ~Condition();
virtual Condition* clone() const = 0;
- virtual String format() const = 0;
+ virtual std::string format() const = 0;
virtual EFilterStatus match(const Event&) = 0;
@@ -67,7 +66,7 @@ public:
// Condition overrides
virtual Condition* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual EFilterStatus match(const Event&);
virtual void enablePrimary(PrimaryClient*);
virtual void disablePrimary(PrimaryClient*);
@@ -91,7 +90,7 @@ public:
// Condition overrides
virtual Condition* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual EFilterStatus match(const Event&);
private:
@@ -103,16 +102,16 @@ public:
// ScreenConnectedCondition
class ScreenConnectedCondition : public Condition {
public:
- ScreenConnectedCondition(IEventQueue* events, const String& screen);
+ ScreenConnectedCondition(IEventQueue* events, const std::string& screen);
virtual ~ScreenConnectedCondition();
// Condition overrides
virtual Condition* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual EFilterStatus match(const Event&);
private:
- String m_screen;
+ std::string m_screen;
IEventQueue* m_events;
};
@@ -126,7 +125,7 @@ public:
virtual ~Action();
virtual Action* clone() const = 0;
- virtual String format() const = 0;
+ virtual std::string format() const = 0;
virtual void perform(const Event&) = 0;
};
@@ -142,7 +141,7 @@ public:
// Action overrides
virtual Action* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual void perform(const Event&);
private:
@@ -153,20 +152,34 @@ public:
// SwitchToScreenAction
class SwitchToScreenAction : public Action {
public:
- SwitchToScreenAction(IEventQueue* events, const String& screen);
+ SwitchToScreenAction(IEventQueue* events, const std::string& screen);
- String getScreen() const;
+ std::string getScreen() const;
// Action overrides
virtual Action* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual void perform(const Event&);
private:
- String m_screen;
+ std::string m_screen;
IEventQueue* m_events;
};
+ // ToggleScreenAction
+ class ToggleScreenAction : public Action {
+ public:
+ ToggleScreenAction(IEventQueue* events);
+
+ // Action overrides
+ virtual Action* clone() const;
+ virtual String format() const;
+ virtual void perform(const Event&);
+
+ private:
+ IEventQueue* m_events;
+ };
+
// SwitchInDirectionAction
class SwitchInDirectionAction : public Action {
public:
@@ -176,7 +189,7 @@ public:
// Action overrides
virtual Action* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual void perform(const Event&);
private:
@@ -190,19 +203,19 @@ public:
enum Mode { kOff, kOn, kToggle };
KeyboardBroadcastAction(IEventQueue* events, Mode = kToggle);
- KeyboardBroadcastAction(IEventQueue* events, Mode, const std::set<String>& screens);
+ KeyboardBroadcastAction(IEventQueue* events, Mode, const std::set<std::string>& screens);
Mode getMode() const;
- std::set<String> getScreens() const;
+ std::set<std::string> getScreens() const;
// Action overrides
virtual Action* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual void perform(const Event&);
private:
Mode m_mode;
- String m_screens;
+ std::string m_screens;
IEventQueue* m_events;
};
@@ -219,7 +232,7 @@ public:
// Action overrides
virtual Action* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual void perform(const Event&);
protected:
@@ -245,7 +258,7 @@ public:
// Action overrides
virtual Action* clone() const;
- virtual String format() const;
+ virtual std::string format() const;
virtual void perform(const Event&);
protected:
@@ -287,7 +300,7 @@ public:
bool handleEvent(const Event&);
// convert rule to a string
- String format() const;
+ std::string format() const;
// get the rule's condition
const Condition*
@@ -340,7 +353,7 @@ public:
virtual void setPrimaryClient(PrimaryClient* client);
// convert rules to a string
- String format(const String& linePrefix) const;
+ std::string format(const std::string& linePrefix) const;
// get number of rules
UInt32 getNumRules() const;
diff --git a/src/lib/server/PrimaryClient.cpp b/src/lib/server/PrimaryClient.cpp
index 4c9fe50..04ae86c 100644
--- a/src/lib/server/PrimaryClient.cpp
+++ b/src/lib/server/PrimaryClient.cpp
@@ -26,7 +26,7 @@
// PrimaryClient
//
-PrimaryClient::PrimaryClient(const String& name, barrier::Screen* screen) :
+PrimaryClient::PrimaryClient(const std::string& name, barrier::Screen* screen) :
BaseClientProxy(name),
m_screen(screen),
m_fakeInputCount(0)
diff --git a/src/lib/server/PrimaryClient.h b/src/lib/server/PrimaryClient.h
index 4296aaa..68b91e3 100644
--- a/src/lib/server/PrimaryClient.h
+++ b/src/lib/server/PrimaryClient.h
@@ -34,7 +34,7 @@ public:
/*!
\c name is the name of the server and \p screen is primary screen.
*/
- PrimaryClient(const String& name, barrier::Screen* screen);
+ PrimaryClient(const std::string& name, barrier::Screen* screen);
~PrimaryClient();
#ifdef TEST_ENV
diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp
index 12aedd0..334049c 100644
--- a/src/lib/server/Server.cpp
+++ b/src/lib/server/Server.cpp
@@ -43,14 +43,13 @@
#include "base/IEventQueue.h"
#include "base/Log.h"
#include "base/TMethodEventJob.h"
-#include "common/stdexcept.h"
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <ctime>
-
+#include <stdexcept>
//
// Server
//
@@ -101,7 +100,7 @@ Server::Server(
assert(config.isScreen(primaryClient->getName()));
assert(m_screen != NULL);
- String primaryName = getName(primaryClient);
+ std::string primaryName = getName(primaryClient);
// clear clipboards
for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
@@ -163,6 +162,10 @@ Server::Server(
m_inputFilter,
new TMethodEventJob<Server>(this,
&Server::handleSwitchToScreenEvent));
+ m_events->adoptHandler(m_events->forServer().toggleScreen(),
+ m_inputFilter,
+ new TMethodEventJob<Server>(this,
+ &Server::handleToggleScreenEvent));
m_events->adoptHandler(m_events->forServer().switchInDirection(),
m_inputFilter,
new TMethodEventJob<Server>(this,
@@ -370,7 +373,7 @@ Server::getNumClients() const
}
void
-Server::getClients(std::vector<String>& list) const
+Server::getClients(std::vector<std::string>& list) const
{
list.clear();
for (ClientList::const_iterator index = m_clients.begin();
@@ -379,10 +382,9 @@ Server::getClients(std::vector<String>& list) const
}
}
-String
-Server::getName(const BaseClientProxy* client) const
+std::string Server::getName(const BaseClientProxy* client) const
{
- String name = m_config->getCanonicalName(client->getName());
+ std::string name = m_config->getCanonicalName(client->getName());
if (name.empty()) {
name = client->getName();
}
@@ -600,7 +602,7 @@ Server::getNeighbor(BaseClientProxy* src,
assert(src != NULL);
// get source screen name
- String srcName = getName(src);
+ std::string srcName = getName(src);
assert(!srcName.empty());
LOG((CLOG_DEBUG2 "find neighbor on %s of \"%s\"", Config::dirName(dir), srcName.c_str()));
@@ -610,7 +612,7 @@ Server::getNeighbor(BaseClientProxy* src,
// search for the closest neighbor that exists in direction dir
float tTmp;
for (;;) {
- String dstName(m_config->getNeighbor(srcName, dir, t, &tTmp));
+ std::string dstName(m_config->getNeighbor(srcName, dir, t, &tTmp));
// if nothing in that direction then return NULL. if the
// destination is the source then we can make no more
@@ -755,7 +757,7 @@ Server::avoidJumpZone(BaseClientProxy* dst,
return;
}
- const String dstName(getName(dst));
+ const std::string dstName(getName(dst));
SInt32 dx, dy, dw, dh;
dst->getShape(dx, dy, dw, dh);
float t = mapToFraction(dst, dir, x, y);
@@ -1408,6 +1410,24 @@ Server::handleSwitchToScreenEvent(const Event& event, void*)
}
void
+Server::handleToggleScreenEvent(const Event& event, void*)
+{
+ std::string current = getName(m_active);
+ ClientList::const_iterator index = m_clients.find(current);
+ if (index == m_clients.end()) {
+ LOG((CLOG_DEBUG1 "screen \"%s\" not active", current.c_str()));
+ }
+ else {
+ ++index;
+ if (index == m_clients.end()) {
+ index = m_clients.begin();
+ }
+ jumpToScreen(index->second);
+ }
+}
+
+
+void
Server::handleSwitchInDirectionEvent(const Event& event, void*)
{
SwitchInDirectionInfo* info =
@@ -1533,7 +1553,7 @@ Server::onClipboardChanged(BaseClientProxy* sender,
sender->getClipboard(id, &clipboard.m_clipboard);
// ignore if data hasn't changed
- String data = clipboard.m_clipboard.marshall();
+ std::string data = clipboard.m_clipboard.marshall();
if (data == clipboard.m_clipboardData) {
LOG((CLOG_DEBUG "ignored screen \"%s\" update of clipboard %d (unchanged)", clipboard.m_clipboardOwner.c_str(), id));
return;
@@ -1703,7 +1723,7 @@ Server::onMouseUp(ButtonID id)
if (m_args.m_enableDragDrop) {
if (!m_screen->isOnScreen()) {
- String& file = m_screen->getDraggingFilename();
+ std::string& file = m_screen->getDraggingFilename();
if (!file.empty()) {
sendFileToClient(file.c_str());
}
@@ -1829,7 +1849,7 @@ Server::sendDragInfoThread(void* arg)
BaseClientProxy* newScreen = static_cast<BaseClientProxy*>(arg);
m_dragFileList.clear();
- String& dragFileList = m_screen->getDraggingFilename();
+ std::string& dragFileList = m_screen->getDraggingFilename();
if (!dragFileList.empty()) {
DragInformation di;
di.setFilename(dragFileList);
@@ -1856,7 +1876,7 @@ Server::sendDragInfoThread(void* arg)
void
Server::sendDragInfo(BaseClientProxy* newScreen)
{
- String infoString;
+ std::string infoString;
UInt32 fileCount = DragInformation::setupDragInfo(m_dragFileList, infoString);
if (fileCount > 0) {
@@ -2089,7 +2109,7 @@ Server::writeToDropDirThread(void*)
bool
Server::addClient(BaseClientProxy* client)
{
- String name = getName(client);
+ std::string name = getName(client);
if (m_clients.count(name) != 0) {
return false;
}
@@ -2313,7 +2333,7 @@ Server::LockCursorToScreenInfo::alloc(State state)
//
Server::SwitchToScreenInfo*
-Server::SwitchToScreenInfo::alloc(const String& screen)
+Server::SwitchToScreenInfo::alloc(const std::string& screen)
{
SwitchToScreenInfo* info =
(SwitchToScreenInfo*)malloc(sizeof(SwitchToScreenInfo) +
@@ -2351,7 +2371,7 @@ Server::KeyboardBroadcastInfo::alloc(State state)
}
Server::KeyboardBroadcastInfo*
-Server::KeyboardBroadcastInfo::alloc(State state, const String& screens)
+Server::KeyboardBroadcastInfo::alloc(State state, const std::string& screens)
{
KeyboardBroadcastInfo* info =
(KeyboardBroadcastInfo*)malloc(sizeof(KeyboardBroadcastInfo) +
@@ -2396,7 +2416,7 @@ Server::sendFileThread(void* data)
}
void
-Server::dragInfoReceived(UInt32 fileNum, String content)
+Server::dragInfoReceived(UInt32 fileNum, std::string content)
{
if (!m_args.m_enableDragDrop) {
LOG((CLOG_DEBUG "drag drop not enabled, ignoring drag info."));
diff --git a/src/lib/server/Server.h b/src/lib/server/Server.h
index 609af21..bfd0a7d 100644
--- a/src/lib/server/Server.h
+++ b/src/lib/server/Server.h
@@ -62,7 +62,7 @@ public:
//! Switch to screen data
class SwitchToScreenInfo {
public:
- static SwitchToScreenInfo* alloc(const String& screen);
+ static SwitchToScreenInfo* alloc(const std::string& screen);
public:
// this is a C-string; this type is a variable size structure
@@ -81,10 +81,10 @@ public:
//! Screen connected data
class ScreenConnectedInfo {
public:
- ScreenConnectedInfo(String screen) : m_screen(screen) { }
+ ScreenConnectedInfo(std::string screen) : m_screen(screen) { }
public:
- String m_screen; // was char[1]
+ std::string m_screen;
};
//! Keyboard broadcast data
@@ -94,7 +94,7 @@ public:
static KeyboardBroadcastInfo* alloc(State state = kToggle);
static KeyboardBroadcastInfo* alloc(State state,
- const String& screens);
+ const std::string& screens);
public:
State m_state;
@@ -146,7 +146,7 @@ public:
void sendFileToClient(const char* filename);
//! Received dragging information from client
- void dragInfoReceived(UInt32 fileNum, String content);
+ void dragInfoReceived(UInt32 fileNum, std::string content);
//! Store ClientListener pointer
void setListener(ClientListener* p) { m_clientListener = p; }
@@ -165,7 +165,7 @@ public:
/*!
Set the \c list to the names of the currently connected clients.
*/
- void getClients(std::vector<String>& list) const;
+ void getClients(std::vector<std::string>& list) const;
//! Return true if recieved file size is valid
bool isReceivedFileSizeValid();
@@ -174,7 +174,7 @@ public:
size_t& getExpectedFileSize() { return m_expectedFileSize; }
//! Return received file data
- String& getReceivedFileData() { return m_receivedFileData; }
+ std::string& getReceivedFileData() { return m_receivedFileData; }
//! Return fake drag file list
DragFileList getFakeDragFileList() { return m_fakeDragFileList; }
@@ -183,7 +183,7 @@ public:
private:
// get canonical name of client
- String getName(const BaseClientProxy*) const;
+ std::string getName(const BaseClientProxy*) const;
// get the sides of the primary screen that have neighbors
UInt32 getActivePrimarySides() const;
@@ -308,6 +308,7 @@ private:
void handleClientDisconnected(const Event&, void*);
void handleClientCloseTimeout(const Event&, void*);
void handleSwitchToScreenEvent(const Event&, void*);
+ void handleToggleScreenEvent(const Event&, void*);
void handleSwitchInDirectionEvent(const Event&, void*);
void handleKeyboardBroadcastEvent(const Event&,void*);
void handleLockCursorToScreenEvent(const Event&, void*);
@@ -378,8 +379,8 @@ private:
public:
Clipboard m_clipboard;
- String m_clipboardData;
- String m_clipboardOwner;
+ std::string m_clipboardData;
+ std::string m_clipboardOwner;
UInt32 m_clipboardSeqNum;
};
@@ -387,7 +388,7 @@ private:
PrimaryClient* m_primaryClient;
// all clients (including the primary client) indexed by name
- typedef std::map<String, BaseClientProxy*> ClientList;
+ typedef std::map<std::string, BaseClientProxy*> ClientList;
typedef std::set<BaseClientProxy*> ClientSet;
ClientList m_clients;
ClientSet m_clientSet;
@@ -454,7 +455,7 @@ private:
// flag whether or not we have broadcasting enabled and the screens to
// which we should send broadcasted keys.
bool m_keyboardBroadcasting;
- String m_keyboardBroadcastingScreens;
+ std::string m_keyboardBroadcastingScreens;
// screen locking (former scroll lock)
bool m_lockedToScreen;
@@ -466,12 +467,12 @@ private:
// file transfer
size_t m_expectedFileSize;
- String m_receivedFileData;
+ std::string m_receivedFileData;
DragFileList m_dragFileList;
DragFileList m_fakeDragFileList;
Thread* m_sendFileThread;
Thread* m_writeToDropDirThread;
- String m_dragFileExt;
+ std::string m_dragFileExt;
bool m_ignoreFileTransfer;
bool m_enableClipboard;
diff --git a/src/test/global/TestEventQueue.cpp b/src/test/global/TestEventQueue.cpp
index d202922..4dd01e7 100644
--- a/src/test/global/TestEventQueue.cpp
+++ b/src/test/global/TestEventQueue.cpp
@@ -20,7 +20,7 @@
#include "base/Log.h"
#include "base/TMethodEventJob.h"
#include "base/SimpleEventQueueBuffer.h"
-#include "common/stdexcept.h"
+#include <stdexcept>
void
TestEventQueue::raiseQuitEvent()
diff --git a/src/test/global/TestEventQueue.h b/src/test/global/TestEventQueue.h
index a6cf0ca..b932508 100644
--- a/src/test/global/TestEventQueue.h
+++ b/src/test/global/TestEventQueue.h
@@ -19,7 +19,7 @@
#include "base/EventQueue.h"
-class EventQueueTimer;
+class EventQueueTimer {};
class TestEventQueue : public EventQueue {
public:
diff --git a/src/test/integtests/CMakeLists.txt b/src/test/integtests/CMakeLists.txt
index a412ecc..0460d8d 100644
--- a/src/test/integtests/CMakeLists.txt
+++ b/src/test/integtests/CMakeLists.txt
@@ -14,24 +14,37 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-file(GLOB_RECURSE headers "*.h")
-file(GLOB_RECURSE sources "*.cpp")
-
-# remove platform files (specific platform added later).
-file(GLOB_RECURSE remove_platform "platform/*")
-list(REMOVE_ITEM headers ${remove_platform})
-list(REMOVE_ITEM sources ${remove_platform})
+set(headers
+)
+set(sources
+ arch/ArchInternetTests.cpp
+ ipc/IpcTests.cpp
+ net/NetworkTests.cpp
+ Main.cpp
+)
# platform
if (WIN32)
- file(GLOB platform_sources "platform/MSWindows*.cpp")
- file(GLOB platform_headers "platform/MSWindows*.h")
+ set(platform_sources
+ platform/MSWindowsClipboardTests.cpp
+ platform/MSWindowsKeyStateTests.cpp
+ )
+ set(platform_headers)
elseif (APPLE)
- file(GLOB platform_sources "platform/OSX*.cpp")
- file(GLOB platform_headers "platform/OSX*.h")
+ set(platform_sources
+ platform/OSXClipboardTests.cpp
+ platform/OSXKeyStateTests.cpp
+ platform/OSXScreenTests.cpp
+ )
+ set(platform_headers)
elseif (UNIX)
- file(GLOB platform_sources "platform/XWindows*.cpp")
- file(GLOB platform_headers "platform/XWindows*.h")
+ set(platform_sources
+ platform/XWindowsClipboardTests.cpp
+ platform/XWindowsKeyStateTests.cpp
+ platform/XWindowsScreenSaverTests.cpp
+ platform/XWindowsScreenTests.cpp
+ )
+ set(platform_headers)
endif()
list(APPEND sources ${platform_sources})
@@ -55,7 +68,6 @@ endif()
include_directories(
../../
- ../../lib/
../../../ext/gtest/include
../../../ext/gmock/include
)
@@ -68,4 +80,4 @@ endif()
add_executable(integtests ${sources})
target_link_libraries(integtests
- arch base client common io ipc mt net platform server barrier gtest gmock ${libs} ${OPENSSL_LIBS})
+ arch base client common io ipc mt net platform server synlib gtest gmock ${libs} ${OPENSSL_LIBS})
diff --git a/src/test/integtests/arch/ArchInternetTests.cpp b/src/test/integtests/arch/ArchInternetTests.cpp
index 722df2f..a384c64 100644
--- a/src/test/integtests/arch/ArchInternetTests.cpp
+++ b/src/test/integtests/arch/ArchInternetTests.cpp
@@ -22,16 +22,16 @@
#define TEST_URL "https://symless.com/tests/?testString"
//#define TEST_URL "http://localhost/barrier/tests/?testString"
-TEST(ArchInternetTests, get)
+TEST(ArchInternetTests, DISABLED_get)
{
ARCH_INTERNET internet;
- String result = internet.get(TEST_URL);
+ std::string result = internet.get(TEST_URL);
ASSERT_EQ("Hello world!", result);
}
TEST(ArchInternetTests, urlEncode)
{
ARCH_INTERNET internet;
- String result = internet.urlEncode("hello=+&world");
+ std::string result = internet.urlEncode("hello=+&world");
ASSERT_EQ("hello%3D%2B%26world", result);
}
diff --git a/src/test/integtests/net/NetworkTests.cpp b/src/test/integtests/net/NetworkTests.cpp
index 4a9a9f0..d404abc 100644
--- a/src/test/integtests/net/NetworkTests.cpp
+++ b/src/test/integtests/net/NetworkTests.cpp
@@ -38,7 +38,7 @@
#include "base/TMethodEventJob.h"
#include "base/TMethodJob.h"
#include "base/Log.h"
-#include "common/stdexcept.h"
+#include <stdexcept>
#include "test/global/gtest.h"
#include <sstream>
diff --git a/src/test/integtests/platform/MSWindowsKeyStateTests.cpp b/src/test/integtests/platform/MSWindowsKeyStateTests.cpp
index f3f9e32..9373d14 100644
--- a/src/test/integtests/platform/MSWindowsKeyStateTests.cpp
+++ b/src/test/integtests/platform/MSWindowsKeyStateTests.cpp
@@ -40,7 +40,6 @@ class MSWindowsKeyStateTests : public ::testing::Test
protected:
virtual void SetUp()
{
- m_hook.loadLibrary();
m_screensaver = new MSWindowsScreenSaver();
}
diff --git a/src/test/integtests/platform/XWindowsKeyStateTests.cpp b/src/test/integtests/platform/XWindowsKeyStateTests.cpp
index ea8ce44..9f6716d 100644
--- a/src/test/integtests/platform/XWindowsKeyStateTests.cpp
+++ b/src/test/integtests/platform/XWindowsKeyStateTests.cpp
@@ -76,8 +76,7 @@ TEST_F(XWindowsKeyStateTests, setActiveGroup_pollAndSet_groupIsZero)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
keyState.setActiveGroup(XWindowsKeyState::kGroupPollAndSet);
@@ -88,8 +87,7 @@ TEST_F(XWindowsKeyStateTests, setActiveGroup_poll_groupIsNotSet)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
keyState.setActiveGroup(XWindowsKeyState::kGroupPoll);
@@ -100,8 +98,7 @@ TEST_F(XWindowsKeyStateTests, setActiveGroup_customGroup_groupWasSet)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
keyState.setActiveGroup(1);
@@ -112,8 +109,7 @@ TEST_F(XWindowsKeyStateTests, mapModifiersFromX_zeroState_zeroMask)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
int mask = keyState.mapModifiersFromX(0);
@@ -124,8 +120,7 @@ TEST_F(XWindowsKeyStateTests, mapModifiersToX_zeroMask_resultIsTrue)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
unsigned int modifiers = 0;
bool result = keyState.mapModifiersToX(0, modifiers);
@@ -137,8 +132,7 @@ TEST_F(XWindowsKeyStateTests, fakeCtrlAltDel_default_returnsFalse)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
bool result = keyState.fakeCtrlAltDel();
@@ -149,21 +143,18 @@ TEST_F(XWindowsKeyStateTests, pollActiveModifiers_defaultState_returnsZero)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
KeyModifierMask actual = keyState.pollActiveModifiers();
ASSERT_EQ(0, actual);
}
-#if 0 // TODO: fix, causes sigsegv
TEST_F(XWindowsKeyStateTests, pollActiveModifiers_shiftKeyDownThenUp_masksAreCorrect)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
// set mock modifier mapping
std::fill(keyState.modifierFromX().begin(), keyState.modifierFromX().end(), 0);
@@ -189,14 +180,12 @@ TEST_F(XWindowsKeyStateTests, pollActiveModifiers_shiftKeyDownThenUp_masksAreCor
EXPECT_TRUE((modUp & KeyModifierShift) == 0)
<< "shift key still in mask - make sure no keys are being held down";
}
-#endif
TEST_F(XWindowsKeyStateTests, pollActiveGroup_defaultState_returnsZero)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
SInt32 actual = keyState.pollActiveGroup();
@@ -207,8 +196,7 @@ TEST_F(XWindowsKeyStateTests, pollActiveGroup_positiveGroup_returnsGroup)
{
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
keyState.group(3);
@@ -222,8 +210,7 @@ TEST_F(XWindowsKeyStateTests, pollActiveGroup_xkb_areEqual)
#if HAVE_XKB_EXTENSION
MockKeyMap keyMap;
MockEventQueue eventQueue;
- XWindowsKeyState keyState(
- m_display, true, &eventQueue, keyMap);
+ XWindowsKeyState keyState(new XWindowsImpl(), m_display, true, &eventQueue, keyMap);
// reset the group
keyState.group(-1);
diff --git a/src/test/integtests/platform/XWindowsScreenTests.cpp b/src/test/integtests/platform/XWindowsScreenTests.cpp
index b74599c..d8f75e1 100644
--- a/src/test/integtests/platform/XWindowsScreenTests.cpp
+++ b/src/test/integtests/platform/XWindowsScreenTests.cpp
@@ -29,12 +29,11 @@ TEST(CXWindowsScreenTests, fakeMouseMove_nonPrimary_getCursorPosValuesCorrect)
EXPECT_CALL(eventQueue, adoptHandler(_, _, _)).Times(2);
EXPECT_CALL(eventQueue, adoptBuffer(_)).Times(2);
EXPECT_CALL(eventQueue, removeHandler(_, _)).Times(2);
- XWindowsScreen screen(
- ":0.0", false, false, 0, &eventQueue);
+ XWindowsScreen screen(new XWindowsImpl(), ":0.0", false, false, 0, &eventQueue);
screen.fakeMouseMove(10, 20);
- int x, y;
+ SInt32 x, y;
screen.getCursorPos(x, y);
ASSERT_EQ(10, x);
ASSERT_EQ(20, y);
diff --git a/src/test/mock/barrier/MockEventQueue.h b/src/test/mock/barrier/MockEventQueue.h
index f273736..735b9fc 100644
--- a/src/test/mock/barrier/MockEventQueue.h
+++ b/src/test/mock/barrier/MockEventQueue.h
@@ -41,7 +41,7 @@ public:
MOCK_METHOD1(dispatchEvent, bool(const Event&));
MOCK_CONST_METHOD2(getHandler, IEventJob*(Event::Type, void*));
MOCK_METHOD1(deleteTimer, void(EventQueueTimer*));
- MOCK_CONST_METHOD1(getRegisteredType, Event::Type(const String&));
+ MOCK_CONST_METHOD1(getRegisteredType, Event::Type(const std::string&));
MOCK_METHOD0(getSystemTarget, void*());
MOCK_METHOD0(forClient, ClientEvents&());
MOCK_METHOD0(forIStream, IStreamEvents&());
diff --git a/src/test/unittests/CMakeLists.txt b/src/test/unittests/CMakeLists.txt
index 3d21a2b..c46375c 100644
--- a/src/test/unittests/CMakeLists.txt
+++ b/src/test/unittests/CMakeLists.txt
@@ -50,7 +50,6 @@ list(APPEND headers ${platform_sources})
include_directories(
../../
- ../../lib/
../../../ext/gtest/include
../../../ext/gmock/include
../../../ext
@@ -68,4 +67,4 @@ endif()
add_executable(unittests ${sources})
target_link_libraries(unittests
- arch base client server common io net platform server barrier mt ipc gtest gmock ${libs} ${OPENSSL_LIBS})
+ arch base client server common io net platform server synlib mt ipc gtest gmock ${libs} ${OPENSSL_LIBS})
diff --git a/src/test/unittests/barrier/ClipboardChunkTests.cpp b/src/test/unittests/barrier/ClipboardChunkTests.cpp
index 9dc4a5e..e0e37be 100644
--- a/src/test/unittests/barrier/ClipboardChunkTests.cpp
+++ b/src/test/unittests/barrier/ClipboardChunkTests.cpp
@@ -22,7 +22,6 @@
TEST(ClipboardChunkTests, start_formatStartChunk)
{
-<<<<<<< HEAD
ClipboardID id = 0;
UInt32 sequence = 0;
String mockDataSize("10");
@@ -34,28 +33,12 @@ TEST(ClipboardChunkTests, start_formatStartChunk)
EXPECT_EQ('1', chunk->m_chunk[6]);
EXPECT_EQ('0', chunk->m_chunk[7]);
EXPECT_EQ('\0', chunk->m_chunk[8]);
-=======
- ClipboardID id = 0;
- UInt32 sequence = 0;
- String mockDataSize("10");
- ClipboardChunk* chunk = ClipboardChunk::start(id, sequence, mockDataSize);
- UInt32 temp_m_chunk;
- memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4);
-
- EXPECT_EQ(id, chunk->m_chunk[0]);
- EXPECT_EQ(sequence, temp_m_chunk);
- EXPECT_EQ(kDataStart, chunk->m_chunk[5]);
- EXPECT_EQ('1', chunk->m_chunk[6]);
- EXPECT_EQ('0', chunk->m_chunk[7]);
- EXPECT_EQ('\0', chunk->m_chunk[8]);
->>>>>>> master
delete chunk;
}
TEST(ClipboardChunkTests, data_formatDataChunk)
{
-<<<<<<< HEAD
ClipboardID id = 0;
UInt32 sequence = 1;
String mockData("mock data");
@@ -74,35 +57,12 @@ TEST(ClipboardChunkTests, data_formatDataChunk)
EXPECT_EQ('t', chunk->m_chunk[13]);
EXPECT_EQ('a', chunk->m_chunk[14]);
EXPECT_EQ('\0', chunk->m_chunk[15]);
-=======
- ClipboardID id = 0;
- UInt32 sequence = 1;
- String mockData("mock data");
- ClipboardChunk* chunk = ClipboardChunk::data(id, sequence, mockData);
- UInt32 temp_m_chunk;
- memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4);
-
- EXPECT_EQ(id, chunk->m_chunk[0]);
- EXPECT_EQ(sequence, temp_m_chunk);
- EXPECT_EQ(kDataChunk, chunk->m_chunk[5]);
- EXPECT_EQ('m', chunk->m_chunk[6]);
- EXPECT_EQ('o', chunk->m_chunk[7]);
- EXPECT_EQ('c', chunk->m_chunk[8]);
- EXPECT_EQ('k', chunk->m_chunk[9]);
- EXPECT_EQ(' ', chunk->m_chunk[10]);
- EXPECT_EQ('d', chunk->m_chunk[11]);
- EXPECT_EQ('a', chunk->m_chunk[12]);
- EXPECT_EQ('t', chunk->m_chunk[13]);
- EXPECT_EQ('a', chunk->m_chunk[14]);
- EXPECT_EQ('\0', chunk->m_chunk[15]);
->>>>>>> master
delete chunk;
}
TEST(ClipboardChunkTests, end_formatDataChunk)
{
-<<<<<<< HEAD
ClipboardID id = 1;
UInt32 sequence = 1;
ClipboardChunk* chunk = ClipboardChunk::end(id, sequence);
@@ -111,18 +71,6 @@ TEST(ClipboardChunkTests, end_formatDataChunk)
EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]);
EXPECT_EQ(kDataEnd, chunk->m_chunk[5]);
EXPECT_EQ('\0', chunk->m_chunk[6]);
-=======
- ClipboardID id = 1;
- UInt32 sequence = 1;
- ClipboardChunk* chunk = ClipboardChunk::end(id, sequence);
- UInt32 temp_m_chunk;
- memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4);
-
- EXPECT_EQ(id, chunk->m_chunk[0]);
- EXPECT_EQ(sequence, temp_m_chunk);
- EXPECT_EQ(kDataEnd, chunk->m_chunk[5]);
- EXPECT_EQ('\0', chunk->m_chunk[6]);
->>>>>>> master
delete chunk;
}