summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/activities/activitybase.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'slideshow/source/engine/activities/activitybase.cxx')
-rw-r--r--slideshow/source/engine/activities/activitybase.cxx54
1 files changed, 27 insertions, 27 deletions
diff --git a/slideshow/source/engine/activities/activitybase.cxx b/slideshow/source/engine/activities/activitybase.cxx
index 212ab1d95294..541e6e9e7e7d 100644
--- a/slideshow/source/engine/activities/activitybase.cxx
+++ b/slideshow/source/engine/activities/activitybase.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,10 +41,10 @@
namespace slideshow
{
namespace internal
- {
+ {
// TODO(P1): Elide some virtual function calls, by templifying this
// static hierarchy
-
+
ActivityBase::ActivityBase( const ActivityParameters& rParms ) :
mpEndEvent( rParms.mrEndEvent ),
mrEventQueue( rParms.mrEventQueue ),
@@ -56,16 +56,16 @@ namespace slideshow
mbAutoReverse( rParms.mbAutoReverse ),
mbFirstPerformCall( true ),
mbIsActive( true ) {}
-
+
void ActivityBase::dispose()
{
// deactivate
mbIsActive = false;
-
+
// dispose event
if( mpEndEvent )
mpEndEvent->dispose();
-
+
// release references
mpEndEvent.reset();
mpShape.reset();
@@ -74,26 +74,26 @@ namespace slideshow
double ActivityBase::calcTimeLag() const
{
- // TODO(Q1): implement different init process!
+ // TODO(Q1): implement different init process!
if (isActive() && mbFirstPerformCall)
{
mbFirstPerformCall = false;
-
- // notify derived classes that we're
+
+ // notify derived classes that we're
// starting now
const_cast<ActivityBase *>(this)->startAnimation();
}
return 0.0;
}
-
+
bool ActivityBase::perform()
{
// still active?
if( !isActive() )
return false; // no, early exit.
-
+
OSL_ASSERT( ! mbFirstPerformCall );
-
+
return true;
}
@@ -101,9 +101,9 @@ namespace slideshow
{
return mbIsActive;
}
-
- void ActivityBase::setTargets( const AnimatableShapeSharedPtr& rShape,
- const ShapeAttributeLayerSharedPtr& rAttrLayer )
+
+ void ActivityBase::setTargets( const AnimatableShapeSharedPtr& rShape,
+ const ShapeAttributeLayerSharedPtr& rAttrLayer )
{
ENSURE_OR_THROW( rShape,
"ActivityBase::setTargets(): Invalid shape" );
@@ -137,7 +137,7 @@ namespace slideshow
if( !isActive() )
endAnimation();
}
-
+
void ActivityBase::end()
{
if (!isActive() || isDisposed())
@@ -148,12 +148,12 @@ namespace slideshow
// notify derived classes that we're starting now
this->startAnimation();
}
-
+
performEnd(); // calling private virtual
endAnimation();
endActivity();
}
-
+
double ActivityBase::calcAcceleratedTime( double nT ) const
{
// Handle acceleration/deceleration
@@ -170,12 +170,12 @@ namespace slideshow
mnAccelerationFraction + mnDecelerationFraction <= 1.0 )
{
/*
- // calc accelerated/decelerated time.
+ // calc accelerated/decelerated time.
//
// We have three intervals:
// 1 [0,a]
// 2 [a,d]
- // 3 [d,1] (with a and d being acceleration/deceleration
+ // 3 [d,1] (with a and d being acceleration/deceleration
// fraction, resp.)
//
// The change rate during interval 1 is constantly
@@ -202,10 +202,10 @@ namespace slideshow
// The graph of the change rate is a trapezoid:
//
// |
- // 1| /--------------\
- // | / \
- // | / \
- // | / \
+ // 1| /--------------\
+ // | / \
+ // | / \
+ // | / \
// -----------------------------
// 0 a d 1
//
@@ -221,8 +221,8 @@ namespace slideshow
}
else
{
- nTPrime += 0.5*mnAccelerationFraction; // full first interval
-
+ nTPrime += 0.5*mnAccelerationFraction; // full first interval
+
if( nT <= 1.0-mnDecelerationFraction )
{
nTPrime += nT-mnAccelerationFraction; // partial second interval
@@ -232,7 +232,7 @@ namespace slideshow
nTPrime += 1.0 - mnAccelerationFraction - mnDecelerationFraction; // full second interval
const double nTRelative( nT - 1.0 + mnDecelerationFraction );
-
+
nTPrime += nTRelative - 0.5*nTRelative*nTRelative / mnDecelerationFraction;
}
}