[Libreoffice-commits] core.git: 6 commits - icon-themes/galaxy offapi/com sdext/source sd/source slideshow/source

Siqi LIU me at siqi.fr
Thu Aug 22 20:19:01 PDT 2013


 icon-themes/galaxy/sd/res/pointericon.png           |binary
 offapi/com/sun/star/presentation/XSlideShowView.idl |   14 +++++++++++
 sd/source/ui/slideshow/slideshowviewimpl.cxx        |   12 +++++++++
 sd/source/ui/slideshow/slideshowviewimpl.hxx        |    2 +
 sdext/source/presenter/PresenterSlideShowView.cxx   |    7 +++++
 sdext/source/presenter/PresenterSlideShowView.hxx   |    3 ++
 slideshow/source/engine/pointersymbol.cxx           |   11 +++++---
 slideshow/source/engine/slide/layermanager.cxx      |    5 ++++
 slideshow/source/engine/slideview.cxx               |   25 ++++++++++++++++++++
 slideshow/source/inc/viewlayer.hxx                  |    3 ++
 10 files changed, 78 insertions(+), 4 deletions(-)

New commits:
commit 6aac349140436a40cfbe84e3fce61a8dc7be4b3f
Author: Siqi LIU <me at siqi.fr>
Date:   Fri Aug 23 10:54:42 2013 +0800

    misc
    
    Change-Id: I24736c4bd05644ed61e6df50f2267f6a2cd2f7f3

diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx
index 91bdb7b..bbe4578 100644
--- a/slideshow/source/engine/slide/layermanager.cxx
+++ b/slideshow/source/engine/slide/layermanager.cxx
@@ -636,6 +636,11 @@ namespace slideshow
                     OSL_FAIL( "BitmapView::setPriority(): This method is not supposed to be called!" );
                 }
 
+                virtual ::com::sun::star::geometry::IntegerSize2D getTranslationOffset() const
+                {
+                    return geometry::IntegerSize2D(0,0);
+                }
+
                 virtual ::basegfx::B2DHomMatrix getTransformation() const
                 {
                     return mpCanvas->getTransformation();
diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx
index 250de4e..db2e471 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -489,6 +489,25 @@ public:
         }
     }
 
+    virtual ::com::sun::star::geometry::IntegerSize2D getTranslationOffset() const
+    {
+        std::cerr << "slideshow/source/engine/slideview.cxx:522" << std::endl;
+        basegfx::B2DRectangle aTmpRect;
+        canvas::tools::calcTransformedRectBounds( aTmpRect,
+                                                  maLayerBounds,
+                                                  maTransformation );
+        geometry::IntegerSize2D offset(0, 0);
+
+        // Add translation according to the origin of aTmpRect.  Ignore the
+        // translation when aTmpRect was not properly initialized.
+        if ( ! aTmpRect.isEmpty())
+        {
+            offset.Width  = basegfx::fround(aTmpRect.getMinX());
+            offset.Height = basegfx::fround(aTmpRect.getMinY());
+        }
+        return offset;
+    }
+
 private:
     // ViewLayer interface
     // ----------------------------------------------
@@ -700,6 +719,7 @@ private:
     virtual cppcanvas::CustomSpriteSharedPtr createSprite( const ::basegfx::B2DSize& rSpriteSizePixel,
                                                            double                    nPriority ) const;
     virtual void setPriority( const basegfx::B1DRange& rRange );
+    virtual geometry::IntegerSize2D getTranslationOffset() const;
     virtual ::basegfx::B2DHomMatrix getTransformation() const;
     virtual basegfx::B2DHomMatrix getSpriteTransformation() const;
     virtual void setClip( const ::basegfx::B2DPolyPolygon& rClip );
@@ -960,6 +980,11 @@ basegfx::B2DHomMatrix SlideView::getTransformation() const
     return maViewTransform * aMatrix;
 }
 
