LibreOffice Module slideshow (master) 1
|
Rewind single effects of the main effect sequence. More...
#include <effectrewinder.hxx>
Public Member Functions | |
EffectRewinder (EventMultiplexer &rEventMultiplexer, EventQueue &rEventQueue, UserEventQueue &rUserEventQueue) | |
~EffectRewinder () | |
void | dispose () |
Call Dispose() before the owner of an EffectRewinder object dies so that the EffectRewinder can release all references to the owner. More... | |
void | setRootAnimationNode (const css::uno::Reference< css::animations::XAnimationNode > &xRootNode) |
Store the root node of the animation tree. More... | |
void | setCurrentSlide (const css::uno::Reference< css::drawing::XDrawPage > &xSlide) |
Store the XDrawPage to reach specific slide properties. More... | |
bool | rewind (const ::std::shared_ptr< ScreenUpdater::UpdateLock > &rpPaintLock, const ::std::function< void()> &rSlideRewindFunctor, const ::std::function< void()> &rPreviousSlideFunctor) |
Rewind one effect of the main effect sequence. More... | |
void | skipAllMainSequenceEffects () |
Call this method after gotoPreviousEffect() triggered a slide change to the previous slide. More... | |
Private Member Functions | |
void | initialize () |
bool | resetEffectCount () |
bool | notifyAnimationStart (const AnimationNodeSharedPtr &rpNode) |
Called by listeners when an animation (not necessarily of a main sequence effect) starts. More... | |
sal_Int32 | countMainSequenceEffects () |
Count the number of effects (or effect groups) in the main effect sequence. More... | |
void | skipSingleMainSequenceEffects () |
Skip the next main sequence effect. More... | |
void | asynchronousRewind (sal_Int32 nEffectCount, const bool bRedisplayCurrentSlide, const ::std::function< void()> &rSlideRewindFunctor) |
Rewind the last effect of the main effect sequence by replaying all previous effects. More... | |
void | asynchronousRewindToPreviousSlide (const ::std::function< void()> &rPreviousSlideFunctor) |
Go to the previous slide and replay all of its main sequence effects (or effect groups). More... | |
Private Attributes | |
EventMultiplexer & | mrEventMultiplexer |
EventQueue & | mrEventQueue |
UserEventQueue & | mrUserEventQueue |
EventHandlerSharedPtr | mpSlideStartHandler |
EventHandlerSharedPtr | mpSlideEndHandler |
AnimationEventHandlerSharedPtr | mpAnimationStartHandler |
sal_Int32 | mnMainSequenceEffectCount |
The number off main sequence effects so far. More... | |
EventSharedPtr | mpAsynchronousRewindEvent |
This is the currently scheduled event that executes the asynchronous part of the effect rewinding. More... | |
css::uno::Reference< css::animations::XAnimationNode > | mxCurrentAnimationRootNode |
css::uno::Reference< css::drawing::XDrawPage > | mxCurrentSlide |
::std::shared_ptr< ScreenUpdater::UpdateLock > | mpPaintLock |
bool | mbNonUserTriggeredMainSequenceEffectSeen |
bool | mbHasAdvancedTimeSetting |
Rewind single effects of the main effect sequence.
A rewind is initiated by calling the Rewind() method. Part of the processing is done asynchronously. Multiple EventQueue::update() calls may be necessary to finish a rewind.
Remember to call SetRootAnimationNode() when switching to a different slide so that the EffectRewinder can determine the number of main sequence effects.
Definition at line 48 of file effectrewinder.hxx.
slideshow::internal::EffectRewinder::EffectRewinder | ( | EventMultiplexer & | rEventMultiplexer, |
EventQueue & | rEventQueue, | ||
UserEventQueue & | rUserEventQueue | ||
) |
Definition at line 71 of file effectrewinder.cxx.
References initialize().
slideshow::internal::EffectRewinder::~EffectRewinder | ( | ) |
Definition at line 118 of file effectrewinder.cxx.
References dispose().
|
private |
Rewind the last effect of the main effect sequence by replaying all previous effects.
nEffectCount | The number of main sequence effects to replay. |
bRedisplayCurrentSlide | When <TRUE> then the current slide is redisplayed before the effects are replayed. |
rSlideRewindFunctor | This functor is used to redisplay the current slide. |
Definition at line 346 of file effectrewinder.cxx.
References slideshow::internal::EventQueue::addEvent(), asynchronousRewind(), slideshow::internal::UserEventQueue::callSkipEffectEventHandler(), slideshow::internal::EventQueue::forceEmpty(), makeEvent, mbHasAdvancedTimeSetting, mbNonUserTriggeredMainSequenceEffectSeen, mpAsynchronousRewindEvent, mpPaintLock, mrEventQueue, mrUserEventQueue, and skipSingleMainSequenceEffects().
Referenced by asynchronousRewind(), rewind(), and skipAllMainSequenceEffects().
|
private |
Go to the previous slide and replay all of its main sequence effects (or effect groups).
rPreviousSlideFunctor | This functor is used to go to the previous slide. |
Definition at line 393 of file effectrewinder.cxx.
References mpAsynchronousRewindEvent.
Referenced by rewind().
|
private |
Count the number of effects (or effect groups) in the main effect sequence.
Definition at line 254 of file effectrewinder.cxx.
References aEvent, and mxCurrentAnimationRootNode.
Referenced by skipAllMainSequenceEffects().
void slideshow::internal::EffectRewinder::dispose | ( | void | ) |
Call Dispose() before the owner of an EffectRewinder object dies so that the EffectRewinder can release all references to the owner.
Definition at line 124 of file effectrewinder.cxx.
References mpAnimationStartHandler, mpAsynchronousRewindEvent, mpSlideEndHandler, mpSlideStartHandler, mrEventMultiplexer, slideshow::internal::EventMultiplexer::removeAnimationStartHandler(), slideshow::internal::EventMultiplexer::removeSlideEndHandler(), and slideshow::internal::EventMultiplexer::removeSlideStartHandler().
Referenced by ~EffectRewinder().
|
private |
Definition at line 92 of file effectrewinder.cxx.
References slideshow::internal::EventMultiplexer::addAnimationStartHandler(), slideshow::internal::EventMultiplexer::addSlideEndHandler(), slideshow::internal::EventMultiplexer::addSlideStartHandler(), mpAnimationStartHandler, mpSlideEndHandler, mpSlideStartHandler, mrEventMultiplexer, notifyAnimationStart(), and resetEffectCount().
Referenced by EffectRewinder().
|
private |
Called by listeners when an animation (not necessarily of a main sequence effect) starts.
Definition at line 313 of file effectrewinder.cxx.
References aEvent, mbNonUserTriggeredMainSequenceEffectSeen, and mnMainSequenceEffectCount.
Referenced by initialize().
|
private |
Definition at line 306 of file effectrewinder.cxx.
References mnMainSequenceEffectCount.
Referenced by initialize().
bool slideshow::internal::EffectRewinder::rewind | ( | const ::std::shared_ptr< ScreenUpdater::UpdateLock > & | rpPaintLock, |
const ::std::function< void()> & | rSlideRewindFunctor, | ||
const ::std::function< void()> & | rPreviousSlideFunctor | ||
) |
Rewind one effect of the main effect sequence.
When the current slide has not effects or no main sequence effect has yet been played then switch to the previous slide and replay all of its main sequence effects. The caller has to pass two functors that redisplay the current slide or switch to the previous slide so that it does not have to expose its internals to us. Only one of the two functors is called.
rpPaintLock | This paint lock is released after the whole asynchronous process of rewinding the current effect is completed. It prevents intermediate repaints that would show partial replay of effects. |
rSlideRewindFunctor | This functor is called when the current slide is to be redisplayed. When it is called then the other functor is not called. |
rPreviousSlideFunctor | This functor is called to switch to the previous slide. When it is called then the other functor is not called. |
Definition at line 173 of file effectrewinder.cxx.
References slideshow::internal::EventQueue::addEvent(), asynchronousRewind(), asynchronousRewindToPreviousSlide(), slideshow::internal::UserEventQueue::callSkipEffectEventHandler(), slideshow::internal::EventQueue::forceEmpty(), makeEvent, mbHasAdvancedTimeSetting, mnMainSequenceEffectCount, mpAsynchronousRewindEvent, mpPaintLock, mrEventQueue, and mrUserEventQueue.
void slideshow::internal::EffectRewinder::setCurrentSlide | ( | const css::uno::Reference< css::drawing::XDrawPage > & | xSlide | ) |
Store the XDrawPage to reach specific slide properties.
Definition at line 158 of file effectrewinder.cxx.
References slideshow::internal::getPropertyValue(), mbHasAdvancedTimeSetting, and mxCurrentSlide.
void slideshow::internal::EffectRewinder::setRootAnimationNode | ( | const css::uno::Reference< css::animations::XAnimationNode > & | xRootNode | ) |
Store the root node of the animation tree.
It is used in CountMainSequenceEffects() to count the number of main sequence effects (or effect groups.)
Definition at line 152 of file effectrewinder.cxx.
References mxCurrentAnimationRootNode.
void slideshow::internal::EffectRewinder::skipAllMainSequenceEffects | ( | ) |
Call this method after gotoPreviousEffect() triggered a slide change to the previous slide.
Definition at line 232 of file effectrewinder.cxx.
References slideshow::internal::EventQueue::addEvent(), asynchronousRewind(), countMainSequenceEffects(), makeEvent, mpAsynchronousRewindEvent, and mrEventQueue.
|
private |
Skip the next main sequence effect.
Definition at line 295 of file effectrewinder.cxx.
References slideshow::internal::UserEventQueue::callSkipEffectEventHandler(), slideshow::internal::EventQueue::forceEmpty(), mrEventMultiplexer, mrEventQueue, mrUserEventQueue, and slideshow::internal::EventMultiplexer::notifyNextEffect().
Referenced by asynchronousRewind().
|
private |
Definition at line 129 of file effectrewinder.hxx.
Referenced by asynchronousRewind(), rewind(), and setCurrentSlide().
|
private |
Definition at line 128 of file effectrewinder.hxx.
Referenced by asynchronousRewind(), and notifyAnimationStart().
|
private |
The number off main sequence effects so far.
Definition at line 116 of file effectrewinder.hxx.
Referenced by notifyAnimationStart(), resetEffectCount(), and rewind().
|
private |
Definition at line 112 of file effectrewinder.hxx.
Referenced by dispose(), and initialize().
|
private |
This is the currently scheduled event that executes the asynchronous part of the effect rewinding.
It is also used as flag that prevents nested rewinds.
Definition at line 122 of file effectrewinder.hxx.
Referenced by asynchronousRewind(), asynchronousRewindToPreviousSlide(), dispose(), rewind(), and skipAllMainSequenceEffects().
|
private |
Definition at line 126 of file effectrewinder.hxx.
Referenced by asynchronousRewind(), and rewind().
|
private |
Definition at line 111 of file effectrewinder.hxx.
Referenced by dispose(), and initialize().
|
private |
Definition at line 110 of file effectrewinder.hxx.
Referenced by dispose(), and initialize().
|
private |
Definition at line 106 of file effectrewinder.hxx.
Referenced by dispose(), initialize(), and skipSingleMainSequenceEffects().
|
private |
Definition at line 107 of file effectrewinder.hxx.
Referenced by asynchronousRewind(), rewind(), skipAllMainSequenceEffects(), and skipSingleMainSequenceEffects().
|
private |
Definition at line 108 of file effectrewinder.hxx.
Referenced by asynchronousRewind(), rewind(), and skipSingleMainSequenceEffects().
|
private |
Definition at line 124 of file effectrewinder.hxx.
Referenced by countMainSequenceEffects(), and setRootAnimationNode().
|
private |
Definition at line 125 of file effectrewinder.hxx.
Referenced by setCurrentSlide().