diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-03-12 20:06:58 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-03-12 20:06:58 +0100 |
commit | c61cd1a5a26de1d1f62389988b00229c04e36693 (patch) | |
tree | 9d6de00f4d149cba080fe88f1eff71a67786b5f0 /slideshow | |
parent | 064f1e4ed53cb16d174534e20a7d02b8c93a4948 (diff) | |
parent | f2aeec8f22f37146c2f9120e8d0ead383049c1fa (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'slideshow')
21 files changed, 245 insertions, 128 deletions
diff --git a/slideshow/prj/build.lst b/slideshow/prj/build.lst index 2b2080dfd5b5..25ecb52922f5 100644 --- a/slideshow/prj/build.lst +++ b/slideshow/prj/build.lst @@ -1,4 +1,4 @@ -pe slideshow : tools sal cppu vcl comphelper cppuhelper offuh cppcanvas basegfx svtools unotools toolkit animations avmedia MESA:Mesa NULL +pe slideshow : tools sal cppu vcl comphelper cppuhelper offuh cppcanvas basegfx svtools unotools toolkit animations avmedia MESA:Mesa LIBXSLT:libxslt NULL pe slideshow usr1 - all pe_mkout NULL pe slideshow\inc nmake - all pe_inc NULL pe slideshow\source\engine nmake - all pe_engine pe_inc NULL diff --git a/slideshow/prj/d.lst b/slideshow/prj/d.lst index 2015e1311834..f6707c2491f4 100644 --- a/slideshow/prj/d.lst +++ b/slideshow/prj/d.lst @@ -4,3 +4,5 @@ ..\%__SRC%\lib\slideshow.uno.so %_DEST%\lib%_EXT%\slideshow.uno.so ..\%__SRC%\lib\OGLTrans.uno.so %_DEST%\lib%_EXT%\OGLTrans.uno.so ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib +..\%__SRC%\misc\ogltrans.component %_DEST%\xml%_EXT%\ogltrans.component +..\%__SRC%\misc\slideshow.component %_DEST%\xml%_EXT%\slideshow.component diff --git a/slideshow/source/engine/OGLTrans/exports.dxp b/slideshow/source/engine/OGLTrans/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/slideshow/source/engine/OGLTrans/exports.dxp +++ b/slideshow/source/engine/OGLTrans/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/slideshow/source/engine/OGLTrans/ogltrans.component b/slideshow/source/engine/OGLTrans/ogltrans.component new file mode 100644 index 000000000000..89f2384b0d6c --- /dev/null +++ b/slideshow/source/engine/OGLTrans/ogltrans.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.presentation.OGLTransitionFactory"> + <service name="com.sun.star.presentation.TransitionFactory"/> + </implementation> +</component> diff --git a/slideshow/source/engine/OGLTrans/win/makefile.mk b/slideshow/source/engine/OGLTrans/win/makefile.mk index b7b9d6a68ba5..7da37872368d 100644 --- a/slideshow/source/engine/OGLTrans/win/makefile.mk +++ b/slideshow/source/engine/OGLTrans/win/makefile.mk @@ -70,3 +70,11 @@ DEF1EXPORTFILE=../exports.dxp # ========================================================================== .INCLUDE : target.mk + +ALLTAR : $(MISC)/ogltrans.component + +$(MISC)/ogltrans.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ogltrans.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ogltrans.component diff --git a/slideshow/source/engine/makefile.mk b/slideshow/source/engine/makefile.mk index beac66778518..fdc99cd1ad9f 100644 --- a/slideshow/source/engine/makefile.mk +++ b/slideshow/source/engine/makefile.mk @@ -38,7 +38,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : $(PRJ)$/util$/makefile.pmk .IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" -CDEFS+=-DENABLE_PRESENTER_EXTRA_UI +ENABLE_PRESENTER_EXTRA_UI is not used anymore .ENDIF # --- Common ---------------------------------------------------------- diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index 68e3830523e0..dec32a95262d 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -308,19 +308,19 @@ sal_Int32 getNextActionOffset( MetaAction * pCurrAct ) switch (pCurrAct->GetType()) { case META_TEXT_ACTION: { MetaTextAction * pAct = static_cast<MetaTextAction *>(pCurrAct); - return (pAct->GetLen() == (USHORT)STRING_LEN + return (pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen()); } case META_TEXTARRAY_ACTION: { MetaTextArrayAction * pAct = static_cast<MetaTextArrayAction *>(pCurrAct); - return (pAct->GetLen() == (USHORT)STRING_LEN + return (pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen()); } case META_STRETCHTEXT_ACTION: { MetaStretchTextAction * pAct = static_cast<MetaStretchTextAction *>(pCurrAct); - return (pAct->GetLen() == (USHORT)STRING_LEN + return (pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen()); } case META_FLOATTRANSPARENT_ACTION: { @@ -358,12 +358,12 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, // update modes) VirtualDevice aVDev; aVDev.SetOutputSizePixel( aAnimSize ); - aVDev.EnableMapMode( FALSE ); + aVDev.EnableMapMode( sal_False ); // setup mask VDev (alpha VDev is currently rather slow) VirtualDevice aVDevMask; aVDevMask.SetOutputSizePixel( aAnimSize ); - aVDevMask.EnableMapMode( FALSE ); + aVDevMask.EnableMapMode( sal_False ); switch( aAnimation.GetCycleMode() ) { @@ -392,7 +392,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, break; } - for( USHORT i=0, nCount=aAnimation.Count(); i<nCount; ++i ) + for( sal_uInt16 i=0, nCount=aAnimation.Count(); i<nCount; ++i ) { const AnimationBitmap& rAnimBmp( aAnimation.Get(i) ); switch(rAnimBmp.eDisposal) diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index fde007e17d23..e7dc67f79e0b 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -416,8 +416,8 @@ ShapeSharedPtr ShapeImporter::createShape( aGraphAttrs.SetChannelG( nGreen ); aGraphAttrs.SetChannelB( nBlue ); aGraphAttrs.SetGamma( nGamma ); - aGraphAttrs.SetTransparency( static_cast<BYTE>(nTransparency) ); - aGraphAttrs.SetRotation( static_cast<USHORT>(nRotation*10) ); + aGraphAttrs.SetTransparency( static_cast<sal_uInt8>(nTransparency) ); + aGraphAttrs.SetRotation( static_cast<sal_uInt16>(nRotation*10) ); text::GraphicCrop aGraphCrop; if( getPropertyValue( aGraphCrop, xPropSet, OUSTR("GraphicCrop") )) @@ -654,20 +654,13 @@ ShapeImporter::ShapeImporter( uno::Reference<drawing::XDrawPage> const& sal_Int32 nOrdNumStart, bool bConvertingMasterPage ) : mxPage( xActualPage ), -#ifdef ENABLE_PRESENTER_EXTRA_UI mxPagesSupplier( xPagesSupplier ), -#else - mxPagesSupplier( NULL ), -#endif mrContext( rContext ), maPolygons(), maShapesStack(), mnAscendingPrio( nOrdNumStart ), mbConvertingMasterPage( bConvertingMasterPage ) { -#ifndef ENABLE_PRESENTER_EXTRA_UI - (void)xPagesSupplier; -#endif uno::Reference<drawing::XShapes> const xShapes( xPage, uno::UNO_QUERY_THROW ); maShapesStack.push( XShapesEntry(xShapes) ); diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index e861b789e561..83324fb630b9 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -40,7 +40,7 @@ #include <cppuhelper/exc_hlp.hxx> #include <vcl/window.hxx> -#include <vcl/javachild.hxx> +#include <vcl/syschild.hxx> #include <vcl/salbtype.hxx> #ifdef GSTREAMER #include <vcl/sysdata.hxx> @@ -157,11 +157,7 @@ namespace slideshow mxPlayerWindow.clear(); } -#ifdef GSTREAMER mpMediaWindow = ::std::auto_ptr< SystemChildWindow >(); -#else - mpMediaWindow = ::std::auto_ptr< JavaChildWindow >(); -#endif // shutdown player if( mxPlayer.is() ) @@ -447,17 +443,12 @@ namespace slideshow rRangePix.getMaxX() - rRangePix.getMinX(), rRangePix.getMaxY() - rRangePix.getMinY() ); -#ifdef GSTREAMER - OSL_TRACE( "created sys child window for viewmediashape" ); + mpMediaWindow = ::std::auto_ptr< SystemChildWindow >( new + SystemChildWindow( pWindow, WB_CLIPCHILDREN ) ); mpMediaWindow = ::std::auto_ptr< SystemChildWindow >( new SystemChildWindow( pWindow, WB_CLIPCHILDREN ) ); -#else - mpMediaWindow = ::std::auto_ptr< JavaChildWindow >( new JavaChildWindow( pWindow, WB_CLIPCHILDREN ) ); -#endif mpMediaWindow->SetBackground( Color( COL_BLACK ) ); - mpMediaWindow->SetPosSizePixel( Point( aAWTRect.X, - aAWTRect.Y ), - Size( aAWTRect.Width, - aAWTRect.Height )); + mpMediaWindow->SetPosSizePixel( Point( aAWTRect.X, aAWTRect.Y ), + Size( aAWTRect.Width, aAWTRect.Height ) ); mpMediaWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP ); mpMediaWindow->EnableEraseBackground( FALSE ); mpMediaWindow->EnablePaint( FALSE ); @@ -469,8 +460,7 @@ namespace slideshow { #ifndef GSTREAMER aArgs[ 0 ] = uno::makeAny( - sal::static_int_cast<sal_IntPtr>( - mpMediaWindow->getParentWindowHandleForJava()) ); + sal::static_int_cast< sal_IntPtr >( mpMediaWindow->GetParentWindowHandle() ) ); #else aArgs[ 0 ] = uno::makeAny ( (sal_Int32) 0 ); #endif @@ -482,6 +472,8 @@ namespace slideshow aArgs[ 2 ] = uno::makeAny( pSystemData->aWindow ); #endif + aArgs[ 2 ] = uno::makeAny( reinterpret_cast< sal_IntPtr >( mpMediaWindow.get() ) ); + mxPlayerWindow.set( mxPlayer->createPlayerWindow( aArgs ) ); if( mxPlayerWindow.is() ) @@ -543,9 +535,7 @@ namespace slideshow if( mxPlayer.is() ) { - aArgs[ 0 ] = uno::makeAny( - sal::static_int_cast<sal_Int32>( - aWNDVal) ); + aArgs[ 0 ] = uno::makeAny( sal::static_int_cast< sal_Int32 >( aWNDVal) ); aArgs[ 1 ] = uno::makeAny( aAWTRect ); mxPlayerWindow.set( mxPlayer->createPlayerWindow( aArgs ) ); diff --git a/slideshow/source/engine/shapes/viewmediashape.hxx b/slideshow/source/engine/shapes/viewmediashape.hxx index 4815f2dc9e6a..5eba4a8c6a42 100644 --- a/slideshow/source/engine/shapes/viewmediashape.hxx +++ b/slideshow/source/engine/shapes/viewmediashape.hxx @@ -37,7 +37,6 @@ #include "viewlayer.hxx" -class JavaChildWindow; class SystemChildWindow; namespace com { namespace sun { namespace star { namespace drawing { @@ -157,11 +156,7 @@ namespace slideshow const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rDXDeviceParams ); ViewLayerSharedPtr mpViewLayer; -#ifdef GSTREAMER ::std::auto_ptr< SystemChildWindow > mpMediaWindow; -#else - ::std::auto_ptr< JavaChildWindow > mpMediaWindow; -#endif mutable ::com::sun::star::awt::Point maWindowOffset; mutable ::basegfx::B2DRectangle maBounds; diff --git a/slideshow/source/engine/slide/layermanager.hxx b/slideshow/source/engine/slide/layermanager.hxx index aee137e140aa..74a643430192 100644 --- a/slideshow/source/engine/slide/layermanager.hxx +++ b/slideshow/source/engine/slide/layermanager.hxx @@ -366,10 +366,10 @@ namespace slideshow /// Number of shape sprites currenly active on this LayerManager sal_Int32 mnActiveSprites; - /// TRUE, if shapes might need to move to different layer + /// sal_True, if shapes might need to move to different layer bool mbLayerAssociationDirty; - /// FALSE when deactivated + /// sal_False when deactivated bool mbActive; /** When true, all sprite animations run in the foreground. That diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index c644a0016cc4..506bd53fa775 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -142,6 +142,10 @@ public: virtual PolyPolygonVector getPolygons(); virtual void drawPolygons() const; virtual bool isPaintOverlayActive() const; + virtual void enablePaintOverlay(); + virtual void disablePaintOverlay(); + virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ); + // TODO(F2): Rework SlideBitmap to no longer be based on XBitmap, // but on canvas-independent basegfx bitmaps @@ -159,6 +163,9 @@ private: virtual bool requestCursor( sal_Int16 nCursorShape ); virtual void resetCursor(); + void activatePaintOverlay(); + void deactivatePaintOverlay(); + /** Query whether the slide has animations at all If the slide doesn't have animations, show() displays @@ -171,9 +178,6 @@ private: */ bool isAnimated(); - void enablePaintOverlay(); - void disablePaintOverlay(); - /// Set all Shapes to their initial attributes for slideshow bool applyInitialShapeAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xRootAnimationNode ); @@ -416,6 +420,13 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra maContext.mrScreenUpdater.addViewUpdate(mpShapeManager); } +void SlideImpl::update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) +{ + maUserPaintColor = aUserPaintColor; + mdUserPaintStrokeWidth = dUserPaintStrokeWidth; + mbUserPaintOverlayEnabled = bUserPaintEnabled; +} + SlideImpl::~SlideImpl() { if( mpShapeManager ) @@ -451,9 +462,7 @@ void SlideImpl::dispose() mpShapeManager.reset(); mxRootNode.clear(); mxDrawPage.clear(); -#ifndef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier.clear(); -#endif } bool SlideImpl::prefetch() @@ -539,7 +548,7 @@ bool SlideImpl::show( bool bSlideBackgoundPainted ) // --------------------------------------------------------------- // enable paint overlay, if maUserPaintColor is valid - enablePaintOverlay(); + activatePaintOverlay(); // --------------------------------------------------------------- @@ -563,7 +572,7 @@ void SlideImpl::hide() // disable user paint overlay under all circumstances, // this slide now ceases to be active. - disablePaintOverlay(); + deactivatePaintOverlay(); // --------------------------------------------------------------- @@ -880,19 +889,33 @@ bool SlideImpl::implPrefetchShow() void SlideImpl::enablePaintOverlay() { - if( mbUserPaintOverlayEnabled ) + if( !mbUserPaintOverlayEnabled || !mbPaintOverlayActive ) + { + mbUserPaintOverlayEnabled = true; + activatePaintOverlay(); + } +} + +void SlideImpl::disablePaintOverlay() +{ +} + +void SlideImpl::activatePaintOverlay() +{ + if( mbUserPaintOverlayEnabled || !maPolygons.empty() ) { mpPaintOverlay = UserPaintOverlay::create( maUserPaintColor, mdUserPaintStrokeWidth, maContext, - maPolygons ); + maPolygons, + mbUserPaintOverlayEnabled ); mbPaintOverlayActive = true; } } void SlideImpl::drawPolygons() const { - if( mbUserPaintOverlayEnabled ) + if( mpPaintOverlay ) mpPaintOverlay->drawPolygons(); } @@ -915,7 +938,7 @@ bool SlideImpl::isPaintOverlayActive() const return mbPaintOverlayActive; } -void SlideImpl::disablePaintOverlay() +void SlideImpl::deactivatePaintOverlay() { if(mbPaintOverlayActive) maPolygons = mpPaintOverlay->getPolygons(); @@ -1251,12 +1274,7 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >& bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) { -#ifdef ENABLE_PRESENTER_EXTRA_UI boost::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue, -#else - (void)xDrawPages; - boost::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, NULL, xRootNode, rEventQueue, -#endif rEventMultiplexer, rScreenUpdater, rActivitiesQueue, rUserEventQueue, rCursorManager, rViewContainer, diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index 45af355700bc..88e3e38425b7 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -71,8 +71,9 @@ namespace slideshow ActivitiesQueue& rActivitiesQueue, ScreenUpdater& rScreenUpdater, const UnoViewContainer& rViews, - Slide& rSlide, - const PolyPolygonVector& rPolygons ) : + Slide& rSlide, + const PolyPolygonVector& rPolygons, + bool bActive ) : mrActivitiesQueue( rActivitiesQueue ), mrScreenUpdater( rScreenUpdater ), maViews(), @@ -88,7 +89,8 @@ namespace slideshow //handle the "remove stroke by stroke" mode of erasing mbIsEraseModeActivated( false ), mrSlide(rSlide), - mnSize(100) + mnSize(100), + mbActive( bActive ) { std::for_each( rViews.begin(), rViews.end(), @@ -130,6 +132,8 @@ namespace slideshow bool colorChanged( RGBColor const& rUserColor ) { + mbIsLastPointValid = false; + mbActive = true; this->maStrokeColor = rUserColor; this->mbIsEraseModeActivated = false; return true; @@ -142,22 +146,15 @@ namespace slideshow return true; } - bool eraseAllInkChanged( bool const& rEraseAllInk ) + void repaintWithoutPolygons() { - this->mbIsEraseAllModeActivated= rEraseAllInk; - // if the erase all mode is activated it will remove all ink from slide, - // therefor destroy all the polygons stored - if(mbIsEraseAllModeActivated) - { - // The Erase Mode should be desactivated - mbIsEraseModeActivated = false; // must get access to the instance to erase all polygon for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); aIter!=aEnd; ++aIter ) { // fully clear view content to background color - (*aIter)->getCanvas()->clear(); + //(*aIter)->getCanvas()->clear(); //get via SlideImpl instance the bitmap of the slide unmodified to redraw it SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) ); @@ -182,7 +179,19 @@ namespace slideshow mrScreenUpdater.notifyUpdate(*aIter,true); } - maPolygons.clear(); + } + + bool eraseAllInkChanged( bool const& rEraseAllInk ) + { + this->mbIsEraseAllModeActivated= rEraseAllInk; + // if the erase all mode is activated it will remove all ink from slide, + // therefor destroy all the polygons stored + if(mbIsEraseAllModeActivated) + { + // The Erase Mode should be desactivated + mbIsEraseModeActivated = false; + repaintWithoutPolygons(); + maPolygons.clear(); } mbIsEraseAllModeActivated=false; return true; @@ -199,18 +208,25 @@ namespace slideshow bool switchPenMode() { + mbIsLastPointValid = false; + mbActive = true; this->mbIsEraseModeActivated = false; return true; } bool switchEraserMode() { + mbIsLastPointValid = false; + mbActive = true; this->mbIsEraseModeActivated = true; return true; } bool disable() { + mbIsLastPointValid = false; + mbIsLastMouseDownPosValid = false; + mbActive = false; return true; } @@ -236,6 +252,9 @@ namespace slideshow // MouseEventHandler methods virtual bool handleMousePressed( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + if (e.Buttons == awt::MouseButton::RIGHT) { mbIsLastPointValid = false; @@ -256,6 +275,9 @@ namespace slideshow virtual bool handleMouseReleased( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + if (e.Buttons == awt::MouseButton::RIGHT) { mbIsLastPointValid = false; @@ -290,6 +312,9 @@ namespace slideshow virtual bool handleMouseEntered( const awt::MouseEvent& e ) { + if( !mbActive ) + return false; + mbIsLastPointValid = true; maLastPoint.setX( e.X ); maLastPoint.setY( e.Y ); @@ -299,6 +324,9 @@ namespace slideshow virtual bool handleMouseExited( const awt::MouseEvent& ) { + if( !mbActive ) + return false; + mbIsLastPointValid = false; mbIsLastMouseDownPosValid = false; @@ -307,7 +335,16 @@ namespace slideshow virtual bool handleMouseDragged( const awt::MouseEvent& e ) { - if(mbIsEraseModeActivated) + if( !mbActive ) + return false; + + if (e.Buttons == awt::MouseButton::RIGHT) + { + mbIsLastPointValid = false; + return false; + } + + if(mbIsEraseModeActivated) { //define the last point as an object //we suppose that there's no way this point could be valid @@ -422,6 +459,14 @@ namespace slideshow } + void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) + { + maStrokeColor = aUserPaintColor; + mnStrokeWidth = dUserPaintStrokeWidth; + mbActive = bUserPaintEnabled; + if( !mbActive ) + disable(); + } private: ActivitiesQueue& mrActivitiesQueue; @@ -439,17 +484,20 @@ namespace slideshow bool mbIsEraseModeActivated; Slide& mrSlide; sal_Int32 mnSize; + bool mbActive; }; UserPaintOverlaySharedPtr UserPaintOverlay::create( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ) + const PolyPolygonVector& rPolygons, + bool bActive ) { UserPaintOverlaySharedPtr pRet( new UserPaintOverlay( rStrokeColor, nStrokeWidth, rContext, - rPolygons )); + rPolygons, + bActive)); return pRet; } @@ -457,7 +505,8 @@ namespace slideshow UserPaintOverlay::UserPaintOverlay( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ) : + const PolyPolygonVector& rPolygons, + bool bActive ) : mpHandler( new PaintOverlayHandler( rStrokeColor, nStrokeWidth, rContext.mrActivitiesQueue, @@ -465,7 +514,7 @@ namespace slideshow rContext.mrViewContainer, //adding a link to Slide dynamic_cast<Slide&>(rContext.mrCursorManager), - rPolygons )), + rPolygons, bActive )), mrMultiplexer( rContext.mrEventMultiplexer ) { mrMultiplexer.addClickHandler( mpHandler, 3.0 ); @@ -484,6 +533,12 @@ namespace slideshow mpHandler->drawPolygons(); } + void UserPaintOverlay::update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) + { + mpHandler->update_settings( bUserPaintEnabled, aUserPaintColor, dUserPaintStrokeWidth ); + } + + UserPaintOverlay::~UserPaintOverlay() { try diff --git a/slideshow/source/engine/slide/userpaintoverlay.hxx b/slideshow/source/engine/slide/userpaintoverlay.hxx index 706156466c97..05abeaea2056 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.hxx +++ b/slideshow/source/engine/slide/userpaintoverlay.hxx @@ -70,16 +70,21 @@ namespace slideshow static UserPaintOverlaySharedPtr create( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ); + const PolyPolygonVector& rPolygons, + bool bActive); ~UserPaintOverlay(); PolyPolygonVector getPolygons(); void drawPolygons(); + void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ); + + private: UserPaintOverlay( const RGBColor& rStrokeColor, double nStrokeWidth, const SlideShowContext& rContext, - const PolyPolygonVector& rPolygons ); + const PolyPolygonVector& rPolygons, + bool bActive ); ::boost::shared_ptr<PaintOverlayHandler> mpHandler; EventMultiplexer& mrMultiplexer; diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index f02440109c46..d29dea85d9c7 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -448,7 +448,7 @@ private: boost::optional<RGBColor> maUserPaintColor; - boost::optional<double> maUserPaintStrokeWidth; + double maUserPaintStrokeWidth; //changed for the eraser project boost::optional<bool> maEraseAllInk; @@ -937,7 +937,7 @@ SlideSharedPtr SlideShowImpl::makeSlide( maShapeCursors, (aIter != maPolygons.end()) ? aIter->second : PolyPolygonVector(), maUserPaintColor ? *maUserPaintColor : RGBColor(), - *maUserPaintStrokeWidth, + maUserPaintStrokeWidth, !!maUserPaintColor, mbImageAnimationsAllowed, mbDisableAnimationZOrder) ); @@ -1096,11 +1096,7 @@ void SlideShowImpl::displaySlide( // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); -#ifdef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier = xDrawPages; -#else - mxDrawPagesSupplier = NULL; -#endif stopShow(); // MUST call that: results in // maUserEventQueue.clear(). What's more, @@ -1602,6 +1598,9 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) // enable user paint maUserPaintColor.reset( unoColor2RGBColor( nColor ) ); + if( mpCurrentSlide && !mpCurrentSlide->isPaintOverlayActive() ) + mpCurrentSlide->enablePaintOverlay(); + maEventMultiplexer.notifyUserPaintColor( *maUserPaintColor ); } else @@ -1609,10 +1608,11 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) // disable user paint maUserPaintColor.reset(); maEventMultiplexer.notifyUserPaintDisabled(); + if( mpCurrentSlide ) + mpCurrentSlide->disablePaintOverlay(); } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); + resetCursor(); return true; } @@ -1631,15 +1631,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEraseAllInk.reset( nEraseAllInk ); maEventMultiplexer.notifyEraseAllInk( *maEraseAllInk ); } - else - { - // disable user paint - maEraseAllInk.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); - } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1659,9 +1650,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEventMultiplexer.notifySwitchPenMode(); } } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1680,8 +1668,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) } } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1698,15 +1684,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEraseInk.reset( nEraseInk ); maEventMultiplexer.notifyEraseInkWidth( *maEraseInk ); } - else - { - // disable user paint - maEraseInk.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); - } - - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); return true; } @@ -1720,17 +1697,10 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) { OSL_ENSURE( mbMouseVisible,"setProperty(): User paint overrides invisible mouse" ); // enable user paint stroke width - maUserPaintStrokeWidth.reset( nWidth ); - maEventMultiplexer.notifyUserPaintStrokeWidth( *maUserPaintStrokeWidth ); + maUserPaintStrokeWidth = nWidth; + maEventMultiplexer.notifyUserPaintStrokeWidth( maUserPaintStrokeWidth ); } - else - { - // disable user paint stroke width - maUserPaintStrokeWidth.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); - } - if( mnCurrentCursor == awt::SystemPointer::ARROW ) - resetCursor(); + return true; } @@ -2193,6 +2163,8 @@ void SlideShowImpl::notifySlideTransitionEnded( bool bPaintSlide ) "notifySlideTransitionEnded(): Invalid current slide" ); if (mpCurrentSlide) { + mpCurrentSlide->update_settings( !!maUserPaintColor, maUserPaintColor ? *maUserPaintColor : RGBColor(), maUserPaintStrokeWidth ); + // first init show, to give the animations // the chance to register SlideStartEvents const bool bBackgroundLayerRendered( !bPaintSlide ); diff --git a/slideshow/source/inc/slide.hxx b/slideshow/source/inc/slide.hxx index e0d3464c747e..a43a5dd67904 100644 --- a/slideshow/source/inc/slide.hxx +++ b/slideshow/source/inc/slide.hxx @@ -122,9 +122,14 @@ namespace slideshow ///Draw the slide Polygons virtual void drawPolygons() const = 0; - ///Check if slide is already active + ///Check if paint overlay is already active virtual bool isPaintOverlayActive() const = 0; + virtual void enablePaintOverlay() = 0; + virtual void disablePaintOverlay() = 0; + + virtual void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ) = 0; + // Slide bitmaps // ------------------------------------------------------------------- diff --git a/slideshow/test/demoshow.cxx b/slideshow/test/demoshow.cxx index 154be6c1307f..68cb0893d531 100644 --- a/slideshow/test/demoshow.cxx +++ b/slideshow/test/demoshow.cxx @@ -315,7 +315,7 @@ class DemoApp : public Application { public: virtual void Main(); - virtual USHORT Exception( USHORT nError ); + virtual sal_uInt16 Exception( sal_uInt16 nError ); }; class ChildWindow : public Window @@ -434,7 +434,7 @@ DemoWindow::DemoWindow() : Show(); maUpdateTimer.SetTimeoutHdl(LINK(this, DemoWindow, updateHdl)); - maUpdateTimer.SetTimeout( (ULONG)30 ); + maUpdateTimer.SetTimeout( (sal_uLong)30 ); maUpdateTimer.Start(); } @@ -504,7 +504,7 @@ void DemoWindow::Resize() // TODO } -USHORT DemoApp::Exception( USHORT nError ) +sal_uInt16 DemoApp::Exception( sal_uInt16 nError ) { switch( nError & EXC_MAJORTYPE ) { @@ -519,7 +519,7 @@ void DemoApp::Main() { bool bHelp = false; - for( USHORT i = 0; i < GetCommandLineParamCount(); i++ ) + for( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ ) { ::rtl::OUString aParam = GetCommandLineParam( i ); diff --git a/slideshow/util/exports.dxp b/slideshow/util/exports.dxp index 0c2e3e7cddd7..0cb5620a1603 100644 --- a/slideshow/util/exports.dxp +++ b/slideshow/util/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory
\ No newline at end of file diff --git a/slideshow/util/makefile.mk b/slideshow/util/makefile.mk index def425b60469..9d9bee14a198 100644 --- a/slideshow/util/makefile.mk +++ b/slideshow/util/makefile.mk @@ -102,3 +102,11 @@ $(MISC)$/$(SHL2TARGET).flt: makefile.mk \ $(TARGET2).flt +$(TYPE) $(TARGET2).flt > $@ + +ALLTAR : $(MISC)/slideshow.component + +$(MISC)/slideshow.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + slideshow.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt slideshow.component diff --git a/slideshow/util/makefile.pmk b/slideshow/util/makefile.pmk index 53724522d5e8..765b5249e5a4 100644 --- a/slideshow/util/makefile.pmk +++ b/slideshow/util/makefile.pmk @@ -35,7 +35,7 @@ CDEFS += -DBOOST_SP_ENABLE_DEBUG_HOOKS .IF "$(COM)"=="MSC" # disable inlining for MSVC -CFLAGS += -Ob0 +#CFLAGS += -Ob0 .ENDIF .ENDIF # "$(debug)"!="" || "$(DEBUG)"!="" diff --git a/slideshow/util/slideshow.component b/slideshow/util/slideshow.component new file mode 100644 index 000000000000..540c586f1ff5 --- /dev/null +++ b/slideshow/util/slideshow.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.presentation.SlideShow"> + <service name="com.sun.star.presentation.SlideShow"/> + </implementation> +</component> |