Kaydet (Commit) 0218b0e2 authored tarafından Ciorba Edmond's avatar Ciorba Edmond Kaydeden (comit) Andras Timar

fdo#65457 - Provide visual clues in presenter view.

Change-Id: I225ae2dfa467df824d2586a05c8b8b576a43e8dc
Reviewed-on: https://gerrit.libreoffice.org/4929Reviewed-by: 's avatarAndras Timar <atimar@suse.com>
Tested-by: 's avatarAndras Timar <atimar@suse.com>
üst 1dbb3884
......@@ -651,6 +651,34 @@
<value>bitmaps/ScrollbarArrowDownDisabled.png</value>
</prop>
</node>
<node oor:name="animation" oor:op="replace">
<prop oor:name="Name">
<value>Animation</value>
</prop>
<prop oor:name="NormalFileName">
<value>bitmaps/Animation.png</value>
</prop>
<prop oor:name="MouseOverFileName">
<value>bitmaps/Animation.png</value>
</prop>
<prop oor:name="DisabledFileName">
<value>bitmaps/Animation.png</value>
</prop>
</node>
<node oor:name="Transition" oor:op="replace">
<prop oor:name="Name">
<value>Transition</value>
</prop>
<prop oor:name="NormalFileName">
<value>bitmaps/Transition.png</value>
</prop>
<prop oor:name="MouseOverFileName">
<value>bitmaps/Transition.png</value>
</prop>
<prop oor:name="DisabledFileName">
<value>bitmaps/Transition.png</value>
</prop>
</node>
<node oor:name="pagervertical" oor:op="replace">
<prop oor:name="Name">
<value>PagerVertical</value>
......
......@@ -385,6 +385,16 @@ Bitmap BMP_PRESENTERSCREEN_BACKGROUND
File = "presenterscreen-Background.png";
};
Bitmap BMP_PRESENTERSCREEN_ANIMATION
{
File = "presenterscreen-Animation.png";
};
Bitmap BMP_PRESENTERSCREEN_TRANSITION
{
File = "presenterscreen-Transition.png";
};
Bitmap BMP_PRESENTERSCREEN_BORDER_RIGHT
{
File = "presenterscreen-BorderRight.png";
......
......@@ -185,6 +185,8 @@
#define BMP_PRESENTERSCREEN_SCROLLBAR_THUMB_TOP_MOUSE_OVER (RID_SD_START+588)
#define BMP_PRESENTERSCREEN_SCROLLBAR_THUMB_TOP_NORMAL (RID_SD_START+589)
#define BMP_PRESENTERSCREEN_VIEW_BACKGROUND (RID_SD_START+590)
#define BMP_PRESENTERSCREEN_ANIMATION (RID_SD_START+591)
#define BMP_PRESENTERSCREEN_TRANSITION (RID_SD_START+592)
// ResourceIDs for Popup-Menus do not need a dummy string!!!
......
......@@ -259,6 +259,10 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap (
static IdMapEntry const map[] = {
{ "bitmaps/Background.png", BMP_PRESENTERSCREEN_BACKGROUND },
{ "bitmaps/Animation.png",
BMP_PRESENTERSCREEN_ANIMATION },
{ "bitmaps/Transition.png",
BMP_PRESENTERSCREEN_TRANSITION },
{ "bitmaps/BorderActiveBottom.png",
BMP_PRESENTERSCREEN_BORDER_ACTIVE_BOTTOM },
{ "bitmaps/BorderActiveBottomCallout.png",
......
......@@ -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)
......
......@@ -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;
......
......@@ -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
{
......
......@@ -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.
......
......@@ -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);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment