LibreOffice Module slideshow (master) 1
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
slideshow::internal::SlideChangeBase Class Reference

Base class for all slide change effects. More...

#include <slidechangebase.hxx>

Inheritance diagram for slideshow::internal::SlideChangeBase:
[legend]
Collaboration diagram for slideshow::internal::SlideChangeBase:
[legend]

Classes

struct  ViewEntry
 Info on a per-view basis. More...
 

Public Member Functions

 SlideChangeBase (const SlideChangeBase &)=delete
 
SlideChangeBaseoperator= (const SlideChangeBase &)=delete
 
virtual bool operator() (double x) override
 Set the animation to value x. More...
 
virtual double getUnderlyingValue () const override
 Request the underlying value for this animation. More...
 
virtual void prefetch () override
 Notify that the animation going active soon. More...
 
virtual void start (const AnimatableShapeSharedPtr &, const ShapeAttributeLayerSharedPtr &) override
 Notify that the animation is about to begin. More...
 
virtual void end () override
 Notify that the animation is about to end. More...
 
virtual void viewAdded (const UnoViewSharedPtr &rView) override
 Notify new view. More...
 
virtual void viewRemoved (const UnoViewSharedPtr &rView) override
 Notify removed view. More...
 
virtual void viewChanged (const UnoViewSharedPtr &rView) override
 Notify changed view. More...
 
virtual void viewsChanged () override
 Notify that all views changed. More...
 
virtual void viewAdded (const UnoViewSharedPtr &rView)=0
 Notify new view. More...
 
virtual void viewRemoved (const UnoViewSharedPtr &rView)=0
 Notify removed view. More...
 
virtual void viewChanged (const UnoViewSharedPtr &rView)=0
 Notify changed view. More...
 
virtual void viewsChanged ()=0
 Notify that all views changed. More...
 
- Public Member Functions inherited from slideshow::internal::SharedPtrAble
virtual ~SharedPtrAble ()
 
virtual bool operator() (double x)=0
 Set the animation to value x. More...
 
virtual double getUnderlyingValue () const =0
 Request the underlying value for this animation. More...
 
virtual void prefetch ()=0
 Notify that the animation going active soon. More...
 
virtual void start (const AnimatableShapeSharedPtr &rShape, const ShapeAttributeLayerSharedPtr &rAttrLayer)=0
 Notify that the animation is about to begin. More...
 
virtual void end ()=0
 Notify that the animation is about to end. More...
 

Protected Types

typedef ::std::vector< ViewEntryViewsVecT
 

Protected Member Functions

 SlideChangeBase (::std::optional< SlideSharedPtr > leavingSlide, const SlideSharedPtr &pEnteringSlide, SoundPlayerSharedPtr pSoundPlayer, const UnoViewContainer &rViewContainer, ScreenUpdater &rScreenUpdater, EventMultiplexer &rEventMultiplexer, bool bCreateLeavingSprites=true, bool bCreateEnteringSprites=true)
 Create a new SlideChanger, for the given leaving and entering slides. More...
 
ViewsVecT::const_iterator beginViews ()
 
ViewsVecT::const_iterator endViews ()
 
SlideBitmapSharedPtr getLeavingBitmap (const ViewEntry &rViewEntry) const
 
SlideBitmapSharedPtr getEnteringBitmap (const ViewEntry &rViewEntry) const
 
SlideBitmapSharedPtr createBitmap (const UnoViewSharedPtr &pView, const std::optional< SlideSharedPtr > &rSlide_) const
 
::basegfx::B2ISize getEnteringSlideSizePixel (const UnoViewSharedPtr &pView) const
 
virtual void prepareForRun (const ViewEntry &rViewEntry, const cppcanvas::CanvasSharedPtr &rDestinationCanvas)
 Called on derived classes to perform actions before first run. More...
 
virtual void performIn (const cppcanvas::CustomSpriteSharedPtr &rSprite, const ViewEntry &rViewEntry, const cppcanvas::CanvasSharedPtr &rDestinationCanvas, double t)
 Called on derived classes to implement actual slide change. More...
 
virtual void performOut (const cppcanvas::CustomSpriteSharedPtr &rSprite, const ViewEntry &rViewEntry, const cppcanvas::CanvasSharedPtr &rDestinationCanvas, double t)
 Called on derived classes to implement actual slide change. More...
 