+geometry::IntegerSize2D SlideView::getTranslationOffset() const
+{
+    return mxView->getTranslationOffset();
+}
+
 basegfx::B2DHomMatrix SlideView::getSpriteTransformation() const
 {
     return getTransformation();
diff --git a/slideshow/source/inc/viewlayer.hxx b/slideshow/source/inc/viewlayer.hxx
index bddb210..f47f18a 100644
--- a/slideshow/source/inc/viewlayer.hxx
+++ b/slideshow/source/inc/viewlayer.hxx
@@ -22,6 +22,7 @@
 
 #include <sal/config.h>
 #include <boost/shared_ptr.hpp>
+#include <com/sun/star/geometry/IntegerSize2D.hpp>
 
 namespace basegfx
 {
@@ -128,6 +129,8 @@ namespace slideshow
             */
             virtual basegfx::B2DHomMatrix getTransformation() const = 0;
 
+            virtual ::com::sun::star::geometry::IntegerSize2D getTranslationOffset() const = 0;
+
             /** Get the overall view transformation.
 
                 Same transformation as with getTransformation(), only
commit 1e7918feeb088008a266edc493731dad361fecbc
Author: Siqi LIU <me at siqi.fr>
Date:   Fri Aug 23 10:40:27 2013 +0800

    getTransilationOffset Impl
    
    Change-Id: Ie02e1c4d2ab1357469213f13971ab04632611d67

diff --git a/slideshow/source/engine/pointersymbol.cxx b/slideshow/source/engine/pointersymbol.cxx
index d0e7fce..f825bbc 100644
--- a/slideshow/source/engine/pointersymbol.cxx
+++ b/slideshow/source/engine/pointersymbol.cxx
@@ -28,6 +28,7 @@
 #include <basegfx/vector/b2dvector.hxx>
 
 #include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/geometry/IntegerSize2D.hpp>
 #include "com/sun/star/uno/Reference.hxx"
 
 #include "pointersymbol.hxx"
@@ -106,6 +107,7 @@ basegfx::B2DPoint PointerSymbol::calcSpritePos( UnoViewSharedPtr const & rView )
     const uno::Reference<rendering::XBitmap> xBitmap( rView->getCanvas()->getUNOCanvas(),
                                                       uno::UNO_QUERY_THROW );
     const geometry::IntegerSize2D realSize( xBitmap->getSize() );
+
     return basegfx::B2DPoint(
         // pos.X pos.Y are given in 0..1, beginning from the upper left corner of the currentSlide.
         std::min<sal_Int32>( 0, LEFT_BORDER_SPACE ),
@@ -120,12 +122,13 @@ basegfx::B2DPoint PointerSymbol::calcSpritePos(
                                                       uno::UNO_QUERY_THROW );
     const geometry::IntegerSize2D realSize( xBitmap->getSize() );
 
+    const geometry::IntegerSize2D realTranslationOffset ( rView->getTranslationOffset() );
+
+
     basegfx::B2DPoint newPos(
-        // pos.X pos.Y are given in 0..1, beginning from the upper left corner of the currentSlide.
-        realSize.Width * pos.X,
-        realSize.Height * pos.Y);
+        realTranslationOffset.Width + (realSize.Width - 2 * realTranslationOffset.Width) * pos.X,
+        realTranslationOffset.Height + (realSize.Height - 2 * realTranslationOffset.Height) * pos.Y);
 
-    // std::cerr << "calcSpritePos : (" << newPos.getX() << ","<<newPos.getY() << ")" << std::endl;
 
     return newPos;
 }
commit eb0cc3a63d6dade5d54deff91c2845a5a782b6ff
Author: Siqi LIU <me at siqi.fr>
Date:   Fri Aug 23 10:40:01 2013 +0800

    dummy implementation for getTranslationOffset
    
    Change-Id: Ie1f71ee76af308a6eec9d38e3d629d7d6faf3596

diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx
index 1a663fc..2dbf3e7 100644
--- a/sdext/source/presenter/PresenterSlideShowView.cxx
+++ b/sdext/source/presenter/PresenterSlideShowView.cxx
@@ -378,6 +378,13 @@ geometry::AffineMatrix2D SAL_CALL PresenterSlideShowView::getTransformation (voi
     }
 }
 
+geometry::IntegerSize2D SAL_CALL PresenterSlideShowView::getTranslationOffset(void)
+    throw (RuntimeException)
+{
+    ThrowIfDisposed();
+    return geometry::IntegerSize2D(0,0);
+}
+
 void SAL_CALL PresenterSlideShowView::addTransformationChangedListener(
     const Reference<util::XModifyListener>& rxListener)
     throw (RuntimeException)
diff --git a/sdext/source/presenter/PresenterSlideShowView.hxx b/sdext/source/presenter/PresenterSlideShowView.hxx
index a392842..fc66fe3 100644
--- a/sdext/source/presenter/PresenterSlideShowView.hxx
+++ b/sdext/source/presenter/PresenterSlideShowView.hxx
@@ -90,6 +90,9 @@ public:
     virtual css::geometry::AffineMatrix2D SAL_CALL getTransformation (void)
         throw (css::uno::RuntimeException);
 
+    virtual ::com::sun::star::geometry::IntegerSize2D SAL_CALL getTranslationOffset(void)
+        throw (css::uno::RuntimeException);
+
     virtual void SAL_CALL addTransformationChangedListener(
         const css::uno::Reference<
             css::util::XModifyListener >& xListener)
commit e21ad69e8b0bc7b3c5b3a310c3891685d8e4b7a1
Author: Siqi LIU <me at siqi.fr>
Date:   Fri Aug 23 10:25:29 2013 +0800

    implementation for getTranslationOffset
    
    Change-Id: Ibe1d7f6af4be8f1520c093cd0b23cb06f5346716

diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx
index e2678b8..45c9b2b 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx
@@ -218,6 +218,9 @@ SlideShowView::SlideShowView( ShowWindow&     rOutputWindow,
     mbMousePressedEaten( false )
 {
     init();
+
+    mTranslationOffset.Width = 0;
+    mTranslationOffset.Height = 0;
 }
 
 /// Dispose all internal references
@@ -329,6 +332,11 @@ void SAL_CALL SlideShowView::clear() throw (::com::sun::star::uno::RuntimeExcept
     }
 }
 
+geometry::IntegerSize2D SAL_CALL SlideShowView::getTranslationOffset( ) throw (RuntimeException)
+{
+        return mTranslationOffset;
+}
+
 geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation(  ) throw (RuntimeException)
 {
     ::osl::MutexGuard aGuard( m_aMutex );
@@ -374,6 +382,10 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation(  ) throw (Ru
     aOutputSize.Width() --;
     aOutputSize.Height() --;
 
+    // Record mTranslationOffset
+    mTranslationOffset.Height = aOutputOffset.Y();
+    mTranslationOffset.Width = aOutputOffset.X();
+
     maPresentationArea = Rectangle( aOutputOffset, aOutputSize );
     mrOutputWindow.SetPresentationArea( maPresentationArea );
 
diff --git a/sd/source/ui/slideshow/slideshowviewimpl.hxx b/sd/source/ui/slideshow/slideshowviewimpl.hxx
index a0239f2..704d53c 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.hxx
@@ -211,6 +211,7 @@ public:
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > SAL_CALL getCanvas(  ) throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL clear(  ) throw (::com::sun::star::uno::RuntimeException);
     virtual ::com::sun::star::geometry::AffineMatrix2D SAL_CALL getTransformation(  ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::geometry::IntegerSize2D SAL_CALL getTranslationOffset( ) throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL addTransformationChangedListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL removeTransformationChangedListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
@@ -265,6 +266,7 @@ private:
     bool                                    mbFirstPaint;
     bool                                    mbFullScreen;
     bool                                    mbMousePressedEaten;
+    ::com::sun::star::geometry::IntegerSize2D mTranslationOffset;
 };
 
 
commit 7ba076d7fd46cce99f6fc7a5b26f74d8f207ec3d
Author: Siqi LIU <me at siqi.fr>
Date:   Fri Aug 23 10:05:28 2013 +0800

    extend the SlideShowView interface with getTranslationOffset
    
    Change-Id: I33f0eaa8a54902bb65a000b74ef25323423d01b4

diff --git a/offapi/com/sun/star/presentation/XSlideShowView.idl b/offapi/com/sun/star/presentation/XSlideShowView.idl
index 5804af2..81ecd86 100644
--- a/offapi/com/sun/star/presentation/XSlideShowView.idl
+++ b/offapi/com/sun/star/presentation/XSlideShowView.idl
@@ -26,6 +26,7 @@
 #include <com/sun/star/awt/XMouseListener.idl>
 #include <com/sun/star/awt/XMouseMotionListener.idl>
 #include <com/sun/star/awt/Rectangle.idl>
+#include <com/sun/star/geometry/IntegerSize2D.idl>
 
 module com {  module sun {  module star {  module presentation {
 
@@ -73,6 +74,19 @@ interface XSlideShowView : ::com::sun::star::uno::XInterface
      */
     ::com::sun::star::geometry::AffineMatrix2D getTransformation();
 
+    /** Query the current translation offset used to fill the physical screen while keeping aspect ratio.<p>
+
+        This method returns the traslation offset of the view of the
+        view.<p>
+
+        @return the slideshowview will be transformed in order to fill
+        the physical screen while keeping the aspect ratio.
+        In order to do so, we need to add a black border on the side. This method
+        return an IntegerSize2D which represent (x, y) translation.
+        x represents the width of the border on the left, for example.
+     */
+    ::com::sun::star::geometry::IntegerSize2D getTranslationOffset();
+
     /** Add a listener to get notified when the transformation matrix changes.<p>
 
         This method registers a listener with the view, which will get
commit 0f61bcb6a304b5323e2d61f088cf688291796e88
Author: Siqi LIU <me at siqi.fr>
Date:   Fri Aug 23 10:03:02 2013 +0800

    replace pointericon png with a transparent background
    
    Change-Id: I9b8528b545ffc67daa8e6b3b9d588c9bd09ee09d

diff --git a/icon-themes/galaxy/sd/res/pointericon.png b/icon-themes/galaxy/sd/res/pointericon.png
index 4184c06..574027c 100644
Binary files a/icon-themes/galaxy/sd/res/pointericon.png and b/icon-themes/galaxy/sd/res/pointericon.png differ


More information about the Libreoffice-commits mailing list