summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndrzej J. R. Hunt <andrzej@ahunt.org>2012-07-11 17:44:41 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-08-06 10:22:54 +0100
commit9d7d8eb7a8a7a26e85f5fa8fde9580947bf005ab (patch)
treea88e3dec6e2e5cad9913b8670c595d54f4e088bd /sd
parenta4e7636536da9548998ae7e8c6ff1bc21b5b8765 (diff)
Image export, encoding and decoding. Protocol improvements.
Change-Id: Ibbc7ac02c5946a49c1cd777abc2853fe7e158009
Diffstat (limited to 'sd')
-rw-r--r--sd/CppunitTest_sd_uimpress.mk1
-rw-r--r--sd/Library_sd.mk1
-rw-r--r--sd/source/ui/remotecontrol/Listener.cxx112
-rw-r--r--sd/source/ui/remotecontrol/Listener.hxx48
-rw-r--r--sd/source/ui/remotecontrol/Receiver.cxx185
-rw-r--r--sd/source/ui/remotecontrol/Receiver.hxx20
-rw-r--r--sd/source/ui/remotecontrol/RemoteDialog.cxx9
-rw-r--r--sd/source/ui/remotecontrol/RemoteDialog.hxx9
-rw-r--r--sd/source/ui/remotecontrol/Server.cxx16
-rw-r--r--sd/source/ui/remotecontrol/Server.hxx14
10 files changed, 367 insertions, 48 deletions
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index d7e7f15dabac..1880c3f87f8d 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -60,6 +60,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\
i18nisolang1 \
msfilter \
sal \
+ sax \
salhelper \
sb \
sfx \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 9492c9a1530c..d403b7f30600 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -328,6 +328,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/presenter/SlideRenderer \
sd/source/ui/remotecontrol/Server \
sd/source/ui/remotecontrol/Receiver \
+ sd/source/ui/remotecontrol/Listener \
sd/source/ui/slideshow/PaneHider \
sd/source/ui/slideshow/SlideShowRestarter \
sd/source/ui/slideshow/showwin \
diff --git a/sd/source/ui/remotecontrol/Listener.cxx b/sd/source/ui/remotecontrol/Listener.cxx
new file mode 100644
index 000000000000..699d7a65101e
--- /dev/null
+++ b/sd/source/ui/remotecontrol/Listener.cxx
@@ -0,0 +1,112 @@
+/* -*- 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 <cstring>
+
+#include "Listener.hxx"
+
+#include <glib-object.h>
+#include <json-glib/json-glib.h>
+
+using namespace sd;
+using namespace ::com::sun::star::presentation;
+using rtl::OString;
+
+
+Listener::Listener( const css::uno::Reference<XSlideShowController>& rxSlideShowController,
+ osl::StreamSocket aSocket )
+ : ::cppu::WeakComponentImplHelper1< XSlideShowListener >( m_aMutex ),
+ mxSlideShowController(rxSlideShowController),
+ mStreamSocket( aSocket )
+{
+ g_type_init();
+
+
+ if( mxSlideShowController.is() )
+ {
+ // Listen for events from the slide show controller.
+ mxSlideShowController->addSlideShowListener(static_cast<XSlideShowListener*>(this));
+ }
+
+}
+
+Listener::~Listener()
+{
+
+
+}
+
+//----- XSlideShowListener ----------------------------------------------------
+
+void SAL_CALL Listener::paused (void)
+ throw (com::sun::star::uno::RuntimeException)
+{
+}
+
+void SAL_CALL Listener::resumed (void)
+ throw (css::uno::RuntimeException)
+{
+}
+
+void SAL_CALL Listener::slideEnded (sal_Bool bReverse)
+ throw (css::uno::RuntimeException)
+{
+ JsonBuilder *aBuilder = json_builder_new();
+
+
+ json_builder_begin_object( aBuilder );
+ json_builder_set_member_name( aBuilder, "slide_numer");
+ json_builder_add_int_value( aBuilder, 2 );
+ // FIXME: get the slide number
+ json_builder_end_object( aBuilder );
+
+ JsonGenerator *aGen = json_generator_new();
+ JsonNode *aRoot = json_builder_get_root( aBuilder );
+ json_generator_set_root( aGen, aRoot );
+ char *aCommand = json_generator_to_data( aGen, NULL);
+
+ json_node_free( aRoot );
+ g_object_unref ( aGen );
+ g_object_unref ( aBuilder );
+
+ sal_Int32 aLen = strlen( aCommand );
+
+ OString aLengthString = OString::valueOf( aLen );
+ const char *aLengthChar = aLengthString.getStr();
+
+ sal_Int32 aLengthLength = aLengthString.getLength();
+
+ mStreamSocket.write( aLengthChar, aLengthLength );
+ mStreamSocket.write( "\n", 1 );
+ mStreamSocket.write( aCommand, aLen );
+ // Transmit here.
+
+ g_free( aCommand );
+}
+
+void SAL_CALL Listener::hyperLinkClicked (const rtl::OUString &)
+ throw (css::uno::RuntimeException)
+{
+}
+
+void SAL_CALL Listener::slideTransitionStarted (void)
+ throw (css::uno::RuntimeException)
+{
+}
+
+void SAL_CALL Listener::slideTransitionEnded (void)
+ throw (css::uno::RuntimeException)
+{
+}
+
+void SAL_CALL Listener::slideAnimationsEnded (void)
+ throw (css::uno::RuntimeException)
+{
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/Listener.hxx b/sd/source/ui/remotecontrol/Listener.hxx
new file mode 100644
index 000000000000..2009074307b6
--- /dev/null
+++ b/sd/source/ui/remotecontrol/Listener.hxx
@@ -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/.
+ */
+#ifndef _SD_IMPRESSREMOTE_LISTENER_HXX
+#define _SD_IMPRESSREMOTE_LISTENER_HXX
+
+#include <sal/config.h>
+#include <com/sun/star/presentation/XSlideShowListener.hpp>
+#include <com/sun/star/presentation/XSlideShowController.hpp>
+
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <osl/socket.hxx>
+
+namespace css = ::com::sun::star;
+//using namespace ::com::sun::star::presentation;
+
+namespace sd {
+class Listener
+ : protected ::cppu::BaseMutex,
+ public ::cppu::WeakComponentImplHelper1< css::presentation::XSlideShowListener >
+{
+public:
+ Listener( const css::uno::Reference<css::presentation::XSlideShowController>& rxSlideShowController,
+ osl::StreamSocket aSocket );
+ ~Listener();
+
+ // XSlideShowListener
+ virtual void SAL_CALL paused( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL resumed( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL slideTransitionStarted( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL slideTransitionEnded( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL slideAnimationsEnded( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL slideEnded(sal_Bool bReverse) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL hyperLinkClicked( const ::rtl::OUString& hyperLink ) throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ css::uno::Reference<css::presentation::XSlideShowController> mxSlideShowController;
+ osl::StreamSocket mStreamSocket;
+};
+}
+#endif // _SD_IMPRESSREMOTE_LISTENER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx
index a2120b1a7d64..9015d799ec0e 100644
--- a/sd/source/ui/remotecontrol/Receiver.cxx
+++ b/sd/source/ui/remotecontrol/Receiver.cxx
@@ -1,38 +1,34 @@
-/*************************************************************************
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2012 Andrzej J.R. Hunt
- *
- * LibreOffice - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * LibreOffice is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * Libreoffice 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 Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with LibreOffice. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+ * 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 "Receiver.hxx"
-#include <cstring>
+#include <string.h>
#include <com/sun/star/frame/XFramesSupplier.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
#include <comphelper/processfactory.hxx>
+#include <osl/file.hxx>
+#include <xmlsec/base64.h>
+#include <rtl/ustrbuf.hxx>
+#include <sax/tools/converter.hxx>
using namespace sd;
using namespace ::com::sun::star::presentation;
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::document;
+using rtl::OUString;
+using rtl::OString;
+using namespace ::osl;
+
Receiver::Receiver()
{
g_type_init ();
@@ -65,7 +61,7 @@ void Receiver::executeCommand( JsonObject *aObject, Reference<XSlideShowControll
}
-void Receiver::parseCommand( const char* aCommand, sal_Int32 size, XSlideShowController *aController )
+void Receiver::parseCommand( const char* aCommand, sal_Int32 size, osl::StreamSocket &aStreamSocket )
{
Reference<XSlideShowController> xSlideShowController;
try {
@@ -78,6 +74,7 @@ void Receiver::parseCommand( const char* aCommand, sal_Int32 size, XSlideShowCon
Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW);
// Throws an exception if now slideshow running
xSlideShowController = Reference<XSlideShowController>( xPresentation->getController(), UNO_QUERY_THROW );
+ sendPreview( 1, xSlideShowController, aStreamSocket );
}
catch ( com::sun::star::uno::RuntimeException &e )
{
@@ -107,18 +104,128 @@ void Receiver::parseCommand( const char* aCommand, sal_Int32 size, XSlideShowCon
}
-// void preparePreview(sal_Int32 aSlideNumber, Reference<SlideShowController> aController)
-// {
-// uno::Reference< XDrawPage > aSlide( aController->getSlideByIndex( aSlideNumber ) );
-//
-// uno::Reference< lang::XMultiServiceFactory > xServiceManager(
-// ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
-//
-// uno::Reference< XGraphicExportFilter > xGraphicExportFilter( xServiceManager->createInstance(
-// "com.sun.star.drawing.GraphicExportFilter" ) , UNO_QUERY_THROW );
-//
-// xGraphicExportFilter->setSource( aSlide );
+void sendPreview(sal_uInt32 aSlideNumber, Reference<XSlideShowController> xSlideShowController, osl::StreamSocket &mStreamSocket )
+{
+
+ sal_uInt64 aSize;
+
+ uno::Sequence<sal_Int8> aData = preparePreview( aSlideNumber, xSlideShowController, 320, 240, aSize );
+
+ rtl::OUStringBuffer aStrBuffer;
+// char* aDataEncoded = (char*) xmlSecBase64Encode( (xmlSecByte *) aData, aSize, 0 );
+ ::sax::Converter::encodeBase64( aStrBuffer, aData );
+
+ OUString aEncodedString = aStrBuffer.makeStringAndClear();
+ OString aEncodedShortString = rtl::OUStringToOString( aEncodedString, RTL_TEXTENCODING_UTF8 );
+// aEncodedString.convertToString( &aEncodedShortString, RTL_TEXTENCODING_UTF8 , 0);
+
+ JsonBuilder *aBuilder = json_builder_new();
+
+
+ json_builder_begin_object( aBuilder );
+
+ json_builder_set_member_name( aBuilder, "command" );
+ json_builder_add_string_value( aBuilder, "slide_preview" );
+
+ json_builder_set_member_name( aBuilder, "slide_number" );
+ json_builder_add_int_value( aBuilder, 2 );
+
+ json_builder_set_member_name( aBuilder, "image_preview" );
+ json_builder_add_string_value( aBuilder, aEncodedShortString.getStr() );
+
+ // FIXME: get the slide number
+ json_builder_end_object( aBuilder );
+
+ JsonGenerator *aGen = json_generator_new();
+ JsonNode *aRoot = json_builder_get_root( aBuilder );
+ json_generator_set_root( aGen, aRoot );
+ char *aCommand = json_generator_to_data( aGen, NULL);
+
+ json_node_free( aRoot );
+ g_object_unref ( aGen );
+ g_object_unref ( aBuilder );
+
+ sal_Int32 aLen = strlen( aCommand );
+
+ OString aLengthString = OString::valueOf( aLen );
+ const char *aLengthChar = aLengthString.getStr();
+
+ sal_Int32 aLengthLength = aLengthString.getLength();
+
+ fprintf( stderr, "%s\n", aCommand );
+
+ mStreamSocket.write( aLengthChar, aLengthLength );
+ mStreamSocket.write( "\n", 1 );
+ mStreamSocket.write( aCommand, aLen );
+ // Transmit here.
+
+ g_free( aCommand );
+
+}
+
+Sequence<sal_Int8> preparePreview(sal_uInt32 aSlideNumber, Reference<XSlideShowController> xSlideShowController, sal_uInt32 aWidth, sal_uInt32 aHeight, sal_uInt64 &rSize )
+{
+
+ // Create temp file
+ OUString aFileURL;
+ FileBase::createTempFile( 0, 0, &aFileURL );
+
+
+ uno::Reference< lang::XMultiServiceFactory > xServiceManager(
+ ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+
+ uno::Reference< XFilter > xFilter( xServiceManager->createInstance(
+ "com.sun.star.drawing.GraphicExportFilter" ) , UNO_QUERY_THROW );
+
+ uno::Reference< XExporter > xExporter( xFilter, uno::UNO_QUERY_THROW );
+
+
+ uno::Reference< lang::XComponent > xSourceDoc(
+ xSlideShowController->getSlideByIndex( aSlideNumber ) , uno::UNO_QUERY_THROW );
+
+ xExporter->setSourceDocument( xSourceDoc );
+
+ Sequence< beans::PropertyValue > aFilterData(3);
+ aFilterData[0].Name = "PixelWidth";
+ aFilterData[0].Value <<= 2000;
+ aFilterData[1].Name = "PixelHeight";
+ aFilterData[1].Value <<= 2000;
+
+ // Add quality if jpg "Quality" [1-100]
+ // FIXME: is setting color mode needed.
+ aFilterData[2].Name = "ColorMode";
+ aFilterData[2].Value <<= 0; // Color
+
+ uno::Sequence< beans::PropertyValue > aProps(3);
+ aProps[0].Name = "MediaType";
+ aProps[0].Value <<= OUString( "image/png" );
+
+ aProps[1].Name = "URL";
+ aProps[1].Value <<= aFileURL;
+
+ aProps[2].Name = "FilterData";
+ aProps[2].Value <<= aFilterData;
+
+ xFilter->filter( aProps );
+
+ fprintf( stderr, "%s\n", rtl::OUStringToOString( aFileURL , RTL_TEXTENCODING_UTF8 ).getStr() );
+
+ // FIXME: error handling.
+
+ File aFile( aFileURL );
+ aFile.open(0);
+ sal_uInt64 aRead;
+ rSize = 0;
+ aFile.getSize( rSize );
+ uno::Sequence<sal_Int8> aContents( rSize );
+
+ aFile.read( aContents.getArray(), rSize, aRead );
+ aFile.close();
+ File::remove( aFileURL );
+ return aContents;
+
+}
-// }
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/Receiver.hxx b/sd/source/ui/remotecontrol/Receiver.hxx
index d4087e461285..4590cde99cf0 100644
--- a/sd/source/ui/remotecontrol/Receiver.hxx
+++ b/sd/source/ui/remotecontrol/Receiver.hxx
@@ -1,12 +1,20 @@
-
+/* -*- 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_RECEIVER_HXX
#define _SD_IMPRESSREMOTE_RECEIVER_HXX
+#include <com/sun/star/presentation/XSlideShowListener.hpp>
#include <com/sun/star/presentation/XSlideShowController.hpp>
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <com/sun/star/presentation/XPresentation.hpp>
#include <com/sun/star/presentation/XPresentation2.hpp>
-
+#include <osl/socket.hxx>
#include <stdlib.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
@@ -21,7 +29,8 @@ class Receiver
public:
Receiver();
~Receiver();
- void parseCommand( const char* aCommand, sal_Int32 size, XSlideShowController *aController );
+ void parseCommand( const char* aCommand, sal_Int32 size, osl::StreamSocket &aSocket );
+
private:
void executeCommand( JsonObject *aObject, Reference<XSlideShowController> aController );
@@ -30,4 +39,9 @@ private:
}
+Sequence<sal_Int8> preparePreview(sal_uInt32 aSlideNumber, Reference<XSlideShowController> xSlideShowController, sal_uInt32 aWidth, sal_uInt32 aHeight, sal_uInt64 &aSize );
+
+void sendPreview(sal_uInt32 aSlideNumber, Reference<XSlideShowController> xSlideShowController, osl::StreamSocket &mStreamSocket );
+
#endif // _SD_IMPRESSREMOTE_RECEIVER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/RemoteDialog.cxx b/sd/source/ui/remotecontrol/RemoteDialog.cxx
index 3aac7538a1e0..e2cbc6a4171b 100644
--- a/sd/source/ui/remotecontrol/RemoteDialog.cxx
+++ b/sd/source/ui/remotecontrol/RemoteDialog.cxx
@@ -1,3 +1,11 @@
+/* -*- 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 "RemoteDialog.hxx"
@@ -9,3 +17,4 @@ RemoteDialog::~RemoteDialog()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/RemoteDialog.hxx b/sd/source/ui/remotecontrol/RemoteDialog.hxx
index 1f1e9626ae71..417c155492b1 100644
--- a/sd/source/ui/remotecontrol/RemoteDialog.hxx
+++ b/sd/source/ui/remotecontrol/RemoteDialog.hxx
@@ -1,3 +1,11 @@
+/* -*- 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/.
+ */
// SERVER
#include <stdio.h>
#include <stdlib.h>
@@ -18,3 +26,4 @@ namespace sd
};
}
}
+/* 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 b4c061334667..d838b6740a18 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -1,4 +1,11 @@
-
+/* -*- 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 <sys/socket.h>
#include <netinet/in.h>
@@ -18,7 +25,6 @@ using rtl::OString;
Server::Server()
: Thread( "ServerThread" ), mSocket(), mReceiver()
{
-
}
Server::~Server()
@@ -60,7 +66,7 @@ void Server::listenThread()
aTempStr = OString( aMessage ); //, (sal_Int32) aLen, CHARSET, 0u
const sal_Char* aCommandChar = aTempStr.getStr();
- mReceiver.parseCommand( aCommandChar, aTempStr.getLength(), NULL );
+ mReceiver.parseCommand( aCommandChar, aTempStr.getLength(), mStreamSocket );
delete [] aMessage;
// TODO: deal with transmision errors gracefully.
@@ -82,6 +88,7 @@ void Server::execute()
}
while ( true )
{
+ fprintf( stderr, "Awaiting a connection.\n" );
mSocket.acceptConnection( mStreamSocket );
fprintf( stderr, "Accepted a connection!\n" );
listenThread();
@@ -89,6 +96,8 @@ void Server::execute()
}
+
+
Server *sd::Server::spServer = NULL;
void Server::setup()
@@ -106,3 +115,4 @@ void SdDLL::RegisterRemotes()
sd::Server::setup();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/Server.hxx b/sd/source/ui/remotecontrol/Server.hxx
index 65b416b52b93..ba6f8cdcb2c0 100644
--- a/sd/source/ui/remotecontrol/Server.hxx
+++ b/sd/source/ui/remotecontrol/Server.hxx
@@ -1,4 +1,11 @@
-
+/* -*- 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_SERVER_HXX
#define _SD_IMPRESSREMOTE_SERVER_HXX
@@ -8,10 +15,10 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/socket.h>
#include <netinet/in.h>
#include <osl/socket.hxx>
//#include <com/sun/star/presentation/AnimationEffect.hpp>
+#include <com/sun/star/presentation/XSlideShowListener.hpp>
#include <salhelper/thread.hxx>
@@ -34,7 +41,7 @@ namespace sd
private:
Server();
~Server();
- static Server *spServer;
+ static Server *spServer;
osl::AcceptorSocket mSocket;
osl::StreamSocket mStreamSocket;
void listenThread();
@@ -44,3 +51,4 @@ namespace sd
}
#endif // _SD_IMPRESSREMOTE_SERVER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file