ScreenUpdatergetScreenUpdater () const
 

Static Protected Member Functions

static void renderBitmap (SlideBitmapSharedPtr const &pSlideBitmap, cppcanvas::CanvasSharedPtr const &pCanvas)
 

Private Member Functions

cppcanvas::CustomSpriteSharedPtr createSprite (UnoViewSharedPtr const &pView, ::basegfx::B2DSize const &rSpriteSize, double nPrio) const
 
void addSprites (ViewEntry &rEntry)
 

Static Private Member Functions

static void clearViewEntry (ViewEntry &rEntry)
 

Private Attributes

SoundPlayerSharedPtr mpSoundPlayer
 
EventMultiplexermrEventMultiplexer
 
ScreenUpdatermrScreenUpdater
 
::std::optional< SlideSharedPtrmaLeavingSlide
 
SlideSharedPtr mpEnteringSlide
 
ViewsVecT maViewData
 
const UnoViewContainermrViewContainer
 
const bool mbCreateLeavingSprites
 
const bool mbCreateEnteringSprites
 
bool mbSpritesVisible
 
bool mbFinished
 
bool mbPrefetched
 

Additional Inherited Members

- Public Types inherited from slideshow::internal::NumberAnimation
typedef double ValueType
 

Detailed Description

Base class for all slide change effects.

This class provides the basic sprite and view handling functionality. Derived classes should normally only need to implement the perform() method.

Definition at line 48 of file slidechangebase.hxx.

Member Typedef Documentation

◆ ViewsVecT

Definition at line 108 of file slidechangebase.hxx.

Constructor & Destructor Documentation

◆ SlideChangeBase() [1/2]

slideshow::internal::SlideChangeBase::SlideChangeBase ( const SlideChangeBase )
delete

◆ SlideChangeBase() [2/2]

slideshow::internal::SlideChangeBase::SlideChangeBase ( ::std::optional< SlideSharedPtr leavingSlide,
const SlideSharedPtr pEnteringSlide,
SoundPlayerSharedPtr  pSoundPlayer,
const UnoViewContainer rViewContainer,
ScreenUpdater rScreenUpdater,
EventMultiplexer rEventMultiplexer,
bool  bCreateLeavingSprites = true,
bool  bCreateEnteringSprites = true 
)
protected

Create a new SlideChanger, for the given leaving and entering slides.

Member Function Documentation

◆ addSprites()

void slideshow::internal::SlideChangeBase::addSprites ( ViewEntry rEntry)
private

◆ beginViews()

ViewsVecT::const_iterator slideshow::internal::SlideChangeBase::beginViews ( )
inlineprotected

Definition at line 110 of file slidechangebase.hxx.

References maViewData.

Referenced by slideshow::internal::CombTransition::operator()().

◆ clearViewEntry()

void slideshow::internal::SlideChangeBase::clearViewEntry ( ViewEntry rEntry)
staticprivate

◆ createBitmap()

SlideBitmapSharedPtr slideshow::internal::SlideChangeBase::createBitmap ( const UnoViewSharedPtr pView,
const std::optional< SlideSharedPtr > &  rSlide_ 
) const
protected

◆ createSprite()

cppcanvas::CustomSpriteSharedPtr slideshow::internal::SlideChangeBase::createSprite ( UnoViewSharedPtr const &  pView,
::basegfx::B2DSize const &  rSpriteSize,
double  nPrio 
) const
private

Definition at line 455 of file slidechangebase.cxx.

◆ end()

void slideshow::internal::SlideChangeBase::end ( )
overridevirtual

Notify that the animation is about to end.

Implements slideshow::internal::Animation.

Definition at line 208 of file slidechangebase.cxx.

References mrEventMultiplexer.

◆ endViews()

ViewsVecT::const_iterator slideshow::internal::SlideChangeBase::endViews ( )
inlineprotected

Definition at line 111 of file slidechangebase.hxx.

References maViewData.

Referenced by slideshow::internal::CombTransition::operator()().

◆ getEnteringBitmap()

SlideBitmapSharedPtr slideshow::internal::SlideChangeBase::getEnteringBitmap ( const ViewEntry rViewEntry) const
protected

