summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-08-02 11:28:38 +0200
committerMichael Meeks <michael.meeks@suse.com>2012-08-06 10:23:08 +0100
commit1a6bcd5bcdaf542c0a0db4fcc74149b9466dc58d (patch)
treeb4142b80e61cb1f8aa65ca95f06436adc0d72422 /sd
parent365f3e71c10eafdb239e70180beb62b41659e753 (diff)
Basic structure for Disovery Service.
Change-Id: Idaae84c46fa96b128ab32451853922c9eb11c6cc
Diffstat (limited to 'sd')
-rw-r--r--sd/Library_sd.mk1
-rw-r--r--sd/source/ui/remotecontrol/DiscoveryService.cxx48
-rw-r--r--sd/source/ui/remotecontrol/DiscoveryService.hxx50
-rw-r--r--sd/source/ui/remotecontrol/Server.cxx2
4 files changed, 101 insertions, 0 deletions
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 0a371cec04e0..8737ba0273e1 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -317,6 +317,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/presenter/PresenterPreviewCache \
sd/source/ui/presenter/PresenterTextView \
sd/source/ui/presenter/SlideRenderer \
+ sd/source/ui/remotecontrol/DiscoveryService \
sd/source/ui/remotecontrol/ImagePreparer \
sd/source/ui/remotecontrol/Server \
sd/source/ui/remotecontrol/Receiver \
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
new file mode 100644
index 000000000000..f92b9ee490df
--- /dev/null
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#include <stdlib.h>
+#include <algorithm>
+#include <vector>
+
+#include <comphelper/processfactory.hxx>
+
+#include "DiscoveryService.hxx"
+
+using namespace sd;
+
+DiscoveryService::DiscoveryService()
+ :
+ Thread( "sd::DiscoveryService" ),
+ mSocket()
+{
+}
+
+DiscoveryService::~DiscoveryService()
+{
+}
+
+
+
+void DiscoveryService::execute()
+{
+
+}
+
+DiscoveryService *sd::DiscoveryService::spService = NULL;
+
+void DiscoveryService::setup()
+{
+ if (spService)
+ return;
+
+ spService = new DiscoveryService();
+ spService->launch();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.hxx b/sd/source/ui/remotecontrol/DiscoveryService.hxx
new file mode 100644
index 000000000000..863ebb56f489
--- /dev/null
+++ b/sd/source/ui/remotecontrol/DiscoveryService.hxx
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#ifndef _SD_IMPRESSREMOTE_DISCOVERYSERVICE_HXX
+#define _SD_IMPRESSREMOTE_DISCOVERYSERVICE_HXX
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <osl/socket.hxx>
+#include <rtl/ref.hxx>
+#include <salhelper/thread.hxx>
+
+namespace css = ::com::sun::star;
+
+/**
+* The port for use for the main communication between LibO and remote control app.
+*/
+#define PORT_DISCOVERY 1598
+
+#define CHARSET RTL_TEXTENCODING_UTF8
+
+namespace sd
+{
+
+ class DiscoveryService : public salhelper::Thread
+ {
+ public:
+ static void setup();
+
+ private:
+ DiscoveryService();
+ ~DiscoveryService();
+ static DiscoveryService *spService;
+
+ osl::DatagramSocket mSocket;
+
+ void execute();
+ };
+}
+
+#endif // _SD_IMPRESSREMOTE_DISCOVERYSERVICE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index 3b896feda594..372103e16328 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -14,6 +14,7 @@
#include "sddll.hxx"
+#include "DiscoveryService.hxx"
#include "ImagePreparer.hxx"
#include "Listener.hxx"
#include "Receiver.hxx"
@@ -161,6 +162,7 @@ void SdDLL::RegisterRemotes()
{
fprintf( stderr, "Register our remote control goodness\n" );
sd::RemoteServer::setup();
+ sd::DiscoveryService::setup();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */