1 Modified: sd/source/ui/slideshow/slideshow.hrc
2 ==============================================================================
3 --- sd/source/ui/slideshow/slideshow.hrc Sat Jan 31 09:53:18 2009 (r267232)
4 +++ sd/source/ui/slideshow/slideshow.hrc Sat Jan 31 14:05:38 2009 (r267233)
6 #define CM_SCREEN_BLACK 5
7 #define CM_SCREEN_WHITE 6
9 -#define CM_FIRST_SLIDE 8
10 -#define CM_LAST_SLIDE 9
12 +#define CM_COLOR_PEN 8
13 +#define CM_FIRST_SLIDE 9
14 +#define CM_LAST_SLIDE 10
15 +#define CM_WIDTH_PEN 11
16 +#define CM_WIDTH_PEN_VERY_THIN 12
17 +#define CM_WIDTH_PEN_THIN 13
18 +#define CM_WIDTH_PEN_NORMAL 14
19 +#define CM_WIDTH_PEN_THICK 15
20 +#define CM_WIDTH_PEN_VERY_THICK 16
25 Modified: sd/source/ui/slideshow/slideshow.src
26 ==============================================================================
27 --- sd/source/ui/slideshow/slideshow.src Sat Jan 31 09:53:18 2009 (r267232)
28 +++ sd/source/ui/slideshow/slideshow.src Sat Jan 31 14:05:38 2009 (r267233)
35 + Identifier = CM_WIDTH_PEN;
36 + Text [ en-US ] = "~Pen Width" ;
44 + Identifier = CM_WIDTH_PEN_VERY_THIN;
45 + Text [ en-US ] = "~Very thin";
49 + Identifier = CM_WIDTH_PEN_THIN;
50 + Text [ en-US ] = "~Thin";
54 + Identifier = CM_WIDTH_PEN_NORMAL;
55 + Text [ en-US ] = "~Normal";
59 + Identifier = CM_WIDTH_PEN_THICK;
60 + Text [ en-US ] = "~Thick";
64 + Identifier = CM_WIDTH_PEN_VERY_THICK;
65 + Text [ en-US ] = "~Very Thick";
76 + Identifier = CM_COLOR_PEN ;
77 + Text [ en-US ] = "~Change Color" ;
85 Identifier = CM_ENDSHOW ;
87 Modified: sd/source/ui/slideshow/slideshowimpl.cxx
88 ==============================================================================
89 --- sd/source/ui/slideshow/slideshowimpl.cxx Sat Jan 31 09:53:18 2009 (r267232)
90 +++ sd/source/ui/slideshow/slideshowimpl.cxx Sat Jan 31 14:05:38 2009 (r267233)
92 #include "canvas/elapsedtime.hxx"
93 #include "canvas/prioritybooster.hxx"
94 #include "avmedia/mediawindow.hxx"
95 +#include "svtools/colrdlg.hxx"
97 #include <boost/noncopyable.hpp>
98 #include <boost/bind.hpp>
100 , mbInputFreeze(false)
101 , mbActive(sal_False)
102 , maPresSettings( pDoc->getPresentationSettings() )
103 -, mnUserPaintColor( 0x0000FF00L )
104 +, mnUserPaintColor( 0x00000000L )
105 +, mdUserPaintStrokeWidth ( 4.0 )
107 , mnLastSlideNumber(-1)
108 , msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") )
109 @@ -2111,6 +2113,8 @@
111 PopupMenu* pMenu = new PopupMenu( SdResId( RID_SLIDESHOW_CONTEXTMENU ) );
113 + pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen));
115 const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
116 pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) );
117 pMenu->EnableItem( CM_PREV_SLIDE, ( mpSlideController->getPreviousSlideIndex() != -1 ) || (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) );
118 @@ -2178,6 +2182,55 @@
123 + PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN);
125 + // populate color width list
128 + if(! maPresSettings.mbMouseAsPen)
130 + pMenu->EnableItem( CM_WIDTH_PEN, FALSE );
134 + sal_Int32 nIterator;
140 + for( nIterator = 1; nIterator < 6; nIterator++)
163 + pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE);
164 + if( nWidth == mdUserPaintStrokeWidth)
165 + pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) );
171 pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) );
172 pMenu->Execute( mpShowWindow, maPopupMousePos );
174 @@ -2240,6 +2293,59 @@
180 + if( maPresSettings.mbMouseAsPen ){
182 + //Open a color picker based on SvColorDialog
183 + ::Color aColor( mnUserPaintColor );
184 + SvColorDialog aColorDlg( mpShowWindow);
185 + aColorDlg.SetColor( aColor );
187 + if (aColorDlg.Execute() )
189 + aColor = aColorDlg.GetColor();
190 + mnUserPaintColor = aColor.GetColor();
191 + setPenColor(mnUserPaintColor);
193 + mbWasPaused = false;
197 + case CM_WIDTH_PEN_VERY_THIN:
198 + if( maPresSettings.mbMouseAsPen ){
200 + mbWasPaused = false;
204 + case CM_WIDTH_PEN_THIN:
205 + if( maPresSettings.mbMouseAsPen ){
206 + setPenWidth(100.0);
207 + mbWasPaused = false;
211 + case CM_WIDTH_PEN_NORMAL:
212 + if( maPresSettings.mbMouseAsPen ){
213 + setPenWidth(150.0);
214 + mbWasPaused = false;
218 + case CM_WIDTH_PEN_THICK:
219 + if( maPresSettings.mbMouseAsPen ){
220 + setPenWidth(200.0);
221 + mbWasPaused = false;
225 + case CM_WIDTH_PEN_VERY_THICK:
226 + if( maPresSettings.mbMouseAsPen ){
227 + setPenWidth(400.0);
228 + mbWasPaused = false;
233 // in case the user cancels the presentation, switch to current slide
234 @@ -2824,6 +2930,17 @@
235 aPenProp.Value = aValue;
237 mxShow->setProperty( aPenProp );
239 + //for StrokeWidth :
241 + if( maPresSettings.mbMouseAsPen )
242 + aValueWidth <<= mdUserPaintStrokeWidth;
244 + beans::PropertyValue aPenPropWidth;
245 + aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" ));
246 + aPenPropWidth.Value = aValueWidth;
248 + mxShow->setProperty( aPenPropWidth );
250 catch( Exception& e )
252 @@ -2837,6 +2954,27 @@
257 +// --------------------------------------------------------------------
259 +double SAL_CALL SlideshowImpl::getPenWidth() throw (RuntimeException)
261 + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
262 + return mdUserPaintStrokeWidth;
266 +// --------------------------------------------------------------------
268 +void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeException)
270 + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
271 + mdUserPaintStrokeWidth = dStrokeWidth;
272 + if( maPresSettings.mbMouseAsPen )
273 + setUsePen( sal_True ); // update color and width
277 // --------------------------------------------------------------------
279 sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException)
280 @@ -2845,6 +2983,7 @@
281 return mnUserPaintColor;
285 // --------------------------------------------------------------------
287 void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeException)
288 @@ -2852,7 +2991,7 @@
289 ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
290 mnUserPaintColor = nColor;
291 if( maPresSettings.mbMouseAsPen )
292 - setUsePen( sal_True ); // update color
293 + setUsePen( sal_True ); // update color and width
296 // --------------------------------------------------------------------
298 Modified: sd/source/ui/slideshow/slideshowimpl.hxx
299 ==============================================================================
300 --- sd/source/ui/slideshow/slideshowimpl.hxx Sat Jan 31 09:53:18 2009 (r267232)
301 +++ sd/source/ui/slideshow/slideshowimpl.hxx Sat Jan 31 14:05:38 2009 (r267233)
303 virtual void SAL_CALL setMouseVisible( ::sal_Bool _mousevisible ) throw (css::uno::RuntimeException);
304 virtual ::sal_Bool SAL_CALL getUsePen() throw (css::uno::RuntimeException);
305 virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException);
306 + virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException);
307 + virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException);
308 virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException);
309 virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException);
310 virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException);
312 PresentationSettings maPresSettings;
313 sal_Int32 mnUserPaintColor;
315 + double mdUserPaintStrokeWidth;
317 /// used in updateHdl to prevent recursive calls
318 sal_Int32 mnEntryCounter;
321 Modified: slideshow/source/engine/eventmultiplexer.cxx
322 ==============================================================================
323 --- slideshow/source/engine/eventmultiplexer.cxx Sat Jan 31 09:53:18 2009 (r267232)
324 +++ slideshow/source/engine/eventmultiplexer.cxx Sat Jan 31 14:05:38 2009 (r267233)
325 @@ -1065,6 +1065,14 @@
326 boost::cref(rUserColor)));
329 +bool EventMultiplexer::notifyUserPaintStrokeWidth( double rUserStrokeWidth )
331 + return mpImpl->maUserPaintEventHandlers.applyAll(
332 + boost::bind(&UserPaintEventHandler::widthChanged,
334 + rUserStrokeWidth));
337 bool EventMultiplexer::notifyUserPaintDisabled()
339 return mpImpl->maUserPaintEventHandlers.applyAll(
341 Modified: slideshow/source/engine/slide/slideimpl.cxx
342 ==============================================================================
343 --- slideshow/source/engine/slide/slideimpl.cxx Sat Jan 31 09:53:18 2009 (r267232)
344 +++ slideshow/source/engine/slide/slideimpl.cxx Sat Jan 31 14:05:38 2009 (r267233)
346 const ShapeEventListenerMap& rShapeListenerMap,
347 const ShapeCursorMap& rShapeCursorMap,
348 RGBColor const& rUserPaintColor,
349 + double dUserPaintStrokeWidth,
350 bool bUserPaintEnabled,
351 bool bIntrinsicAnimationsAllowed,
352 bool bDisableAnimationZOrder );
354 SlideAnimations maAnimations;
356 RGBColor maUserPaintColor;
357 + double mdUserPaintStrokeWidth;
358 UserPaintOverlaySharedPtr mpPaintOverlay;
360 /// Bitmaps with slide content at various states
362 const ShapeEventListenerMap& rShapeListenerMap,
363 const ShapeCursorMap& rShapeCursorMap,
364 RGBColor const& aUserPaintColor,
365 + double dUserPaintStrokeWidth,
366 bool bUserPaintEnabled,
367 bool bIntrinsicAnimationsAllowed,
368 bool bDisableAnimationZOrder ) :
370 maAnimations( maContext,
371 getSlideSizeImpl() ),
372 maUserPaintColor(aUserPaintColor),
373 + mdUserPaintStrokeWidth(dUserPaintStrokeWidth),
376 meAnimationState( CONSTRUCTING_STATE ),
379 if( mbUserPaintOverlayEnabled )
380 mpPaintOverlay = UserPaintOverlay::create( maUserPaintColor,
382 + mdUserPaintStrokeWidth,
386 @@ -1188,6 +1192,7 @@
387 const ShapeEventListenerMap& rShapeListenerMap,
388 const ShapeCursorMap& rShapeCursorMap,
389 RGBColor const& rUserPaintColor,
390 + double dUserPaintStrokeWidth,
391 bool bUserPaintEnabled,
392 bool bIntrinsicAnimationsAllowed,
393 bool bDisableAnimationZOrder )
394 @@ -1198,7 +1203,7 @@
395 rCursorManager, rViewContainer,
396 xComponentContext, rShapeListenerMap,
397 rShapeCursorMap, rUserPaintColor,
399 + dUserPaintStrokeWidth, bUserPaintEnabled,
400 bIntrinsicAnimationsAllowed,
401 bDisableAnimationZOrder ));
404 Modified: slideshow/source/engine/slide/userpaintoverlay.cxx
405 ==============================================================================
406 --- slideshow/source/engine/slide/userpaintoverlay.cxx Sat Jan 31 09:53:18 2009 (r267232)
407 +++ slideshow/source/engine/slide/userpaintoverlay.cxx Sat Jan 31 14:05:38 2009 (r267233)
411 class PaintOverlayHandler : public MouseEventHandler,
412 - public ViewEventHandler
413 + public ViewEventHandler,
414 + public UserPaintEventHandler
417 PaintOverlayHandler( const RGBColor& rStrokeColor,
421 pPolyPoly->setRGBALineColor( maStrokeColor.getIntegerColor() );
422 + pPolyPoly->setStrokeWidth(mnStrokeWidth);
427 return false; // did not handle the event
431 + bool colorChanged( RGBColor const& rUserColor ){
432 + this->maStrokeColor = rUserColor;
436 + bool widthChanged( double nUserStrokeWidth ){
437 + this->mnStrokeWidth = nUserStrokeWidth;
442 + //this->maStrokeColor = *(new RGBColor(255,255,255));
443 + //this->mnStrokeWidth = 4.0;
449 ActivitiesQueue& mrActivitiesQueue;
450 ScreenUpdater& mrScreenUpdater;
452 mrMultiplexer.addClickHandler( mpHandler, 3.0 );
453 mrMultiplexer.addMouseMoveHandler( mpHandler, 3.0 );
454 mrMultiplexer.addViewHandler( mpHandler );
455 + mrMultiplexer.addUserPaintHandler(mpHandler);
458 UserPaintOverlay::~UserPaintOverlay()
460 Modified: slideshow/source/engine/slideshowimpl.cxx
461 ==============================================================================
462 --- slideshow/source/engine/slideshowimpl.cxx Sat Jan 31 09:53:18 2009 (r267232)
463 +++ slideshow/source/engine/slideshowimpl.cxx Sat Jan 31 14:05:38 2009 (r267233)
466 boost::optional<RGBColor> maUserPaintColor;
468 + boost::optional<double> maUserPaintStrokeWidth;
470 boost::shared_ptr<canvas::tools::ElapsedTime> mpPresTimer;
471 ScreenUpdater maScreenUpdater;
472 EventQueue maEventQueue;
474 maShapeEventListeners(),
477 + maUserPaintStrokeWidth(4.0),
478 mpPresTimer( new canvas::tools::ElapsedTime ),
479 maScreenUpdater(maViewContainer),
480 maEventQueue( mpPresTimer ),
482 maShapeEventListeners,
484 maUserPaintColor ? *maUserPaintColor : RGBColor(),
485 + *maUserPaintStrokeWidth,
487 mbImageAnimationsAllowed,
488 mbDisableAnimationZOrder) );
489 @@ -1173,6 +1177,34 @@
494 + // new Property for pen's width
495 + if (rProperty.Name.equalsAsciiL(
496 + RTL_CONSTASCII_STRINGPARAM("UserPaintStrokeWidth") ))
498 + double nWidth(4.0);
499 + if (rProperty.Value >>= nWidth)
501 + OSL_ENSURE( mbMouseVisible,
502 + "setProperty(): User paint overrides invisible mouse" );
504 + // enable user paint stroke width
505 + maUserPaintStrokeWidth.reset( nWidth );
506 + maEventMultiplexer.notifyUserPaintStrokeWidth( *maUserPaintStrokeWidth );
510 + // disable user paint stroke width
511 + maUserPaintStrokeWidth.reset();
512 + maEventMultiplexer.notifyUserPaintDisabled();
515 + if( mnCurrentCursor == awt::SystemPointer::ARROW )
522 if (rProperty.Name.equalsAsciiL(
523 RTL_CONSTASCII_STRINGPARAM("AdvanceOnClick") ))
525 Modified: slideshow/source/inc/eventmultiplexer.hxx
526 ==============================================================================
527 --- slideshow/source/inc/eventmultiplexer.hxx Sat Jan 31 09:53:18 2009 (r267232)
528 +++ slideshow/source/inc/eventmultiplexer.hxx Sat Jan 31 14:05:38 2009 (r267233)
531 bool notifyUserPaintColor( RGBColor const& rUserColor );
533 + /** Notify a new user paint width
535 + Sending this notification also implies that user paint is
538 + @return true, if this event was processed by
539 + anybody. If false is returned, no handler processed
540 + this event (and probably, nothing will happen at all)
542 + bool notifyUserPaintStrokeWidth( double rUserStrokeWidth );
544 /** Notify that user paint is disabled
546 User paint denotes the feature to draw colored lines on top of
548 Modified: slideshow/source/inc/slide.hxx
549 ==============================================================================
550 --- slideshow/source/inc/slide.hxx Sat Jan 31 09:53:18 2009 (r267232)
551 +++ slideshow/source/inc/slide.hxx Sat Jan 31 14:05:38 2009 (r267233)
553 const ShapeEventListenerMap& rShapeListenerMap,
554 const ShapeCursorMap& rShapeCursorMap,
555 RGBColor const& aUserPaintColor,
556 + double dUserPaintStrokeWidth,
557 bool bUserPaintEnabled,
558 bool bIntrinsicAnimationsAllowed,
559 bool bDisableAnimationZOrder );
561 Modified: slideshow/source/inc/userpainteventhandler.hxx
562 ==============================================================================
563 --- slideshow/source/inc/userpainteventhandler.hxx Sat Jan 31 09:53:18 2009 (r267232)
564 +++ slideshow/source/inc/userpainteventhandler.hxx Sat Jan 31 14:05:38 2009 (r267233)
566 virtual ~UserPaintEventHandler() {}
568 virtual bool colorChanged( RGBColor const& rUserColor ) = 0;
569 + virtual bool widthChanged( double nUserStrokeWidth ) = 0;
570 virtual bool disable() = 0;