summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-14 15:47:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-15 08:33:37 +0200
commit602a07e110df440a02692b607b6fc08ddfb074d5 (patch)
treea16c8d792947caf93ba515cd97acfe524011667d /slideshow
parentdd803c6e2551ed3f49d2275f7020e4987773adb6 (diff)
drop CycleMode enum
since we only ever used the CYCLE_LOOP enumerator Change-Id: I181be1e1bba7f72f64420ab22e119d2bffad2d37
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/shapes/drawshape.cxx7
-rw-r--r--slideshow/source/engine/shapes/drawshape.hxx3
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.cxx2
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.hxx4
-rw-r--r--slideshow/source/engine/shapes/intrinsicanimationactivity.cxx51
-rw-r--r--slideshow/source/engine/shapes/intrinsicanimationactivity.hxx3
-rw-r--r--slideshow/source/inc/tools.hxx11
7 files changed, 14 insertions, 67 deletions
diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx
index 6bbdc534793f..8ee2dc7d6688 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -383,7 +383,6 @@ namespace slideshow
maSubsetting(),
mnIsAnimatedCount(0),
mnAnimationLoopCount(0),
- meCycleMode(CYCLE_LOOP),
mbIsVisible( true ),
mbForceUpdate( false ),
mbAttributeLayerRevoked( false ),
@@ -443,7 +442,6 @@ namespace slideshow
maSubsetting(),
mnIsAnimatedCount(0),
mnAnimationLoopCount(0),
- meCycleMode(CYCLE_LOOP),
mbIsVisible( true ),
mbForceUpdate( false ),
mbAttributeLayerRevoked( false ),
@@ -454,7 +452,6 @@ namespace slideshow
getAnimationFromGraphic( maAnimationFrames,
mnAnimationLoopCount,
- meCycleMode,
rGraphic );
ENSURE_OR_THROW( !maAnimationFrames.empty() &&
@@ -495,7 +492,6 @@ namespace slideshow
maSubsetting( rTreeNode, mpCurrMtf ),
mnIsAnimatedCount(0),
mnAnimationLoopCount(0),
- meCycleMode(CYCLE_LOOP),
mbIsVisible( rSrc.mbIsVisible ),
mbForceUpdate( false ),
mbAttributeLayerRevoked( false ),
@@ -580,8 +576,7 @@ namespace slideshow
pShape,
pWakeupEvent,
aTimeout,
- pShape->mnAnimationLoopCount,
- pShape->meCycleMode);
+ pShape->mnAnimationLoopCount);
pWakeupEvent->setActivity( pActivity );
pShape->mpIntrinsicAnimationActivity = pActivity;
diff --git a/slideshow/source/engine/shapes/drawshape.hxx b/slideshow/source/engine/shapes/drawshape.hxx
index 5db8b111101b..51dfcfff066a 100644
--- a/slideshow/source/engine/shapes/drawshape.hxx
+++ b/slideshow/source/engine/shapes/drawshape.hxx
@@ -339,9 +339,6 @@ namespace slideshow
/// Number of times the bitmap animation shall loop
::std::size_t mnAnimationLoopCount;
- /// Cycle mode for bitmap animation
- CycleMode meCycleMode;
-
/// Whether shape is visible (without attribute layers)
bool mbIsVisible;
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index 386956215cfe..fdd383f47f8f 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -264,7 +264,6 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct )
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
::std::size_t& o_rLoopCount,
- CycleMode& o_eCycleMode,
const Graphic& rGraphic )
{
o_rFrames.clear();
@@ -291,7 +290,6 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
pVDevMask->EnableMapMode( false );
o_rLoopCount = aAnimation.GetLoopCount();
- o_eCycleMode = CYCLE_LOOP;
for( sal_uInt16 i=0, nCount=aAnimation.Count(); i<nCount; ++i )
{
diff --git a/slideshow/source/engine/shapes/gdimtftools.hxx b/slideshow/source/engine/shapes/gdimtftools.hxx
index d27e6ed5d89b..861d3528ffa8 100644
--- a/slideshow/source/engine/shapes/gdimtftools.hxx
+++ b/slideshow/source/engine/shapes/gdimtftools.hxx
@@ -109,15 +109,11 @@ namespace slideshow
@param o_rLoopCount
Number of times the bitmap animation shall be repeated
- @param o_eCycleMode
- Repeat mode (normal, or ping-pong mode)
-
@param rGraphic
Input graphic object, to extract animations from
*/
bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
::std::size_t& o_rLoopCount,
- CycleMode& o_eCycleMode,
const Graphic& rGraphic );
/** Retrieve scroll text animation rectangles from given metafile
diff --git a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
index ba1d4817d6a8..e44f8320fbb3 100644
--- a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
+++ b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
@@ -65,8 +65,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
- ::std::size_t nNumLoops,
- CycleMode eCycleMode );
+ ::std::size_t nNumLoops );
IntrinsicAnimationActivity(const IntrinsicAnimationActivity&) = delete;
IntrinsicAnimationActivity& operator=(const IntrinsicAnimationActivity&) = delete;
@@ -85,7 +84,6 @@ namespace slideshow
WakeupEventSharedPtr mpWakeupEvent;
IntrinsicAnimationEventHandlerSharedPtr mpListener;
::std::vector<double> maTimeouts;
- CycleMode meCycleMode;
::std::size_t mnCurrIndex;
::std::size_t mnNumLoops;
::std::size_t mnLoopCount;
@@ -115,14 +113,12 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
- ::std::size_t nNumLoops,
- CycleMode eCycleMode ) :
+ ::std::size_t nNumLoops ) :
maContext( rContext ),
mpDrawShape( rDrawShape ),
mpWakeupEvent( rWakeupEvent ),
mpListener( new IntrinsicAnimationListener(*this) ),
maTimeouts( rTimeouts ),
- meCycleMode( eCycleMode ),
mnCurrIndex(0),
mnNumLoops(nNumLoops),
mnLoopCount(0),
@@ -192,35 +188,14 @@ namespace slideshow
::std::size_t nNewIndex = 0;
const ::std::size_t nNumFrames(maTimeouts.size());
- switch( meCycleMode )
- {
- case CYCLE_LOOP:
- {
- pDrawShape->setIntrinsicAnimationFrame( mnCurrIndex );
-
- mpWakeupEvent->start();
- mpWakeupEvent->setNextTimeout( maTimeouts[mnCurrIndex] );
-
- 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;
- }
- }
+
+ pDrawShape->setIntrinsicAnimationFrame( mnCurrIndex );
+
+ mpWakeupEvent->start();
+ mpWakeupEvent->setNextTimeout( maTimeouts[mnCurrIndex] );
+
+ mnLoopCount += (mnCurrIndex + 1) / nNumFrames;
+ nNewIndex = (mnCurrIndex + 1) % nNumFrames;
maContext.mrEventQueue.addEvent( mpWakeupEvent );
maContext.mpSubsettableShapeManager->notifyShapeUpdate( pDrawShape );
@@ -259,16 +234,14 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
- ::std::size_t nNumLoops,
- CycleMode eCycleMode )
+ ::std::size_t nNumLoops )
{
return ActivitySharedPtr(
new IntrinsicAnimationActivity(rContext,
rDrawShape,
rWakeupEvent,
rTimeouts,
- nNumLoops,
- eCycleMode) );
+ nNumLoops) );
}
}
}
diff --git a/slideshow/source/engine/shapes/intrinsicanimationactivity.hxx b/slideshow/source/engine/shapes/intrinsicanimationactivity.hxx
index 54e2772a04e5..628a458cb728 100644
--- a/slideshow/source/engine/shapes/intrinsicanimationactivity.hxx
+++ b/slideshow/source/engine/shapes/intrinsicanimationactivity.hxx
@@ -60,8 +60,7 @@ namespace slideshow
const DrawShapeSharedPtr& rDrawShape,
const WakeupEventSharedPtr& rWakeupEvent,
const ::std::vector<double>& rTimeouts,
- ::std::size_t nNumLoops,
- CycleMode eCycleMode );
+ ::std::size_t nNumLoops );
}
}
diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx
index d1165a6754b2..0b8337764857 100644
--- a/slideshow/source/inc/tools.hxx
+++ b/slideshow/source/inc/tools.hxx
@@ -105,17 +105,6 @@ namespace slideshow
{
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
// =========================