[Libreoffice-commits] core.git: icon-themes/galaxy officecfg/registry sdext/source sd/source

Ciorba Edmond edmond_ciorba at yahoo.com
Thu Jul 18 00:57:42 PDT 2013


 icon-themes/galaxy/sd/res/presenterscreen-Animation.png           |binary
 icon-themes/galaxy/sd/res/presenterscreen-Transition.png          |binary
 officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu |   28 ++++++
 sd/source/ui/app/res_bmp.src                                      |   10 ++
 sd/source/ui/inc/res_bmp.hrc                                      |    2 
 sd/source/ui/presenter/PresenterHelper.cxx                        |    4 
 sdext/source/presenter/PresenterController.cxx                    |   42 ++++++++++
 sdext/source/presenter/PresenterController.hxx                    |    2 
 sdext/source/presenter/PresenterSlidePreview.cxx                  |   40 +++++++++
 sdext/source/presenter/PresenterSlidePreview.hxx                  |    1 
 sdext/source/presenter/PresenterSlideSorter.cxx                   |   39 +++++++++
 11 files changed, 167 insertions(+), 1 deletion(-)

New commits:
commit 0218b0e2fa510d7acd7413dbedefd9ad50257f76
Author: Ciorba Edmond <edmond_ciorba at yahoo.com>
Date:   Mon Jul 15 19:45:44 2013 +0300

    fdo#65457 -  Provide visual clues in presenter view.
    
    Change-Id: I225ae2dfa467df824d2586a05c8b8b576a43e8dc
    Reviewed-on: https://gerrit.libreoffice.org/4929
    Reviewed-by: Andras Timar <atimar at suse.com>
    Tested-by: Andras Timar <atimar at suse.com>

diff --git a/icon-themes/galaxy/sd/res/presenterscreen-Animation.png b/icon-themes/galaxy/sd/res/presenterscreen-Animation.png
new file mode 100644
index 0000000..e454428
Binary files /dev/null and b/icon-themes/galaxy/sd/res/presenterscreen-Animation.png differ
diff --git a/icon-themes/galaxy/sd/res/presenterscreen-Transition.png b/icon-themes/galaxy/sd/res/presenterscreen-Transition.png
new file mode 100644
index 0000000..38b49ae
Binary files /dev/null and b/icon-themes/galaxy/sd/res/presenterscreen-Transition.png differ
diff --git a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
index 29825fc..3eb6434 100644
--- a/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/PresenterScreen.xcu
@@ -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>
diff --git a/sd/source/ui/app/res_bmp.src b/sd/source/ui/app/res_bmp.src
index 246f230..ba42bb5 100644
--- a/sd/source/ui/app/res_bmp.src
+++ b/sd/source/ui/app/res_bmp.src
@@ -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";
diff --git a/sd/source/ui/inc/res_bmp.hrc b/sd/source/ui/inc/res_bmp.hrc
index a2a2b03..22dbaa0 100644
--- a/sd/source/ui/inc/res_bmp.hrc
+++ b/sd/source/ui/inc/res_bmp.hrc
@@ -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!!!
 
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index e83c033..d1180cc 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -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",
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index d0521e4..779f32d 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 e8b4ec6..8f7a713 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 e7b7b51..3055afe 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 d98a486..d6117d1 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 084f718..01f886f 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);
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list