◆ getEnteringSlideSizePixel()

basegfx::B2ISize slideshow::internal::SlideChangeBase::getEnteringSlideSizePixel ( const UnoViewSharedPtr pView) const
protected

◆ getLeavingBitmap()

SlideBitmapSharedPtr slideshow::internal::SlideChangeBase::getLeavingBitmap ( const ViewEntry rViewEntry) const
protected

◆ getScreenUpdater()

ScreenUpdater & slideshow::internal::SlideChangeBase::getScreenUpdater ( ) const
inlineprotected

Definition at line 170 of file slidechangebase.hxx.

References mrScreenUpdater.

Referenced by slideshow::internal::CombTransition::operator()().

◆ getUnderlyingValue()

double slideshow::internal::SlideChangeBase::getUnderlyingValue ( ) const
overridevirtual

Request the underlying value for this animation.

This is necessary for pure To or By animations, as the Activity cannot determine a sensible start value otherwise.

Attention: \n Note that you are only permitted to query
for the underlying value, if the animation has actually been started (via start() call).

Implements slideshow::internal::NumberAnimation.

Definition at line 378 of file slidechangebase.cxx.

◆ operator()()

bool slideshow::internal::SlideChangeBase::operator() ( double  x)
overridevirtual

Set the animation to value x.

Parameters
xCurrent animation value (must be in an attribute-specific permissible range). Overflowing values will be clipped to the permissible range internally.

Implements slideshow::internal::NumberAnimation.

Reimplemented in slideshow::internal::CombTransition.

Definition at line 254 of file slidechangebase.cxx.

References i, slideshow::internal::SlideChangeBase::ViewEntry::mpInSprite, slideshow::internal::SlideChangeBase::ViewEntry::mpOutSprite, slideshow::internal::SlideChangeBase::ViewEntry::mpView, and nValue.

◆ operator=()

SlideChangeBase & slideshow::internal::SlideChangeBase::operator= ( const SlideChangeBase )
delete

◆ performIn()

void slideshow::internal::SlideChangeBase::performIn ( const cppcanvas::CustomSpriteSharedPtr rSprite,
const ViewEntry rViewEntry,
const cppcanvas::CanvasSharedPtr rDestinationCanvas,
double  t 
)
protectedvirtual

Called on derived classes to implement actual slide change.

This method is called with the sprite of the slide coming 'in'

Parameters
rSpriteCurrent sprite to operate on. This is the sprite of the 'entering' slide
tCurrent parameter value

Definition at line 362 of file slidechangebase.cxx.

◆ performOut()

void slideshow::internal::SlideChangeBase::performOut ( const cppcanvas::CustomSpriteSharedPtr rSprite,
const ViewEntry rViewEntry,
const cppcanvas::CanvasSharedPtr rDestinationCanvas,
double  t 
)
protectedvirtual

Called on derived classes to implement actual slide change.

This method is called with the sprite of the slide moving 'out'

Parameters
rSpriteCurrent sprite to operate on. This is the sprite of the 'leaving' slide
tCurrent parameter value

Definition at line 370 of file slidechangebase.cxx.

◆ prefetch()

void slideshow::internal::SlideChangeBase::prefetch ( )
overridevirtual

Notify that the animation going active soon.

Implementers should preload any buffers, and create any expensive objects at this time.

Parameters
rShapeShape to apply this animation to.
rAttrLayerAttribute layer to play the animation on.

Implements slideshow::internal::Animation.

Definition at line 169 of file slidechangebase.cxx.

References mrEventMultiplexer.

◆ prepareForRun()

void slideshow::internal::SlideChangeBase::prepareForRun ( const ViewEntry rViewEntry,
const cppcanvas::CanvasSharedPtr rDestinationCanvas 
)
protectedvirtual

Called on derived classes to perform actions before first run.

This typically involves rendering of the initial slide content.

Parameters
rViewEntrythe view entry
rDestinationCanvasthe canvas to render on

Definition at line 356 of file slidechangebase.cxx.

◆ renderBitmap()

void slideshow::internal::SlideChangeBase::renderBitmap ( SlideBitmapSharedPtr const &  pSlideBitmap,
cppcanvas::CanvasSharedPtr const &  pCanvas 
)
staticprotected

◆ start()

