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 /sd/source/ui/slideshow | |
parent | 064f1e4ed53cb16d174534e20a7d02b8c93a4948 (diff) | |
parent | f2aeec8f22f37146c2f9120e8d0ead383049c1fa (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'sd/source/ui/slideshow')
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/slideshow/makefile.mk | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/slideshow/showwin.cxx | 62 | ||||
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/slideshow/showwindow.hxx | 14 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshow.cxx | 23 | ||||
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/slideshow/slideshow.hrc | 33 | ||||
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/slideshow/slideshow.src | 70 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 623 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.hxx | 14 |
8 files changed, 308 insertions, 534 deletions
diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk index ad4f4d306c6b..62062d7e5461 100644..100755 --- a/sd/source/ui/slideshow/makefile.mk +++ b/sd/source/ui/slideshow/makefile.mk @@ -40,8 +40,7 @@ AUTOSEG=true .INCLUDE : $(PRJ)$/util$/makefile.pmk .IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" -RSCDEFS+=-DENABLE_PRESENTER_EXTRA_UI -ADDCDEFS+=-DENABLE_PRESENTER_EXTRA_UI +ENABLE_PRESENTER_EXTRA_UI is not used anymore .ENDIF # --- Files -------------------------------------------------------- diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index 18556148d00a..eccd94c6e960 100644..100755 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -50,8 +50,8 @@ using namespace ::com::sun::star; namespace sd { -static const ULONG HIDE_MOUSE_TIMEOUT = 10000; -static const ULONG SHOW_MOUSE_TIMEOUT = 1000; +static const sal_uLong HIDE_MOUSE_TIMEOUT = 10000; +static const sal_uLong SHOW_MOUSE_TIMEOUT = 1000; // ============================================================================= @@ -60,7 +60,7 @@ ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, :: , mnPauseTimeout( SLIDE_NO_TIMEOUT ) , mnRestartPageIndex( PAGE_NO_END ) , meShowWindowMode(SHOWWINDOWMODE_NORMAL) -, mbShowNavigatorAfterSpecialMode( FALSE ) +, mbShowNavigatorAfterSpecialMode( sal_False ) , mbMouseAutoHide(true) , mbMouseCursorHidden(false) , mnFirstMouseMove(0) @@ -70,7 +70,7 @@ ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, :: // Do never mirror the preview window. This explicitly includes right // to left writing environments. - EnableRTL (FALSE); + EnableRTL (sal_False); MapMode aMap(GetMapMode()); aMap.SetMapUnit(MAP_100TH_MM); @@ -105,7 +105,7 @@ ShowWindow::~ShowWindow(void) void ShowWindow::KeyInput(const KeyEvent& rKEvt) { - BOOL bReturn = FALSE; + sal_Bool bReturn = sal_False; if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode ) { @@ -219,10 +219,10 @@ void ShowWindow::MouseMove(const MouseEvent& /*rMEvt*/) { // if this is not the first mouse move while hidden, see if // enough time has pasted to show mouse pointer again - ULONG nTime = Time::GetSystemTicks(); + sal_uLong nTime = Time::GetSystemTicks(); if( (nTime - mnFirstMouseMove) >= SHOW_MOUSE_TIMEOUT ) { - ShowPointer( TRUE ); + ShowPointer( sal_True ); mnFirstMouseMove = 0; mbMouseCursorHidden = false; maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT ); @@ -307,7 +307,7 @@ void ShowWindow::Paint(const Rectangle& rRect) } else if( SHOWWINDOWMODE_PAUSE == meShowWindowMode ) { - DrawPauseScene( FALSE ); + DrawPauseScene( sal_False ); } else if( SHOWWINDOWMODE_BLANK == meShowWindowMode ) { @@ -324,7 +324,7 @@ void ShowWindow::Paint(const Rectangle& rRect) long ShowWindow::Notify(NotifyEvent& rNEvt) { - long nOK = FALSE; + long nOK = sal_False; if (!nOK) nOK = Window::Notify(rNEvt); @@ -366,7 +366,7 @@ void ShowWindow::Move() // ----------------------------------------------------------------------------- -BOOL ShowWindow::SetEndMode() +sal_Bool ShowWindow::SetEndMode() { if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() ) { @@ -377,8 +377,8 @@ BOOL ShowWindow::SetEndMode() // hide navigator if it is visible if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) ) { - mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, FALSE ); - mbShowNavigatorAfterSpecialMode = TRUE; + mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False ); + mbShowNavigatorAfterSpecialMode = sal_True; } Invalidate(); @@ -389,7 +389,7 @@ BOOL ShowWindow::SetEndMode() // ----------------------------------------------------------------------------- -BOOL ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeout, Graphic* pLogo ) +sal_Bool ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeout, Graphic* pLogo ) { rtl::Reference< SlideShow > xSlideShow; @@ -411,8 +411,8 @@ BOOL ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeout // hide navigator if it is visible if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) ) { - mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, FALSE ); - mbShowNavigatorAfterSpecialMode = TRUE; + mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False ); + mbShowNavigatorAfterSpecialMode = sal_True; } if( pLogo ) @@ -429,7 +429,7 @@ BOOL ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeout // ----------------------------------------------------------------------------- -BOOL ShowWindow::SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor ) +sal_Bool ShowWindow::SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor ) { if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() ) { @@ -441,8 +441,8 @@ BOOL ShowWindow::SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlan // hide navigator if it is visible if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) ) { - mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, FALSE ); - mbShowNavigatorAfterSpecialMode = TRUE; + mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False ); + mbShowNavigatorAfterSpecialMode = sal_True; } Invalidate(); @@ -475,8 +475,8 @@ void ShowWindow::TerminateShow() // show navigator? if( mbShowNavigatorAfterSpecialMode ) { - mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, TRUE ); - mbShowNavigatorAfterSpecialMode = FALSE; + mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_True ); + mbShowNavigatorAfterSpecialMode = sal_False; } } @@ -532,14 +532,14 @@ void ShowWindow::RestartShow( sal_Int32 nPageIndexToRestart ) // show navigator? if( mbShowNavigatorAfterSpecialMode ) { - mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, TRUE ); - mbShowNavigatorAfterSpecialMode = FALSE; + mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_True ); + mbShowNavigatorAfterSpecialMode = sal_False; } } // ----------------------------------------------------------------------------- -void ShowWindow::DrawPauseScene( BOOL bTimeoutOnly ) +void ShowWindow::DrawPauseScene( sal_Bool bTimeoutOnly ) { const MapMode& rMap = GetMapMode(); const Point aOutOrg( PixelToLogic( Point() ) ); @@ -547,7 +547,7 @@ void ShowWindow::DrawPauseScene( BOOL bTimeoutOnly ) const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, rMap ) ); const Size aOffset( LogicToLogic( Size( 1000, 1000 ), MAP_100TH_MM, rMap ) ); String aText( SdResId( STR_PRES_PAUSE ) ); - BOOL bDrawn = FALSE; + sal_Bool bDrawn = sal_False; Font aFont( GetSettings().GetStyleSettings().GetMenuFont() ); const Font aOldFont( GetFont() ); @@ -600,7 +600,7 @@ void ShowWindow::DrawPauseScene( BOOL bTimeoutOnly ) aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " )" )); aVDev.DrawText( Point( aOffset.Width(), 0 ), aText ); DrawOutDev( Point( aOutOrg.X(), aOffset.Height() ), aVDevSize, Point(), aVDevSize, aVDev ); - bDrawn = TRUE; + bDrawn = sal_True; } } @@ -647,7 +647,7 @@ IMPL_LINK( ShowWindow, PauseTimeoutHdl, Timer*, pTimer ) RestartShow(); else { - DrawPauseScene( TRUE ); + DrawPauseScene( sal_True ); pTimer->Start(); } @@ -665,7 +665,7 @@ IMPL_LINK( ShowWindow, MouseTimeoutHdl, Timer*, EMPTYARG ) else { // mouse has been idle to long, hide pointer - ShowPointer( FALSE ); + ShowPointer( sal_False ); mbMouseCursorHidden = true; } return 0L; @@ -694,9 +694,9 @@ void ShowWindow::DeleteWindowFromPaintView() if( mpViewShell->GetView() ) mpViewShell->GetView()->DeleteWindowFromPaintView( this ); - USHORT nChild = GetChildCount(); + sal_uInt16 nChild = GetChildCount(); while( nChild-- ) - GetChild( nChild )->Show( FALSE ); + GetChild( nChild )->Show( sal_False ); } void ShowWindow::AddWindowToPaintView() @@ -704,9 +704,9 @@ void ShowWindow::AddWindowToPaintView() if( mpViewShell->GetView() ) mpViewShell->GetView()->AddWindowToPaintView( this ); - USHORT nChild = GetChildCount(); + sal_uInt16 nChild = GetChildCount(); while( nChild-- ) - GetChild( nChild )->Show( TRUE ); + GetChild( nChild )->Show( sal_True ); } } // end of namespace sd diff --git a/sd/source/ui/slideshow/showwindow.hxx b/sd/source/ui/slideshow/showwindow.hxx index 41a385d46af2..31a447a630c9 100644..100755 --- a/sd/source/ui/slideshow/showwindow.hxx +++ b/sd/source/ui/slideshow/showwindow.hxx @@ -76,9 +76,9 @@ public: ShowWindow ( const ::rtl::Reference< ::sd::SlideshowImpl >& xController, ::Window* pParent ); virtual ~ShowWindow (void); - BOOL SetEndMode(); - BOOL SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL ); - BOOL SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor ); + sal_Bool SetEndMode(); + sal_Bool SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL ); + sal_Bool SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor ); const Color& GetBlankColor() const { return maShowBackground.GetColor(); } @@ -107,7 +107,7 @@ public: void RestartShow(); private: - void DrawPauseScene( BOOL bTimeoutOnly ); + void DrawPauseScene( sal_Bool bTimeoutOnly ); void DrawEndScene(); void DrawBlankScene(); @@ -119,14 +119,14 @@ private: Timer maMouseTimer; Wallpaper maShowBackground; Graphic maLogo; - ULONG mnPauseTimeout; + sal_uLong mnPauseTimeout; sal_Int32 mnRestartPageIndex; ShowWindowMode meShowWindowMode; - BOOL mbShowNavigatorAfterSpecialMode; + sal_Bool mbShowNavigatorAfterSpecialMode; Rectangle maPresArea; bool mbMouseAutoHide; bool mbMouseCursorHidden; - ULONG mnFirstMouseMove; + sal_uLong mnFirstMouseMove; DECL_LINK( PauseTimeoutHdl, Timer* pTimer ); DECL_LINK( MouseTimeoutHdl, Timer* pTimer ); diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index a17fdea1cd98..464aa4fe76e7 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -61,6 +61,7 @@ #include "FactoryIds.hxx" #include "ViewShell.hxx" #include "SlideShowRestarter.hxx" +#include "DrawController.hxx" #include <boost/bind.hpp> using ::com::sun::star::presentation::XSlideShowController; @@ -715,7 +716,7 @@ void SAL_CALL SlideShow::end() throw(RuntimeException) WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetTopFrame().GetWindow().GetParent()); if( pWorkWindow ) { - pWorkWindow->StartPresentationMode( FALSE, isAlwaysOnTop() ); + pWorkWindow->StartPresentationMode( sal_False, isAlwaysOnTop() ); } } } @@ -754,7 +755,7 @@ void SAL_CALL SlideShow::end() throw(RuntimeException) framework::FrameworkHelper::GetViewURL(ePreviousType), framework::FrameworkHelper::msCenterPaneURL); - pViewShell->GetViewFrame()->GetBindings().InvalidateAll( TRUE ); + pViewShell->GetViewFrame()->GetBindings().InvalidateAll( sal_True ); } } } @@ -773,7 +774,17 @@ void SAL_CALL SlideShow::end() throw(RuntimeException) // switch to the previously visible Slide DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>( pViewShell ); if( pDrawViewShell ) - pDrawViewShell->SwitchPage( (USHORT)xController->getRestoreSlide() ); + pDrawViewShell->SwitchPage( (sal_uInt16)xController->getRestoreSlide() ); + else + { + Reference<XDrawView> xDrawView ( + Reference<XWeak>(&mpCurrentViewShellBase->GetDrawController()), UNO_QUERY); + if (xDrawView.is()) + xDrawView->setCurrentPage( + Reference<XDrawPage>( + mpDoc->GetSdPage(xController->getRestoreSlide(), PK_STANDARD)->getUnoPage(), + UNO_QUERY)); + } } if( pViewShell->GetDoc()->IsStartWithPresentation() ) @@ -1198,9 +1209,9 @@ void SlideShow::StartFullscreenPresentation( ) // fullscreen. const sal_Int32 nDisplay (GetDisplay()); WorkWindow* pWorkWindow = new FullScreenWorkWindow(this, mpCurrentViewShellBase); - pWorkWindow->StartPresentationMode( TRUE, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PRESENTATION_HIDEALLAPPS : 0, nDisplay); - // pWorkWindow->ShowFullScreenMode(FALSE, nDisplay); pWorkWindow->SetBackground(Wallpaper(COL_BLACK)); + pWorkWindow->StartPresentationMode( sal_True, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PRESENTATION_HIDEALLAPPS : 0, nDisplay); + // pWorkWindow->ShowFullScreenMode(sal_False, nDisplay); if (pWorkWindow->IsVisible()) { @@ -1218,7 +1229,7 @@ void SlideShow::StartFullscreenPresentation( ) // new view shell--a prerequisite to process slot calls and initialize // its panes--a GrabFocus() has to be called later on. SfxFrame* pNewFrame = SfxFrame::Create( *mpDoc->GetDocSh(), *pWorkWindow, PRESENTATION_FACTORY_ID, true ); - pNewFrame->SetPresentationMode(TRUE); + pNewFrame->SetPresentationMode(sal_True); mpFullScreenViewShellBase = static_cast<ViewShellBase*>(pNewFrame->GetCurrentViewFrame()->GetViewShell()); if(mpFullScreenViewShellBase != NULL) diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc index 709e2a79146e..f086f52cb73f 100644..100755 --- a/sd/source/ui/slideshow/slideshow.hrc +++ b/sd/source/ui/slideshow/slideshow.hrc @@ -37,25 +37,20 @@ #define CM_ENDSHOW 7 #define CM_FIRST_SLIDE 8 #define CM_LAST_SLIDE 9 -#define CM_SLIDES 10 + //CM for extra presenter UI -#define CM_ERASE_ALLINK 11 -#define CM_ERASE_INK 12 -#define CM_ERASE_INK_PEN 13 -#define CM_ERASE_INK_PEN_VERY_THIN 14 -#define CM_ERASE_INK_PEN_THIN 15 -#define CM_ERASE_INK_PEN_NORMAL 16 -#define CM_ERASE_INK_PEN_THICK 17 -#define CM_ERASE_INK_PEN_VERY_THICK 18 -#define CM_COLOR_PEN 19 -#define CM_WIDTH_PEN 20 -#define CM_WIDTH_PEN_VERY_THIN 21 -#define CM_WIDTH_PEN_THIN 22 -#define CM_WIDTH_PEN_NORMAL 23 -#define CM_WIDTH_PEN_THICK 24 -#define CM_WIDTH_PEN_VERY_THICK 25 -#define CM_PEN_MODE 26 -#define CM_ERASE_MODE 27 -#define CM_POINTER_OPTION 28 +#define CM_ERASE_ALLINK 10 +#define CM_COLOR_PEN 11 +#define CM_WIDTH_PEN 12 +#define CM_WIDTH_PEN_VERY_THIN 13 +#define CM_WIDTH_PEN_THIN 14 +#define CM_WIDTH_PEN_NORMAL 15 +#define CM_WIDTH_PEN_THICK 16 +#define CM_WIDTH_PEN_VERY_THICK 17 +#define CM_PEN_MODE 18 +#define CM_ERASE_MODE 19 +#define CM_POINTER_OPTION 20 + +#define CM_SLIDES 21 // this must be the last id! #endif diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index 02c225fb5ea9..78cd2aae0d9f 100644..100755 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -71,20 +71,10 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Separator = TRUE; }; -#ifdef ENABLE_PRESENTER_EXTRA_UI MenuItem { Identifier = CM_PEN_MODE; - Text [ en-US ] = "~Pen Mode"; - }; - MenuItem - { - Identifier = CM_ERASE_MODE; - Text [ en-US ] = "~Eraser Mode"; - }; - MenuItem - { - Separator = TRUE; + Text [ en-US ] = "Mouse pointer as ~pen"; }; MenuItem { @@ -124,20 +114,8 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; MenuItem { - Separator = TRUE; - }; - MenuItem - { Identifier = CM_COLOR_PEN ; - Text [ en-US ] = "~Change Pen Color" ; - }; - MenuItem - { - Separator = TRUE; - }; - MenuItem - { - Separator = TRUE; + Text [ en-US ] = "~Change Pen Color..." ; }; MenuItem { @@ -150,48 +128,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; MenuItem { - Identifier = CM_ERASE_INK_PEN; - Text [ en-US ] = "~Eraser Width" ; - - SubMenu = Menu - { - ItemList = - { - MenuItem - { - Identifier = CM_ERASE_INK_PEN_VERY_THIN; - Text [ en-US ] = "~Very thin"; - }; - MenuItem - { - Identifier = CM_ERASE_INK_PEN_THIN; - Text [ en-US ] = "~Thin"; - }; - MenuItem - { - Identifier = CM_ERASE_INK_PEN_NORMAL; - Text [ en-US ] = "~Normal"; - }; - MenuItem - { - Identifier = CM_ERASE_INK_PEN_THICK; - Text [ en-US ] = "~Thick"; - }; - MenuItem - { - Identifier = CM_ERASE_INK_PEN_VERY_THICK; - Text [ en-US ] = "~Very Thick"; - }; - }; - }; - }; -#endif - MenuItem - { - Separator = TRUE; - }; - MenuItem - { Identifier = CM_SCREEN; Text [ en-US ] = "~Screen" ; @@ -216,6 +152,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Identifier = CM_ENDSHOW ; Text [ en-US ] = "~End Show" ; - }; + }; }; }; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 63bce31f8cb8..8fcf76f2f728 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -115,7 +115,7 @@ namespace sd // Slots, welche im Sfx verwaltet werden und in der SlideShow disabled // werden sollen (muss in Reihenfolge der SIDs geordnet sein) -static USHORT const pAllowed[] = +static sal_uInt16 const pAllowed[] = { SID_OPENDOC , // 5501 // damit interne Spruenge klappen SID_JUMPTOMARK , // 5598 @@ -549,12 +549,11 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mbInputFreeze(false) , mbActive(sal_False) , maPresSettings( pDoc->getPresentationSettings() ) -, mnUserPaintColor( 0x00000000L ) //User paint color is Black by default -#ifdef ENABLE_PRESENTER_EXTRA_UI -, mbSwitchPenMode(true) +, mnUserPaintColor( 0x80ff0000L ) +, mbUsePen(false) +, mdUserPaintStrokeWidth ( 150.0 ) +#ifdef ENABLE_ERASER_UI , mbSwitchEraserMode(false) -, mdUserPaintStrokeWidth ( 4.0 ) -, mbEraseAllInk(false) , mnEraseInkSize(100) #endif , mnEntryCounter(0) @@ -585,10 +584,26 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, mbAutoSaveWasOn = true; Application::AddEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) ); + + mbUsePen = maPresSettings.mbMouseAsPen; + + SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); + if( pOptions ) + { + mnUserPaintColor = pOptions->GetPresentationPenColor(); + mdUserPaintStrokeWidth = pOptions->GetPresentationPenWidth(); + } } SlideshowImpl::~SlideshowImpl() { + SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); + if( pOptions ) + { + pOptions->SetPresentationPenColor(mnUserPaintColor); + pOptions->SetPresentationPenWidth(mdUserPaintStrokeWidth); + } + Application::RemoveEventListener( LINK( this, SlideshowImpl, EventListenerHdl ) ); maDeactivateTimer.Stop(); @@ -670,7 +685,7 @@ void SAL_CALL SlideshowImpl::disposing() mpView->DeleteWindowFromPaintView( mpShowWindow ); if( mpView ) - mpView->SetAnimationPause( FALSE ); + mpView->SetAnimationPause( sal_False ); if( mpViewShell ) { @@ -748,7 +763,7 @@ void SAL_CALL SlideshowImpl::disposing() // restart the custom show dialog if he started us if( mpViewShell->IsStartShowWithDialog() && getDispatcher() ) { - mpViewShell->SetStartShowWithDialog( FALSE ); + mpViewShell->SetStartShowWithDialog( sal_False ); getDispatcher()->Execute( SID_CUSTOMSHOW_DLG, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD ); } @@ -832,7 +847,7 @@ bool SlideshowImpl::startPreview( if( mpView ) { mpView->AddWindowToPaintView( mpShowWindow ); - mpView->SetAnimationPause( TRUE ); + mpView->SetAnimationPause( sal_True ); } // call resize handler @@ -939,7 +954,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) { // we are in notes page mode, so get // the corresponding draw page - const USHORT nPgNum = ( pStartPage->GetPageNum() - 2 ) >> 1; + const sal_uInt16 nPgNum = ( pStartPage->GetPageNum() - 2 ) >> 1; pStartPage = mpDoc->GetSdPage( nPgNum, PK_STANDARD ); } } @@ -981,7 +996,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) sal_Int32 nSlide; for( nSlide = 0; (nSlide < nSlideCount); nSlide++ ) { - if( mpDoc->GetSdPage( (USHORT) nSlide, PK_STANDARD )->GetName() == aPresSlide ) + if( mpDoc->GetSdPage( (sal_uInt16) nSlide, PK_STANDARD )->GetName() == aPresSlide ) break; } @@ -1020,7 +1035,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) // these Slots are forbiden in other views for this document if( mpDocSh ) { - mpDocSh->SetSlotFilter( TRUE, sizeof( pAllowed ) / sizeof( USHORT ), pAllowed ); + mpDocSh->SetSlotFilter( sal_True, sizeof( pAllowed ) / sizeof( sal_uInt16 ), pAllowed ); mpDocSh->ApplySlotFilter(); } @@ -1054,7 +1069,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) if( mpView ) { mpView->AddWindowToPaintView( mpShowWindow ); - mpView->SetAnimationPause( TRUE ); + mpView->SetAnimationPause( sal_True ); } SfxBindings* pBindings = getBindings(); @@ -1095,13 +1110,20 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) -1, Any( maPresSettings.mbManual != sal_False ), beans::PropertyState_DIRECT_VALUE ) ); - if( maPresSettings.mbMouseAsPen ) + if( mbUsePen ) { aProperties.push_back( beans::PropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ), // User paint color is black by default. - -1, Any( static_cast<sal_Int32>(0x00000000L) ), + -1, Any( mnUserPaintColor ), + beans::PropertyState_DIRECT_VALUE ) ); + + aProperties.push_back( + beans::PropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintStrokeWidth") ), + // User paint color is black by default. + -1, Any( mdUserPaintStrokeWidth ), beans::PropertyState_DIRECT_VALUE ) ); } @@ -1201,13 +1223,15 @@ void SlideshowImpl::onFirstPaint() { if( mpShowWindow ) { + /* mpShowWindow->SetBackground( Wallpaper( Color( COL_BLACK ) ) ); mpShowWindow->Erase(); mpShowWindow->SetBackground(); + */ } SolarMutexGuard aSolarGuard; - maUpdateTimer.SetTimeout( (ULONG)100 ); + maUpdateTimer.SetTimeout( (sal_uLong)100 ); maUpdateTimer.Start(); } @@ -1430,14 +1454,14 @@ void SlideshowImpl::displayCurrentSlide (const bool bSkipAllMainSequenceEffects) void SlideshowImpl::endPresentation() { -#ifdef ENABLE_PRESENTER_EXTRA_UI +/* if( maPresSettings.mbMouseAsPen) { Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY ); if( xDocFactory.is() ) mxShow->registerUserPaintPolygons(xDocFactory); } -#endif +*/ if( !mnEndShowEvent ) mnEndShowEvent = Application::PostUserEvent( LINK(this, SlideshowImpl, endPresentationHdl) ); } @@ -1610,7 +1634,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape, const ::com::sun:: if( INET_PROT_FILE == aURL.GetProtocol() ) { SfxStringItem aUrl( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::NO_DECODE ) ); - SfxBoolItem aBrowsing( SID_BROWSE, TRUE ); + SfxBoolItem aBrowsing( SID_BROWSE, sal_True ); SfxViewFrame* pViewFrm = SfxViewFrame::Current(); if (pViewFrm) @@ -1673,9 +1697,9 @@ void SlideshowImpl::click( const Reference< XShape >& xShape, const ::com::sun:: sal_Int32 SlideshowImpl::getSlideNumberForBookmark( const OUString& rStrBookmark ) { - BOOL bIsMasterPage; + sal_Bool bIsMasterPage; OUString aBookmark = getUiNameFromPageApiNameImpl( rStrBookmark ); - USHORT nPgNum = mpDoc->GetPageByName( aBookmark, bIsMasterPage ); + sal_uInt16 nPgNum = mpDoc->GetPageByName( aBookmark, bIsMasterPage ); if( nPgNum == SDRPAGE_NOTFOUND ) { @@ -1685,7 +1709,7 @@ sal_Int32 SlideshowImpl::getSlideNumberForBookmark( const OUString& rStrBookmark if( pObj ) { nPgNum = pObj->GetPage()->GetPageNum(); - bIsMasterPage = (BOOL)pObj->GetPage()->IsMasterPage(); + bIsMasterPage = (sal_Bool)pObj->GetPage()->IsMasterPage(); } } @@ -1913,13 +1937,13 @@ sal_Int32 SlideshowImpl::updateSlideShow (void) // Make sure that the maximum frame count has not been set // too high (only then conversion to milliseconds and long // integer may lead to zero value.) - OSL_ASSERT(static_cast<ULONG>(fUpdate * 1000.0) > 0); + OSL_ASSERT(static_cast<sal_uLong>(fUpdate * 1000.0) > 0); Application::EnableNoYieldMode(false); Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); // Use a timer for the asynchronous callback. - maUpdateTimer.SetTimeout(static_cast<ULONG>(fUpdate * 1000.0)); + maUpdateTimer.SetTimeout(static_cast<sal_uLong>(fUpdate * 1000.0)); maUpdateTimer.Start(); } } @@ -2170,16 +2194,8 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) PopupMenu* pMenu = new PopupMenu( SdResId( RID_SLIDESHOW_CONTEXTMENU ) ); -#ifdef ENABLE_PRESENTER_EXTRA_UI - //adding button to contextual menu for erasing functionnalities for UserPaintOverlay - pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen)); - // Adding button to contextual menu for changing pen color - pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen)); // Adding button to display if in Pen mode - pMenu->EnableItem( CM_PEN_MODE, (maPresSettings.mbMouseAsPen)); - // Adding button to displau if in Erase Mode - pMenu->EnableItem( CM_ERASE_MODE, (maPresSettings.mbMouseAsPen)); -#endif + pMenu->CheckItem( CM_PEN_MODE, mbUsePen); const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) ); @@ -2193,13 +2209,13 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) Reference< ::com::sun::star::frame::XFrame > xFrame( pViewFrame->GetFrame().GetFrameInterface() ); if( xFrame.is() ) { - pMenu->SetItemImage( CM_NEXT_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10617") ), FALSE ) ); - pMenu->SetItemImage( CM_PREV_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10618") ), FALSE ) ); + pMenu->SetItemImage( CM_NEXT_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10617") ), sal_False ) ); + pMenu->SetItemImage( CM_PREV_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10618") ), sal_False ) ); if( pPageMenu ) { - pPageMenu->SetItemImage( CM_FIRST_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10616") ), FALSE ) ); - pPageMenu->SetItemImage( CM_LAST_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10619") ), FALSE ) ); + pPageMenu->SetItemImage( CM_FIRST_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10616") ), sal_False ) ); + pPageMenu->SetItemImage( CM_LAST_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10619") ), sal_False ) ); } } } @@ -2210,7 +2226,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) const sal_Int32 nPageNumberCount = mpSlideController->getSlideNumberCount(); if( nPageNumberCount <= 1 ) { - pMenu->EnableItem( CM_GOTO, FALSE ); + pMenu->EnableItem( CM_GOTO, sal_False ); } else { @@ -2227,12 +2243,12 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) { if( mpSlideController->isVisibleSlideNumber( nPageNumber ) ) { - SdPage* pPage = mpDoc->GetSdPage((USHORT)nPageNumber, PK_STANDARD); + SdPage* pPage = mpDoc->GetSdPage((sal_uInt16)nPageNumber, PK_STANDARD); if (pPage) { - pPageMenu->InsertItem( (USHORT)(CM_SLIDES + nPageNumber), pPage->GetName() ); + pPageMenu->InsertItem( (sal_uInt16)(CM_SLIDES + nPageNumber), pPage->GetName() ); if( nPageNumber == nCurrentSlideNumber ) - pPageMenu->CheckItem( (USHORT)(CM_SLIDES + nPageNumber) ); + pPageMenu->CheckItem( (sal_uInt16)(CM_SLIDES + nPageNumber) ); } } } @@ -2247,105 +2263,44 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) pBlankMenu->CheckItem( ( mpShowWindow->GetBlankColor() == Color( COL_WHITE ) ) ? CM_SCREEN_WHITE : CM_SCREEN_BLACK ); } } -#ifdef ENABLE_PRESENTER_EXTRA_UI PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN); // populate color width list if( pWidthMenu ) { - if(! maPresSettings.mbMouseAsPen) - { - pMenu->EnableItem( CM_WIDTH_PEN, FALSE ); - } - else - { - sal_Int32 nIterator; - double nWidth; - - nWidth = 4.0; - for( nIterator = 1; nIterator < 6; nIterator++) - { - switch(nIterator) - { - case 1: - nWidth = 4.0; - break; - case 2: - nWidth = 100.0; - break; - case 3: - nWidth = 150.0; - break; - case 4: - nWidth = 200.0; - break; - case 5: - nWidth = 400.0; - break; - default: - break; - } + sal_Int32 nIterator; + double nWidth; - pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE); - if( nWidth == mdUserPaintStrokeWidth) - pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) ); - - } - } - } - - - PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN); - - // populate eraser width list - if( pEraseWidthMenu ) - { - if(! maPresSettings.mbMouseAsPen) + nWidth = 4.0; + for( nIterator = 1; nIterator < 6; nIterator++) { - pMenu->EnableItem( CM_ERASE_INK_PEN, FALSE ); - } - else - { - sal_Int32 nEIterator; - double nEWidth; - - nEWidth = 100.0; - for( nEIterator = 1; nEIterator < 6; nEIterator++) + switch(nIterator) { - switch(nEIterator) - { - case 1: - nEWidth = 100.0; - break; - case 2: - nEWidth = 200.0; - break; - case 3: - nEWidth = 300.0; - break; - case 4: - nEWidth = 400.0; - break; - case 5: - nEWidth = 500.0; - break; - default: - break; - } - - pEraseWidthMenu->EnableItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator), TRUE); - if( nEWidth == mnEraseInkSize) - pEraseWidthMenu->CheckItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator) ); - if( mbSwitchPenMode ) - pMenu->CheckItem( (USHORT)(CM_PEN_MODE)); - if( mbSwitchEraserMode ) - pMenu->CheckItem( (USHORT)(CM_ERASE_MODE)); - + case 1: + nWidth = 4.0; + break; + case 2: + nWidth = 100.0; + break; + case 3: + nWidth = 150.0; + break; + case 4: + nWidth = 200.0; + break; + case 5: + nWidth = 400.0; + break; + default: + break; } + + pWidthMenu->EnableItem( (sal_uInt16)(CM_WIDTH_PEN + nIterator), sal_True); + if( nWidth == mdUserPaintStrokeWidth) + pWidthMenu->CheckItem( (sal_uInt16)(CM_WIDTH_PEN + nIterator) ); } } -#endif pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) ); pMenu->Execute( mpShowWindow, maPopupMousePos ); @@ -2409,139 +2364,93 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; -#ifdef ENABLE_PRESENTER_EXTRA_UI - if( maPresSettings.mbMouseAsPen ) - { - case CM_COLOR_PEN: - { - //Open a color picker based on SvColorDialog - ::Color aColor( mnUserPaintColor ); - SvColorDialog aColorDlg( mpShowWindow); - aColorDlg.SetColor( aColor ); - - if (aColorDlg.Execute() ) - { - aColor = aColorDlg.GetColor(); - mnUserPaintColor = aColor.GetColor(); - setPenColor(mnUserPaintColor); - } - mbWasPaused = false; - } - break; - - case CM_WIDTH_PEN_VERY_THIN: - { - setPenWidth(4.0); - mbWasPaused = false; - } - break; - - case CM_WIDTH_PEN_THIN: - { - setPenWidth(100.0); - mbWasPaused = false; - } - break; + case CM_COLOR_PEN: + { + //Open a color picker based on SvColorDialog + ::Color aColor( mnUserPaintColor ); + SvColorDialog aColorDlg( mpShowWindow); + aColorDlg.SetColor( aColor ); - case CM_WIDTH_PEN_NORMAL: + if (aColorDlg.Execute() ) { - setPenWidth(150.0); - mbWasPaused = false; + aColor = aColorDlg.GetColor(); + setPenColor(aColor.GetColor()); } - break; + mbWasPaused = false; + } + break; - case CM_WIDTH_PEN_THICK: - { - setPenWidth(200.0); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_VERY_THIN: + { + setPenWidth(4.0); + mbWasPaused = false; + } + break; - case CM_WIDTH_PEN_VERY_THICK: - { - setPenWidth(400.0); - mbWasPaused = false; - } - break; - case CM_ERASE_ALLINK: - { - setEraseAllInk(true); - mbWasPaused = false; - } - break; - case CM_PEN_MODE: - { - setPenMode(true); - mbWasPaused = false; - } - break; - case CM_ERASE_MODE: - { - setEraserMode(true); - mbWasPaused = false; - } - break; - case CM_ERASE_INK_PEN_VERY_THIN: - { - setEraseInk(100); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_THIN: + { + setPenWidth(100.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_THIN: - { - setEraseInk(200); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_NORMAL: + { + setPenWidth(150.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_NORMAL: - { - setEraseInk(300); - mbWasPaused = false; - } - break; + case CM_WIDTH_PEN_THICK: + { + setPenWidth(200.0); + mbWasPaused = false; + } + break; - case CM_ERASE_INK_PEN_THICK: - { - setEraseInk(400); - mbWasPaused = false; - } - break; - case CM_ERASE_INK_PEN_VERY_THICK: - { - setEraseInk(500); + case CM_WIDTH_PEN_VERY_THICK: + { + setPenWidth(400.0); + mbWasPaused = false; + } + break; + case CM_ERASE_ALLINK: + { + setEraseAllInk(true); mbWasPaused = false; - } - break; - } -#endif - - case CM_ENDSHOW: - // in case the user cancels the presentation, switch to current slide - // in edit mode - if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) - { - if( mpSlideController->getCurrentSlideNumber() != -1 ) - { - mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); - } - } - endPresentation(); - break; - default: - sal_Int32 nPageNumber = nMenuId - CM_SLIDES; - const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); - if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) - { - mpShowWindow->RestartShow( nPageNumber ); - } - else if( nPageNumber != mpSlideController->getCurrentSlideNumber() ) + } + break; + case CM_PEN_MODE: + { + setUsePen(!mbUsePen); + mbWasPaused = false; + } + break; + case CM_ENDSHOW: + // in case the user cancels the presentation, switch to current slide + // in edit mode + if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) + { + if( mpSlideController->getCurrentSlideNumber() != -1 ) { - displaySlideNumber( nPageNumber ); + mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); } - mbWasPaused = false; - break; + } + endPresentation(); + break; + default: + sal_Int32 nPageNumber = nMenuId - CM_SLIDES; + const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); + if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) + { + mpShowWindow->RestartShow( nPageNumber ); + } + else if( nPageNumber != mpSlideController->getCurrentSlideNumber() ) + { + displaySlideNumber( nPageNumber ); + } + mbWasPaused = false; + break; } } @@ -2613,16 +2522,16 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons if( rPresSlide.Len() ) { sal_Int32 nSlide; - BOOL bTakeNextAvailable = FALSE; + sal_Bool bTakeNextAvailable = sal_False; for( nSlide = 0, nFirstSlide = -1; ( nSlide < nSlideCount ) && ( -1 == nFirstSlide ); nSlide++ ) { - SdPage* pTestSlide = mpDoc->GetSdPage( (USHORT)nSlide, PK_STANDARD ); + SdPage* pTestSlide = mpDoc->GetSdPage( (sal_uInt16)nSlide, PK_STANDARD ); if( pTestSlide->GetName() == rPresSlide ) { if( pTestSlide->IsExcluded() ) - bTakeNextAvailable = TRUE; + bTakeNextAvailable = sal_True; else nFirstSlide = nSlide; } @@ -2637,7 +2546,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons for( sal_Int32 i = 0; i < nSlideCount; i++ ) { - bool bVisible = ( mpDoc->GetSdPage( (USHORT)i, PK_STANDARD ) )->IsExcluded() ? false : true; + bool bVisible = ( mpDoc->GetSdPage( (sal_uInt16)i, PK_STANDARD ) )->IsExcluded() ? false : true; if( bVisible || (eMode == AnimationSlideController::ALL) ) mpSlideController->insertSlideNumber( i, bVisible ); } @@ -2650,18 +2559,18 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons { sal_Int32 nSlide; for( nSlide = 0; nSlide < nSlideCount; nSlide++ ) - if( rPresSlide == mpDoc->GetSdPage( (USHORT) nSlide, PK_STANDARD )->GetName() ) + if( rPresSlide == mpDoc->GetSdPage( (sal_uInt16) nSlide, PK_STANDARD )->GetName() ) break; if( nSlide < nSlideCount ) - mpSlideController->insertSlideNumber( (USHORT) nSlide ); + mpSlideController->insertSlideNumber( (sal_uInt16) nSlide ); } void* pCustomSlide; sal_Int32 nSlideIndex; for( pCustomSlide = pCustomShow->First(),nSlideIndex=0; pCustomSlide; pCustomSlide = pCustomShow->Next(), nSlideIndex++ ) { - const USHORT nSdSlide = ( ( (SdPage*) pCustomSlide )->GetPageNum() - 1 ) / 2; + const sal_uInt16 nSdSlide = ( ( (SdPage*) pCustomSlide )->GetPageNum() - 1 ) / 2; if( !( mpDoc->GetSdPage( nSdSlide, PK_STANDARD ) )->IsExcluded()) mpSlideController->insertSlideNumber( nSdSlide ); @@ -2672,7 +2581,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons // --------------------------------------------------------- -typedef USHORT (*FncGetChildWindowId)(); +typedef sal_uInt16 (*FncGetChildWindowId)(); FncGetChildWindowId aShowChilds[] = { @@ -2703,13 +2612,13 @@ void SlideshowImpl::hideChildWindows() if( pViewFrame->GetChildWindow( SID_NAVIGATOR ) != NULL ) mnChildMask |= NAVIGATOR_CHILD_MASK; - for( ULONG i = 0, nCount = sizeof( aShowChilds ) / sizeof( FncGetChildWindowId ); i < nCount; i++ ) + for( sal_uLong i = 0, nCount = sizeof( aShowChilds ) / sizeof( FncGetChildWindowId ); i < nCount; i++ ) { - const USHORT nId = ( *aShowChilds[ i ] )(); + const sal_uInt16 nId = ( *aShowChilds[ i ] )(); if( pViewFrame->GetChildWindow( nId ) ) { - pViewFrame->SetChildWindow( nId, FALSE ); + pViewFrame->SetChildWindow( nId, sal_False ); mnChildMask |= 1 << i; } } @@ -2728,10 +2637,10 @@ void SlideshowImpl::showChildWindows() { pViewFrame->SetChildWindow( SID_NAVIGATOR, ( mnChildMask & NAVIGATOR_CHILD_MASK ) != 0 ); - for( ULONG i = 0, nCount = sizeof( aShowChilds ) / sizeof( FncGetChildWindowId ); i < nCount; i++ ) + for( sal_uLong i = 0, nCount = sizeof( aShowChilds ) / sizeof( FncGetChildWindowId ); i < nCount; i++ ) { if( mnChildMask & ( 1 << i ) ) - pViewFrame->SetChildWindow( ( *aShowChilds[ i ] )(), TRUE ); + pViewFrame->SetChildWindow( ( *aShowChilds[ i ] )(), sal_True ); } } } @@ -2848,11 +2757,11 @@ void SAL_CALL SlideshowImpl::activate() throw (RuntimeException) if( pDispatcher ) { // filter all forbiden slots - pDispatcher->SetSlotFilter( TRUE, sizeof(pAllowed) / sizeof(USHORT), pAllowed ); + pDispatcher->SetSlotFilter( sal_True, sizeof(pAllowed) / sizeof(sal_uInt16), pAllowed ); } if( getBindings() ) - getBindings()->InvalidateAll(TRUE); + getBindings()->InvalidateAll(sal_True); mpShowWindow->GrabFocus(); } @@ -2915,7 +2824,7 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq) switch ( rReq.GetSlot() ) { case SID_NAVIGATOR_PEN: - setUsePen(!maPresSettings.mbMouseAsPen); + setUsePen(!mbUsePen); break; case SID_NAVIGATOR_PAGE: @@ -2937,8 +2846,8 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq) const String aTarget( ((SfxStringItem&) pArgs->Get(SID_NAVIGATOR_OBJECT)).GetValue() ); // is the bookmark a Slide? - BOOL bIsMasterPage; - USHORT nPgNum = mpDoc->GetPageByName( aTarget, bIsMasterPage ); + sal_Bool bIsMasterPage; + sal_uInt16 nPgNum = mpDoc->GetPageByName( aTarget, bIsMasterPage ); SdrObject* pObj = NULL; if( nPgNum == SDRPAGE_NOTFOUND ) @@ -3101,7 +3010,7 @@ void SAL_CALL SlideshowImpl::setMouseVisible( sal_Bool bVisible ) throw (Runtime sal_Bool SAL_CALL SlideshowImpl::getUsePen() throw (RuntimeException) { SolarMutexGuard aSolarGuard; - return maPresSettings.mbMouseAsPen; + return mbUsePen; } // -------------------------------------------------------------------- @@ -3109,93 +3018,38 @@ sal_Bool SAL_CALL SlideshowImpl::getUsePen() throw (RuntimeException) void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeException) { SolarMutexGuard aSolarGuard; - maPresSettings.mbMouseAsPen = bMouseAsPen; + mbUsePen = bMouseAsPen; if( mxShow.is() ) try { - // For Pencolor; + // For Pencolor; Any aValue; - if( maPresSettings.mbMouseAsPen ) - // TODO: take color from configuration - aValue <<= mnUserPaintColor; + if( mbUsePen ) + aValue <<= mnUserPaintColor; beans::PropertyValue aPenProp; aPenProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintColor" )); aPenProp.Value = aValue; mxShow->setProperty( aPenProp ); -#ifdef ENABLE_PRESENTER_EXTRA_UI - //for StrokeWidth : - Any aValueWidth; - if( maPresSettings.mbMouseAsPen ) - aValueWidth <<= mdUserPaintStrokeWidth; - - beans::PropertyValue aPenPropWidth; - aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" )); - aPenPropWidth.Value = aValueWidth; - - mxShow->setProperty( aPenPropWidth ); - - // for Pen Mode - Any aValueSwitchPenMode; - if( maPresSettings.mbMouseAsPen ) - aValueSwitchPenMode <<= mbSwitchPenMode; - beans::PropertyValue aPenPropSwitchPenMode; - aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" )); - aPenPropSwitchPenMode.Value = aValueSwitchPenMode; - mxShow->setProperty( aPenPropSwitchPenMode ); - - //for EraseAllInk : - Any aValueEraseAllInk; - if( maPresSettings.mbMouseAsPen ) - aValueEraseAllInk <<= mbEraseAllInk; - beans::PropertyValue aPenPropEraseAllInk; - aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); - aPenPropEraseAllInk.Value = aValueEraseAllInk; - mxShow->setProperty( aPenPropEraseAllInk ); - mbEraseAllInk = false; // sets to false so not to have it applied again -#endif - } - catch( Exception& e ) - { - static_cast<void>(e); - DBG_ERROR( - (OString("sd::SlideshowImpl::setUsePen(), " - "exception caught: ") + - rtl::OUStringToOString( - comphelper::anyToString( cppu::getCaughtException() ), - RTL_TEXTENCODING_UTF8 )).getStr() ); - } -} -#ifdef ENABLE_PRESENTER_EXTRA_UI -void SAL_CALL SlideshowImpl::setUseEraser( sal_Bool bMouseAsPen ) throw (RuntimeException) -{ - SolarMutexGuard aSolarGuard; - maPresSettings.mbMouseAsPen = bMouseAsPen; - if( mxShow.is() ) try - { + //for StrokeWidth : + if( mbUsePen ) + { + beans::PropertyValue aPenPropWidth; + aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" )); + aPenPropWidth.Value <<= mdUserPaintStrokeWidth; + mxShow->setProperty( aPenPropWidth ); - //for EraseInk : - Any aValueEraseInk; - if( maPresSettings.mbMouseAsPen ) - aValueEraseInk <<= mnEraseInkSize; - beans::PropertyValue aPenPropEraseInk; - aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" )); - aPenPropEraseInk.Value = aValueEraseInk; - mxShow->setProperty( aPenPropEraseInk ); - - // for Erase Mode - Any aValueSwitchEraserMode; - if( maPresSettings.mbMouseAsPen ) - aValueSwitchEraserMode <<= mbSwitchEraserMode; - beans::PropertyValue aPenPropSwitchEraserMode; - aPenPropSwitchEraserMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchEraserMode" )); - aPenPropSwitchEraserMode.Value = aValueSwitchEraserMode; - mxShow->setProperty( aPenPropSwitchEraserMode ); + // for Pen Mode + beans::PropertyValue aPenPropSwitchPenMode; + aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" )); + aPenPropSwitchPenMode.Value <<= sal_True; + mxShow->setProperty( aPenPropSwitchPenMode ); + } } catch( Exception& e ) { static_cast<void>(e); DBG_ERROR( - (OString("sd::SlideshowImpl::setUseEraser(), " + (OString("sd::SlideshowImpl::setUsePen(), " "exception caught: ") + rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), @@ -3217,12 +3071,9 @@ void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeEx { SolarMutexGuard aSolarGuard; mdUserPaintStrokeWidth = dStrokeWidth; - mbSwitchPenMode = true; - mbSwitchEraserMode = !mbSwitchPenMode; - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update color and width + setUsePen( true ); // enable pen mode, update color and width } -#endif + // -------------------------------------------------------------------- sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException) @@ -3237,71 +3088,59 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep { SolarMutexGuard aSolarGuard; mnUserPaintColor = nColor; -#ifdef ENABLE_PRESENTER_EXTRA_UI - mbSwitchPenMode = true; - mbSwitchEraserMode = !mbSwitchPenMode; -#endif - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update color + setUsePen( true ); // enable pen mode, update color } -#ifdef ENABLE_PRESENTER_EXTRA_UI // -------------------------------------------------------------------- -void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setUseEraser( ::sal_Bool /*_usepen*/ ) throw (css::uno::RuntimeException) { - SolarMutexGuard aSolarGuard; - mbSwitchPenMode = bSwitchPenMode; - - if(mbSwitchPenMode == true){ - mbSwitchEraserMode = false; - }else{ - mbSwitchEraserMode = true; - } - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // Switch to Pen Mode - } -void SAL_CALL SlideshowImpl::setEraserMode(bool bSwitchEraserMode ) throw (RuntimeException) +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException) { SolarMutexGuard aSolarGuard; - mbSwitchEraserMode = bSwitchEraserMode; - if(mbSwitchEraserMode = true){ - mbSwitchPenMode = false; - }else{ - mbSwitchPenMode = true; - } - - if( maPresSettings.mbMouseAsPen ) - setUseEraser( sal_True ); // Switch to EraseMode + setUsePen( bSwitchPenMode ); // SwitchPen Mode } - // -------------------------------------------------------------------- -void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setEraseAllInk(bool bEraseAllInk) throw (RuntimeException) { - SolarMutexGuard aSolarGuard; - mbEraseAllInk=bEraseAllInk; - mbSwitchPenMode = true; - mbSwitchEraserMode = false; - if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update erase all ink bool + if( bEraseAllInk ) + { + SolarMutexGuard aSolarGuard; + if( mxShow.is() ) try + { + beans::PropertyValue aPenPropEraseAllInk; + aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); + aPenPropEraseAllInk.Value <<= bEraseAllInk; + mxShow->setProperty( aPenPropEraseAllInk ); + } + catch( Exception& e ) + { + static_cast<void>(e); + DBG_ERROR( + (OString("sd::SlideshowImpl::setEraseAllInk(), " + "exception caught: ") + + rtl::OUStringToOString( + comphelper::anyToString( cppu::getCaughtException() ), + RTL_TEXTENCODING_UTF8 )).getStr() ); + } + } } +void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 /*nEraseInkSize*/ ) throw (css::uno::RuntimeException) +{ +} -void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setEraserMode( bool /*bSwitchEraserMode*/ ) throw (css::uno::RuntimeException) { - SolarMutexGuard aSolarGuard; - mnEraseInkSize=nEraseInkSize; - mbSwitchPenMode = false; - mbSwitchEraserMode = true; - if( maPresSettings.mbMouseAsPen ) - setUseEraser( sal_True ); // update erase ink size } -#endif + // -------------------------------------------------------------------- // XSlideShowController Methods // -------------------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index ef8e2c2b9b28..612d91b263cf 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -195,7 +195,6 @@ public: virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException); virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException); -#ifdef ENABLE_PRESENTER_EXTRA_UI virtual void SAL_CALL setUseEraser( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException); virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException); @@ -203,7 +202,6 @@ public: virtual void SAL_CALL setEraseInk( sal_Int32 nEraseInkSize ) throw (css::uno::RuntimeException); virtual void SAL_CALL setPenMode( bool bSwitchPenMode) throw (css::uno::RuntimeException); virtual void SAL_CALL setEraserMode( bool bSwitchEraserMode ) throw (css::uno::RuntimeException); -#endif virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getSlideCount( ) throw (css::uno::RuntimeException); virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException); @@ -393,13 +391,9 @@ private: PresentationSettings maPresSettings; sal_Int32 mnUserPaintColor; -#ifdef ENABLE_PRESENTER_EXTRA_UI - bool mbSwitchPenMode; - bool mbSwitchEraserMode; + bool mbUsePen; double mdUserPaintStrokeWidth; - bool mbEraseAllInk; - sal_Int32 mnEraseInkSize; -#endif + /// used in updateHdl to prevent recursive calls sal_Int32 mnEntryCounter; @@ -417,8 +411,8 @@ private: ::std::auto_ptr<PaneHider> mpPaneHider; - ULONG mnEndShowEvent; - ULONG mnContextMenuEvent; + sal_uLong mnEndShowEvent; + sal_uLong mnContextMenuEvent; sal_Int32 mnUpdateEvent; css::uno::Reference< css::presentation::XPresentation2 > mxPresentation; |