diff options
author | Ciorba Edmond <edmond_ciorba@yahoo.com> | 2013-07-15 19:45:44 +0300 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-07-18 07:57:19 +0000 |
commit | 0218b0e2fa510d7acd7413dbedefd9ad50257f76 (patch) | |
tree | 194e8e685b1739a130bb61fcce99ecc71204d062 /sdext/source | |
parent | 1dbb3884b49c50fc9ab23e825acb169cf28d243e (diff) |
fdo#65457 - Provide visual clues in presenter view.
Change-Id: I225ae2dfa467df824d2586a05c8b8b576a43e8dc
Reviewed-on: https://gerrit.libreoffice.org/4929
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/presenter/PresenterController.cxx | 42 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterController.hxx | 2 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterSlidePreview.cxx | 40 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterSlidePreview.hxx | 1 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterSlideSorter.cxx | 39 |
5 files changed, 123 insertions, 1 deletions
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index d0521e453bbf..779f32d21de6 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/drawing/framework/XControllerManager.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/presentation/AnimationEffect.hpp> #include <com/sun/star/presentation/XPresentation.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> @@ -577,6 +578,47 @@ Reference<drawing::XDrawPage> PresenterController::GetCurrentSlide (void) const return mxCurrentSlide; } +bool PresenterController::HasTransition (Reference<drawing::XDrawPage>& rxPage) +{ + bool bTransition = false; + sal_uInt16 aTransitionType = 0; + if( rxPage.is() ) + { + Reference<beans::XPropertySet> xSlidePropertySet (rxPage, UNO_QUERY); + xSlidePropertySet->getPropertyValue("TransitionType") >>= aTransitionType; + if( aTransitionType > 0 ) + { + bTransition = true; + } + } + return bTransition; +} + +bool PresenterController::HasCustomAnimation (Reference<drawing::XDrawPage>& rxPage) +{ + bool bCustomAnimation = false; + presentation::AnimationEffect aEffect = presentation::AnimationEffect_NONE; + presentation::AnimationEffect aTextEffect = presentation::AnimationEffect_NONE; + if( rxPage.is() ) + { + sal_uInt32 i, nCount = rxPage->getCount(); + for ( i = 0; i < nCount; i++ ) + { + Reference<drawing::XShape> xShape(rxPage->getByIndex(i), UNO_QUERY); + Reference<beans::XPropertySet> xShapePropertySet(xShape, UNO_QUERY); + xShapePropertySet->getPropertyValue("Effect") >>= aEffect; + xShapePropertySet->getPropertyValue("TextEffect") >>= aTextEffect; + if( aEffect != presentation::AnimationEffect_NONE || + aTextEffect != presentation::AnimationEffect_NONE ) + { + bCustomAnimation = true; + break; + } + } + } + return bCustomAnimation; +} + void PresenterController::SetAccessibilityActiveState (const bool bIsActive) { if ( mbIsAccessibilityActive != bIsActive) diff --git a/sdext/source/presenter/PresenterController.hxx b/sdext/source/presenter/PresenterController.hxx index e8b4ec6c2c9a..8f7a713ab97c 100644 --- a/sdext/source/presenter/PresenterController.hxx +++ b/sdext/source/presenter/PresenterController.hxx @@ -121,6 +121,8 @@ public: css::uno::Reference<css::drawing::framework::XConfigurationController> GetConfigurationController (void) const; css::uno::Reference<css::drawing::XDrawPage> GetCurrentSlide (void) const; + bool HasTransition (css::uno::Reference<css::drawing::XDrawPage>& rxPage); + bool HasCustomAnimation (css::uno::Reference<css::drawing::XDrawPage>& rxPage); void SetAccessibilityActiveState (const bool bIsActive); bool IsAccessibilityActive (void) const; diff --git a/sdext/source/presenter/PresenterSlidePreview.cxx b/sdext/source/presenter/PresenterSlidePreview.cxx index e7b7b51b6594..3055afeccfc0 100644 --- a/sdext/source/presenter/PresenterSlidePreview.cxx +++ b/sdext/source/presenter/PresenterSlidePreview.cxx @@ -21,6 +21,8 @@ #include "PresenterCanvasHelper.hxx" #include "PresenterGeometryHelper.hxx" #include "PresenterPaintManager.hxx" +#include "PresenterScrollBar.hxx" +#include "PresenterBitmapContainer.hxx" #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -96,7 +98,11 @@ PresenterSlidePreview::PresenterSlidePreview ( OUString("com.sun.star.drawing.SlideRenderer"), rxContext), UNO_QUERY); - + mpBitmaps.reset(new PresenterBitmapContainer( + OUString("PresenterScreenSettings/ScrollBar/Bitmaps"), + ::boost::shared_ptr<PresenterBitmapContainer>(), + rxContext, + mxCanvas)); Resize(); } @@ -253,6 +259,14 @@ void PresenterSlidePreview::Paint (const awt::Rectangle& rBoundingBox) // Make sure that a preview in the correct size exists. awt::Rectangle aWindowBox (mxWindow->getPosSize()); + bool bCustomAnimation = false; + bool bTransition = false; + if( mxCurrentSlide.is() ) + { + bCustomAnimation = mpPresenterController->HasCustomAnimation(mxCurrentSlide); + bTransition = mpPresenterController->HasTransition(mxCurrentSlide); + } + if ( ! mxPreview.is() && mxCurrentSlide.is()) { // Create a new preview bitmap. @@ -311,6 +325,30 @@ void PresenterSlidePreview::Paint (const awt::Rectangle& rBoundingBox) if (mxPreview.is()) { mxCanvas->drawBitmap(mxPreview, aViewState, aRenderState); + if( bTransition ) + { + const awt::Rectangle aTransitionPreviewBox(5, aWindowBox.Height-20, 0, 0); + SharedBitmapDescriptor aTransitionDescriptor = mpBitmaps->GetBitmap("Transition"); + Reference<rendering::XBitmap> xTransitionIcon (aTransitionDescriptor->GetNormalBitmap()); + rendering::RenderState aTransitionRenderState ( + geometry::AffineMatrix2D(1, 0, aTransitionPreviewBox.X, 0, 1, aTransitionPreviewBox.Y), + NULL, + aBackgroundColor, + rendering::CompositeOperation::SOURCE); + mxCanvas->drawBitmap(xTransitionIcon, aViewState, aTransitionRenderState); + } + if( bCustomAnimation ) + { + const awt::Rectangle aAnimationPreviewBox(5, aWindowBox.Height-40, 0, 0); + SharedBitmapDescriptor aAnimationDescriptor = mpBitmaps->GetBitmap("Animation"); + Reference<rendering::XBitmap> xAnimationIcon (aAnimationDescriptor->GetNormalBitmap()); + rendering::RenderState aAnimationRenderState ( + geometry::AffineMatrix2D(1, 0, aAnimationPreviewBox.X, 0, 1, aAnimationPreviewBox.Y), + NULL, + aBackgroundColor, + rendering::CompositeOperation::SOURCE); + mxCanvas->drawBitmap(xAnimationIcon, aViewState, aAnimationRenderState); + } } else { diff --git a/sdext/source/presenter/PresenterSlidePreview.hxx b/sdext/source/presenter/PresenterSlidePreview.hxx index d98a4860ac19..d6117d19a173 100644 --- a/sdext/source/presenter/PresenterSlidePreview.hxx +++ b/sdext/source/presenter/PresenterSlidePreview.hxx @@ -123,6 +123,7 @@ private: size. */ css::uno::Reference<css::rendering::XBitmap> mxPreview; + boost::shared_ptr<PresenterBitmapContainer> mpBitmaps; /** The current slide for which a preview is displayed. This may or may not be the same as the current slide of the PresenterView. diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index 084f7186a7c3..01f886fdd2f1 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -903,6 +903,17 @@ void PresenterSlideSorter::PaintPreview ( mpLayout->GetWindowPosition( mpLayout->GetPoint(nSlideIndex, isRTL?1:-1, -1))); + PresenterBitmapContainer aContainer ( + "PresenterScreenSettings/ScrollBar/Bitmaps", + ::boost::shared_ptr<PresenterBitmapContainer>(), + mxComponentContext, + rxCanvas); + Reference<container::XIndexAccess> xIndexAccess(mxSlideShowController, UNO_QUERY); + Reference<drawing::XDrawPage> xPage = Reference<drawing::XDrawPage>( + xIndexAccess->getByIndex(nSlideIndex), UNO_QUERY); + bool bTransition = mpPresenterController->HasTransition(xPage); + bool bCustomAnimation = mpPresenterController->HasCustomAnimation(xPage); + // Create clip rectangle as intersection of the current update area and // the bounding box of all previews. geometry::RealRectangle2D aBoundingBox (mpLayout->maBoundingBox); @@ -950,6 +961,34 @@ void PresenterSlideSorter::PaintPreview ( if (aSize.Width > 0 && aSize.Height > 0) { rxCanvas->drawBitmap(xPreview, aViewState, aRenderState); + if( bCustomAnimation ) + { + const awt::Rectangle aAnimationPreviewBox(aTopLeft.X+3, aTopLeft.Y+aSize.Height-40, 0, 0); + SharedBitmapDescriptor aAnimationDescriptor = aContainer.GetBitmap("Animation"); + Reference<rendering::XBitmap> xAnimationIcon (aAnimationDescriptor->GetNormalBitmap()); + rendering::RenderState aAnimationRenderState ( + geometry::AffineMatrix2D( + 1, 0, aAnimationPreviewBox.X, + 0, 1, aAnimationPreviewBox.Y), + NULL, + Sequence<double>(4), + rendering::CompositeOperation::SOURCE); + rxCanvas->drawBitmap(xAnimationIcon, aViewState, aAnimationRenderState); + } + if( bTransition ) + { + const awt::Rectangle aTransitionPreviewBox(aTopLeft.X+3, aTopLeft.Y+aSize.Height-20, 0, 0); + SharedBitmapDescriptor aTransitionDescriptor = aContainer.GetBitmap("Transition"); + Reference<rendering::XBitmap> xTransitionIcon (aTransitionDescriptor->GetNormalBitmap()); + rendering::RenderState aTransitionRenderState ( + geometry::AffineMatrix2D( + 1, 0, aTransitionPreviewBox.X, + 0, 1, aTransitionPreviewBox.Y), + NULL, + Sequence<double>(4), + rendering::CompositeOperation::SOURCE); + rxCanvas->drawBitmap(xTransitionIcon, aViewState, aTransitionRenderState); + } } } |