LibreOffice Module slideshow (master) 1
|
Base class for animation activities. More...
#include <activitybase.hxx>
Public Member Functions | |
ActivityBase (const ActivityParameters &rParms) | |
virtual void | dispose () override |
From Disposable interface. More... | |
virtual void | setTargets (const AnimatableShapeSharedPtr &rShape, const ShapeAttributeLayerSharedPtr &rAttrLayer)=0 |
Sets targets (shape and attributeLayer) More... | |
virtual bool | perform ()=0 |
Perform the activity associated with this interface's implementation. More... | |
virtual double | calcTimeLag () const =0 |
Calculates whether the activity lags time. More... | |
virtual bool | isActive () const =0 |
Query whether this activity is still continuing. More... | |
virtual void | dequeued ()=0 |
Notifies the Activity that it has now left the ActivitiesQueue. More... | |
virtual void | end ()=0 |
Forces this activity deactivate and get to its end state (if possible), but does not dispose. More... | |
Public Member Functions inherited from slideshow::internal::Disposable | |
virtual | ~Disposable () |
virtual void | dispose ()=0 |
Dispose all object references. More... | |
Public Member Functions inherited from slideshow::internal::SharedPtrAble | |
virtual | ~SharedPtrAble () |
Protected Member Functions | |
virtual bool | perform () override |
From Activity interface. More... | |
virtual double | calcTimeLag () const override |
Calculates whether the activity lags time. More... | |
virtual bool | isActive () const override |
Query whether this activity is still continuing. More... | |
void | endActivity () |
End this activity, in a regular way. More... | |
double | calcAcceleratedTime (double nT) const |
Modify fractional time. More... | |
bool | isDisposed () const |
EventQueue & | getEventQueue () const |
const AnimatableShapeSharedPtr & | getShape () const |
const ShapeAttributeLayerSharedPtr & | getShapeAttributeLayer () const |
bool | isRepeatCountValid () const |
double | getRepeatCount () const |
bool | isAutoReverse () const |
Private Member Functions | |
virtual void | dequeued () override |
Notifies the Activity that it has now left the ActivitiesQueue. More... | |
virtual void | setTargets (const AnimatableShapeSharedPtr &rShape, const ShapeAttributeLayerSharedPtr &rAttrLayer) override |
Sets targets (shape and attributeLayer) More... | |
virtual void | startAnimation ()=0 |
Hook for derived classes. More... | |
virtual void | endAnimation ()=0 |
Hook for derived classes. More... | |
virtual void | end () override |
Activity: More... | |
virtual void | performEnd ()=0 |
Private Attributes | |
EventSharedPtr | mpEndEvent |
EventQueue & | mrEventQueue |
AnimatableShapeSharedPtr | mpShape |
ShapeAttributeLayerSharedPtr | mpAttributeLayer |
::std::optional< double > const | maRepeats |
const double | mnAccelerationFraction |
const double | mnDecelerationFraction |
const bool | mbAutoReverse |
bool | mbFirstPerformCall |
bool | mbIsActive |
Base class for animation activities.
This whole class hierarchy is only for code sharing between the various specializations (with or without key times, fully discrete, etc.).
Definition at line 36 of file activitybase.hxx.
|
explicit |
Definition at line 34 of file activitybase.cxx.
References mbAutoReverse.
|
protected |
Modify fractional time.
This method modifies the fractional time (total duration mapped to the [0,1] range) to the effective simple time, but only according to acceleration/deceleration.
Definition at line 143 of file activitybase.cxx.
References clamp(), mnAccelerationFraction, and mnDecelerationFraction.
Referenced by slideshow::internal::DiscreteActivityBase::perform(), slideshow::internal::ContinuousActivityBase::simplePerform(), and slideshow::internal::ContinuousKeyTimeActivityBase::simplePerform().
|
overrideprotectedvirtual |
Calculates whether the activity lags time.
If this method returns a time lag greater than 0.0, the ActivitiesQueue will adjust the global slideshow time, by subtracting the given amount of lag.
Implements slideshow::internal::Activity.
Reimplemented in slideshow::internal::SimpleContinuousActivityBase.
Definition at line 61 of file activitybase.cxx.
References isActive(), mbFirstPerformCall, and startAnimation().
Referenced by slideshow::internal::SimpleContinuousActivityBase::calcTimeLag().
|
overrideprivatevirtual |
Notifies the Activity that it has now left the ActivitiesQueue.
Use this method to react on the queue removal event. For animated shapes, this is e.g. used to switch back to the non-sprite presentation mode of the shape.
Implements slideshow::internal::Activity.
Definition at line 116 of file activitybase.cxx.
References endAnimation(), and isActive().
|
overridevirtual |
From Disposable interface.
Implements slideshow::internal::Disposable.
Reimplemented in slideshow::internal::DiscreteActivityBase.
Definition at line 46 of file activitybase.cxx.
References mbIsActive, mpAttributeLayer, mpEndEvent, and mpShape.
Referenced by slideshow::internal::DiscreteActivityBase::dispose().
|
overrideprivatevirtual |
Implements slideshow::internal::Activity.
Definition at line 127 of file activitybase.cxx.
References endActivity(), endAnimation(), isActive(), isDisposed(), mbFirstPerformCall, performEnd(), and startAnimation().
|
protected |
End this activity, in a regular way.
This method is for derived classes needing to signal a regular activity end (i.e. because the regular duration is over)
Definition at line 103 of file activitybase.cxx.
References slideshow::internal::EventQueue::addEvent(), mbIsActive, mpEndEvent, and mrEventQueue.
Referenced by end(), slideshow::internal::DiscreteActivityBase::perform(), and slideshow::internal::SimpleContinuousActivityBase::perform().
|
privatepure virtual |
Hook for derived classes.
This method will be called after the last perform() invocation, and after the potential changes of that perform() call are committed to screen. That is, in endAnimation(), the animation objects (sprites, animation) can safely be destroyed, without causing visible artifacts on screen.
Referenced by dequeued(), and end().
|
inlineprotected |
Definition at line 106 of file activitybase.hxx.
References mrEventQueue.
Referenced by slideshow::internal::DiscreteActivityBase::perform().
|
inlineprotected |
Definition at line 114 of file activitybase.hxx.
References maRepeats.
Referenced by slideshow::internal::DiscreteActivityBase::perform(), and slideshow::internal::SimpleContinuousActivityBase::perform().
|
inlineprotected |
Definition at line 108 of file activitybase.hxx.
References mpShape.
|
inlineprotected |
Definition at line 110 of file activitybase.hxx.
References mpAttributeLayer.
|
overrideprotectedvirtual |
Query whether this activity is still continuing.
Implements slideshow::internal::Activity.
Definition at line 86 of file activitybase.cxx.
References mbIsActive.
Referenced by calcTimeLag(), slideshow::internal::SimpleContinuousActivityBase::calcTimeLag(), dequeued(), end(), perform(), and slideshow::internal::SimpleContinuousActivityBase::perform().
|
inlineprotected |
Definition at line 115 of file activitybase.hxx.
References mbAutoReverse.
Referenced by slideshow::internal::DiscreteActivityBase::calcFrameIndex(), slideshow::internal::DiscreteActivityBase::calcRepeatCount(), slideshow::internal::DiscreteActivityBase::perform(), and slideshow::internal::SimpleContinuousActivityBase::perform().
|
inlineprotected |
Definition at line 101 of file activitybase.hxx.
References mbIsActive, mpAttributeLayer, mpEndEvent, and mpShape.
Referenced by end().
|
inlineprotected |
Definition at line 113 of file activitybase.hxx.
References maRepeats.
Referenced by slideshow::internal::DiscreteActivityBase::perform(), and slideshow::internal::SimpleContinuousActivityBase::perform().
|
overrideprotectedvirtual |
From Activity interface.
Derived classes should override, call this first and then perform their work.
Implements slideshow::internal::Activity.
Reimplemented in slideshow::internal::ContinuousActivityBase, slideshow::internal::ContinuousKeyTimeActivityBase, slideshow::internal::DiscreteActivityBase, and slideshow::internal::SimpleContinuousActivityBase.
Definition at line 75 of file activitybase.cxx.
References isActive(), and mbFirstPerformCall.
Referenced by slideshow::internal::DiscreteActivityBase::perform(), and slideshow::internal::SimpleContinuousActivityBase::perform().
|
privatepure virtual |
Referenced by end().
|
overrideprivatevirtual |
Sets targets (shape and attributeLayer)
Since attribute layers can only be generated when the animation starts, the Activity owner must be able to pass it into the Activity after initial creation. The same applies to the actual shape the animation must run for, since e.g. subsetted shapes are generated close before the animation starts, too (this is not necessary in and out of itself, but for performance reasons. Otherwise, character iterations produce tons of subset shapes).
rShape | Shape to play the animation on. |
rAttrLayer | Attribute layer to change the animated values on. |
Implements slideshow::internal::AnimationActivity.
Definition at line 91 of file activitybase.cxx.
References ENSURE_OR_THROW, mpAttributeLayer, and mpShape.
|
privatepure virtual |
Hook for derived classes.
This method will be called from the first perform() invocation, to signal the start of the activity.
Implemented in slideshow::internal::DiscreteActivityBase, and slideshow::internal::SimpleContinuousActivityBase.
Referenced by calcTimeLag(), and end().
|
private |
Definition at line 128 of file activitybase.hxx.
Referenced by getRepeatCount(), and isRepeatCountValid().
|
private |
Definition at line 132 of file activitybase.hxx.
Referenced by isAutoReverse().
|
mutableprivate |
Definition at line 135 of file activitybase.hxx.
Referenced by calcTimeLag(), end(), and perform().
|
private |
Definition at line 136 of file activitybase.hxx.
Referenced by dispose(), endActivity(), isActive(), and isDisposed().
|
private |
Definition at line 129 of file activitybase.hxx.
Referenced by calcAcceleratedTime().
|
private |
Definition at line 130 of file activitybase.hxx.
Referenced by calcAcceleratedTime().
|
private |
Definition at line 126 of file activitybase.hxx.
Referenced by dispose(), getShapeAttributeLayer(), isDisposed(), and setTargets().
|
private |
Definition at line 123 of file activitybase.hxx.
Referenced by dispose(), endActivity(), and isDisposed().
|
private |
Definition at line 125 of file activitybase.hxx.
Referenced by dispose(), getShape(), isDisposed(), and setTargets().
|
private |
Definition at line 124 of file activitybase.hxx.
Referenced by endActivity(), and getEventQueue().