From 38a4b5ea2ab7188ce61d18c655893482dd098772 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 3 Aug 2015 17:20:26 +0200 Subject: slideshow: try to fix libc++/MSVC build by replacing boost::bind Change-Id: I6418119f9d3e70ea89f7c8a094bbde42eeadec8c --- .../engine/animationnodes/animationaudionode.cxx | 13 +++++---- .../engine/animationnodes/animationbasenode.cxx | 4 +-- .../engine/animationnodes/animationcommandnode.cxx | 4 +-- .../engine/animationnodes/animationsetnode.cxx | 5 +--- .../engine/animationnodes/basecontainernode.cxx | 3 +- .../source/engine/animationnodes/basenode.cxx | 3 +- .../animationnodes/paralleltimecontainer.cxx | 5 ++-- .../animationnodes/sequentialtimecontainer.cxx | 10 +++---- slideshow/source/engine/effectrewinder.cxx | 8 +++--- slideshow/source/engine/eventmultiplexer.cxx | 11 ++++---- slideshow/source/engine/slideshowimpl.cxx | 32 ++++++---------------- slideshow/source/engine/slideview.cxx | 9 ++---- slideshow/source/engine/usereventqueue.cxx | 6 ++-- 13 files changed, 44 insertions(+), 69 deletions(-) (limited to 'slideshow/source/engine') diff --git a/slideshow/source/engine/animationnodes/animationaudionode.cxx b/slideshow/source/engine/animationnodes/animationaudionode.cxx index 5e953a977f59..c44561ae6798 100644 --- a/slideshow/source/engine/animationnodes/animationaudionode.cxx +++ b/slideshow/source/engine/animationnodes/animationaudionode.cxx @@ -27,7 +27,6 @@ #include "delayevent.hxx" #include "tools.hxx" #include "nodetools.hxx" -#include "boost/bind.hpp" using namespace com::sun::star; @@ -79,17 +78,19 @@ void AnimationAudioNode::activate_st() else { // no node duration. Take inherent media time, then + auto self(getSelf()); scheduleDeactivationEvent( - makeDelay( boost::bind( &AnimationNode::deactivate, getSelf() ), - mpPlayer->getDuration(), + makeDelay( [self] () { self->deactivate(); }, + mpPlayer->getDuration(), "AnimationAudioNode::deactivate with delay") ); } } else { // deactivate ASAP: + auto self(getSelf()); scheduleDeactivationEvent( - makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ), + makeEvent( [self] () { self->deactivate(); }, "AnimationAudioNode::deactivate without delay") ); } } @@ -114,8 +115,8 @@ void AnimationAudioNode::deactivate_st( NodeState /*eDestState*/ ) // notify _after_ state change: getContext().mrEventQueue.addEvent( - makeEvent( boost::bind( &EventMultiplexer::notifyAudioStopped, - boost::ref(getContext().mrEventMultiplexer), + makeEvent( std::bind( &EventMultiplexer::notifyAudioStopped, + std::ref(getContext().mrEventMultiplexer), getSelf() ), "AnimationAudioNode::notifyAudioStopped") ); } diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index d9373d57c106..41adb19b6435 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -35,7 +35,6 @@ #include "delayevent.hxx" #include "framerate.hxx" -#include #include #include @@ -449,8 +448,7 @@ AnimationBaseNode::fillCommonParameters() const EventSharedPtr pEndEvent; if (pSelf) { - pEndEvent = makeEvent( - boost::bind( &AnimationNode::deactivate, pSelf ), + pEndEvent = makeEvent( [pSelf] () {pSelf->deactivate(); }, "AnimationBaseNode::deactivate"); } diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx b/slideshow/source/engine/animationnodes/animationcommandnode.cxx index be7b2b767972..17365f331ce1 100644 --- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx +++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx @@ -30,7 +30,6 @@ #include "tools.hxx" #include "nodetools.hxx" -#include using namespace com::sun::star; @@ -108,8 +107,9 @@ void AnimationCommandNode::activate_st() } // deactivate ASAP: + auto self(getSelf()); scheduleDeactivationEvent( - makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ), + makeEvent( [self] () { self->deactivate(); }, "AnimationCommandNode::deactivate" ) ); } diff --git a/slideshow/source/engine/animationnodes/animationsetnode.cxx b/slideshow/source/engine/animationnodes/animationsetnode.cxx index 2b1230a6e649..63c7620603d0 100644 --- a/slideshow/source/engine/animationnodes/animationsetnode.cxx +++ b/slideshow/source/engine/animationnodes/animationsetnode.cxx @@ -28,8 +28,6 @@ #include "tools.hxx" #include "delayevent.hxx" -#include - using namespace com::sun::star; namespace slideshow { @@ -66,8 +64,7 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const ENSURE_OR_THROW( pSelf, "cannot cast getSelf() to my type!" ); aParms.mpEndEvent = makeEvent( - boost::bind( &AnimationSetNode::implScheduleDeactivationEvent, - pSelf ), + [pSelf] () { pSelf->implScheduleDeactivationEvent(); }, "AnimationSetNode::implScheduleDeactivationEvent"); } diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx b/slideshow/source/engine/animationnodes/basecontainernode.cxx index a3c73e8e2c23..5371c1217462 100644 --- a/slideshow/source/engine/animationnodes/basecontainernode.cxx +++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx @@ -28,7 +28,6 @@ #include "nodetools.hxx" #include "delayevent.hxx" -#include #include #include @@ -154,7 +153,7 @@ bool BaseContainerNode::notifyDeactivatedChild( { bFinished = false; EventSharedPtr aRepetitionEvent = - makeDelay( boost::bind( &BaseContainerNode::repeat, this ), + makeDelay( [this] () { this->repeat(); }, 0.0, "BaseContainerNode::repeat"); getContext().mrEventQueue.addEvent( aRepetitionEvent ); diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx index 4940a8330ed7..0aced6f0d913 100644 --- a/slideshow/source/engine/animationnodes/basenode.cxx +++ b/slideshow/source/engine/animationnodes/basenode.cxx @@ -474,8 +474,9 @@ bool BaseNode::resolve() // schedule delayed activation event. Take iterate node // timeout into account + auto self(mpSelf); mpCurrentEvent = makeDelay( - boost::bind( &AnimationNode::activate, mpSelf ), + [self] () { self->activate(); }, mnStartDelay, "AnimationNode::activate with delay"); maContext.mrEventQueue.addEvent( mpCurrentEvent ); diff --git a/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx b/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx index 07b68a231db9..20d16d711552 100644 --- a/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx +++ b/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx @@ -21,7 +21,7 @@ #include "paralleltimecontainer.hxx" #include "delayevent.hxx" -#include +#include namespace slideshow { namespace internal { @@ -39,8 +39,9 @@ void ParallelTimeContainer::activate_st() if (isDurationIndefinite() && maChildren.empty()) { // deactivate ASAP: + auto self(getSelf()); scheduleDeactivationEvent( - makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ), + makeEvent( [self] () { self->deactivate(); }, "ParallelTimeContainer::deactivate") ); } else { // use default diff --git a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx index 1972e31ce687..7a53e33f1fb7 100644 --- a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx +++ b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx @@ -27,7 +27,6 @@ #include "sequentialtimecontainer.hxx" #include "tools.hxx" -#include #include namespace slideshow { @@ -49,9 +48,9 @@ void SequentialTimeContainer::activate_st() (maChildren.empty() || mnFinishedChildren >= maChildren.size())) { // deactivate ASAP: + auto self(getSelf()); scheduleDeactivationEvent( - makeEvent( - boost::bind< void >( boost::mem_fn( &AnimationNode::deactivate ), getSelf() ), + makeEvent( [self] () { self->deactivate(); }, "SequentialTimeContainer::deactivate") ); } else // use default @@ -78,8 +77,7 @@ void SequentialTimeContainer::skipEffect( // empty all events ignoring timings => until next effect getContext().mrEventQueue.forceEmpty(); getContext().mrEventQueue.addEvent( - makeEvent( - boost::bind( boost::mem_fn( &AnimationNode::deactivate ), pChildNode ), + makeEvent( [pChildNode] () { pChildNode->deactivate(); }, "SequentialTimeContainer::deactivate, skipEffect with delay") ); } else @@ -99,7 +97,7 @@ bool SequentialTimeContainer::resolveChild( // event that will deactivate the resolved/running child: mpCurrentSkipEvent = makeEvent( - boost::bind( &SequentialTimeContainer::skipEffect, + std::bind( &SequentialTimeContainer::skipEffect, boost::dynamic_pointer_cast( getSelf() ), pChildNode ), "SequentialTimeContainer::skipEffect, resolveChild"); diff --git a/slideshow/source/engine/effectrewinder.cxx b/slideshow/source/engine/effectrewinder.cxx index 2b2bbfbbc324..af589c2bc0e7 100644 --- a/slideshow/source/engine/effectrewinder.cxx +++ b/slideshow/source/engine/effectrewinder.cxx @@ -198,7 +198,7 @@ bool EffectRewinder::rewind ( // No main sequence effects to rewind on the current slide. // Go back to the previous slide. mpAsynchronousRewindEvent = makeEvent( - ::boost::bind( + ::std::bind( &EffectRewinder::asynchronousRewindToPreviousSlide, this, rPreviousSlideFunctor), @@ -209,7 +209,7 @@ bool EffectRewinder::rewind ( // The actual rewinding is done asynchronously so that we can safely // call other methods. mpAsynchronousRewindEvent = makeEvent( - ::boost::bind( + ::std::bind( &EffectRewinder::asynchronousRewind, this, nSkipCount, @@ -238,7 +238,7 @@ void EffectRewinder::skipAllMainSequenceEffects() const int nTotalMainSequenceEffectCount (countMainSequenceEffects()); mpAsynchronousRewindEvent = makeEvent( - ::boost::bind( + ::std::bind( &EffectRewinder::asynchronousRewind, this, nTotalMainSequenceEffectCount, @@ -365,7 +365,7 @@ void EffectRewinder::asynchronousRewind ( if (rSlideRewindFunctor) rSlideRewindFunctor(); mpAsynchronousRewindEvent = makeEvent( - ::boost::bind( + ::std::bind( &EffectRewinder::asynchronousRewind, this, nEffectCount, diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index d5c32fa9757e..2be7714360d3 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -351,7 +351,7 @@ void SAL_CALL EventMultiplexerListener::mousePressed( // might not be the main thread! if( mpEventQueue ) mpEventQueue->addEvent( - makeEvent( boost::bind( &EventMultiplexerImpl::mousePressed, + makeEvent( std::bind( &EventMultiplexerImpl::mousePressed, mpEventMultiplexer, e ), "EventMultiplexerImpl::mousePressed") ); @@ -366,7 +366,7 @@ void SAL_CALL EventMultiplexerListener::mouseReleased( // this might not be the main thread! if( mpEventQueue ) mpEventQueue->addEvent( - makeEvent( boost::bind( &EventMultiplexerImpl::mouseReleased, + makeEvent( std::bind( &EventMultiplexerImpl::mouseReleased, mpEventMultiplexer, e ), "EventMultiplexerImpl::mouseReleased") ); @@ -394,7 +394,7 @@ void SAL_CALL EventMultiplexerListener::mouseDragged( // might not be the main thread! if( mpEventQueue ) mpEventQueue->addEvent( - makeEvent( boost::bind( &EventMultiplexerImpl::mouseDragged, + makeEvent( std::bind( &EventMultiplexerImpl::mouseDragged, mpEventMultiplexer, e ), "EventMultiplexerImpl::mouseDragged") ); @@ -409,7 +409,7 @@ void SAL_CALL EventMultiplexerListener::mouseMoved( // might not be the main thread! if( mpEventQueue ) mpEventQueue->addEvent( - makeEvent( boost::bind( &EventMultiplexerImpl::mouseMoved, + makeEvent( std::bind( &EventMultiplexerImpl::mouseMoved, mpEventMultiplexer, e ), "EventMultiplexerImpl::mouseMoved") ); @@ -514,8 +514,7 @@ void EventMultiplexerImpl::tick() void EventMultiplexerImpl::scheduleTick() { EventSharedPtr pEvent( - makeDelay( boost::bind( &EventMultiplexerImpl::tick, - this ), + makeDelay( [this] () { this->tick(); }, mnTimeout, "EventMultiplexerImpl::tick with delay")); diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index cd46010e2991..fecd0646c046 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -534,8 +534,7 @@ struct SlideShowImpl::SeparateListenerImpl : public EventHandler, // sprite hiding and shape redraw (at the end of the animation of a // shape), which would cause a flicker. mrEventQueue.addEventForNextRound( - makeEvent( - boost::bind( &SlideShowImpl::notifySlideAnimationsEnded, boost::ref(mrShow) ), + makeEvent( [this] () { this->mrShow.notifySlideAnimationsEnded(); }, "SlideShowImpl::notifySlideAnimationsEnded")); return true; } @@ -861,12 +860,10 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( // displaySlide() has finished - sometimes, view size has not yet // reached final size maEventQueue.addEvent( - makeEvent( - boost::bind( - &::slideshow::internal::Animation::prefetch, - pTransition, - AnimatableShapeSharedPtr(), - ShapeAttributeLayerSharedPtr()), + makeEvent( [pTransition] () { + pTransition->prefetch( + AnimatableShapeSharedPtr(), + ShapeAttributeLayerSharedPtr()); }, "Animation::prefetch")); return ActivitySharedPtr( @@ -1156,10 +1153,7 @@ void SlideShowImpl::displaySlide( mpPreviousSlide, mpCurrentSlide, makeEvent( - boost::bind( - &SlideShowImpl::notifySlideTransitionEnded, - this, - false ), + [this] () { this->notifySlideTransitionEnded(false); }, "SlideShowImpl::notifySlideTransitionEnded"))); if (bSkipSlideTransition) @@ -1182,10 +1176,7 @@ void SlideShowImpl::displaySlide( // effect start event right away. maEventQueue.addEvent( makeEvent( - boost::bind( - &SlideShowImpl::notifySlideTransitionEnded, - this, - true ), + [this] () { this->notifySlideTransitionEnded(true); }, "SlideShowImpl::notifySlideTransitionEnded")); } } @@ -1219,11 +1210,7 @@ void SlideShowImpl::redisplayCurrentSlide() // No transition effect on this slide - schedule slide // effect start event right away. maEventQueue.addEvent( - makeEvent( - boost::bind( - &SlideShowImpl::notifySlideTransitionEnded, - this, - true ), + makeEvent( [this] () { this->notifySlideTransitionEnded(true); }, "SlideShowImpl::notifySlideTransitionEnded")); maListenerContainer.forEach( @@ -2287,8 +2274,7 @@ void SlideShowImpl::notifySlideAnimationsEnded() // generate interruptable event here, there's no // timeout involved. aNotificationEvents.mpImmediateEvent = - makeEvent( boost::bind( - boost::mem_fn(&SlideShowImpl::notifySlideEnded), this, false ), + makeEvent( [this] () { this->notifySlideEnded(false); }, "SlideShowImpl::notifySlideEnded"); } } diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx index 04170a72cc1b..f699ce1e711d 100644 --- a/slideshow/source/engine/slideview.cxx +++ b/slideshow/source/engine/slideview.cxx @@ -53,7 +53,6 @@ #include #include -#include #include #include @@ -1087,10 +1086,7 @@ void SlideView::modified( const lang::EventObject& /*aEvent*/ ) // notify view change. Don't call EventMultiplexer directly, this // might not be the main thread! mrEventQueue.addEvent( - makeEvent( boost::bind( (bool (EventMultiplexer::*)( - const uno::Reference&)) - &EventMultiplexer::notifyViewChanged, - boost::ref(mrEventMultiplexer), mxView ), + makeEvent( [this] () { this->mrEventMultiplexer.notifyViewChanged(this->mxView); }, "EventMultiplexer::notifyViewChanged")); } @@ -1105,8 +1101,7 @@ void SlideView::windowPaint( const awt::PaintEvent& /*e*/ ) // notify view clobbering. Don't call EventMultiplexer directly, // this might not be the main thread! mrEventQueue.addEvent( - makeEvent( boost::bind( &EventMultiplexer::notifyViewClobbered, - boost::ref(mrEventMultiplexer), mxView ), + makeEvent( [this] () { this->mrEventMultiplexer.notifyViewClobbered(this->mxView); }, "EventMultiplexer::notifyViewClobbered") ); } diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx index 1b5d1a100433..9f06797b78ea 100644 --- a/slideshow/source/engine/usereventqueue.cxx +++ b/slideshow/source/engine/usereventqueue.cxx @@ -268,9 +268,9 @@ private: // someone has registerered above for next effects // (multiplexer prio=0) at the user event queue. return mrEventQueue.addEventWhenQueueIsEmpty( - makeEvent( boost::bind( &EventMultiplexer::notifyNextEffect, - boost::ref(mrEventMultiplexer) ), - "EventMultiplexer::notifyNextEffect") ); + makeEvent( [this] () { + this->mrEventMultiplexer.notifyNextEffect(); + }, "EventMultiplexer::notifyNextEffect") ); } else return true; -- cgit