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/ScreenSharingOverviewImpl.cpp | |
parent | c8ced8597ab28b928862d21554c0a68c238b1165 (diff) | |
download | swift-contrib-6247ed394302ff2cf1f33a71df808bebf7241242.zip swift-contrib-6247ed394302ff2cf1f33a71df808bebf7241242.tar.bz2 |
Fix test suite compliance
Diffstat (limited to 'Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp')
-rw-r--r-- | Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp b/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp new file mode 100644 index 0000000..1f5cdec --- /dev/null +++ b/Swift/Controllers/ScreenSharing/ScreenSharingOverviewImpl.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Yoann Blein + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#include "ScreenSharingOverviewImpl.h" + +#include "Swift/QtUI/ScreenSharing/QtDesktopScreenGrabber.h" +#include "Swift/Controllers/ScreenSharing/ScreenSharingController.h" +#include <Swiften/ScreenSharing/ScreenSharingManager.h> + +#include <boost/bind.hpp> + +namespace Swift { + +ScreenSharingOverviewImpl::ScreenSharingOverviewImpl(ScreenSharingManager *screenSharingManager, RemoteScreenWindowFactory* remoteScreenViewerFactory, TimerFactory* timerFactory) + : ScreenSharingOverview(), + screenSharingManager(screenSharingManager), remoteScreenWindowFactory(remoteScreenViewerFactory), timerFactory(timerFactory), + screenGrabber(new QtDesktopScreenGrabber) +{ + screenSharingManager->onIncomingScreenSharing.connect(boost::bind(&ScreenSharingOverviewImpl::handleIncomingScreenSharing, this, _1)); +} + +ScreenSharingOverviewImpl::~ScreenSharingOverviewImpl() +{ + screenSharingManager->onIncomingScreenSharing.disconnect(boost::bind(&ScreenSharingOverviewImpl::handleIncomingScreenSharing, this, _1)); +} + +void ScreenSharingOverviewImpl::createOugoingScreenSharing(const JID& to) +{ + ScreenSharingController* ssc = new ScreenSharingController(screenSharingManager, timerFactory, screenGrabber, to); + controllers.push_back(ssc); + onNewScreenSharingController(ssc); +} + +void ScreenSharingOverviewImpl::handleIncomingScreenSharing(boost::shared_ptr<IncomingScreenSharing> incomingScreenSharing) +{ + ScreenSharingController* ssc = new ScreenSharingController(incomingScreenSharing, remoteScreenWindowFactory); + controllers.push_back(ssc); + onNewScreenSharingController(ssc); +} + +} |