diff options
author | dknn <yoann.blein@free.fr> | 2012-08-17 15:32:43 (GMT) |
---|---|---|
committer | dknn <yoann.blein@free.fr> | 2012-09-22 09:34:49 (GMT) |
commit | 6247ed394302ff2cf1f33a71df808bebf7241242 (patch) | |
tree | d4d61fb5e66611ecdc75cf1149b64e23fef2b077 /Swift/Controllers/ScreenSharing | |
parent | c8ced8597ab28b928862d21554c0a68c238b1165 (diff) | |
download | swift-contrib-6247ed394302ff2cf1f33a71df808bebf7241242.zip swift-contrib-6247ed394302ff2cf1f33a71df808bebf7241242.tar.bz2 |
Fix test suite compliance
Diffstat (limited to 'Swift/Controllers/ScreenSharing')
-rw-r--r-- | Swift/Controllers/ScreenSharing/ScreenSharingController.cpp | 4 | ||||
-rw-r--r-- | Swift/Controllers/ScreenSharing/ScreenSharingOverview.h | 25 | ||||
-rw-r--r-- | Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp (renamed from Swift/Controllers/ScreenSharing/ScreenSharingOverview.cpp) | 17 | ||||
-rw-r--r-- | Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.h | 40 | ||||
-rw-r--r-- | Swift/Controllers/ScreenSharing/UnitTest/DummyScreenSharingOverview.h | 18 |
5 files changed, 71 insertions, 33 deletions
diff --git a/Swift/Controllers/ScreenSharing/ScreenSharingController.cpp b/Swift/Controllers/ScreenSharing/ScreenSharingController.cpp index 2e9a75d..a42e9bb 100644 --- a/Swift/Controllers/ScreenSharing/ScreenSharingController.cpp +++ b/Swift/Controllers/ScreenSharing/ScreenSharingController.cpp @@ -23,7 +23,7 @@ namespace Swift { ScreenSharingController::ScreenSharingController(ScreenSharingManager* screenSharingManager, TimerFactory* timerFactory, DesktopScreenGrabber* desktopScreenGrabber, const JID& to) - : screenGrabber(desktopScreenGrabber), grabTimer(timerFactory->createTimer(500)), remoteScreenWindowFactory(0), + : screenGrabber(desktopScreenGrabber), grabTimer(timerFactory->createTimer(1000/0.5)), remoteScreenWindowFactory(0), remoteScreenWindow(0), otherParty(to), incoming(false), chatWindow(0) { OutgoingScreenSharing::ref oss = screenSharingManager->createOutgoingScreenSharing(to); @@ -108,7 +108,7 @@ void ScreenSharingController::handleReady() void ScreenSharingController::handleFinished() { - screenSharing->onFinished.disconnect(boost::bind(&ScreenSharingController::handleFinished, this)); +// screenSharing->onFinished.disconnect(boost::bind(&ScreenSharingController::handleFinished, this)); screenSharing.reset(); delete remoteScreenWindow; remoteScreenWindow = 0; diff --git a/Swift/Controllers/ScreenSharing/ScreenSharingOverview.h b/Swift/Controllers/ScreenSharing/ScreenSharingOverview.h index b43a665..86f81df 100644 --- a/Swift/Controllers/ScreenSharing/ScreenSharingOverview.h +++ b/Swift/Controllers/ScreenSharing/ScreenSharingOverview.h @@ -8,38 +8,17 @@ #include <Swiften/Base/boost_bsignals.h> -#include <boost/shared_ptr.hpp> - -#include <vector> - namespace Swift { - class ScreenSharingManager; class ScreenSharingController; - class IncomingScreenSharing; - class TimerFactory; - class DesktopScreenGrabber; - class RemoteScreenWindowFactory; class JID; class ScreenSharingOverview { public: - ScreenSharingOverview(ScreenSharingManager* screenSharingManager, RemoteScreenWindowFactory* remoteScreenWindowFactory, TimerFactory* timerFactory); - ~ScreenSharingOverview(); + virtual ~ScreenSharingOverview() {} - void createOugoingScreenSharing(const JID& to); + virtual void createOugoingScreenSharing(const JID& to) = 0; public: boost::signal<void (ScreenSharingController*)> onNewScreenSharingController; - - private: - void handleIncomingScreenSharing(boost::shared_ptr<IncomingScreenSharing> incomingScreenSharing); - - private: - ScreenSharingManager* screenSharingManager; - RemoteScreenWindowFactory* remoteScreenWindowFactory; - TimerFactory* timerFactory; - - DesktopScreenGrabber* screenGrabber; - std::vector<ScreenSharingController*> controllers; }; } diff --git a/Swift/Controllers/ScreenSharing/ScreenSharingOverview.cpp b/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp index 91f75b9..1f5cdec 100644 --- a/Swift/Controllers/ScreenSharing/ScreenSharingOverview.cpp +++ b/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp @@ -4,7 +4,7 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ -#include "ScreenSharingOverview.h" +#include "ScreenSharingOverviewImpl.h" #include "Swift/QtUI/ScreenSharing/QtDesktopScreenGrabber.h" #include "Swift/Controllers/ScreenSharing/ScreenSharingController.h" @@ -14,26 +14,27 @@ namespace Swift { -ScreenSharingOverview::ScreenSharingOverview(ScreenSharingManager *screenSharingManager, RemoteScreenWindowFactory* remoteScreenViewerFactory, TimerFactory* timerFactory) - : screenSharingManager(screenSharingManager), remoteScreenWindowFactory(remoteScreenViewerFactory), timerFactory(timerFactory), +ScreenSharingOverviewImpl::ScreenSharingOverviewImpl(ScreenSharingManager *screenSharingManager, RemoteScreenWindowFactory* remoteScreenViewerFactory, TimerFactory* timerFactory) + : ScreenSharingOverview(), + screenSharingManager(screenSharingManager), remoteScreenWindowFactory(remoteScreenViewerFactory), timerFactory(timerFactory), screenGrabber(new QtDesktopScreenGrabber) { - screenSharingManager->onIncomingScreenSharing.connect(boost::bind(&ScreenSharingOverview::handleIncomingScreenSharing, this, _1)); + screenSharingManager->onIncomingScreenSharing.connect(boost::bind(&ScreenSharingOverviewImpl::handleIncomingScreenSharing, this, _1)); } -ScreenSharingOverview::~ScreenSharingOverview() +ScreenSharingOverviewImpl::~ScreenSharingOverviewImpl() { - screenSharingManager->onIncomingScreenSharing.disconnect(boost::bind(&ScreenSharingOverview::handleIncomingScreenSharing, this, _1)); + screenSharingManager->onIncomingScreenSharing.disconnect(boost::bind(&ScreenSharingOverviewImpl::handleIncomingScreenSharing, this, _1)); } -void ScreenSharingOverview::createOugoingScreenSharing(const JID& to) +void ScreenSharingOverviewImpl::createOugoingScreenSharing(const JID& to) { ScreenSharingController* ssc = new ScreenSharingController(screenSharingManager, timerFactory, screenGrabber, to); controllers.push_back(ssc); onNewScreenSharingController(ssc); } -void ScreenSharingOverview::handleIncomingScreenSharing(boost::shared_ptr<IncomingScreenSharing> incomingScreenSharing) +void ScreenSharingOverviewImpl::handleIncomingScreenSharing(boost::shared_ptr<IncomingScreenSharing> incomingScreenSharing) { ScreenSharingController* ssc = new ScreenSharingController(incomingScreenSharing, remoteScreenWindowFactory); controllers.push_back(ssc); diff --git a/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.h b/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.h new file mode 100644 index 0000000..ad5871d --- /dev/null +++ b/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2012 Yoann Blein + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> + +#include <vector> + +#include "ScreenSharingOverview.h" + +namespace Swift { + class ScreenSharingManager; + class IncomingScreenSharing; + class TimerFactory; + class DesktopScreenGrabber; + class RemoteScreenWindowFactory; + + class ScreenSharingOverviewImpl : public ScreenSharingOverview { + public: + ScreenSharingOverviewImpl(ScreenSharingManager* screenSharingManager, RemoteScreenWindowFactory* remoteScreenWindowFactory, TimerFactory* timerFactory); + virtual ~ScreenSharingOverviewImpl(); + + virtual void createOugoingScreenSharing(const JID& to); + + private: + void handleIncomingScreenSharing(boost::shared_ptr<IncomingScreenSharing> incomingScreenSharing); + + private: + ScreenSharingManager* screenSharingManager; + RemoteScreenWindowFactory* remoteScreenWindowFactory; + TimerFactory* timerFactory; + + DesktopScreenGrabber* screenGrabber; + std::vector<ScreenSharingController*> controllers; + }; +} diff --git a/Swift/Controllers/ScreenSharing/UnitTest/DummyScreenSharingOverview.h b/Swift/Controllers/ScreenSharing/UnitTest/DummyScreenSharingOverview.h new file mode 100644 index 0000000..8ea4d68 --- /dev/null +++ b/Swift/Controllers/ScreenSharing/UnitTest/DummyScreenSharingOverview.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2012 Yoann Blein + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#pragma once + +#include "Swift/Controllers/ScreenSharing/ScreenSharingOverview.h" + +namespace Swift { + class DummyScreenSharingOverview : public ScreenSharingOverview { + public: + virtual ~DummyScreenSharingOverview() {} + + virtual void createOugoingScreenSharing(const JID& /*to*/) {} + }; +} |