summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Jaumann <meta_dev@yahoo.com>2015-03-06 09:10:50 +0000
committerMichael Jaumann <meta_dev@yahoo.com>2015-03-06 09:10:50 +0000
commit2e79054b549aa5b55b8f1ac90c9b8d47fb2d3e97 (patch)
tree329076b4167a8c425cdc36bde95a69c7f7577f38
parent26d17e0f42b13af514081fc3de4145744e1bf9ce (diff)
removed LayerManager
will be replaced by direct calls to shape, or moved to shapemanagerimpl/slideimpl Change-Id: Iae64ffe62e841f4de4a11a8e5c61e5a5f8c6e137
-rw-r--r--slideshow/source/engine/slide/shapemanagerimpl.cxx79
-rw-r--r--slideshow/source/engine/slide/shapemanagerimpl.hxx2
-rw-r--r--slideshow/source/engine/slide/slideimpl.cxx40
3 files changed, 60 insertions, 61 deletions
diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx
index a8d324838bcf..71fc7f1c8655 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.cxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx
@@ -37,12 +37,10 @@ namespace slideshow {
namespace internal {
ShapeManagerImpl::ShapeManagerImpl( EventMultiplexer& rMultiplexer,
- LayerManagerSharedPtr const& rLayerManager,
CursorManager& rCursorManager,
const ShapeEventListenerMap& rGlobalListenersMap,
const ShapeCursorMap& rGlobalCursorMap ):
mrMultiplexer(rMultiplexer),
- mpLayerManager(rLayerManager),
mrCursorManager(rCursorManager),
mrGlobalListenersMap(rGlobalListenersMap),
mrGlobalCursorMap(rGlobalCursorMap),
@@ -88,8 +86,8 @@ void ShapeManagerImpl::activate( bool bSlideBackgoundPainted )
o3tl::select2nd<ShapeCursorMap::value_type>(),
_1 )));
- if( mpLayerManager )
- mpLayerManager->activate( bSlideBackgoundPainted );
+ /* if( mpLayerManager )
+ mpLayerManager->activate( bSlideBackgoundPainted );*/
}
}
@@ -99,9 +97,6 @@ void ShapeManagerImpl::deactivate()
{
mbEnabled = false;
- if( mpLayerManager )
- mpLayerManager->deactivate();
-
maShapeListenerMap.clear();
maShapeCursorMap.clear();
@@ -119,7 +114,6 @@ void ShapeManagerImpl::dispose()
maHyperlinkShapes.clear();
maShapeCursorMap.clear();
maShapeListenerMap.clear();
- mpLayerManager.reset();
}
bool ShapeManagerImpl::handleMousePressed( awt::MouseEvent const& )
@@ -250,9 +244,8 @@ bool ShapeManagerImpl::handleMouseMoved( const awt::MouseEvent& e )
bool ShapeManagerImpl::update()
{
- if( mbEnabled && mpLayerManager )
- return mpLayerManager->update();
-
+ //if( mbEnabled)
+ // return mpLayerManager->update();
return false;
}
@@ -264,34 +257,39 @@ bool ShapeManagerImpl::update( ViewSharedPtr const& /*rView*/ )
bool ShapeManagerImpl::needsUpdate() const
{
- if( mbEnabled && mpLayerManager )
- return mpLayerManager->isUpdatePending();
+ //if( mbEnabled )
+ // return mpLayerManager->isUpdatePending();
return false;
}
void ShapeManagerImpl::enterAnimationMode( const AnimatableShapeSharedPtr& rShape )
{
- if( mbEnabled && mpLayerManager )
- mpLayerManager->enterAnimationMode(rShape);
+ if( mbEnabled)
+ {
+ ENSURE_OR_THROW( rShape, "ShapeManagerImpl::enterAnimationMode(): invalid Shape" );
+ rShape->enterAnimationMode();
+ }
}
void ShapeManagerImpl::leaveAnimationMode( const AnimatableShapeSharedPtr& rShape )
{
- if( mbEnabled && mpLayerManager )
- mpLayerManager->leaveAnimationMode(rShape);
+ if( mbEnabled){
+ ENSURE_OR_THROW( rShape, "ShapeManagerImpl::leaveAnimationMode(): invalid Shape" );
+ rShape->leaveAnimationMode();
+ }
}
void ShapeManagerImpl::notifyShapeUpdate( const ShapeSharedPtr& rShape )
{
- if( mbEnabled && mpLayerManager )
- mpLayerManager->notifyShapeUpdate(rShape);
+ // if( mbEnabled )
+ // mpLayerManager->notifyShapeUpdate(rShape);
}
ShapeSharedPtr ShapeManagerImpl::lookupShape( uno::Reference< drawing::XShape > const & xShape ) const
{
- if( mpLayerManager )
- return mpLayerManager->lookupShape(xShape);
+ /* if( mpLayerManager )
+ return mpLayerManager->lookupShape(xShape);*/
return ShapeSharedPtr();
}
@@ -309,17 +307,46 @@ void ShapeManagerImpl::removeHyperlinkArea( const HyperlinkAreaSharedPtr& rArea
AttributableShapeSharedPtr ShapeManagerImpl::getSubsetShape( const AttributableShapeSharedPtr& rOrigShape,
const DocTreeNode& rTreeNode )
{
- if( mpLayerManager )
- return mpLayerManager->getSubsetShape(rOrigShape,rTreeNode);
+ AttributableShapeSharedPtr pSubset;
+
+ // shape already added?
+ if( rOrigShape->createSubset( pSubset,
+ rTreeNode ) )
+ {
+ OSL_ENSURE( pSubset, "ShapeManagerImpl::getSubsetShape(): failed to create subset" );
+
+ // don't add to shape hash, we're dupes to the
+ // original XShape anyway - all subset shapes return
+ // the same XShape as the original one.
- return AttributableShapeSharedPtr();
+ // add shape to corresponding layer
+ implAddShape( pSubset );
+
+ // update original shape, it now shows less content
+ // (the subset is removed from its displayed
+ // output). Subset shape is updated within
+ // implAddShape().
+ if( rOrigShape->isVisible() )
+ notifyShapeUpdate( rOrigShape );
+ }
+
+ return pSubset;
}
void ShapeManagerImpl::revokeSubset( const AttributableShapeSharedPtr& rOrigShape,
const AttributableShapeSharedPtr& rSubsetShape )
{
- if( mpLayerManager )
- mpLayerManager->revokeSubset(rOrigShape,rSubsetShape);
+ if( rOrigShape->revokeSubset( rSubsetShape ) )
+ {
+ OSL_ASSERT( maAllShapes.find(rSubsetShape) != maAllShapes.end() );
+
+ implRemoveShape( rSubsetShape );
+
+ // update original shape, it now shows more content
+ // (the subset is added back to its displayed output)
+ if( rOrigShape->isVisible() )
+ notifyShapeUpdate( rOrigShape );
+ }
}
bool ShapeManagerImpl::listenerAdded(
diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx
index 6de066c42ec2..4f5f2f11ed13 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.hxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx
@@ -65,7 +65,6 @@ public:
registeres its event handlers.
*/
ShapeManagerImpl( EventMultiplexer& rMultiplexer,
- LayerManagerSharedPtr const& rLayerManager,
CursorManager& rCursorManager,
const ShapeEventListenerMap& rGlobalListenersMap,
const ShapeCursorMap& rGlobalCursorMap );
@@ -184,7 +183,6 @@ private:
std::vector<IntrinsicAnimationEventHandlerSharedPtr> > ImplIntrinsicAnimationEventHandlers;
EventMultiplexer& mrMultiplexer;
- LayerManagerSharedPtr mpLayerManager;
CursorManager& mrCursorManager;
const ShapeEventListenerMap& mrGlobalListenersMap;
const ShapeCursorMap& mrGlobalCursorMap;
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index 5549e5ebd213..1db93e94a310 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -220,7 +220,6 @@ private:
uno::Reference< drawing::XDrawPagesSupplier > mxDrawPagesSupplier;
uno::Reference< animations::XAnimationNode > mxRootNode;
- LayerManagerSharedPtr mpLayerManager;
boost::shared_ptr<ShapeManagerImpl> mpShapeManager;
boost::shared_ptr<SubsettableShapeManager> mpSubsettableShapeManager;
@@ -349,13 +348,8 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra
mxDrawPage( xDrawPage ),
mxDrawPagesSupplier( xDrawPages ),
mxRootNode( xRootNode ),
- mpLayerManager( new LayerManager(
- rViewContainer,
- getSlideRect(),
- bDisableAnimationZOrder) ),
mpShapeManager( new ShapeManagerImpl(
rEventMultiplexer,
- mpLayerManager,
rCursorManager,
rShapeListenerMap,
rShapeCursorMap)),
@@ -414,11 +408,6 @@ SlideImpl::~SlideImpl()
{
maContext.mrScreenUpdater.removeViewUpdate(mpShapeManager);
mpShapeManager->dispose();
-
- // TODO(Q3): Make sure LayerManager (and thus Shapes) dies
- // first, because SlideShowContext has SubsettableShapeManager
- // as reference member.
- mpLayerManager.reset();
}
}
@@ -437,7 +426,7 @@ bool SlideImpl::show( bool bSlideBackgoundPainted )
if( mbActive )
return true; // already active
- if( !mpShapeManager || !mpLayerManager )
+ if( !mpShapeManager)
return false; // disposed
@@ -642,15 +631,10 @@ void SlideImpl::viewAdded( const UnoViewSharedPtr& rView )
maSlideBitmaps.push_back(
std::make_pair( rView,
VectorOfSlideBitmaps(SlideAnimationState_NUM_ENTRIES) ));
-
- if( mpLayerManager )
- mpLayerManager->viewAdded( rView );
}
void SlideImpl::viewRemoved( const UnoViewSharedPtr& rView )
{
- if( mpLayerManager )
- mpLayerManager->viewRemoved( rView );
const VectorOfVectorOfSlideBitmaps::iterator aEnd( maSlideBitmaps.end() );
maSlideBitmaps.erase(
@@ -670,16 +654,13 @@ void SlideImpl::viewChanged( const UnoViewSharedPtr& rView )
{
// nothing to do for the Slide - getCurrentSlideBitmap() lazily
// handles bitmap resizes
- if( mbActive && mpLayerManager )
- mpLayerManager->viewChanged(rView);
}
void SlideImpl::viewsChanged()
{
// nothing to do for the Slide - getCurrentSlideBitmap() lazily
// handles bitmap resizes
- if( mbActive && mpLayerManager )
- mpLayerManager->viewsChanged();
+ if( mbActive);
}
bool SlideImpl::requestCursor( sal_Int16 nCursorShape )
@@ -708,8 +689,6 @@ SlideBitmapSharedPtr SlideImpl::createCurrentSlideBitmap( const UnoViewSharedPtr
{
ENSURE_OR_THROW( rView && rView->getCanvas(),
"SlideImpl::createCurrentSlideBitmap(): Invalid view" );
- ENSURE_OR_THROW( mpLayerManager,
- "SlideImpl::createCurrentSlideBitmap(): Invalid layer manager" );
ENSURE_OR_THROW( mbShowLoaded,
"SlideImpl::createCurrentSlideBitmap(): No show loaded" );
@@ -738,7 +717,6 @@ SlideBitmapSharedPtr SlideImpl::createCurrentSlideBitmap( const UnoViewSharedPtr
// output all shapes to bitmap
initSlideBackground( pBitmapCanvas, rBmpSize );
- mpLayerManager->renderTo( pBitmapCanvas );
return SlideBitmapSharedPtr( new SlideBitmap( pBitmap ) );
}
@@ -782,8 +760,6 @@ bool SlideImpl::implPrefetchShow()
ENSURE_OR_RETURN_FALSE( mxDrawPage.is(),
"SlideImpl::implPrefetchShow(): Invalid draw page" );
- ENSURE_OR_RETURN_FALSE( mpLayerManager,
- "SlideImpl::implPrefetchShow(): Invalid layer manager" );
// fetch desired page content
// ==========================
@@ -961,7 +937,7 @@ bool SlideImpl::applyInitialShapeAttributes(
if( xShape.is() )
{
- ShapeSharedPtr pShape( mpLayerManager->lookupShape( xShape ) );
+ ShapeSharedPtr pShape( /*mpLayerManager->lookupShape( xShape )*/ );
if( !pShape )
{
@@ -1040,8 +1016,6 @@ bool SlideImpl::loadShapes()
ENSURE_OR_RETURN_FALSE( mxDrawPage.is(),
"SlideImpl::loadShapes(): Invalid draw page" );
- ENSURE_OR_RETURN_FALSE( mpLayerManager,
- "SlideImpl::loadShapes(): Invalid layer manager" );
// fetch desired page content
// ==========================
@@ -1075,15 +1049,15 @@ bool SlideImpl::loadShapes()
0, /* shape num starts at 0 */
true );
- mpLayerManager->addShape(
- aMPShapesFunctor.importBackgroundShape() );
+ /* mpLayerManager->addShape(
+ aMPShapesFunctor.importBackgroundShape() );*/
while( !aMPShapesFunctor.isImportDone() )
{
ShapeSharedPtr const& rShape(
aMPShapesFunctor.importShape() );
if( rShape )
- mpLayerManager->addShape( rShape );
+ /* mpLayerManager->addShape( rShape );*/;
}
addPolygons(aMPShapesFunctor.getPolygons());
@@ -1128,7 +1102,7 @@ bool SlideImpl::loadShapes()
ShapeSharedPtr const& rShape(
aShapesFunctor.importShape() );
if( rShape )
- mpLayerManager->addShape( rShape );
+ /*mpLayerManager->addShape( rShape );*/;
}
addPolygons(aShapesFunctor.getPolygons());
}