sd/source/ui/remotecontrol/Receiver.cxx | 17 ++++------------- sd/source/ui/remotecontrol/Receiver.hxx | 9 ++++----- sd/source/ui/remotecontrol/RemoteDialog.cxx | 7 ------- sd/source/ui/remotecontrol/RemoteDialog.hxx | 5 +---- sd/source/ui/remotecontrol/Server.cxx | 23 +++++++++-------------- sd/source/ui/remotecontrol/Server.hxx | 5 +---- 6 files changed, 19 insertions(+), 47 deletions(-)
New commits: commit 388c7111149b01af846c4db04a76ec840ddfd7ad Author: Michael Meeks <[email protected]> Date: Mon Jul 9 11:52:22 2012 +0100 cleanup trailing whitespace Change-Id: I788513e8cb7d8e1fd9efca4ff4150381df9b199a diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx index c77cc54..ea7a344 100644 --- a/sd/source/ui/remotecontrol/Receiver.cxx +++ b/sd/source/ui/remotecontrol/Receiver.cxx @@ -33,30 +33,25 @@ Receiver::Receiver() Receiver::~Receiver() { - - } void Receiver::parseCommand(char* aCommand, XSlideShowController *aController) { - - JsonParser *parser; JsonNode *root; GError *error; - + parser = json_parser_new (); error = NULL; json_parser_load_from_data( parser, aCommand, aCommand.size, error ); - + if (error) { - } - + root = json_parser_get_root( parser ); JsonObject *aObject = json_node_get_object( root ); char* aInstruction = json_node_get_string( json_object_get_member( "command" ) ); - + switch ( aInstruction ) { case "transition_next": @@ -69,7 +64,5 @@ void Receiver::parseCommand(char* aCommand, XSlideShowController *aController) case "goto_slide": // break; - }; - - -} \ No newline at end of file + }; +} diff --git a/sd/source/ui/remotecontrol/Receiver.hxx b/sd/source/ui/remotecontrol/Receiver.hxx index 78dbb0d..9757946 100644 --- a/sd/source/ui/remotecontrol/Receiver.hxx +++ b/sd/source/ui/remotecontrol/Receiver.hxx @@ -18,19 +18,19 @@ namespace sd { - + class Receiver { public: Receiver(); ~Receiver(); - void parseCommand(char* aCommand, XSlideShowController *aController); - + void parseCommand(char* aCommand, XSlideShowController *aController); + private: - + } } -#endif // _SD_IMPRESSREMOTE_RECEIVER_HXX \ No newline at end of file +#endif // _SD_IMPRESSREMOTE_RECEIVER_HXX diff --git a/sd/source/ui/remotecontrol/RemoteDialog.cxx b/sd/source/ui/remotecontrol/RemoteDialog.cxx index 9c1dedd..3aac753 100644 --- a/sd/source/ui/remotecontrol/RemoteDialog.cxx +++ b/sd/source/ui/remotecontrol/RemoteDialog.cxx @@ -3,16 +3,9 @@ RemoteDialog::RemoteDialog() { - - - - } RemoteDialog::~RemoteDialog() { - - - } diff --git a/sd/source/ui/remotecontrol/RemoteDialog.hxx b/sd/source/ui/remotecontrol/RemoteDialog.hxx index 80f5c34..1f1e962 100644 --- a/sd/source/ui/remotecontrol/RemoteDialog.hxx +++ b/sd/source/ui/remotecontrol/RemoteDialog.hxx @@ -12,11 +12,9 @@ namespace sd { public: RemoteDialog(); - ~RemoteDialog(); - + ~RemoteDialog(); private: - //int mSocket; }; } -} \ No newline at end of file +} diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index 345ea03..e562809 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -21,17 +21,17 @@ Server::Server(char* aEncryptionKey, XSlideShowController aController) { // Error opening } - + sockaddr_in aAddress; aAddress.sin_family = AF_INET; aAddress.sin_port = htons(PORT); aAddress.sin_addr.s_addr = htonl(INADDR_ANY); - + if ( bind( mSocket, (struct sockaddr*) &aAddress, sizeof(aAddress) ) == -1 ) { // Error binding } - + if ( listen ( mSocket, 3 ) == -1 ) { // Error listening @@ -39,16 +39,13 @@ Server::Server(char* aEncryptionKey, XSlideShowController aController) while (true) { mNewSocket = accept( mSocket, (struct sockaddr*) &aAddress, (socklen_t*) &aAddrLen ); - boost::thread t( boost::bind(&Server::listenThread, this )) + boost::thread t( boost::bind(&Server::listenThread, this )) } // TODO: pass mNewSocket to the thread. } Server::~Server() { - - - } // Run as a thread @@ -66,18 +63,17 @@ void Server::listenThread() } OUString aLengthString = OUString( aBuffer.front(), aBuffer.size(), RTL_TEXTENCODING_UNICODE ); const sal_Char* aLengthChar = aLengthString.convertToString( *aCLength, RTL_TEXTENCODING_ASCII_US, 0).getStr(); - + sal_uInt32 aLen = strtol( aLengthChar, NULL, 10); - + char *aMessage = new char[aLen]; recv( mSocket, *aMessage, aLen, 0); // Parse. mReceiver.parseCommand( aCommand ); - + delete [] aMessage; // TODO: deal with transmision errors gracefully. } - } @@ -85,9 +81,9 @@ void Server::listenThread() // { // our_mServerList.insert( our_mServerList.end, new Server() ); // thread aThread = Boost::thread( listen ); -// +// // } -// +// // void Server::clientDisconnected() // { // our_mServerList::iterator aBegin = our_mServerList.begin; @@ -99,4 +95,4 @@ void Server::listenThread() // our_mServerList.erase( this ); // delete this; // } -// } \ No newline at end of file +// } diff --git a/sd/source/ui/remotecontrol/Server.hxx b/sd/source/ui/remotecontrol/Server.hxx index 6826e34..0728954 100644 --- a/sd/source/ui/remotecontrol/Server.hxx +++ b/sd/source/ui/remotecontrol/Server.hxx @@ -7,7 +7,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <sys/types.h> +#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> @@ -33,17 +33,15 @@ namespace sd Server(); ~Server(); void setPresentationController( XSlideShowController aController) { mController = aController; } - private: int mSocket; // static vector<Server> our_mServerList; void listen(); - Receiver mReceiver; // Transmitter mTransmitter; }; } } -#endif // _SD_IMPRESSREMOTE_SERVER_HXX \ No newline at end of file +#endif // _SD_IMPRESSREMOTE_SERVER_HXX _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
