/* * 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 #include 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) { ScreenSharingController* ssc = new ScreenSharingController(incomingScreenSharing, remoteScreenWindowFactory); controllers.push_back(ssc); onNewScreenSharingController(ssc); } }