diff options
author | ericb <ericb@ordinateur-de-eric-b-2.local> | 2009-12-15 23:12:19 +0100 |
---|---|---|
committer | ericb <ericb@ordinateur-de-eric-b-2.local> | 2009-12-15 23:12:19 +0100 |
commit | af5c661b945658b1c0a2f61e66446d030abdbf40 (patch) | |
tree | 636538744983ed395deb85b22861e50971a8f183 /slideshow/source/engine/slide | |
parent | 54e4becdc5eee38a4ef85f8bab8d6258c54e2faf (diff) |
#i97972# commit all changes since Thorsten rebase. Thanks to Nelle, Jonathan, Christian and ericb
Diffstat (limited to 'slideshow/source/engine/slide')
-rw-r--r-- | slideshow/source/engine/slide/slideimpl.cxx | 15 | ||||
-rw-r--r-- | slideshow/source/engine/slide/userpaintoverlay.cxx | 51 |
2 files changed, 48 insertions, 18 deletions
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index e895f98fa94a..c0302fd92909 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -81,6 +81,7 @@ #include <iterator> #include <algorithm> #include <functional> +#include <iostream> using namespace ::com::sun::star; @@ -367,7 +368,11 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) : mxDrawPage( xDrawPage ), - mxDrawPagesSupplier( xDrawPages ), +#ifdef ENABLE_PRESENTER_EXTRA_UI + mxDrawPagesSupplier( xDrawPages ), +#else + mxDrawPagesSupplier( NULL ), +#endif mxRootNode( xRootNode ), mpLayerManager( new LayerManager( rViewContainer, @@ -456,7 +461,9 @@ void SlideImpl::dispose() mpShapeManager.reset(); mxRootNode.clear(); mxDrawPage.clear(); +#ifndef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier.clear(); +#endif } bool SlideImpl::prefetch() @@ -906,7 +913,7 @@ void SlideImpl::drawPolygons() const void SlideImpl::addPolygons(PolyPolygonVector aPolygons) { - if(!aPolygons.empty()) + if(!aPolygons.empty()) /* FIXME : was if(aPolygons.size() != 0) */ { for( PolyPolygonVector::iterator aIter=aPolygons.begin(), aEnd=aPolygons.end(); @@ -1259,7 +1266,11 @@ 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 + 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 d9854f67b6fe..cfcb6a1918dc 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -65,7 +65,7 @@ namespace slideshow { class PaintOverlayHandler : public MouseEventHandler, public ViewEventHandler, - public UserPaintEventHandler + public UserPaintEventHandler { public: PaintOverlayHandler( const RGBColor& rStrokeColor, @@ -73,7 +73,7 @@ namespace slideshow ActivitiesQueue& rActivitiesQueue, ScreenUpdater& rScreenUpdater, const UnoViewContainer& rViews, - Slide& rSlide, + Slide& rSlide, const PolyPolygonVector& rPolygons ) : mrActivitiesQueue( rActivitiesQueue ), mrScreenUpdater( rScreenUpdater ), @@ -90,7 +90,7 @@ namespace slideshow //handle the "remove stroke by stroke" mode of erasing mbIsEraseModeActivated( false ), mrSlide(rSlide), - mnSize(100.0) + mnSize(100) { std::for_each( rViews.begin(), rViews.end(), @@ -132,23 +132,27 @@ namespace slideshow bool colorChanged( RGBColor const& rUserColor ) { - maStrokeColor = rUserColor; + this->maStrokeColor = rUserColor; + this->mbIsEraseModeActivated = false; return true; } bool widthChanged( double nUserStrokeWidth ) { - mnStrokeWidth = nUserStrokeWidth; + this->mnStrokeWidth = nUserStrokeWidth; + mbIsEraseModeActivated = false; return true; } bool eraseAllInkChanged( bool const& rEraseAllInk ) { - mbIsEraseAllModeActivated= 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; // must get access to the instance to erase all polygon for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); aIter!=aEnd; @@ -180,17 +184,30 @@ namespace slideshow mrScreenUpdater.notifyUpdate(*aIter,true); } + maPolygons.clear(); } - mbIsEraseAllModeActivated=false; + mbIsEraseAllModeActivated=false; + return true; + } + + bool eraseInkWidthChanged( sal_Int32 rEraseInkSize ) + { + // Change the size + this->mnSize=rEraseInkSize; + // Changed to mode Erase + this->mbIsEraseModeActivated = true; return true; } - bool eraseInkChanged( double rEraseInkSize ) + bool switchPenMode() { - if(mbIsEraseModeActivated) - mbIsEraseModeActivated=false; - else - mbIsEraseModeActivated=true; + this->mbIsEraseModeActivated = false; + return true; + } + + bool switchEraserMode() + { + this->mbIsEraseModeActivated = true; return true; } @@ -292,7 +309,7 @@ namespace slideshow virtual bool handleMouseDragged( const awt::MouseEvent& e ) { - if(mbIsEraseModeActivated) + if(mbIsEraseModeActivated) { //define the last point as an object //we suppose that there's no way this point could be valid @@ -324,7 +341,7 @@ namespace slideshow //The point is to redraw the LastPoint the way it was originally on the bitmap, //of the slide - for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); + for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); aIter!=aEnd; ++aIter ) { @@ -355,7 +372,7 @@ namespace slideshow mrScreenUpdater.notifyUpdate(*aIter,true); } - } + } else { if( !mbIsLastPointValid ) @@ -385,8 +402,10 @@ namespace slideshow if( pPolyPoly ) { + pPolyPoly->setStrokeWidth(mnStrokeWidth); pPolyPoly->setRGBALineColor( maStrokeColor.getIntegerColor() ); pPolyPoly->draw(); + maPolygons.push_back(pPolyPoly); } } @@ -421,7 +440,7 @@ namespace slideshow bool mbIsEraseAllModeActivated; bool mbIsEraseModeActivated; Slide& mrSlide; - double mnSize; + sal_Int32 mnSize; }; UserPaintOverlaySharedPtr UserPaintOverlay::create( const RGBColor& rStrokeColor, |