void slideshow::internal::SlideChangeBase::start ( const AnimatableShapeSharedPtr rShape,
const ShapeAttributeLayerSharedPtr rAttrLayer 
)
overridevirtual

Notify that the animation is about to begin.

Implementers are free to start accompanying effects, such as sounds, and the animation timer now.

Parameters
rShapeShape to apply this animation to.
rAttrLayerAttribute layer to play the animation on.

Implements slideshow::internal::Animation.

Definition at line 185 of file slidechangebase.cxx.

◆ viewAdded()

void slideshow::internal::SlideChangeBase::viewAdded ( const UnoViewSharedPtr rView)
overridevirtual

Notify new view.

Parameters
rViewThe newly added view

Implements slideshow::internal::ViewEventHandler.

Definition at line 386 of file slidechangebase.cxx.

◆ viewChanged()

void slideshow::internal::SlideChangeBase::viewChanged ( const UnoViewSharedPtr rView)
overridevirtual

Notify changed view.

Reasons for a viewChanged notification can be different view size, transformation, or other device properties (color resolution or profile, etc.)

Parameters
rViewThe changed view

Implements slideshow::internal::ViewEventHandler.

Definition at line 416 of file slidechangebase.cxx.

◆ viewRemoved()

void slideshow::internal::SlideChangeBase::viewRemoved ( const UnoViewSharedPtr rView)
overridevirtual

Notify removed view.

Parameters
rViewThe removed view

Implements slideshow::internal::ViewEventHandler.

Definition at line 400 of file slidechangebase.cxx.

◆ viewsChanged()

void slideshow::internal::SlideChangeBase::viewsChanged ( )
overridevirtual

Notify that all views changed.

Reasons for a viewChanged notification can be different view size, transformation, or other device properties (color resolution or profile, etc.)

Note that this method avoids hidden inefficiencies (O(n^2) behaviour when viewChanged() needs to perform linear searches)

Implements slideshow::internal::ViewEventHandler.

Definition at line 440 of file slidechangebase.cxx.

Member Data Documentation

◆ maLeavingSlide

::std::optional<SlideSharedPtr> slideshow::internal::SlideChangeBase::maLeavingSlide
private

Definition at line 187 of file slidechangebase.hxx.

◆ maViewData

ViewsVecT slideshow::internal::SlideChangeBase::maViewData
private

Definition at line 190 of file slidechangebase.hxx.

Referenced by beginViews(), and endViews().

◆ mbCreateEnteringSprites

const bool slideshow::internal::SlideChangeBase::mbCreateEnteringSprites
private

Definition at line 194 of file slidechangebase.hxx.

◆ mbCreateLeavingSprites

const bool slideshow::internal::SlideChangeBase::mbCreateLeavingSprites
private

Definition at line 193 of file slidechangebase.hxx.

◆ mbFinished

bool slideshow::internal::SlideChangeBase::mbFinished
private

Definition at line 196 of file slidechangebase.hxx.

◆ mbPrefetched

bool slideshow::internal::SlideChangeBase::mbPrefetched
private

Definition at line 197 of file slidechangebase.hxx.

◆ mbSpritesVisible

bool slideshow::internal::SlideChangeBase::mbSpritesVisible
private

Definition at line 195 of file slidechangebase.hxx.

◆ mpEnteringSlide

SlideSharedPtr slideshow::internal::SlideChangeBase::mpEnteringSlide
private

Definition at line 188 of file slidechangebase.hxx.

◆ mpSoundPlayer

SoundPlayerSharedPtr slideshow::internal::SlideChangeBase::mpSoundPlayer
private

Definition at line 182 of file slidechangebase.hxx.

◆ mrEventMultiplexer

EventMultiplexer& slideshow::internal::SlideChangeBase::mrEventMultiplexer
private

Definition at line 184 of file slidechangebase.hxx.

◆ mrScreenUpdater

ScreenUpdater& slideshow::internal::SlideChangeBase::mrScreenUpdater
private

Definition at line 185 of file slidechangebase.hxx.

Referenced by getScreenUpdater().

◆ mrViewContainer

const UnoViewContainer& slideshow::internal::SlideChangeBase::mrViewContainer
private

Definition at line 191 of file slidechangebase.hxx.


The documentation for this class was generated from the following files: