Kaydet (Commit) 602a07e1 authored tarafından Noel Grandin's avatar Noel Grandin

drop CycleMode enum

since we only ever used the CYCLE_LOOP enumerator

Change-Id: I181be1e1bba7f72f64420ab22e119d2bffad2d37
üst dd803c6e
...@@ -383,7 +383,6 @@ namespace slideshow ...@@ -383,7 +383,6 @@ namespace slideshow
maSubsetting(), maSubsetting(),
mnIsAnimatedCount(0), mnIsAnimatedCount(0),
mnAnimationLoopCount(0), mnAnimationLoopCount(0),
meCycleMode(CYCLE_LOOP),
mbIsVisible( true ), mbIsVisible( true ),
mbForceUpdate( false ), mbForceUpdate( false ),
mbAttributeLayerRevoked( false ), mbAttributeLayerRevoked( false ),
...@@ -443,7 +442,6 @@ namespace slideshow ...@@ -443,7 +442,6 @@ namespace slideshow
maSubsetting(), maSubsetting(),
mnIsAnimatedCount(0), mnIsAnimatedCount(0),
mnAnimationLoopCount(0), mnAnimationLoopCount(0),
meCycleMode(CYCLE_LOOP),
mbIsVisible( true ), mbIsVisible( true ),
mbForceUpdate( false ), mbForceUpdate( false ),
mbAttributeLayerRevoked( false ), mbAttributeLayerRevoked( false ),
...@@ -454,7 +452,6 @@ namespace slideshow ...@@ -454,7 +452,6 @@ namespace slideshow
getAnimationFromGraphic( maAnimationFrames, getAnimationFromGraphic( maAnimationFrames,
mnAnimationLoopCount, mnAnimationLoopCount,
meCycleMode,
rGraphic ); rGraphic );
ENSURE_OR_THROW( !maAnimationFrames.empty() && ENSURE_OR_THROW( !maAnimationFrames.empty() &&
...@@ -495,7 +492,6 @@ namespace slideshow ...@@ -495,7 +492,6 @@ namespace slideshow
maSubsetting( rTreeNode, mpCurrMtf ), maSubsetting( rTreeNode, mpCurrMtf ),
mnIsAnimatedCount(0), mnIsAnimatedCount(0),
mnAnimationLoopCount(0), mnAnimationLoopCount(0),
meCycleMode(CYCLE_LOOP),
mbIsVisible( rSrc.mbIsVisible ), mbIsVisible( rSrc.mbIsVisible ),
mbForceUpdate( false ), mbForceUpdate( false ),
mbAttributeLayerRevoked( false ), mbAttributeLayerRevoked( false ),
...@@ -580,8 +576,7 @@ namespace slideshow ...@@ -580,8 +576,7 @@ namespace slideshow
pShape, pShape,
pWakeupEvent, pWakeupEvent,
aTimeout, aTimeout,
pShape->mnAnimationLoopCount, pShape->mnAnimationLoopCount);
pShape->meCycleMode);
pWakeupEvent->setActivity( pActivity ); pWakeupEvent->setActivity( pActivity );
pShape->mpIntrinsicAnimationActivity = pActivity; pShape->mpIntrinsicAnimationActivity = pActivity;
......
...@@ -339,9 +339,6 @@ namespace slideshow ...@@ -339,9 +339,6 @@ namespace slideshow
/// Number of times the bitmap animation shall loop /// Number of times the bitmap animation shall loop
::std::size_t mnAnimationLoopCount; ::std::size_t mnAnimationLoopCount;
/// Cycle mode for bitmap animation
CycleMode meCycleMode;
/// Whether shape is visible (without attribute layers) /// Whether shape is visible (without attribute layers)
bool mbIsVisible; bool mbIsVisible;
......
...@@ -264,7 +264,6 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct ) ...@@ -264,7 +264,6 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct )
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
::std::size_t& o_rLoopCount, ::std::size_t& o_rLoopCount,
CycleMode& o_eCycleMode,
const Graphic& rGraphic ) const Graphic& rGraphic )
{ {
o_rFrames.clear(); o_rFrames.clear();
...@@ -291,7 +290,6 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, ...@@ -291,7 +290,6 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
pVDevMask->EnableMapMode( false ); pVDevMask->EnableMapMode( false );
o_rLoopCount = aAnimation.GetLoopCount(); o_rLoopCount = aAnimation.GetLoopCount();
o_eCycleMode = CYCLE_LOOP;
for( sal_uInt16 i=0, nCount=aAnimation.Count(); i<nCount; ++i ) for( sal_uInt16 i=0, nCount=aAnimation.Count(); i<nCount; ++i )
{ {
......
...@@ -109,15 +109,11 @@ namespace slideshow ...@@ -109,15 +109,11 @@ namespace slideshow
@param o_rLoopCount @param o_rLoopCount
Number of times the bitmap animation shall be repeated Number of times the bitmap animation shall be repeated
@param o_eCycleMode
Repeat mode (normal, or ping-pong mode)
@param rGraphic @param rGraphic
Input graphic object, to extract animations from Input graphic object, to extract animations from
*/ */
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
::std::size_t& o_rLoopCount, ::std::size_t& o_rLoopCount,
CycleMode& o_eCycleMode,
const Graphic& rGraphic ); const Graphic& rGraphic );
/** Retrieve scroll text animation rectangles from given metafile /** Retrieve scroll text animation rectangles from given metafile
......
...@@ -65,8 +65,7 @@ namespace slideshow ...@@ -65,8 +65,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape, const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent, const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts, const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops, ::std::size_t nNumLoops );
CycleMode eCycleMode );
IntrinsicAnimationActivity(const IntrinsicAnimationActivity&) = delete; IntrinsicAnimationActivity(const IntrinsicAnimationActivity&) = delete;
IntrinsicAnimationActivity& operator=(const IntrinsicAnimationActivity&) = delete; IntrinsicAnimationActivity& operator=(const IntrinsicAnimationActivity&) = delete;
...@@ -85,7 +84,6 @@ namespace slideshow ...@@ -85,7 +84,6 @@ namespace slideshow
WakeupEventSharedPtr mpWakeupEvent; WakeupEventSharedPtr mpWakeupEvent;
IntrinsicAnimationEventHandlerSharedPtr mpListener; IntrinsicAnimationEventHandlerSharedPtr mpListener;
::std::vector<double> maTimeouts; ::std::vector<double> maTimeouts;
CycleMode meCycleMode;
::std::size_t mnCurrIndex; ::std::size_t mnCurrIndex;
::std::size_t mnNumLoops; ::std::size_t mnNumLoops;
::std::size_t mnLoopCount; ::std::size_t mnLoopCount;
...@@ -115,14 +113,12 @@ namespace slideshow ...@@ -115,14 +113,12 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape, const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent, const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts, const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops, ::std::size_t nNumLoops ) :
CycleMode eCycleMode ) :
maContext( rContext ), maContext( rContext ),
mpDrawShape( rDrawShape ), mpDrawShape( rDrawShape ),
mpWakeupEvent( rWakeupEvent ), mpWakeupEvent( rWakeupEvent ),
mpListener( new IntrinsicAnimationListener(*this) ), mpListener( new IntrinsicAnimationListener(*this) ),
maTimeouts( rTimeouts ), maTimeouts( rTimeouts ),
meCycleMode( eCycleMode ),
mnCurrIndex(0), mnCurrIndex(0),
mnNumLoops(nNumLoops), mnNumLoops(nNumLoops),
mnLoopCount(0), mnLoopCount(0),
...@@ -192,35 +188,14 @@ namespace slideshow ...@@ -192,35 +188,14 @@ namespace slideshow
::std::size_t nNewIndex = 0; ::std::size_t nNewIndex = 0;
const ::std::size_t nNumFrames(maTimeouts.size()); const ::std::size_t nNumFrames(maTimeouts.size());
switch( meCycleMode )
{ pDrawShape->setIntrinsicAnimationFrame( mnCurrIndex );
case CYCLE_LOOP:
{ mpWakeupEvent->start();
pDrawShape->setIntrinsicAnimationFrame( mnCurrIndex ); mpWakeupEvent->setNextTimeout( maTimeouts[mnCurrIndex] );
mpWakeupEvent->start(); mnLoopCount += (mnCurrIndex + 1) / nNumFrames;
mpWakeupEvent->setNextTimeout( maTimeouts[mnCurrIndex] ); nNewIndex = (mnCurrIndex + 1) % nNumFrames;
mnLoopCount += (mnCurrIndex + 1) / nNumFrames;
nNewIndex = (mnCurrIndex + 1) % nNumFrames;
break;
}
case CYCLE_PINGPONGLOOP:
{
::std::size_t nTrueIndex( mnCurrIndex < nNumFrames ?
mnCurrIndex :
2*nNumFrames - mnCurrIndex - 1 );
pDrawShape->setIntrinsicAnimationFrame( nTrueIndex );
mpWakeupEvent->start();
mpWakeupEvent->setNextTimeout( maTimeouts[nTrueIndex] );
mnLoopCount += (mnCurrIndex + 1) / (2*nNumFrames);
nNewIndex = (mnCurrIndex + 1) % 2*nNumFrames;
break;
}
}
maContext.mrEventQueue.addEvent( mpWakeupEvent ); maContext.mrEventQueue.addEvent( mpWakeupEvent );
maContext.mpSubsettableShapeManager->notifyShapeUpdate( pDrawShape ); maContext.mpSubsettableShapeManager->notifyShapeUpdate( pDrawShape );
...@@ -259,16 +234,14 @@ namespace slideshow ...@@ -259,16 +234,14 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape, const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent, const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts, const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops, ::std::size_t nNumLoops )
CycleMode eCycleMode )
{ {
return ActivitySharedPtr( return ActivitySharedPtr(
new IntrinsicAnimationActivity(rContext, new IntrinsicAnimationActivity(rContext,
rDrawShape, rDrawShape,
rWakeupEvent, rWakeupEvent,
rTimeouts, rTimeouts,
nNumLoops, nNumLoops) );
eCycleMode) );
} }
} }
} }
......
...@@ -60,8 +60,7 @@ namespace slideshow ...@@ -60,8 +60,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape, const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent, const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts, const ::std::vector<double>& rTimeouts,
::std::size_t nNumLoops, ::std::size_t nNumLoops );
CycleMode eCycleMode );
} }
} }
......
...@@ -105,17 +105,6 @@ namespace slideshow ...@@ -105,17 +105,6 @@ namespace slideshow
{ {
namespace internal namespace internal
{ {
/** Cycle mode of intrinsic animations
*/
enum CycleMode
{
/// loop the animation back to back
CYCLE_LOOP,
/// loop, but play backwards from end to start
CYCLE_PINGPONGLOOP
};
// Value extraction from Any // Value extraction from Any
// ========================= // =========================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment