summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/slide/slideimpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'slideshow/source/engine/slide/slideimpl.cxx')
-rw-r--r--slideshow/source/engine/slide/slideimpl.cxx50
1 files changed, 34 insertions, 16 deletions
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index 55831ba1609f..2534b495ca90 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -139,6 +139,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
@@ -156,6 +160,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
@@ -174,9 +181,6 @@ private:
*/
bool isShowing() const;
- 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 );
@@ -419,6 +423,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 )
@@ -454,9 +465,7 @@ void SlideImpl::dispose()
mpShapeManager.reset();
mxRootNode.clear();
mxDrawPage.clear();
-#ifndef ENABLE_PRESENTER_EXTRA_UI
mxDrawPagesSupplier.clear();
-#endif
}
bool SlideImpl::prefetch()
@@ -542,7 +551,7 @@ bool SlideImpl::show( bool bSlideBackgoundPainted )
// ---------------------------------------------------------------
// enable paint overlay, if maUserPaintColor is valid
- enablePaintOverlay();
+ activatePaintOverlay();
// ---------------------------------------------------------------
@@ -566,7 +575,7 @@ void SlideImpl::hide()
// disable user paint overlay under all circumstances,
// this slide now ceases to be active.
- disablePaintOverlay();
+ deactivatePaintOverlay();
// ---------------------------------------------------------------
@@ -888,19 +897,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();
}
@@ -923,7 +946,7 @@ bool SlideImpl::isPaintOverlayActive() const
return mbPaintOverlayActive;
}
-void SlideImpl::disablePaintOverlay()
+void SlideImpl::deactivatePaintOverlay()
{
if(mbPaintOverlayActive)
maPolygons = mpPaintOverlay->getPolygons();
@@ -1259,12 +1282,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,