skeleton for new ipc code.

This commit is contained in:
Nick Bolton 2012-06-28 07:29:06 +00:00
parent 0c42964f3a
commit 7d8fd5927d
12 changed files with 318 additions and 9 deletions

View File

@ -18,6 +18,7 @@ add_subdirectory(base)
add_subdirectory(client) add_subdirectory(client)
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(io) add_subdirectory(io)
add_subdirectory(ipc)
add_subdirectory(mt) add_subdirectory(mt)
add_subdirectory(net) add_subdirectory(net)
add_subdirectory(platform) add_subdirectory(platform)

View File

@ -0,0 +1,31 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "CIpcClient.h"
CIpcClient::CIpcClient()
{
}
CIpcClient::~CIpcClient()
{
}
void
CIpcClient::connect()
{
}

31
src/lib/ipc/CIpcClient.h Normal file
View File

@ -0,0 +1,31 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//! IPC client for communication between daemon and GUI.
/*!
* See \ref CIpcServer description.
*/
class CIpcClient {
public:
CIpcClient();
virtual ~CIpcClient();
//! Connects to the IPC server at localhost.
void connect();
};

View File

@ -0,0 +1,26 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "CIpcClientProxy.h"
CIpcClientProxy::CIpcClientProxy()
{
}
CIpcClientProxy::~CIpcClientProxy()
{
}

View File

@ -0,0 +1,24 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
class CIpcClientProxy {
public:
CIpcClientProxy();
virtual ~CIpcClientProxy();
};

View File

@ -0,0 +1,31 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "CIpcServer.h"
CIpcServer::CIpcServer()
{
}
CIpcServer::~CIpcServer()
{
}
void
CIpcServer::listen()
{
}

34
src/lib/ipc/CIpcServer.h Normal file
View File

@ -0,0 +1,34 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//! IPC server for communication between daemon and GUI.
/*!
* The IPC server listens on localhost. The IPC client runs on both the
* client/server process or the GUI. The IPC server runs on the daemon process.
* This allows the GUI to send config changes to the daemon and client/server,
* and allows the daemon and client/server to send log data to the GUI.
*/
class CIpcServer {
public:
CIpcServer();
virtual ~CIpcServer();
//! Opens a TCP socket only allowing local connections
void listen();
};

View File

@ -0,0 +1,26 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "CIpcServerProxy.h"
CIpcServerProxy::CIpcServerProxy()
{
}
CIpcServerProxy::~CIpcServerProxy()
{
}

View File

@ -0,0 +1,24 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
class CIpcServerProxy {
public:
CIpcServerProxy();
virtual ~CIpcServerProxy();
};

View File

@ -0,0 +1,49 @@
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea
#
# This package is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# found in the file COPYING that should have accompanied this file.
#
# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(inc
CIpcServer.h
CIpcClient.h
CIpcServerProxy.h
CIpcClientProxy.h
)
set(src
CIpcServer.cpp
CIpcClient.cpp
CIpcServerProxy.cpp
CIpcClientProxy.cpp
)
if (WIN32)
list(APPEND src ${inc})
endif()
set(inc
../net
)
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc})
add_library(ipc STATIC ${src})
if (UNIX)
target_link_libraries(net)
endif()

View File

@ -0,0 +1,38 @@
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012 Nick Bolton
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include <gtest/gtest.h>
#include "CIpcServer.h"
#include "CIpcClient.h"
TEST(CIpcTests, serverSend)
{
CIpcServer server;
server.listen();
CIpcClient client;
client.connect();
}
TEST(CIpcTests, clientSend)
{
CIpcServer server;
server.listen();
CIpcClient client;
client.connect();
}

View File

@ -15,34 +15,27 @@
set(src set(src
Main.cpp Main.cpp
CIpcTests.cpp
) )
if (WIN32) if (WIN32)
# windows
list(APPEND src list(APPEND src
platform/CMSWindowsClipboardTests.cpp platform/CMSWindowsClipboardTests.cpp
platform/CMSWindowsKeyStateTests.cpp platform/CMSWindowsKeyStateTests.cpp
) )
elseif (APPLE) elseif (APPLE)
# mac
list(APPEND src list(APPEND src
platform/COSXClipboardTests.cpp platform/COSXClipboardTests.cpp
platform/COSXKeyStateTests.cpp platform/COSXKeyStateTests.cpp
) )
elseif (UNIX) elseif (UNIX)
# unix/linux
list(APPEND src list(APPEND src
platform/CXWindowsClipboardTests.cpp platform/CXWindowsClipboardTests.cpp
platform/CXWindowsKeyStateTests.cpp platform/CXWindowsKeyStateTests.cpp
platform/CXWindowsScreenTests.cpp platform/CXWindowsScreenTests.cpp
platform/CXWindowsScreenSaverTests.cpp platform/CXWindowsScreenSaverTests.cpp
) )
endif() endif()
set(inc set(inc
@ -51,6 +44,7 @@ set(inc
../../lib/client ../../lib/client
../../lib/common ../../lib/common
../../lib/io ../../lib/io
../../lib/ipc
../../lib/mt ../../lib/mt
../../lib/net ../../lib/net
../../lib/platform ../../lib/platform
@ -76,4 +70,4 @@ endif()
include_directories(${inc}) include_directories(${inc})
add_executable(integtests ${src}) add_executable(integtests ${src})
target_link_libraries(integtests target_link_libraries(integtests
arch base client common io mt net platform server synergy gtest gmock ${libs}) arch base client common io ipc mt net platform server synergy gtest gmock ${libs})