diff --git a/.cproject b/.cproject
deleted file mode 100644
index cabfcaba..00000000
--- a/.cproject
+++ /dev/null
@@ -1,2327 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/opt/local/bin/gmake
-
-rebuild_cache
-true
-false
-
-
-/opt/local/bin/gmake
-
-synergy
-true
-false
-
-
-/opt/local/bin/gmake
-
-synergy/fast
-true
-false
-
-
-/opt/local/bin/gmake
-
-synergyc
-true
-false
-
-
-/opt/local/bin/gmake
-
-synergyc/fast
-true
-false
-
-
-/opt/local/bin/gmake
-
-synergys
-true
-false
-
-
-/opt/local/bin/gmake
-
-synergys/fast
-true
-false
-
-
-/opt/local/bin/gmake
-
-tests
-true
-false
-
-
-/opt/local/bin/gmake
-
-tests/fast
-true
-false
-
-
-/opt/local/bin/gmake
-
-all
-true
-false
-
-
-/opt/local/bin/gmake
-
-clean
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergyc/COSXClientTaskBarReceiver.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergyc/COSXClientTaskBarReceiver.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergyc/COSXClientTaskBarReceiver.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergyc/synergyc.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergyc/synergyc.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergyc/synergyc.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergys/COSXServerTaskBarReceiver.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergys/COSXServerTaskBarReceiver.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergys/COSXServerTaskBarReceiver.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergys/synergys.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergys/synergys.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-cmd/synergys/synergys.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArch.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArch.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArch.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchAppUtil.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchAppUtil.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchAppUtil.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchAppUtilUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchAppUtilUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchAppUtilUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchConsoleStd.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchConsoleStd.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchConsoleStd.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchConsoleUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchConsoleUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchConsoleUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchDaemonNone.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchDaemonNone.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchDaemonNone.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchDaemonUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchDaemonUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchDaemonUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchFileUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchFileUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchFileUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchLogUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchLogUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchLogUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchMultithreadPosix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchMultithreadPosix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchMultithreadPosix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchNetworkBSD.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchNetworkBSD.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchNetworkBSD.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchSleepUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchSleepUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchSleepUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchStringUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchStringUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchStringUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchSystemUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchSystemUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchSystemUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchTaskBarXWindows.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchTaskBarXWindows.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchTaskBarXWindows.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchTimeUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchTimeUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/CArchTimeUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/XArch.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/XArch.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/XArch.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/XArchUnix.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/XArchUnix.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/arch/XArchUnix.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CEvent.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CEvent.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CEvent.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CEventQueue.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CEventQueue.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CEventQueue.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CFunctionEventJob.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CFunctionEventJob.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CFunctionEventJob.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CFunctionJob.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CFunctionJob.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CFunctionJob.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CLog.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CLog.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CLog.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CSimpleEventQueueBuffer.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CSimpleEventQueueBuffer.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CSimpleEventQueueBuffer.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CStopwatch.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CStopwatch.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CStopwatch.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CStringUtil.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CStringUtil.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CStringUtil.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CUnicode.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CUnicode.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/CUnicode.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/IEventQueue.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/IEventQueue.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/IEventQueue.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/LogOutputters.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/LogOutputters.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/LogOutputters.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/XBase.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/XBase.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/base/XBase.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/client/CClient.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/client/CClient.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/client/CClient.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/client/CServerProxy.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/client/CServerProxy.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/client/CServerProxy.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/common/Version.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/common/Version.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/common/Version.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/CStreamBuffer.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/CStreamBuffer.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/CStreamBuffer.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/CStreamFilter.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/CStreamFilter.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/CStreamFilter.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/IStream.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/IStream.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/IStream.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/XIO.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/XIO.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/io/XIO.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CCondVar.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CCondVar.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CCondVar.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CLock.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CLock.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CLock.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CMutex.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CMutex.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CMutex.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CThread.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CThread.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/CThread.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/XMT.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/XMT.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/mt/XMT.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CNetworkAddress.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CNetworkAddress.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CNetworkAddress.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CSocketMultiplexer.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CSocketMultiplexer.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CSocketMultiplexer.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPListenSocket.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPListenSocket.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPListenSocket.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPSocket.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPSocket.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPSocket.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPSocketFactory.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPSocketFactory.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/CTCPSocketFactory.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/IDataSocket.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/IDataSocket.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/IDataSocket.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/IListenSocket.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/IListenSocket.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/IListenSocket.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/ISocket.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/ISocket.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/ISocket.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/XSocket.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/XSocket.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/net/XSocket.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboard.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboard.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboard.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardAnyTextConverter.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardAnyTextConverter.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardAnyTextConverter.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardTextConverter.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardTextConverter.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardTextConverter.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardUTF16Converter.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardUTF16Converter.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXClipboardUTF16Converter.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXEventQueueBuffer.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXEventQueueBuffer.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXEventQueueBuffer.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXKeyState.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXKeyState.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXKeyState.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreen.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreen.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreen.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreenSaver.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreenSaver.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreenSaver.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreenSaverUtil.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreenSaverUtil.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/platform/COSXScreenSaverUtil.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CBaseClientProxy.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CBaseClientProxy.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CBaseClientProxy.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientListener.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientListener.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientListener.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_0.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_0.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_0.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_1.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_1.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_1.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_2.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_2.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_2.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_3.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_3.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxy1_3.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxyUnknown.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxyUnknown.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CClientProxyUnknown.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CConfig.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CConfig.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CConfig.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CInputFilter.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CInputFilter.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CInputFilter.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CPrimaryClient.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CPrimaryClient.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CPrimaryClient.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CServer.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CServer.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/server/CServer.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CApp.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CApp.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CApp.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClientApp.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClientApp.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClientApp.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClientTaskBarReceiver.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClientTaskBarReceiver.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClientTaskBarReceiver.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClipboard.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClipboard.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CClipboard.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CKeyMap.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CKeyMap.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CKeyMap.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CKeyState.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CKeyState.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CKeyState.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CPacketStreamFilter.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CPacketStreamFilter.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CPacketStreamFilter.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CPlatformScreen.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CPlatformScreen.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CPlatformScreen.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CProtocolUtil.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CProtocolUtil.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CProtocolUtil.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CProtocolUtilTest.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CProtocolUtilTest.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CProtocolUtilTest.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CScreen.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CScreen.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CScreen.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CServerApp.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CServerApp.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CServerApp.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CServerTaskBarReceiver.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CServerTaskBarReceiver.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/CServerTaskBarReceiver.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IClipboard.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IClipboard.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IClipboard.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IKeyState.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IKeyState.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IKeyState.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IPrimaryScreen.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IPrimaryScreen.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IPrimaryScreen.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IScreen.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IScreen.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/IScreen.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/KeyTypes.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/KeyTypes.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/KeyTypes.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/ProtocolTypes.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/ProtocolTypes.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/ProtocolTypes.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/XScreen.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/XScreen.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/XScreen.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/XSynergy.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/XSynergy.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-lib/synergy/XSynergy.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-third_party/gtest/src/gtest-all.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-third_party/gtest/src/gtest-all.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-third_party/gtest/src/gtest-all.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-gtest
-true
-false
-
-
-/opt/local/bin/gmake
-
-gtest/fast
-true
-false
-
-
-/opt/local/bin/gmake
-
-gtest_main
-true
-false
-
-
-/opt/local/bin/gmake
-
-gtest_main/fast
-true
-false
-
-
-/opt/local/bin/gmake
-
-gtest_unittest
-true
-false
-
-
-/opt/local/bin/gmake
-
-gtest_unittest/fast
-true
-false
-
-
-/opt/local/bin/gmake
-
-all
-true
-false
-
-
-/opt/local/bin/gmake
-
-clean
-true
-false
-
-
-/opt/local/bin/gmake
-
-src/gtest-all.cc.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-src/gtest-all.cc.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-src/gtest-all.cc.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-src/gtest_main.cc.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-src/gtest_main.cc.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-src/gtest_main.cc.s
-true
-false
-
-
-/opt/local/bin/gmake
-
-test/gtest_unittest.cc.o
-true
-false
-
-
-/opt/local/bin/gmake
-
-test/gtest_unittest.cc.i
-true
-false
-
-
-/opt/local/bin/gmake
-
-test/gtest_unittest.cc.s
-true
-false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.project b/.project
deleted file mode 100644
index befcd90c..00000000
--- a/.project
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
- synergy-Debug@synergy-plus-git-svn
-
-
-
-
-
- org.eclipse.cdt.make.core.makeBuilder
- clean,full,incremental,
-
-
- org.eclipse.cdt.make.core.cleanBuildTarget
- clean
-
-
- org.eclipse.cdt.make.core.enableCleanBuild
- true
-
-
- org.eclipse.cdt.make.core.append_environment
- true
-
-
- org.eclipse.cdt.make.core.stopOnError
- true
-
-
- org.eclipse.cdt.make.core.enabledIncrementalBuild
- true
-
-
- org.eclipse.cdt.make.core.build.command
- /opt/local/bin/gmake
-
-
- org.eclipse.cdt.make.core.contents
- org.eclipse.cdt.make.core.activeConfigSettings
-
-
- org.eclipse.cdt.make.core.build.target.inc
- all
-
-
- org.eclipse.cdt.make.core.build.arguments
-
-
-
- org.eclipse.cdt.make.core.buildLocation
- /Users/jason/programming/synergy-plus-git-svn
-
-
- org.eclipse.cdt.make.core.useDefaultBuildCmd
- false
-
-
- org.eclipse.cdt.make.core.environment
- VERBOSE=1|CMAKE_NO_VERBOSE=1|
-
-
- org.eclipse.cdt.make.core.enableFullBuild
- true
-
-
- org.eclipse.cdt.make.core.build.target.auto
- all
-
-
- org.eclipse.cdt.make.core.enableAutoBuild
- false
-
-
- org.eclipse.cdt.make.core.build.target.clean
- clean
-
-
- org.eclipse.cdt.make.core.fullBuildTarget
- all
-
-
- org.eclipse.cdt.make.core.buildArguments
-
-
-
- org.eclipse.cdt.make.core.build.location
- /Users/jason/programming/synergy-plus-git-svn
-
-
- org.eclipse.cdt.make.core.autoBuildTarget
- all
-
-
- org.eclipse.cdt.core.errorOutputParser
- org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;
-
-
-
-
- org.eclipse.cdt.make.core.ScannerConfigBuilder
-
-
-
-
-
- org.eclipse.cdt.core.ccnature
- org.eclipse.cdt.make.core.makeNature
- org.eclipse.cdt.make.core.ScannerConfigNature
- org.eclipse.cdt.core.cnature
-
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c75d8f36..5e93e13b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,16 +39,15 @@ endif()
project(synergy C CXX)
# put binaries in a different dir to make them easier to find.
-if (WIN32)
- set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
- set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
-elseif (UNIX)
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
+set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
+
+# for unix, put debug files in a separate bin "debug" dir.
+# release bin files should stay in the root of the bin dir.
+if (UNIX)
if (CMAKE_BUILD_TYPE STREQUAL Debug)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/debug)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/debug)
- elseif (CMAKE_BUILD_TYPE STREQUAL Release)
- set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/release)
- set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/release)
endif()
endif()
diff --git a/configure b/configure
new file mode 100644
index 00000000..d2cd98a1
--- /dev/null
+++ b/configure
@@ -0,0 +1,2 @@
+cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
+
diff --git a/hm.py b/hm.py
index 1df65027..87c2dc05 100644
--- a/hm.py
+++ b/hm.py
@@ -46,21 +46,17 @@ requiredMajor = 2
requiredMinor = 3
# options used by all commands
-global_options = 'g:v'
-global_options_long = ['no-prompts', 'generator=', 'verbose', 'make-gui']
-
-# options used by build related commands
-build_options = 'dr'
-build_options_long = ['debug', 'release']
+globalOptions = 'v'
+globalOptionsLong = ['no-prompts', 'generator=', 'verbose', 'make-gui']
# list of valid commands as keys. the values are optarg strings, but most
# are None for now (this is mainly for extensibility)
cmd_opt_dict = {
'about' : ['', []],
- 'setup' : ['', []],
- 'configure' : [build_options, build_options_long],
- 'build' : [build_options, build_options_long],
- 'clean' : [build_options, build_options_long],
+ 'setup' : ['g:', []],
+ 'configure' : ['g:dr', ['debug', 'release']],
+ 'build' : ['dr', ['debug', 'release']],
+ 'clean' : ['dr', ['debug', 'release']],
'update' : ['', []],
'install' : ['', []],
'doxygen' : ['', []],
@@ -170,10 +166,10 @@ def run_cmd(cmd, argv = []):
try:
options_pair = cmd_opt_dict[cmd]
- options = global_options + options_pair[0]
+ options = globalOptions + options_pair[0]
options_long = []
- options_long.extend(global_options_long)
+ options_long.extend(globalOptionsLong)
options_long.extend(options_pair[1])
opts, args = gnu_getopt(argv, options, options_long)
@@ -214,3 +210,4 @@ def main(argv):
# Start the program.
main(sys.argv)
+
diff --git a/src/lib/base/CEvent.cpp b/src/lib/base/CEvent.cpp
index 5e4b4eba..b2e5cd86 100644
--- a/src/lib/base/CEvent.cpp
+++ b/src/lib/base/CEvent.cpp
@@ -64,24 +64,6 @@ CEvent::getFlags() const
return m_flags;
}
-CEvent::Type
-CEvent::registerType(const char* name)
-{
- return EVENTQUEUE->registerType(name);
-}
-
-CEvent::Type
-CEvent::registerTypeOnce(Type& type, const char* name)
-{
- return EVENTQUEUE->registerTypeOnce(type, name);
-}
-
-const char*
-CEvent::getTypeName(Type type)
-{
- return EVENTQUEUE->getTypeName(type);
-}
-
void
CEvent::deleteData(const CEvent& event)
{
diff --git a/src/lib/base/CEvent.h b/src/lib/base/CEvent.h
index ee664500..65a6783a 100644
--- a/src/lib/base/CEvent.h
+++ b/src/lib/base/CEvent.h
@@ -59,27 +59,6 @@ public:
//! @name manipulators
//@{
- //! Creates a new event type
- /*!
- Returns a unique event type id.
- */
- static Type registerType(const char* name);
-
- //! Creates a new event type
- /*!
- If \p type contains \c kUnknown then it is set to a unique event
- type id otherwise it is left alone. The final value of \p type
- is returned.
- */
- static Type registerTypeOnce(Type& type, const char* name);
-
- //! Get name for event
- /*!
- Returns the name for the event \p type. This is primarily for
- debugging.
- */
- static const char* getTypeName(Type type);
-
//! Release event data
/*!
Deletes event data for the given event (using free()).
diff --git a/src/lib/client/CClient.cpp b/src/lib/client/CClient.cpp
index 0e48b563..eea408c3 100644
--- a/src/lib/client/CClient.cpp
+++ b/src/lib/client/CClient.cpp
@@ -187,21 +187,21 @@ CClient::getServerAddress() const
CEvent::Type
CClient::getConnectedEvent()
{
- return CEvent::registerTypeOnce(s_connectedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_connectedEvent,
"CClient::connected");
}
CEvent::Type
CClient::getConnectionFailedEvent()
{
- return CEvent::registerTypeOnce(s_connectionFailedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_connectionFailedEvent,
"CClient::failed");
}
CEvent::Type
CClient::getDisconnectedEvent()
{
- return CEvent::registerTypeOnce(s_disconnectedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_disconnectedEvent,
"CClient::disconnected");
}
diff --git a/src/lib/io/CMakeLists.txt b/src/lib/io/CMakeLists.txt
index 2c87c4ba..4fdaf92b 100644
--- a/src/lib/io/CMakeLists.txt
+++ b/src/lib/io/CMakeLists.txt
@@ -33,6 +33,7 @@ if (WIN32)
endif()
set(inc
+ ../arch
../base
../common
)
diff --git a/src/lib/io/IStream.cpp b/src/lib/io/IStream.cpp
index 14edc7c1..5255b870 100644
--- a/src/lib/io/IStream.cpp
+++ b/src/lib/io/IStream.cpp
@@ -16,6 +16,7 @@
*/
#include "IStream.h"
+#include "CEventQueue.h"
//
// IStream
@@ -30,34 +31,34 @@ CEvent::Type IStream::s_outputShutdownEvent = CEvent::kUnknown;
CEvent::Type
IStream::getInputReadyEvent()
{
- return CEvent::registerTypeOnce(s_inputReadyEvent,
+ return EVENTQUEUE->registerTypeOnce(s_inputReadyEvent,
"IStream::inputReady");
}
CEvent::Type
IStream::getOutputFlushedEvent()
{
- return CEvent::registerTypeOnce(s_outputFlushedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_outputFlushedEvent,
"IStream::outputFlushed");
}
CEvent::Type
IStream::getOutputErrorEvent()
{
- return CEvent::registerTypeOnce(s_outputErrorEvent,
+ return EVENTQUEUE->registerTypeOnce(s_outputErrorEvent,
"IStream::outputError");
}
CEvent::Type
IStream::getInputShutdownEvent()
{
- return CEvent::registerTypeOnce(s_inputShutdownEvent,
+ return EVENTQUEUE->registerTypeOnce(s_inputShutdownEvent,
"IStream::inputShutdown");
}
CEvent::Type
IStream::getOutputShutdownEvent()
{
- return CEvent::registerTypeOnce(s_outputShutdownEvent,
+ return EVENTQUEUE->registerTypeOnce(s_outputShutdownEvent,
"IStream::outputShutdown");
}
diff --git a/src/lib/net/IDataSocket.cpp b/src/lib/net/IDataSocket.cpp
index f9045585..0fe37af4 100644
--- a/src/lib/net/IDataSocket.cpp
+++ b/src/lib/net/IDataSocket.cpp
@@ -16,6 +16,7 @@
*/
#include "IDataSocket.h"
+#include "CEventQueue.h"
//
// IDataSocket
@@ -27,14 +28,14 @@ CEvent::Type IDataSocket::s_failedEvent = CEvent::kUnknown;
CEvent::Type
IDataSocket::getConnectedEvent()
{
- return CEvent::registerTypeOnce(s_connectedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_connectedEvent,
"IDataSocket::connected");
}
CEvent::Type
IDataSocket::getConnectionFailedEvent()
{
- return CEvent::registerTypeOnce(s_failedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_failedEvent,
"IDataSocket::failed");
}
diff --git a/src/lib/net/IListenSocket.cpp b/src/lib/net/IListenSocket.cpp
index eb66a7ff..97683081 100644
--- a/src/lib/net/IListenSocket.cpp
+++ b/src/lib/net/IListenSocket.cpp
@@ -16,6 +16,7 @@
*/
#include "IListenSocket.h"
+#include "CEventQueue.h"
//
// IListenSocket
@@ -26,6 +27,6 @@ CEvent::Type IListenSocket::s_connectingEvent = CEvent::kUnknown;
CEvent::Type
IListenSocket::getConnectingEvent()
{
- return CEvent::registerTypeOnce(s_connectingEvent,
+ return EVENTQUEUE->registerTypeOnce(s_connectingEvent,
"IListenSocket::connecting");
}
diff --git a/src/lib/net/ISocket.cpp b/src/lib/net/ISocket.cpp
index fd5ea306..5ca90451 100644
--- a/src/lib/net/ISocket.cpp
+++ b/src/lib/net/ISocket.cpp
@@ -16,6 +16,7 @@
*/
#include "ISocket.h"
+#include "CEventQueue.h"
//
// ISocket
@@ -26,6 +27,6 @@ CEvent::Type ISocket::s_disconnectedEvent = CEvent::kUnknown;
CEvent::Type
ISocket::getDisconnectedEvent()
{
- return CEvent::registerTypeOnce(s_disconnectedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_disconnectedEvent,
"ISocket::disconnected");
}
diff --git a/src/lib/server/CClientListener.cpp b/src/lib/server/CClientListener.cpp
index e528422d..49012ca6 100644
--- a/src/lib/server/CClientListener.cpp
+++ b/src/lib/server/CClientListener.cpp
@@ -115,7 +115,7 @@ CClientListener::getNextClient()
CEvent::Type
CClientListener::getConnectedEvent()
{
- return CEvent::registerTypeOnce(s_connectedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_connectedEvent,
"CClientListener::connected");
}
diff --git a/src/lib/server/CClientProxy.cpp b/src/lib/server/CClientProxy.cpp
index 02d0fc34..1478e3b7 100644
--- a/src/lib/server/CClientProxy.cpp
+++ b/src/lib/server/CClientProxy.cpp
@@ -19,6 +19,7 @@
#include "CProtocolUtil.h"
#include "IStream.h"
#include "CLog.h"
+#include "CEventQueue.h"
//
// CClientProxy
@@ -59,21 +60,21 @@ CClientProxy::getStream() const
CEvent::Type
CClientProxy::getReadyEvent()
{
- return CEvent::registerTypeOnce(s_readyEvent,
+ return EVENTQUEUE->registerTypeOnce(s_readyEvent,
"CClientProxy::ready");
}
CEvent::Type
CClientProxy::getDisconnectedEvent()
{
- return CEvent::registerTypeOnce(s_disconnectedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_disconnectedEvent,
"CClientProxy::disconnected");
}
CEvent::Type
CClientProxy::getClipboardChangedEvent()
{
- return CEvent::registerTypeOnce(s_clipboardChangedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_clipboardChangedEvent,
"CClientProxy::clipboardChanged");
}
diff --git a/src/lib/server/CClientProxyUnknown.cpp b/src/lib/server/CClientProxyUnknown.cpp
index 580652a1..0262b709 100644
--- a/src/lib/server/CClientProxyUnknown.cpp
+++ b/src/lib/server/CClientProxyUnknown.cpp
@@ -79,14 +79,14 @@ CClientProxyUnknown::orphanClientProxy()
CEvent::Type
CClientProxyUnknown::getSuccessEvent()
{
- return CEvent::registerTypeOnce(s_successEvent,
+ return EVENTQUEUE->registerTypeOnce(s_successEvent,
"CClientProxy::success");
}
CEvent::Type
CClientProxyUnknown::getFailureEvent()
{
- return CEvent::registerTypeOnce(s_failureEvent,
+ return EVENTQUEUE->registerTypeOnce(s_failureEvent,
"CClientProxy::failure");
}
diff --git a/src/lib/server/CInputFilter.cpp b/src/lib/server/CInputFilter.cpp
index b6f80a4f..ace55657 100644
--- a/src/lib/server/CInputFilter.cpp
+++ b/src/lib/server/CInputFilter.cpp
@@ -536,8 +536,8 @@ CInputFilter::CKeystrokeAction::format() const
void
CInputFilter::CKeystrokeAction::perform(const CEvent& event)
{
- CEvent::Type type = m_press ? IPlatformScreen::getKeyDownEvent() :
- IPlatformScreen::getKeyUpEvent();
+ CEvent::Type type = m_press ? IPlatformScreen::getKeyDownEvent(*EVENTQUEUE) :
+ IPlatformScreen::getKeyUpEvent(*EVENTQUEUE);
EVENTQUEUE->addEvent(CEvent(IPlatformScreen::getFakeInputBeginEvent(),
event.getTarget(), NULL,
CEvent::kDeliverImmediately));
@@ -609,7 +609,7 @@ CInputFilter::CMouseButtonAction::perform(const CEvent& event)
KeyID key = m_press ? kKeySetModifiers : kKeyClearModifiers;
modifierInfo =
IKeyState::CKeyInfo::alloc(key, m_buttonInfo->m_mask, 0, 1);
- EVENTQUEUE->addEvent(CEvent(IPlatformScreen::getKeyDownEvent(),
+ EVENTQUEUE->addEvent(CEvent(IPlatformScreen::getKeyDownEvent(*EVENTQUEUE),
event.getTarget(), modifierInfo,
CEvent::kDeliverImmediately));
}
@@ -937,11 +937,11 @@ CInputFilter::setPrimaryClient(CPrimaryClient* client)
rule->disable(m_primaryClient);
}
- EVENTQUEUE->removeHandler(IPlatformScreen::getKeyDownEvent(),
+ EVENTQUEUE->removeHandler(IPlatformScreen::getKeyDownEvent(*EVENTQUEUE),
m_primaryClient->getEventTarget());
- EVENTQUEUE->removeHandler(IPlatformScreen::getKeyUpEvent(),
+ EVENTQUEUE->removeHandler(IPlatformScreen::getKeyUpEvent(*EVENTQUEUE),
m_primaryClient->getEventTarget());
- EVENTQUEUE->removeHandler(IPlatformScreen::getKeyRepeatEvent(),
+ EVENTQUEUE->removeHandler(IPlatformScreen::getKeyRepeatEvent(*EVENTQUEUE),
m_primaryClient->getEventTarget());
EVENTQUEUE->removeHandler(IPlatformScreen::getButtonDownEvent(),
m_primaryClient->getEventTarget());
@@ -958,15 +958,15 @@ CInputFilter::setPrimaryClient(CPrimaryClient* client)
m_primaryClient = client;
if (m_primaryClient != NULL) {
- EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyDownEvent(),
+ EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyDownEvent(*EVENTQUEUE),
m_primaryClient->getEventTarget(),
new TMethodEventJob(this,
&CInputFilter::handleEvent));
- EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyUpEvent(),
+ EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyUpEvent(*EVENTQUEUE),
m_primaryClient->getEventTarget(),
new TMethodEventJob(this,
&CInputFilter::handleEvent));
- EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyRepeatEvent(),
+ EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyRepeatEvent(*EVENTQUEUE),
m_primaryClient->getEventTarget(),
new TMethodEventJob(this,
&CInputFilter::handleEvent));
diff --git a/src/lib/server/CServer.cpp b/src/lib/server/CServer.cpp
index 45dfb632..986c010b 100644
--- a/src/lib/server/CServer.cpp
+++ b/src/lib/server/CServer.cpp
@@ -95,15 +95,15 @@ CServer::CServer(const CConfig& config, CPrimaryClient* primaryClient) :
EVENTQUEUE->adoptHandler(CEvent::kTimer, this,
new TMethodEventJob(this,
&CServer::handleSwitchWaitTimeout));
- EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyDownEvent(),
+ EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyDownEvent(*EVENTQUEUE),
m_inputFilter,
new TMethodEventJob(this,
&CServer::handleKeyDownEvent));
- EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyUpEvent(),
+ EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyUpEvent(*EVENTQUEUE),
m_inputFilter,
new TMethodEventJob(this,
&CServer::handleKeyUpEvent));
- EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyRepeatEvent(),
+ EVENTQUEUE->adoptHandler(IPlatformScreen::getKeyRepeatEvent(* EVENTQUEUE),
m_inputFilter,
new TMethodEventJob(this,
&CServer::handleKeyRepeatEvent));
@@ -182,11 +182,11 @@ CServer::CServer(const CConfig& config, CPrimaryClient* primaryClient) :
CServer::~CServer()
{
// remove event handlers and timers
- EVENTQUEUE->removeHandler(IPlatformScreen::getKeyDownEvent(),
+ EVENTQUEUE->removeHandler(IPlatformScreen::getKeyDownEvent(*EVENTQUEUE),
m_inputFilter);
- EVENTQUEUE->removeHandler(IPlatformScreen::getKeyUpEvent(),
+ EVENTQUEUE->removeHandler(IPlatformScreen::getKeyUpEvent(*EVENTQUEUE),
m_inputFilter);
- EVENTQUEUE->removeHandler(IPlatformScreen::getKeyRepeatEvent(),
+ EVENTQUEUE->removeHandler(IPlatformScreen::getKeyRepeatEvent(*EVENTQUEUE),
m_inputFilter);
EVENTQUEUE->removeHandler(IPlatformScreen::getButtonDownEvent(),
m_inputFilter);
@@ -345,49 +345,49 @@ CServer::getClients(std::vector& list) const
CEvent::Type
CServer::getErrorEvent()
{
- return CEvent::registerTypeOnce(s_errorEvent,
+ return EVENTQUEUE->registerTypeOnce(s_errorEvent,
"CServer::error");
}
CEvent::Type
CServer::getConnectedEvent()
{
- return CEvent::registerTypeOnce(s_connectedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_connectedEvent,
"CServer::connected");
}
CEvent::Type
CServer::getDisconnectedEvent()
{
- return CEvent::registerTypeOnce(s_disconnectedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_disconnectedEvent,
"CServer::disconnected");
}
CEvent::Type
CServer::getSwitchToScreenEvent()
{
- return CEvent::registerTypeOnce(s_switchToScreen,
+ return EVENTQUEUE->registerTypeOnce(s_switchToScreen,
"CServer::switchToScreen");
}
CEvent::Type
CServer::getSwitchInDirectionEvent()
{
- return CEvent::registerTypeOnce(s_switchInDirection,
+ return EVENTQUEUE->registerTypeOnce(s_switchInDirection,
"CServer::switchInDirection");
}
CEvent::Type
CServer::getKeyboardBroadcastEvent()
{
- return CEvent::registerTypeOnce(s_keyboardBroadcast,
+ return EVENTQUEUE->registerTypeOnce(s_keyboardBroadcast,
"CServer:keyboardBroadcast");
}
CEvent::Type
CServer::getLockCursorToScreenEvent()
{
- return CEvent::registerTypeOnce(s_lockCursorToScreen,
+ return EVENTQUEUE->registerTypeOnce(s_lockCursorToScreen,
"CServer::lockCursorToScreen");
}
diff --git a/src/lib/synergy/CKeyMap.h b/src/lib/synergy/CKeyMap.h
index e3ef46f6..c1982587 100644
--- a/src/lib/synergy/CKeyMap.h
+++ b/src/lib/synergy/CKeyMap.h
@@ -123,7 +123,7 @@ public:
//@{
//! Swap with another \c CKeyMap
- void swap(CKeyMap&);
+ virtual void swap(CKeyMap&);
//! Add a key entry
/*!
@@ -189,19 +189,19 @@ public:
Records that modifier key \p key is half-duplex. This is called to
set user configurable half-duplex settings.
*/
- void addHalfDuplexModifier(KeyID key);
+ virtual void addHalfDuplexModifier(KeyID key);
//! Finish adding entries
/*!
Called after adding entries, this does some internal housekeeping.
*/
- void finish();
+ virtual void finish();
//! Iterate over all added keys items
/*!
Calls \p cb for every key item.
*/
- void foreachKey(ForeachKeyCallback cb, void* userData);
+ virtual void foreachKey(ForeachKeyCallback cb, void* userData);
//@}
//! @name accessors
@@ -251,7 +251,7 @@ public:
Returns \c true iff modifier key \p key or button \p button is
half-duplex.
*/
- bool isHalfDuplex(KeyID key, KeyButton button) const;
+ virtual bool isHalfDuplex(KeyID key, KeyButton button) const;
//! Test if modifiers indicate a command
/*!
diff --git a/src/lib/synergy/CKeyState.cpp b/src/lib/synergy/CKeyState.cpp
index ddef5864..1b36bf8d 100644
--- a/src/lib/synergy/CKeyState.cpp
+++ b/src/lib/synergy/CKeyState.cpp
@@ -16,7 +16,6 @@
*/
#include "CKeyState.h"
-#include "IEventQueue.h"
#include "CLog.h"
#include
#include
@@ -383,7 +382,31 @@ static const KeyID s_numpadTable[] = {
//
CKeyState::CKeyState() :
- m_mask(0)
+ IKeyState(),
+ m_mask(0),
+ m_keyMapPtr(new CKeyMap()),
+ m_keyMap(*m_keyMapPtr)
+{
+ init();
+}
+
+CKeyState::CKeyState(IEventQueue& eventQueue, CKeyMap& keyMap) :
+ IKeyState(eventQueue),
+ m_mask(0),
+ m_keyMapPtr(0),
+ m_keyMap(keyMap)
+{
+ init();
+}
+
+CKeyState::~CKeyState()
+{
+ if (m_keyMapPtr)
+ delete m_keyMapPtr;
+}
+
+void
+CKeyState::init()
{
memset(&m_keys, 0, sizeof(m_keys));
memset(&m_syntheticKeys, 0, sizeof(m_syntheticKeys));
@@ -391,11 +414,6 @@ CKeyState::CKeyState() :
memset(&m_serverKeys, 0, sizeof(m_serverKeys));
}
-CKeyState::~CKeyState()
-{
- // do nothing
-}
-
void
CKeyState::onKey(KeyButton button, bool down, KeyModifierMask newState)
{
@@ -431,23 +449,23 @@ CKeyState::sendKeyEvent(
// ignore auto-repeat on half-duplex keys
}
else {
- EVENTQUEUE->addEvent(CEvent(getKeyDownEvent(), target,
+ getEventQueue().addEvent(CEvent(getKeyDownEvent(), target,
CKeyInfo::alloc(key, mask, button, 1)));
- EVENTQUEUE->addEvent(CEvent(getKeyUpEvent(), target,
+ getEventQueue().addEvent(CEvent(getKeyUpEvent(), target,
CKeyInfo::alloc(key, mask, button, 1)));
}
}
else {
if (isAutoRepeat) {
- EVENTQUEUE->addEvent(CEvent(getKeyRepeatEvent(), target,
+ getEventQueue().addEvent(CEvent(getKeyRepeatEvent(), target,
CKeyInfo::alloc(key, mask, button, count)));
}
else if (press) {
- EVENTQUEUE->addEvent(CEvent(getKeyDownEvent(), target,
+ getEventQueue().addEvent(CEvent(getKeyDownEvent(), target,
CKeyInfo::alloc(key, mask, button, 1)));
}
else {
- EVENTQUEUE->addEvent(CEvent(getKeyUpEvent(), target,
+ getEventQueue().addEvent(CEvent(getKeyUpEvent(), target,
CKeyInfo::alloc(key, mask, button, 1)));
}
}
diff --git a/src/lib/synergy/CKeyState.h b/src/lib/synergy/CKeyState.h
index 7638b2d1..9536bd2f 100644
--- a/src/lib/synergy/CKeyState.h
+++ b/src/lib/synergy/CKeyState.h
@@ -29,6 +29,7 @@ platform specific methods.
class CKeyState : public IKeyState {
public:
CKeyState();
+ CKeyState(IEventQueue& eventQueue, CKeyMap& keyMap);
virtual ~CKeyState();
//! @name manipulators
@@ -137,6 +138,7 @@ protected:
private:
typedef CKeyMap::Keystrokes Keystrokes;
typedef CKeyMap::ModifierToKeys ModifierToKeys;
+public:
struct CAddActiveModifierContext {
public:
CAddActiveModifierContext(SInt32 group, KeyModifierMask mask,
@@ -152,6 +154,7 @@ private:
CAddActiveModifierContext(const CAddActiveModifierContext&);
CAddActiveModifierContext& operator=(const CAddActiveModifierContext&);
};
+private:
class ButtonToKeyLess {
public:
@@ -166,6 +169,9 @@ private:
CKeyState(const CKeyState&);
CKeyState& operator=(const CKeyState&);
+ // called by all ctors.
+ void init();
+
// adds alias key sequences. these are sequences that are equivalent
// to other sequences.
void addAliasEntries();
@@ -190,8 +196,11 @@ private:
CKeyMap::KeyItem& keyItem, void* vcontext);
private:
+ // must be declared before m_keyMap. used when this class owns the key map.
+ CKeyMap* m_keyMapPtr;
+
// the keyboard map
- CKeyMap m_keyMap;
+ CKeyMap& m_keyMap;
// current modifier state
KeyModifierMask m_mask;
diff --git a/src/lib/synergy/CServerApp.cpp b/src/lib/synergy/CServerApp.cpp
index 10784be0..0c52b075 100644
--- a/src/lib/synergy/CServerApp.cpp
+++ b/src/lib/synergy/CServerApp.cpp
@@ -289,7 +289,7 @@ CServerApp::loadConfig(const CString& pathname)
CEvent::Type
CServerApp::getReloadConfigEvent()
{
- return CEvent::registerTypeOnce(s_reloadConfigEvent, "reloadConfig");
+ return EVENTQUEUE->registerTypeOnce(s_reloadConfigEvent, "reloadConfig");
}
void
@@ -303,13 +303,13 @@ CServerApp::forceReconnect(const CEvent&, void*)
CEvent::Type
CServerApp::getForceReconnectEvent()
{
- return CEvent::registerTypeOnce(s_forceReconnectEvent, "forceReconnect");
+ return EVENTQUEUE->registerTypeOnce(s_forceReconnectEvent, "forceReconnect");
}
CEvent::Type
CServerApp::getResetServerEvent()
{
- return CEvent::registerTypeOnce(s_resetServerEvent, "resetServer");
+ return EVENTQUEUE->registerTypeOnce(s_resetServerEvent, "resetServer");
}
void
diff --git a/src/lib/synergy/IKeyState.cpp b/src/lib/synergy/IKeyState.cpp
index 08d447ec..3d9efac9 100644
--- a/src/lib/synergy/IKeyState.cpp
+++ b/src/lib/synergy/IKeyState.cpp
@@ -16,6 +16,7 @@
*/
#include "IKeyState.h"
+#include "CEventQueue.h"
#include
#include
@@ -27,28 +28,37 @@ CEvent::Type IKeyState::s_keyDownEvent = CEvent::kUnknown;
CEvent::Type IKeyState::s_keyUpEvent = CEvent::kUnknown;
CEvent::Type IKeyState::s_keyRepeatEvent = CEvent::kUnknown;
-CEvent::Type
-IKeyState::getKeyDownEvent()
+IKeyState::IKeyState() :
+ m_eventQueue(*EVENTQUEUE)
{
- return CEvent::registerTypeOnce(s_keyDownEvent,
+}
+
+IKeyState::IKeyState(IEventQueue& eventQueue) :
+ m_eventQueue(eventQueue)
+{
+}
+
+CEvent::Type
+IKeyState::getKeyDownEvent(IEventQueue& eventQueue)
+{
+ return eventQueue.registerTypeOnce(s_keyDownEvent,
"IKeyState::keyDown");
}
CEvent::Type
-IKeyState::getKeyUpEvent()
+IKeyState::getKeyUpEvent(IEventQueue& eventQueue)
{
- return CEvent::registerTypeOnce(s_keyUpEvent,
+ return eventQueue.registerTypeOnce(s_keyUpEvent,
"IKeyState::keyUp");
}
CEvent::Type
-IKeyState::getKeyRepeatEvent()
+IKeyState::getKeyRepeatEvent(IEventQueue& eventQueue)
{
- return CEvent::registerTypeOnce(s_keyRepeatEvent,
+ return eventQueue.registerTypeOnce(s_keyRepeatEvent,
"IKeyState::keyRepeat");
}
-
//
// IKeyState::CKeyInfo
//
diff --git a/src/lib/synergy/IKeyState.h b/src/lib/synergy/IKeyState.h
index 1cdd66e5..f12d1b10 100644
--- a/src/lib/synergy/IKeyState.h
+++ b/src/lib/synergy/IKeyState.h
@@ -23,6 +23,7 @@
#include "CEvent.h"
#include "CString.h"
#include "stdset.h"
+#include "IEventQueue.h"
//! Key state interface
/*!
@@ -31,6 +32,9 @@ to synthesize key events.
*/
class IKeyState : public IInterface {
public:
+ IKeyState();
+ IKeyState(IEventQueue& eventQueue);
+
enum {
kNumButtons = 0x200
};
@@ -160,18 +164,33 @@ public:
virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const = 0;
//! Get key down event type. Event data is CKeyInfo*, count == 1.
- static CEvent::Type getKeyDownEvent();
+ CEvent::Type getKeyDownEvent() { return getKeyDownEvent(m_eventQueue); }
+
//! Get key up event type. Event data is CKeyInfo*, count == 1.
- static CEvent::Type getKeyUpEvent();
+ CEvent::Type getKeyUpEvent() { return getKeyUpEvent(m_eventQueue); }
+
//! Get key repeat event type. Event data is CKeyInfo*.
- static CEvent::Type getKeyRepeatEvent();
+ CEvent::Type getKeyRepeatEvent() { return getKeyRepeatEvent(m_eventQueue); }
+
+ //! Get key down event type. Event data is CKeyInfo*, count == 1.
+ static CEvent::Type getKeyDownEvent(IEventQueue& eventQueue);
+
+ //! Get key up event type. Event data is CKeyInfo*, count == 1.
+ static CEvent::Type getKeyUpEvent(IEventQueue& eventQueue);
+
+ //! Get key repeat event type. Event data is CKeyInfo*.
+ static CEvent::Type getKeyRepeatEvent(IEventQueue& eventQueue);
//@}
+protected:
+ IEventQueue& getEventQueue() const { return m_eventQueue; }
+
private:
static CEvent::Type s_keyDownEvent;
static CEvent::Type s_keyUpEvent;
static CEvent::Type s_keyRepeatEvent;
+ IEventQueue& m_eventQueue;
};
#endif
diff --git a/src/lib/synergy/IPrimaryScreen.cpp b/src/lib/synergy/IPrimaryScreen.cpp
index 2e9c4c55..ea1bfc0a 100644
--- a/src/lib/synergy/IPrimaryScreen.cpp
+++ b/src/lib/synergy/IPrimaryScreen.cpp
@@ -16,6 +16,7 @@
*/
#include "IPrimaryScreen.h"
+#include "CEventQueue.h"
#include
//
@@ -37,77 +38,77 @@ CEvent::Type IPrimaryScreen::s_fakeInputEnd = CEvent::kUnknown;
CEvent::Type
IPrimaryScreen::getButtonDownEvent()
{
- return CEvent::registerTypeOnce(s_buttonDownEvent,
+ return EVENTQUEUE->registerTypeOnce(s_buttonDownEvent,
"IPrimaryScreen::buttonDown");
}
CEvent::Type
IPrimaryScreen::getButtonUpEvent()
{
- return CEvent::registerTypeOnce(s_buttonUpEvent,
+ return EVENTQUEUE->registerTypeOnce(s_buttonUpEvent,
"IPrimaryScreen::buttonUp");
}
CEvent::Type
IPrimaryScreen::getMotionOnPrimaryEvent()
{
- return CEvent::registerTypeOnce(s_motionPrimaryEvent,
+ return EVENTQUEUE->registerTypeOnce(s_motionPrimaryEvent,
"IPrimaryScreen::motionPrimary");
}
CEvent::Type
IPrimaryScreen::getMotionOnSecondaryEvent()
{
- return CEvent::registerTypeOnce(s_motionSecondaryEvent,
+ return EVENTQUEUE->registerTypeOnce(s_motionSecondaryEvent,
"IPrimaryScreen::motionSecondary");
}
CEvent::Type
IPrimaryScreen::getWheelEvent()
{
- return CEvent::registerTypeOnce(s_wheelEvent,
+ return EVENTQUEUE->registerTypeOnce(s_wheelEvent,
"IPrimaryScreen::wheel");
}
CEvent::Type
IPrimaryScreen::getScreensaverActivatedEvent()
{
- return CEvent::registerTypeOnce(s_ssActivatedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_ssActivatedEvent,
"IPrimaryScreen::screensaverActivated");
}
CEvent::Type
IPrimaryScreen::getScreensaverDeactivatedEvent()
{
- return CEvent::registerTypeOnce(s_ssDeactivatedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_ssDeactivatedEvent,
"IPrimaryScreen::screensaverDeactivated");
}
CEvent::Type
IPrimaryScreen::getHotKeyDownEvent()
{
- return CEvent::registerTypeOnce(s_hotKeyDownEvent,
+ return EVENTQUEUE->registerTypeOnce(s_hotKeyDownEvent,
"IPrimaryScreen::hotKeyDown");
}
CEvent::Type
IPrimaryScreen::getHotKeyUpEvent()
{
- return CEvent::registerTypeOnce(s_hotKeyUpEvent,
+ return EVENTQUEUE->registerTypeOnce(s_hotKeyUpEvent,
"IPrimaryScreen::hotKeyUp");
}
CEvent::Type
IPrimaryScreen::getFakeInputBeginEvent()
{
- return CEvent::registerTypeOnce(s_fakeInputBegin,
+ return EVENTQUEUE->registerTypeOnce(s_fakeInputBegin,
"IPrimaryScreen::fakeInputBegin");
}
CEvent::Type
IPrimaryScreen::getFakeInputEndEvent()
{
- return CEvent::registerTypeOnce(s_fakeInputEnd,
+ return EVENTQUEUE->registerTypeOnce(s_fakeInputEnd,
"IPrimaryScreen::fakeInputEnd");
}
diff --git a/src/lib/synergy/IScreen.cpp b/src/lib/synergy/IScreen.cpp
index 6ec1a977..83b6328f 100644
--- a/src/lib/synergy/IScreen.cpp
+++ b/src/lib/synergy/IScreen.cpp
@@ -16,6 +16,7 @@
*/
#include "IScreen.h"
+#include "CEventQueue.h"
//
// IScreen
@@ -30,34 +31,34 @@ CEvent::Type IScreen::s_resumeEvent = CEvent::kUnknown;
CEvent::Type
IScreen::getErrorEvent()
{
- return CEvent::registerTypeOnce(s_errorEvent,
+ return EVENTQUEUE->registerTypeOnce(s_errorEvent,
"IScreen::error");
}
CEvent::Type
IScreen::getShapeChangedEvent()
{
- return CEvent::registerTypeOnce(s_shapeChangedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_shapeChangedEvent,
"IScreen::shapeChanged");
}
CEvent::Type
IScreen::getClipboardGrabbedEvent()
{
- return CEvent::registerTypeOnce(s_clipboardGrabbedEvent,
+ return EVENTQUEUE->registerTypeOnce(s_clipboardGrabbedEvent,
"IScreen::clipboardGrabbed");
}
CEvent::Type
IScreen::getSuspendEvent()
{
- return CEvent::registerTypeOnce(s_suspendEvent,
+ return EVENTQUEUE->registerTypeOnce(s_suspendEvent,
"IScreen::suspend");
}
CEvent::Type
IScreen::getResumeEvent()
{
- return CEvent::registerTypeOnce(s_resumeEvent,
+ return EVENTQUEUE->registerTypeOnce(s_resumeEvent,
"IScreen::resume");
}
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index c6a59b84..b0725df8 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -1,26 +1,26 @@
-# synergy -- mouse and keyboard sharing utility
-# Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
-#
-# This package is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# found in the file COPYING that should have accompanied this file.
-#
-# This package is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-
-include_directories(
- ../../tools/gtest-1.6.0
- ../../tools/gtest-1.6.0/include
- ../../tools/gmock-1.6.0
- ../../tools/gmock-1.6.0/include)
-
-add_library(gtest STATIC ../../tools/gtest-1.6.0/src/gtest-all.cc)
-add_library(gmock STATIC ../../tools/gmock-1.6.0/src/gmock-all.cc)
-
-add_subdirectory(integtests)
-add_subdirectory(unittests)
+# synergy -- mouse and keyboard sharing utility
+# Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
+#
+# This package is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# found in the file COPYING that should have accompanied this file.
+#
+# This package is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+include_directories(
+ ../../tools/gtest-1.6.0
+ ../../tools/gtest-1.6.0/include
+ ../../tools/gmock-1.6.0
+ ../../tools/gmock-1.6.0/include)
+
+add_library(gtest STATIC ../../tools/gtest-1.6.0/src/gtest-all.cc)
+add_library(gmock STATIC ../../tools/gmock-1.6.0/src/gmock-all.cc)
+
+add_subdirectory(integtests)
+add_subdirectory(unittests)
diff --git a/src/test/integtests/CMakeLists.txt b/src/test/integtests/CMakeLists.txt
index 5e0c1091..3711a382 100644
--- a/src/test/integtests/CMakeLists.txt
+++ b/src/test/integtests/CMakeLists.txt
@@ -50,7 +50,7 @@ set(inc
../../lib/net
../../lib/platform
../../lib/synergy
- ../../../tools/gtest-1.6.0/include
+ ../../../tools/gtest-1.6.0/include
../../../tools/gmock-1.6.0/include
)
diff --git a/src/test/integtests/platform/CMSWindowsClipboardTests.cpp b/src/test/integtests/platform/CMSWindowsClipboardTests.cpp
index aa0b9e4e..e3779666 100644
--- a/src/test/integtests/platform/CMSWindowsClipboardTests.cpp
+++ b/src/test/integtests/platform/CMSWindowsClipboardTests.cpp
@@ -50,33 +50,33 @@ public:
TEST_F(CMSWindowsClipboardTests, emptyUnowned_openCalled_returnsTrue)
{
- CMSWindowsClipboard clipboard(NULL);
- clipboard.open(0);
-
- bool actual = clipboard.emptyUnowned();
-
+ CMSWindowsClipboard clipboard(NULL);
+ clipboard.open(0);
+
+ bool actual = clipboard.emptyUnowned();
+
EXPECT_EQ(true, actual);
}
TEST_F(CMSWindowsClipboardTests, empty_openCalled_returnsTrue)
{
- CMSWindowsClipboard clipboard(NULL);
- clipboard.open(0);
-
- bool actual = clipboard.empty();
-
+ CMSWindowsClipboard clipboard(NULL);
+ clipboard.open(0);
+
+ bool actual = clipboard.empty();
+
EXPECT_EQ(true, actual);
}
TEST_F(CMSWindowsClipboardTests, empty_singleFormat_hasReturnsFalse)
{
- CMSWindowsClipboard clipboard(NULL);
- clipboard.open(0);
- clipboard.add(CMSWindowsClipboard::kText, "synergy rocks!");
-
- clipboard.empty();
-
- bool actual = clipboard.has(CMSWindowsClipboard::kText);
+ CMSWindowsClipboard clipboard(NULL);
+ clipboard.open(0);
+ clipboard.add(CMSWindowsClipboard::kText, "synergy rocks!");
+
+ clipboard.empty();
+
+ bool actual = clipboard.has(CMSWindowsClipboard::kText);
EXPECT_EQ(false, actual);
}
@@ -117,19 +117,19 @@ TEST_F(CMSWindowsClipboardTests, add_replaceValue_valueWasReplaced)
TEST_F(CMSWindowsClipboardTests, open_timeIsZero_returnsTrue)
{
- CMSWindowsClipboard clipboard(NULL);
-
- bool actual = clipboard.open(0);
-
+ CMSWindowsClipboard clipboard(NULL);
+
+ bool actual = clipboard.open(0);
+
EXPECT_EQ(true, actual);
}
TEST_F(CMSWindowsClipboardTests, open_timeIsOne_returnsTrue)
{
- CMSWindowsClipboard clipboard(NULL);
-
- bool actual = clipboard.open(1);
-
+ CMSWindowsClipboard clipboard(NULL);
+
+ bool actual = clipboard.open(1);
+
EXPECT_EQ(true, actual);
}
@@ -147,13 +147,13 @@ TEST_F(CMSWindowsClipboardTests, close_isOpen_noErrors)
// * http://buildbot.synergy-foss.org:8000/builders/trunk-win32/builds/246/steps/shell_3/logs/stdio
/*TEST_F(CMSWindowsClipboardTests, getTime_openWithNoEmpty_returnsOne)
{
- CMSWindowsClipboard clipboard(NULL);
- clipboard.open(1);
-
- CMSWindowsClipboard::Time actual = clipboard.getTime();
-
- // this behavior is different to that of CClipboard which only
- // returns the value passed into open(t) after empty() is called.
+ CMSWindowsClipboard clipboard(NULL);
+ clipboard.open(1);
+
+ CMSWindowsClipboard::Time actual = clipboard.getTime();
+
+ // this behavior is different to that of CClipboard which only
+ // returns the value passed into open(t) after empty() is called.
EXPECT_EQ(1, actual);
}*/
@@ -161,12 +161,12 @@ TEST_F(CMSWindowsClipboardTests, close_isOpen_noErrors)
// http://buildbot.synergy-foss.org:8000/builders/trunk-win32/builds/266/steps/shell_3/logs/stdio
/*TEST_F(CMSWindowsClipboardTests, getTime_openAndEmpty_returnsOne)
{
- CMSWindowsClipboard clipboard(NULL);
- clipboard.open(1);
- clipboard.empty();
-
- CMSWindowsClipboard::Time actual = clipboard.getTime();
-
+ CMSWindowsClipboard clipboard(NULL);
+ clipboard.open(1);
+ clipboard.empty();
+
+ CMSWindowsClipboard::Time actual = clipboard.getTime();
+
EXPECT_EQ(1, actual);
}*/
diff --git a/src/test/integtests/platform/CXWindowsClipboardTests.cpp b/src/test/integtests/platform/CXWindowsClipboardTests.cpp
index 42590dbb..3565f938 100644
--- a/src/test/integtests/platform/CXWindowsClipboardTests.cpp
+++ b/src/test/integtests/platform/CXWindowsClipboardTests.cpp
@@ -77,7 +77,7 @@ TEST_F(CXWindowsClipboardTests, empty_singleFormat_hasReturnsFalse)
clipboard.empty();
bool actual = clipboard.has(CXWindowsClipboard::kText);
- EXPECT_EQ(false, actual);
+ EXPECT_FALSE(actual);
}
TEST_F(CXWindowsClipboardTests, add_newValue_valueWasStored)
@@ -127,7 +127,7 @@ TEST_F(CXWindowsClipboardTests, has_withNoFormats_returnsFalse)
bool actual = clipboard.has(IClipboard::kText);
- EXPECT_EQ(false, actual);
+ EXPECT_FALSE(actual);
}
TEST_F(CXWindowsClipboardTests, get_withNoFormats_returnsEmpty)
diff --git a/src/test/unittests/CMakeLists.txt b/src/test/unittests/CMakeLists.txt
index ee396831..c98f9cf6 100644
--- a/src/test/unittests/CMakeLists.txt
+++ b/src/test/unittests/CMakeLists.txt
@@ -13,7 +13,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+set(h
+ synergy/CKeyStateImpl.h
+ synergy/CMockEventQueue.h
+ synergy/CMockKeyMap.h
+)
+
set(src
+ ${h}
Main.cpp
synergy/CClipboardTests.cpp
synergy/CKeyStateTests.cpp
@@ -29,7 +36,7 @@ set(inc
../../lib/net
../../lib/platform
../../lib/synergy
- ../../../tools/gtest-1.6.0/include
+ ../../../tools/gtest-1.6.0/include
../../../tools/gmock-1.6.0/include
)
diff --git a/src/test/unittests/synergy/CClipboardTests.cpp b/src/test/unittests/synergy/CClipboardTests.cpp
index f968c790..cf14e382 100644
--- a/src/test/unittests/synergy/CClipboardTests.cpp
+++ b/src/test/unittests/synergy/CClipboardTests.cpp
@@ -20,24 +20,24 @@
TEST(CClipboardTests, empty_openCalled_returnsTrue)
{
- CClipboard clipboard;
- clipboard.open(0);
-
- bool actual = clipboard.empty();
-
+ CClipboard clipboard;
+ clipboard.open(0);
+
+ bool actual = clipboard.empty();
+
EXPECT_EQ(true, actual);
}
TEST(CClipboardTests, empty_singleFormat_hasReturnsFalse)
{
- CClipboard clipboard;
- clipboard.open(0);
- clipboard.add(CClipboard::kText, "synergy rocks!");
-
- clipboard.empty();
-
- bool actual = clipboard.has(CClipboard::kText);
- EXPECT_EQ(false, actual);
+ CClipboard clipboard;
+ clipboard.open(0);
+ clipboard.add(CClipboard::kText, "synergy rocks!");
+
+ clipboard.empty();
+
+ bool actual = clipboard.has(CClipboard::kText);
+ EXPECT_FALSE(actual);
}
TEST(CClipboardTests, add_newValue_valueWasStored)
@@ -65,19 +65,19 @@ TEST(CClipboardTests, add_replaceValue_valueWasReplaced)
TEST(CClipboardTests, open_timeIsZero_returnsTrue)
{
- CClipboard clipboard;
-
- bool actual = clipboard.open(0);
-
+ CClipboard clipboard;
+
+ bool actual = clipboard.open(0);
+
EXPECT_EQ(true, actual);
}
TEST(CClipboardTests, open_timeIsOne_returnsTrue)
{
- CClipboard clipboard;
-
- bool actual = clipboard.open(1);
-
+ CClipboard clipboard;
+
+ bool actual = clipboard.open(1);
+
EXPECT_EQ(true, actual);
}
@@ -93,22 +93,22 @@ TEST(CClipboardTests, close_isOpen_noErrors)
TEST(CClipboardTests, getTime_openWithNoEmpty_returnsZero)
{
- CClipboard clipboard;
- clipboard.open(1);
-
- CClipboard::Time actual = clipboard.getTime();
-
+ CClipboard clipboard;
+ clipboard.open(1);
+
+ CClipboard::Time actual = clipboard.getTime();
+
EXPECT_EQ(0, actual);
}
TEST(CClipboardTests, getTime_openAndEmpty_returnsOne)
{
- CClipboard clipboard;
- clipboard.open(1);
- clipboard.empty();
-
- CClipboard::Time actual = clipboard.getTime();
-
+ CClipboard clipboard;
+ clipboard.open(1);
+ clipboard.empty();
+
+ CClipboard::Time actual = clipboard.getTime();
+
EXPECT_EQ(1, actual);
}
@@ -130,7 +130,7 @@ TEST(CClipboardTests, has_withNoFormats_returnsFalse)
bool actual = clipboard.has(IClipboard::kText);
- EXPECT_EQ(false, actual);
+ EXPECT_FALSE(actual);
}
TEST(CClipboardTests, get_withNoFormats_returnsEmpty)
@@ -281,7 +281,7 @@ TEST(CClipboardTests, unmarshall_emptyData_hasTextIsFalse)
clipboard.open(0);
bool actual = clipboard.has(IClipboard::kText);
- EXPECT_EQ(false, actual);
+ EXPECT_FALSE(actual);
}
TEST(CClipboardTests, unmarshall_withTextSize285_getTextIsValid)
diff --git a/src/test/unittests/synergy/CKeyStateImpl.h b/src/test/unittests/synergy/CKeyStateImpl.h
new file mode 100644
index 00000000..81bc2edd
--- /dev/null
+++ b/src/test/unittests/synergy/CKeyStateImpl.h
@@ -0,0 +1,60 @@
+/*
+ * synergy -- mouse and keyboard sharing utility
+ * Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
+ *
+ * This package is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * found in the file COPYING that should have accompanied this file.
+ *
+ * This package is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#ifndef CKEYSTATEIMPL_H
+#define CKEYSTATEIMPL_H
+
+#include "CKeyState.h"
+#include "gmock/gmock.h"
+
+class CMockKeyMap;
+class CMockEventQueue;
+
+// while the class name indicates that this is actually a mock, we use a
+// typedef later to rename it (so the name matches the compilation unit)
+// so the tests are less confusing.
+class CMockKeyState : public CKeyState
+{
+public:
+ CMockKeyState() : CKeyState()
+ {
+ }
+
+ CMockKeyState(const CMockEventQueue& eventQueue, const CMockKeyMap& keyMap) :
+ CKeyState((IEventQueue&)eventQueue, (CKeyMap&)keyMap)
+ {
+ }
+
+ MOCK_CONST_METHOD0(pollActiveGroup, SInt32());
+ MOCK_CONST_METHOD0(pollActiveModifiers, KeyModifierMask());
+ MOCK_METHOD0(fakeCtrlAltDel, bool());
+ MOCK_METHOD1(getKeyMap, void(CKeyMap&));
+ MOCK_METHOD1(fakeKey, void(const Keystroke&));
+ MOCK_CONST_METHOD1(pollPressedKeys, void(KeyButtonSet&));
+};
+
+// hide that we're actually testing a mock to make the unit tests less
+// confusing. use NiceMock so that we don't get warnings for unexpected
+// calls.
+typedef ::testing::NiceMock CKeyStateImpl;
+
+typedef UInt32 KeyID;
+
+typedef void (*ForeachKeyCallback)(
+ KeyID, SInt32 group, CKeyMap::KeyItem&, void* userData);
+
+#endif
diff --git a/src/test/unittests/synergy/CKeyStateTests.cpp b/src/test/unittests/synergy/CKeyStateTests.cpp
index bb8e9c6f..f73cff28 100644
--- a/src/test/unittests/synergy/CKeyStateTests.cpp
+++ b/src/test/unittests/synergy/CKeyStateTests.cpp
@@ -16,66 +16,205 @@
*/
#include
-#include "CKeyState.h"
+#include
+#include "CKeyStateImpl.h"
+#include "CMockEventQueue.h"
+#include "CMockKeyMap.h"
+
+using ::testing::_;
+using ::testing::NiceMock;
+using ::testing::Invoke;
+using ::testing::Return;
+using ::testing::SaveArg;
enum {
kAKey = 30
};
-class CKeyStateImpl : public CKeyState
+TEST(CKeyStateTests, onKey_aKeyDown_keyStateOne)
{
-protected:
- virtual SInt32 pollActiveGroup() const
- {
- return 0;
- }
-
- virtual KeyModifierMask pollActiveModifiers() const
- {
- return 0;
- }
-
- virtual bool fakeCtrlAltDel()
- {
- return false;
- }
-
- virtual void getKeyMap(CKeyMap& keyMap)
- {
- }
-
- virtual void fakeKey(const Keystroke& keystroke)
- {
- }
-
- virtual void pollPressedKeys(KeyButtonSet& pressedKeys) const
- {
- }
-};
-
-TEST(CKeyStateTests, onKey_aKeyPressed_keyStateOne)
-{
- CKeyStateImpl keyState;
+ CMockKeyMap keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
keyState.onKey(kAKey, true, KeyModifierAlt);
EXPECT_EQ(1, keyState.getKeyState(kAKey));
}
-TEST(CKeyStateTests, onKey_validButtonUp_keyStateZero)
+TEST(CKeyStateTests, onKey_aKeyUp_keyStateZero)
{
- CKeyStateImpl keyState;
+ CMockKeyMap keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+
+ keyState.onKey(kAKey, false, KeyModifierAlt);
+
+ EXPECT_EQ(0, keyState.getKeyState(kAKey));
+}
+
+TEST(CKeyStateTests, onKey_invalidKey_keyStateZero)
+{
+ CMockKeyMap keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
keyState.onKey(0, true, KeyModifierAlt);
EXPECT_EQ(0, keyState.getKeyState(0));
}
-TEST(CKeyStateTests, onKey_bogusButtonDown_keyStateZero)
+TEST(CKeyStateTests, sendKeyEvent_halfDuplexAndRepeat_addEventNotCalled)
{
- CKeyStateImpl keyState;
+ NiceMock keyMap;
+ NiceMock eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+ ON_CALL(keyMap, isHalfDuplex(_, _)).WillByDefault(Return(true));
- keyState.onKey(0, true, KeyModifierAlt);
+ EXPECT_CALL(eventQueue, addEvent(_)).Times(0);
- EXPECT_EQ(0, keyState.getKeyState(0));
+ keyState.sendKeyEvent(NULL, false, true, kKeyCapsLock, 0, 0, 0);
+}
+
+TEST(CKeyStateTests, sendKeyEvent_halfDuplex_addEventCalledTwice)
+{
+ CMockKeyMap keyMap;
+ NiceMock eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+ ON_CALL(keyMap, isHalfDuplex(_, _)).WillByDefault(Return(true));
+
+ EXPECT_CALL(eventQueue, addEvent(_)).Times(2);
+
+ keyState.sendKeyEvent(NULL, false, false, kKeyCapsLock, 0, 0, 0);
+}
+
+TEST(CKeyStateTests, sendKeyEvent_keyRepeat_addEventCalledOnce)
+{
+ CMockKeyMap keyMap;
+ NiceMock eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+
+ EXPECT_CALL(eventQueue, addEvent(_)).Times(1);
+
+ keyState.sendKeyEvent(NULL, false, true, kAKey, 0, 0, 0);
+}
+
+TEST(CKeyStateTests, sendKeyEvent_keyDown_addEventCalledOnce)
+{
+ CMockKeyMap keyMap;
+ NiceMock eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+
+ EXPECT_CALL(eventQueue, addEvent(_)).Times(1);
+
+ keyState.sendKeyEvent(NULL, true, false, kAKey, 0, 0, 0);
+}
+
+TEST(CKeyStateTests, sendKeyEvent_keyUp_addEventCalledOnce)
+{
+ CMockKeyMap keyMap;
+ NiceMock eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+
+ EXPECT_CALL(eventQueue, addEvent(_)).Times(1);
+
+ keyState.sendKeyEvent(NULL, false, false, kAKey, 0, 0, 0);
+}
+
+TEST(CKeyStateTests, updateKeyMap_mockKeyMap_keyMapGotMock)
+{
+ CMockKeyMap keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+
+ EXPECT_CALL(keyMap, swap(_));
+ EXPECT_CALL(keyMap, finish());
+
+ keyState.updateKeyMap();
+}
+
+void
+stubPollPressedKeys(IKeyState::KeyButtonSet& pressedKeys)
+{
+ pressedKeys.insert(kAKey);
+}
+
+TEST(CKeyStateTests, updateKeyState_pollInsertsSingleKey_keyIsDown)
+{
+ NiceMock keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+ ON_CALL(keyState, pollPressedKeys(_)).WillByDefault(Invoke(stubPollPressedKeys));
+
+ keyState.updateKeyState();
+
+ bool actual = keyState.isKeyDown(kAKey);
+ ASSERT_TRUE(actual);
+}
+
+TEST(CKeyStateTests, updateKeyState_pollDoesNothing_keyNotSet)
+{
+ NiceMock keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+
+ keyState.updateKeyState();
+
+ bool actual = keyState.isKeyDown(kAKey);
+ ASSERT_FALSE(actual);
+}
+
+TEST(CKeyStateTests, updateKeyState_activeModifiers_maskSet)
+{
+ NiceMock keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+ ON_CALL(keyState, pollActiveModifiers()).WillByDefault(Return(KeyModifierAlt));
+
+ keyState.updateKeyState();
+
+ KeyModifierMask actual = keyState.getActiveModifiers();
+ ASSERT_EQ(KeyModifierAlt, actual);
+}
+
+TEST(CKeyStateTests, updateKeyState_activeModifiers_maskNotSet)
+{
+ NiceMock keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+
+ keyState.updateKeyState();
+
+ KeyModifierMask actual = keyState.getActiveModifiers();
+ ASSERT_EQ(0, actual);
+}
+
+void
+assertMaskIsOne(ForeachKeyCallback cb, void* userData)
+{
+ ASSERT_EQ(1, ((CKeyState::CAddActiveModifierContext*)userData)->m_mask);
+}
+
+TEST(CKeyStateTests, updateKeyState_activeModifiers_keyMapGotModifers)
+{
+ CMockKeyMap keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+ EXPECT_CALL(keyMap, foreachKey(_, _));
+
+ ON_CALL(keyState, pollActiveModifiers()).WillByDefault(Return(1));
+ ON_CALL(keyMap, foreachKey(_, _)).WillByDefault(Invoke(assertMaskIsOne));
+
+ keyState.updateKeyState();
+}
+
+TEST(CKeyStateTests, setHalfDuplexMask_capsLock_halfDuplexCapsLockAdded)
+{
+ CMockKeyMap keyMap;
+ CMockEventQueue eventQueue;
+ CKeyStateImpl keyState(eventQueue, keyMap);
+
+ EXPECT_CALL(keyMap, addHalfDuplexModifier(kKeyCapsLock));
+
+ keyState.setHalfDuplexMask(KeyModifierCapsLock);
}
diff --git a/src/test/unittests/synergy/CMockEventQueue.h b/src/test/unittests/synergy/CMockEventQueue.h
new file mode 100644
index 00000000..9390955e
--- /dev/null
+++ b/src/test/unittests/synergy/CMockEventQueue.h
@@ -0,0 +1,44 @@
+/*
+ * synergy -- mouse and keyboard sharing utility
+ * Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
+ *
+ * This package is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * found in the file COPYING that should have accompanied this file.
+ *
+ * This package is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#ifndef CMOCKEVENTQUEUE_H
+#define CMOCKEVENTQUEUE_H
+
+#include
+#include "IEventQueue.h"
+
+class CMockEventQueue : public IEventQueue
+{
+public:
+ MOCK_METHOD2(newOneShotTimer, CEventQueueTimer*(double, void*));
+ MOCK_METHOD2(newTimer, CEventQueueTimer*(double, void*));
+ MOCK_METHOD2(getEvent, bool(CEvent&, double));
+ MOCK_METHOD1(adoptBuffer, void(IEventQueueBuffer*));
+ MOCK_METHOD2(registerTypeOnce, CEvent::Type(CEvent::Type&, const char*));
+ MOCK_METHOD1(removeHandlers, void(void*));
+ MOCK_METHOD1(registerType, CEvent::Type(const char*));
+ MOCK_CONST_METHOD0(isEmpty, bool());
+ MOCK_METHOD3(adoptHandler, void(CEvent::Type, void*, IEventJob*));
+ MOCK_METHOD1(getTypeName, const char*(CEvent::Type));
+ MOCK_METHOD1(addEvent, void(const CEvent&));
+ MOCK_METHOD2(removeHandler, void(CEvent::Type, void*));
+ MOCK_METHOD1(dispatchEvent, bool(const CEvent&));
+ MOCK_CONST_METHOD2(getHandler, IEventJob*(CEvent::Type, void*));
+ MOCK_METHOD1(deleteTimer, void(CEventQueueTimer*));
+};
+
+#endif
diff --git a/src/test/unittests/synergy/CMockKeyMap.h b/src/test/unittests/synergy/CMockKeyMap.h
new file mode 100644
index 00000000..d5a8ac78
--- /dev/null
+++ b/src/test/unittests/synergy/CMockKeyMap.h
@@ -0,0 +1,34 @@
+/*
+ * synergy -- mouse and keyboard sharing utility
+ * Copyright (C) 2011 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
+ *
+ * This package is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * found in the file COPYING that should have accompanied this file.
+ *
+ * This package is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#ifndef CMOCKKEYMAP_H
+#define CMOCKKEYMAP_H
+
+#include
+#include "CKeyMap.h"
+
+class CMockKeyMap : public CKeyMap
+{
+public:
+ MOCK_METHOD1(swap, void(CKeyMap&));
+ MOCK_METHOD0(finish, void());
+ MOCK_METHOD2(foreachKey, void(ForeachKeyCallback, void*));
+ MOCK_METHOD1(addHalfDuplexModifier, void(KeyID));
+ MOCK_CONST_METHOD2(isHalfDuplex, bool(KeyID, KeyButton));
+};
+
+#endif
diff --git a/tools/build/__init__.py b/tools/build/__init__.py
index 1cf7e0b0..f272ddb0 100644
--- a/tools/build/__init__.py
+++ b/tools/build/__init__.py
@@ -11,4 +11,6 @@
# 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 .
\ No newline at end of file
+# along with this program. If not, see .
+
+from build import generators
diff --git a/tools/build/generators.py b/tools/build/generators.py
new file mode 100644
index 00000000..1d326071
--- /dev/null
+++ b/tools/build/generators.py
@@ -0,0 +1,50 @@
+class Generator(object):
+ def __init__(self, cmakeName, buildDir='build', sourceDir='..', binDir='bin'):
+ self.cmakeName = cmakeName
+ self.buildDir = buildDir
+ self.sourceDir = sourceDir
+ self.binDir = binDir
+
+ def getBuildDir(self, target):
+ return self.buildDir
+
+ def getBinDir(self, target=''):
+ return self.binDir
+
+ def getSourceDir(self):
+ return self.sourceDir
+
+class MakefilesGenerator(Generator):
+ def __init__(self):
+ super(MakefilesGenerator, self).__init__('Unix Makefiles', 'build', '..', 'bin')
+
+ def getBuildDir(self, target):
+ return super(MakefilesGenerator, self).getBuildDir(target) + '/' + target
+
+ def getBinDir(self, target=''):
+ workingDir = super(MakefilesGenerator, self).getBinDir(target)
+
+ # only put debug files in separate bin dir
+ if target == 'debug':
+ workingDir += '/debug'
+
+ return workingDir
+
+ def getSourceDir(self):
+ return super(MakefilesGenerator, self).getSourceDir() + '/..'
+
+class EclipseGenerator(Generator):
+ def __init__(self):
+ super(EclipseGenerator, self).__init__('Eclipse CDT4 - Unix Makefiles', '', '')
+
+ def getBuildDir(self, target):
+ # eclipse only works with in-source build.
+ return ''
+
+ def getBinDir(self, target=''):
+ # eclipse only works with in-source build.
+ return 'bin'
+
+ def getSourceDir(self):
+ return ''
+
diff --git a/tools/build/toolchain.py b/tools/build/toolchain.py
index e840b7da..0db362be 100644
--- a/tools/build/toolchain.py
+++ b/tools/build/toolchain.py
@@ -16,6 +16,7 @@
# TODO: split this file up, it's too long!
import sys, os, ConfigParser, shutil, re, ftputil
+from generators import Generator, EclipseGenerator, MakefilesGenerator
if sys.version_info >= (2, 4):
import subprocess
@@ -23,7 +24,7 @@ if sys.version_info >= (2, 4):
class InternalCommands:
project = 'synergy'
- setup_version = 4 # increment to force setup/config
+ setup_version = 5 # increment to force setup/config
website_url = 'http://synergy-foss.org/'
this_cmd = 'hm'
@@ -33,11 +34,9 @@ class InternalCommands:
xcodebuild_cmd = 'xcodebuild'
w32_make_cmd = 'mingw32-make'
w32_qt_version = '4.6.2'
+ defaultTarget = 'release'
- source_dir = '..' # Source, relative to build.
cmake_dir = 'res'
- build_dir = 'build'
- bin_dir = 'bin'
gui_dir = 'src/gui'
doc_dir = 'doc'
@@ -69,37 +68,33 @@ class InternalCommands:
enable_make_gui = False
win32_generators = {
- 1 : 'Visual Studio 10',
- 2 : 'Visual Studio 10 Win64',
- 3 : 'Visual Studio 9 2008',
- 4 : 'Visual Studio 9 2008 Win64',
- 5 : 'Visual Studio 8 2005',
- 6 : 'Visual Studio 8 2005 Win64',
+ 1 : Generator('Visual Studio 10'),
+ 2 : Generator('Visual Studio 10 Win64'),
+ 3 : Generator('Visual Studio 9 2008'),
+ 4 : Generator('Visual Studio 9 2008 Win64'),
+ 5 : Generator('Visual Studio 8 2005'),
+ 6 : Generator('Visual Studio 8 2005 Win64')
}
unix_generators = {
- 1 : 'Unix Makefiles',
+ 1 : MakefilesGenerator(),
+ 2 : EclipseGenerator(),
}
darwin_generators = {
- 1 : 'Unix Makefiles',
- 2 : 'Xcode',
+ 1 : MakefilesGenerator(),
+ 2 : Generator('Xcode'),
+ 3 : EclipseGenerator(),
}
def getBuildDir(self, target=''):
- workingDir = self.build_dir
- if target != '':
- workingDir += '/' + target
- return workingDir
+ return self.getGenerator().getBuildDir(target)
def getBinDir(self, target=''):
- workingDir = self.bin_dir
- if target != '':
- workingDir += '/' + target
- return workingDir
+ return self.getGenerator().getBinDir(target)
- def config_filepath(self, target=''):
- return '%s/%s' % (self.getBuildDir(target), self.config_filename)
+ def getConfigDir(self):
+ return self.config_filename
def sln_filepath(self):
return '%s\%s' % (self.getBuildDir(), self.sln_filename)
@@ -129,16 +124,17 @@ class InternalCommands:
'\n'
'Example: %s build -g 3'
) % (app, app)
-
- def configure(self, target):
- self.configure_internal(target)
-
- print ('Configure complete!\n\n'
- 'Open project now: %s open\n'
- 'Command line build: %s build'
- ) % (self.this_cmd, self.this_cmd)
- def configure_internal(self, target='', extraArgs=''):
+ def configureAll(self, targets):
+
+ # if no mode specified, use default
+ if len(targets) == 0:
+ targets += [self.defaultTarget,]
+
+ for target in targets:
+ self.configure(target)
+
+ def configure(self, target='', extraArgs=''):
cmake_args = ''
@@ -148,37 +144,42 @@ class InternalCommands:
# ensure that we have access to cmake
_cmake_cmd = self.persist_cmake()
-
+
# now that we know we've got the latest setup, we can ask the config
# file for the generator (but again, we only fall back to this if not
# specified as arg).
- generator = self.get_generator_from_config()
+ generator = self.getGenerator()
- if generator != '':
- cmake_args += ' -G "' + generator + '"'
+ if generator != self.findGeneratorFromConfig():
+ print('Generator changed, running setup.')
+ self.setup(target)
+
+ if generator.cmakeName != '':
+ cmake_args += ' -G "' + generator.cmakeName + '"'
+ # default is release
+ if target == '':
+ print 'Defaulting target to: ' + self.defaultTarget
+ target = self.defaultTarget
+
# for non-vs always specify a build type (debug, release, etc)
- if not generator.startswith('Visual Studio'):
- # default is default for non-vs
- if target == '':
- target = 'debug'
+ if not generator.cmakeName.startswith('Visual Studio'):
cmake_args += ' -DCMAKE_BUILD_TYPE=' + target.capitalize()
# if not visual studio, use parent dir
- sourceDir = self.source_dir
- if not generator.startswith('Visual Studio'):
- sourceDir += '/..'
+ sourceDir = generator.getSourceDir()
if extraArgs != '':
cmake_args += ' ' + extraArgs
cmake_cmd_string = _cmake_cmd + cmake_args + ' ' + sourceDir
- print "CMake command: " + cmake_cmd_string
-
# Run from build dir so we have an out-of-source build.
self.try_chdir(self.getBuildDir(target))
+
+ print "CMake command: " + cmake_cmd_string
err = os.system(cmake_cmd_string)
+
self.restore_chdir()
if err != 0:
@@ -201,7 +202,7 @@ class InternalCommands:
if err != 0:
raise Exception('QMake encountered error: ' + str(err))
- self.set_conf_run()
+ self.setConfRun(target)
def persist_cmake(self):
# even though we're running `cmake --version`, we're only doing this for the 0 return
@@ -220,8 +221,6 @@ class InternalCommands:
def persist_qt(self):
self.persist_qmake()
- if sys.platform == 'win32':
- self.persist_w32_make()
def persist_qmake(self):
# cannot use subprocess on < python 2.4
@@ -261,46 +260,47 @@ class InternalCommands:
else:
raise Exception('Could not find qmake version.')
- def persist_w32_make():
- # TODO
- pass
+ def ensureConfHasRun(self, target, skipConfig):
+ if self.hasConfRun(target):
+ print 'Skipping config for target: ' + target
+ skipConfig = True
+
+ if not skipConfig:
+ self.configure(target)
def build(self, targets=[], skipConfig=False):
- # if no mode specified, default to debug
+ # if no mode specified, use default
if len(targets) == 0:
- targets += ['debug',]
+ targets += [self.defaultTarget,]
self.ensure_setup_latest()
- generator = self.get_generator_from_config()
-
- if generator.startswith('Visual Studio'):
-
- # only need to configure once for vs
- if not self.has_conf_run() and not skipConfig:
- self.configure_internal()
+ generator = self.getGeneratorFromConfig().cmakeName
+ if generator.startswith('Visual Studio'):
+
+ self.ensureConfHasRun('all', skipConfig)
+
for target in targets:
self.run_vcbuild(generator, target)
else:
-
+
+ for target in targets:
+ self.ensureConfHasRun(target, skipConfig)
+
cmd = ''
- if generator == "Unix Makefiles":
+ if generator.find("Unix Makefiles") != -1:
print 'Building with GNU Make...'
cmd = self.make_cmd
elif generator == 'Xcode':
print 'Building with Xcode...'
cmd = self.xcodebuild_cmd
else:
- raise Exception('Not supported with generator: ' + generator)
+ raise Exception('Build command not supported with generator: ' + generator)
for target in targets:
-
- if not self.has_conf_run(target) and not skipConfig:
- self.configure_internal(target)
-
self.try_chdir(self.getBuildDir(target))
err = os.system(cmd)
self.restore_chdir()
@@ -314,11 +314,11 @@ class InternalCommands:
def clean(self, targets=[]):
- # if no mode specified, default to debug
+ # if no mode specified, use default
if len(targets) == 0:
- targets += ['debug',]
+ targets += [self.defaultTarget,]
- generator = self.get_generator_from_config()
+ generator = self.getGeneratorFromConfig().cmakeName
if generator.startswith('Visual Studio'):
# special case for version 10, use new /target:clean
@@ -391,7 +391,7 @@ class InternalCommands:
self.restore_chdir()
def open(self):
- generator = self.get_generator_from_config()
+ generator = self.getGeneratorFromConfig().cmakeName
if generator.startswith('Visual Studio'):
print 'Opening with %s...' % generator
self.open_internal(self.sln_filepath())
@@ -437,8 +437,8 @@ class InternalCommands:
def doxygen(self):
# The conf generates doc/doxygen.cfg from cmake/doxygen.cfg.in
- if not self.has_conf_run():
- self.configure_internal()
+ if not self.hasConfRun():
+ self.configure()
err = os.system('doxygen %s/%s' % (self.doc_dir, self.doxygen_filename))
@@ -449,13 +449,13 @@ class InternalCommands:
# Package is supported by default.
package_unsupported = False
- unixTarget = 'release'
+ unixTarget = self.defaultTarget
if type != 'win' and type != 'mac':
- self.configure_internal(unixTarget, '-DCONF_CPACK:BOOL=TRUE')
+ self.configure(unixTarget, '-DCONF_CPACK:BOOL=TRUE')
# make sure we have a release build to package
- self.build(['release'], skipConfig=True)
+ self.build([self.defaultTarget], skipConfig=True)
moveExt = ''
@@ -500,8 +500,8 @@ class InternalCommands:
if moveExt != '':
self.unixMove(
- self.build_dir + '/release/*.' + moveExt,
- self.bin_dir)
+ self.getGenerator().buildDir + '/release/*.' + moveExt,
+ self.getGenerator().binDir)
if package_unsupported:
raise Exception(
@@ -511,7 +511,7 @@ class InternalCommands:
def distSrc(self):
version = self.getVersionFromCmake()
name = (self.project + '-' + version + '-Source')
- exportPath = self.build_dir + '/' + name
+ exportPath = self.getGenerator().buildDir + '/' + name
if os.path.exists(exportPath):
print "Removing existing export..."
@@ -523,10 +523,10 @@ class InternalCommands:
if err != 0:
raise Exception('Repository export failed: ' + str(err))
- packagePath = '../' + self.bin_dir + '/' + name + '.tar.gz'
+ packagePath = '../' + self.getGenerator().binDir + '/' + name + '.tar.gz'
try:
- self.try_chdir(self.build_dir)
+ self.try_chdir(self.getGenerator().buildDir)
print 'Packaging to: ' + packagePath
err = os.system('tar cfvz ' + packagePath + ' ' + name)
if err != 0:
@@ -570,7 +570,7 @@ class InternalCommands:
else:
shutil.copy2(f, zipFile + '/')
- zipCmd = ('zip -r ../../' + self.bin_dir + '/' + zipFile + '.zip ' + zipFile);
+ zipCmd = ('zip -r ../../' + self.getGenerator().binDir + '/' + zipFile + '.zip ' + zipFile);
print 'Creating package: ' + zipCmd
err = os.system(zipCmd)
@@ -590,7 +590,7 @@ class InternalCommands:
raise Exception(
'QT SDK dir path not specified (--qt-dir).')
- generator = self.get_generator_from_config()
+ generator = self.getGeneratorFromConfig().cmakeName
arch = 'x86'
installDirVar = '$PROGRAMFILES32'
@@ -608,7 +608,7 @@ class InternalCommands:
template = template.replace('${in:qtDir}', qtDir)
template = template.replace('${in:installDirVar}', installDirVar)
- nsiPath = self.build_dir + '\Installer.nsi'
+ nsiPath = self.getGenerator().buildDir + '\Installer.nsi'
nsiFile = open(nsiPath, 'w')
nsiFile.write(template)
nsiFile.close()
@@ -646,7 +646,7 @@ class InternalCommands:
print 'Uploading %s to FTP server %s...' % (dest, ftp.host)
srcDir = 'bin/'
- generator = self.get_generator_from_config()
+ generator = self.getGeneratorFromConfig().cmakeName
#if not generator.startswith('Visual Studio'):
# srcDir += 'release/'
@@ -678,7 +678,7 @@ class InternalCommands:
# get platform based on last generator used
ext = 'exe'
- generator = self.get_generator_from_config()
+ generator = self.getGeneratorFromConfig().cmakeName
if generator.find('Win64') != -1:
platform = 'Windows-x64'
else:
@@ -696,8 +696,6 @@ class InternalCommands:
# only use release dir if not windows
target = ''
- #if type != 'win':
- # target = 'release'
for filename in os.listdir(self.getBinDir(target)):
if re.search(pattern, filename):
@@ -740,12 +738,17 @@ class InternalCommands:
def try_chdir(self, dir):
+ global prevdir
+
+ if dir == '':
+ prevdir = ''
+ return
+
# Ensure temp build dir exists.
if not os.path.exists(dir):
print 'Creating dir: ' + dir
- os.mkdir(dir)
-
- global prevdir
+ os.makedirs(dir)
+
prevdir = os.path.abspath(os.curdir)
# It will exist by this point, so it's safe to chdir.
@@ -754,6 +757,8 @@ class InternalCommands:
def restore_chdir(self):
global prevdir
+ if prevdir == '':
+ return
print 'Going back to: ' + prevdir
os.chdir(prevdir)
@@ -774,17 +779,26 @@ class InternalCommands:
def setup(self, target=''):
print "Running setup..."
+ oldGenerator = self.findGeneratorFromConfig()
+ if not oldGenerator == None:
+ for target in ['debug', 'release']:
+ buildDir = oldGenerator.getBuildDir(target)
+
+ cmakeCacheFilename = 'CMakeCache.txt'
+ if buildDir != '':
+ cmakeCacheFilename = buildDir + '/' + cmakeCacheFilename
+
+ if os.path.exists(cmakeCacheFilename):
+ print "Removing %s, since generator changed." % cmakeCacheFilename
+ os.remove(cmakeCacheFilename)
+
# always either get generator from args, or prompt user when
# running setup
generator = self.get_generator_from_prompt()
- # Create build dir, since config file resides there.
- if not os.path.exists(self.getBuildDir(target)):
- os.mkdir(self.getBuildDir(target))
-
- if os.path.exists(self.config_filepath()):
+ if os.path.exists(self.getConfigDir()):
config = ConfigParser.ConfigParser()
- config.read(self.config_filepath())
+ config.read(self.getConfigDir())
else:
config = ConfigParser.ConfigParser()
@@ -801,29 +815,46 @@ class InternalCommands:
self.write_config(config)
- cmakecache_filename = '%s/CMakeCache.txt' % self.getBuildDir(target)
- if os.path.exists(cmakecache_filename):
- print "Removing %s, since generator changed." % cmakecache_filename
- os.remove(cmakecache_filename)
+ # for all targets, set conf not run
+ self.setConfRun('all', False)
+ self.setConfRun('debug', False)
+ self.setConfRun('release', False)
- print "\nSetup complete."
+ print "Setup complete."
def write_config(self, config, target=''):
- configfile = open(self.config_filepath(target), 'wb')
+ configfile = open(self.getConfigDir(), 'wb')
config.write(configfile)
- def get_generator_from_config(self):
- if self.generator_id:
- return self.getGenerator()
- else:
- config = ConfigParser.RawConfigParser()
- config.read(self.config_filepath())
- return config.get('cmake', 'generator')
+ def getGeneratorFromConfig(self):
+ generator = self.findGeneratorFromConfig()
+ if generator:
+ return generator
+
+ raise Exception("Could not find generator: " + name)
+
+ def findGeneratorFromConfig(self):
+ config = ConfigParser.RawConfigParser()
+ config.read(self.getConfigDir())
+
+ if not config.has_section('cmake'):
+ return None
+
+ name = config.get('cmake', 'generator')
+
+ generators = self.get_generators()
+ keys = generators.keys()
+ keys.sort()
+ for k in keys:
+ if generators[k].cmakeName == name:
+ return generators[k]
+
+ return None
def min_setup_version(self, version):
- if os.path.exists(self.config_filepath()):
+ if os.path.exists(self.getConfigDir()):
config = ConfigParser.RawConfigParser()
- config.read(self.config_filepath())
+ config.read(self.getConfigDir())
try:
return config.getint('hm', 'setup_version') >= version
@@ -832,22 +863,22 @@ class InternalCommands:
else:
return False
- def has_conf_run(self, target=''):
+ def hasConfRun(self, target):
if self.min_setup_version(2):
config = ConfigParser.RawConfigParser()
- config.read(self.config_filepath(target))
+ config.read(self.getConfigDir())
try:
- return config.getboolean('hm', 'has_conf_run')
+ return config.getboolean('hm', 'conf_done_' + target)
except:
return False
else:
return False
- def set_conf_run(self):
+ def setConfRun(self, target, hasRun=True):
if self.min_setup_version(3):
config = ConfigParser.RawConfigParser()
- config.read(self.config_filepath())
- config.set('hm', 'has_conf_run', True)
+ config.read(self.getConfigDir())
+ config.set('hm', 'conf_done_' + target, hasRun)
self.write_config(config)
else:
raise Exception("User does not have correct setup version.")
@@ -863,7 +894,7 @@ class InternalCommands:
raise Exception('Unsupported platform: ' + sys.platform)
def get_generator_from_prompt(self):
- return self.getGenerator()
+ return self.getGenerator().cmakeName
def getGenerator(self):
generators = self.get_generators()
@@ -873,10 +904,14 @@ class InternalCommands:
# if user has specified a generator as an argument
if self.generator_id:
return generators[int(self.generator_id)]
- else:
- raise Exception(
- 'Generator not specified, use -g arg ' +
- '(use `hm genlist` for a list of generators).')
+
+ conf = self.findGeneratorFromConfig()
+ if conf:
+ return conf
+
+ raise Exception(
+ 'Generator not specified, use -g arg ' +
+ '(use `hm genlist` for a list of generators).')
def setup_generator_prompt(self, generators):
@@ -1000,7 +1035,7 @@ class InternalCommands:
keys = generators.keys()
keys.sort()
for k in keys:
- print str(k) + ': ' + generators[k]
+ print str(k) + ': ' + generators[k].cmakeName
def getMacPackageName(self):
import commands
@@ -1056,10 +1091,7 @@ class CommandHandler:
self.ic.setup()
def configure(self):
- target = ''
- if (len(self.build_targets) > 0):
- target = self.build_targets[0]
- self.ic.configure(target)
+ self.ic.configureAll(self.build_targets)
def build(self):
self.ic.build(self.build_targets)