diff options
-rw-r--r-- | sdext/source/presenter/PresenterSlideShowView.cxx | 48 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterSlideShowView.hxx | 7 |
2 files changed, 37 insertions, 18 deletions
diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index dd30d1b..ac74b72 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -82,6 +82,8 @@ PresenterSlideShowView::PresenterSlideShowView ( mxPointer(), mxWindow(), mxViewWindow(), + mxTopPane(), + mxPresenterHelper(), mxBackgroundPolygon1(), mxBackgroundPolygon2(), mbIsViewAdded(false), @@ -114,6 +116,13 @@ void PresenterSlideShowView::LateInit (void) if (xSlideShowComponent.is()) xSlideShowComponent->addEventListener(static_cast<awt::XWindowListener*>(this)); + Reference<lang::XMultiComponentFactory> xFactory ( + mxComponentContext->getServiceManager(), UNO_QUERY_THROW); + mxPresenterHelper.set (xFactory->createInstanceWithContext( + OUString::createFromAscii("com.sun.star.comp.Draw.PresenterHelper"), + mxComponentContext), + UNO_QUERY_THROW); + // Use view id and controller to retrieve window and canvas from // configuration controller. Reference<XControllerManager> xCM (mxController, UNO_QUERY_THROW); @@ -121,6 +130,8 @@ void PresenterSlideShowView::LateInit (void) if (xCC.is()) { + mxTopPane.set(xCC->getResource(mxViewId->getAnchor()->getAnchor()), UNO_QUERY); + Reference<XPane> xPane (xCC->getResource(mxViewId->getAnchor()), UNO_QUERY_THROW); mxWindow = xPane->getWindow(); @@ -142,8 +153,8 @@ void PresenterSlideShowView::LateInit (void) // Create a window for the actual slide show view. It is places // centered and with maximal size inside the pane. mxViewWindow = CreateViewWindow(mxWindow); - mxViewCanvas = CreateViewCanvas(mxViewWindow, - Reference<XPane>(xCC->getResource(mxViewId->getAnchor()->getAnchor()), UNO_QUERY)); + + mxViewCanvas = CreateViewCanvas(mxViewWindow); if (mxViewWindow.is()) { @@ -543,6 +554,19 @@ void SAL_CALL PresenterSlideShowView::setMouseCursor(::sal_Int16 nPointerShape) +awt::Rectangle SAL_CALL PresenterSlideShowView::getCanvasArea( ) throw (RuntimeException) +{ + if( mxViewWindow.is() && mxTopPane.is() ) + return mxPresenterHelper->getWindowExtentsRelative( mxViewWindow, mxTopPane->getWindow() ); + + awt::Rectangle aRectangle; + + aRectangle.X = aRectangle.Y = aRectangle.Width = aRectangle.Height = 0; + + return aRectangle; +} + + //----- lang::XEventListener -------------------------------------------------- @@ -976,22 +1000,14 @@ Reference<awt::XWindow> PresenterSlideShowView::CreateViewWindow ( Reference<rendering::XCanvas> PresenterSlideShowView::CreateViewCanvas ( - const Reference<awt::XWindow>& rxViewWindow, - const Reference<XPane>& rxParentPane) const + const Reference<awt::XWindow>& rxViewWindow) const { // Create a canvas for the view window. - Reference<lang::XMultiComponentFactory> xFactory ( - mxComponentContext->getServiceManager(), UNO_QUERY_THROW); - Reference<drawing::XPresenterHelper> xPresenterHelper( - xFactory->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.comp.Draw.PresenterHelper"), - mxComponentContext), - UNO_QUERY_THROW); - return xPresenterHelper->createSharedCanvas( - Reference<rendering::XSpriteCanvas>(rxParentPane->getCanvas(), UNO_QUERY), - rxParentPane->getWindow(), - rxParentPane->getCanvas(), - rxParentPane->getWindow(), + return mxPresenterHelper->createSharedCanvas( + Reference<rendering::XSpriteCanvas>(mxTopPane->getCanvas(), UNO_QUERY), + mxTopPane->getWindow(), + mxTopPane->getCanvas(), + mxTopPane->getWindow(), rxViewWindow); } diff --git a/sdext/source/presenter/PresenterSlideShowView.hxx b/sdext/source/presenter/PresenterSlideShowView.hxx index 0270752..8e74a85 100644 --- a/sdext/source/presenter/PresenterSlideShowView.hxx +++ b/sdext/source/presenter/PresenterSlideShowView.hxx @@ -149,6 +149,8 @@ public: virtual void SAL_CALL setMouseCursor(::sal_Int16 nPointerShape) throw (css::uno::RuntimeException); + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCanvasArea( ) + throw (::com::sun::star::uno::RuntimeException); // lang::XEventListener virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) @@ -236,6 +238,8 @@ private: css::uno::Reference<css::awt::XPointer> mxPointer; css::uno::Reference<css::awt::XWindow> mxWindow; css::uno::Reference<css::awt::XWindow> mxViewWindow; + css::uno::Reference<css::drawing::framework::XPane> mxTopPane; + css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper; css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon1; css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon2; bool mbIsViewAdded; @@ -267,8 +271,7 @@ private: css::uno::Reference<css::awt::XWindow> CreateViewWindow ( const css::uno::Reference<css::awt::XWindow>& rxParentWindow) const; css::uno::Reference<css::rendering::XCanvas> CreateViewCanvas ( - const css::uno::Reference<css::awt::XWindow>& rxWindow, - const css::uno::Reference<css::drawing::framework::XPane>& rxParentPane) const; + const css::uno::Reference<css::awt::XWindow>& rxWindow) const; void Resize (void); |