diff options
-rw-r--r-- | include/vcl/wrkwin.hxx | 39 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshow.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/wrkwin.cxx | 18 |
3 files changed, 35 insertions, 26 deletions
diff --git a/include/vcl/wrkwin.hxx b/include/vcl/wrkwin.hxx index 9fa12281bc02..493779ae75e1 100644 --- a/include/vcl/wrkwin.hxx +++ b/include/vcl/wrkwin.hxx @@ -23,6 +23,7 @@ #include <tools/solar.h> #include <vcl/dllapi.h> #include <vcl/syswin.hxx> +#include <o3tl/typed_flags_set.hxx> namespace com { namespace sun { namespace star { namespace uno { class Any; }}}} struct SystemParentData; @@ -32,9 +33,17 @@ struct SystemParentData; // Presentation Flags -#define PRESENTATION_HIDEALLAPPS ((sal_uInt16)0x0001) -#define PRESENTATION_NOFULLSCREEN ((sal_uInt16)0x0002) -#define PRESENTATION_NOAUTOSHOW ((sal_uInt16)0x0004) +enum class PresentationFlags +{ + NONE = 0x0000, + HideAllApps = 0x0001, + NoFullScreen = 0x0002, + NoAutoShow = 0x0004, +}; +namespace o3tl +{ + template<> struct typed_flags<PresentationFlags> : is_typed_flags<PresentationFlags, 0x0007> {}; +} // - WorkWindow - @@ -43,11 +52,11 @@ struct SystemParentData; class VCL_DLLPUBLIC WorkWindow : public SystemWindow { private: - sal_uInt16 mnPresentationFlags; - bool mbPresentationMode:1, - mbPresentationVisible:1, - mbPresentationFull:1, - mbFullScreenMode:1; + PresentationFlags mnPresentationFlags; + bool mbPresentationMode:1, + mbPresentationVisible:1, + mbPresentationFull:1, + mbFullScreenMode:1; SAL_DLLPRIVATE void ImplInitWorkWindowData(); SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle, const ::com::sun::star::uno::Any& aSystemWorkWindowToken ); @@ -77,28 +86,28 @@ public: */ void ShowFullScreenMode( bool bFullScreenMode = true ); void EndFullScreenMode() { ShowFullScreenMode( false ); } - bool IsFullScreenMode() const { return mbFullScreenMode; } + bool IsFullScreenMode() const { return mbFullScreenMode; } void StartPresentationMode( bool bPresentation, - sal_uInt16 nFlags, + PresentationFlags nFlags, sal_Int32 nDisplayScreen ); /** @overload void StartPresentationMode( bool bPresentation, sal_uInt16 nFlags, sal_uInt32 nDisplayScreen) */ void StartPresentationMode( bool bPresentation = true, - sal_uInt16 nFlags = 0 ); + PresentationFlags nFlags = PresentationFlags::NONE ); void EndPresentationMode() { StartPresentationMode( false ); } - bool IsPresentationMode() const { return mbPresentationMode; } + bool IsPresentationMode() const { return mbPresentationMode; } - bool IsMinimized() const; + bool IsMinimized() const; - bool SetPluginParent( SystemParentData* pParent ); + bool SetPluginParent( SystemParentData* pParent ); void Minimize(); void Restore(); void Maximize( bool bMaximize = true ); - bool IsMaximized() const; + bool IsMaximized() const; }; #endif // INCLUDED_VCL_WRKWIN_HXX diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 36ca9d4b5eab..e3dd97c128bf 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -689,7 +689,7 @@ void SAL_CALL SlideShow::end() WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetTopFrame().GetWindow().GetParent()); if( pWorkWindow ) { - pWorkWindow->StartPresentationMode( false, isAlwaysOnTop() ? PRESENTATION_HIDEALLAPPS : 0 ); + pWorkWindow->StartPresentationMode( false, isAlwaysOnTop() ? PresentationFlags::HideAllApps : PresentationFlags::NONE ); } } } @@ -1161,7 +1161,7 @@ void SlideShow::StartFullscreenPresentation( ) const sal_Int32 nDisplay (GetDisplay()); VclPtr<WorkWindow> pWorkWindow = VclPtr<FullScreenWorkWindow>::Create(this, mpCurrentViewShellBase); pWorkWindow->SetBackground(Wallpaper(COL_BLACK)); - pWorkWindow->StartPresentationMode( true, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PRESENTATION_HIDEALLAPPS : 0, nDisplay); + pWorkWindow->StartPresentationMode( true, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PresentationFlags::HideAllApps : PresentationFlags::NONE, nDisplay); // pWorkWindow->ShowFullScreenMode(sal_False, nDisplay); if (pWorkWindow->IsVisible()) diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index 78d0b24951dd..3977eee0fbd4 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -36,7 +36,7 @@ void WorkWindow::ImplInitWorkWindowData() { mnIcon = 0; // Should be removed in the next top level update - now in SystemWindow - mnPresentationFlags = 0; + mnPresentationFlags = PresentationFlags::NONE; mbPresentationMode = false; mbPresentationVisible = false; mbPresentationFull = false; @@ -157,12 +157,12 @@ void WorkWindow::ShowFullScreenMode( bool bFullScreenMode, sal_Int32 nDisplayScr } } -void WorkWindow::StartPresentationMode( bool bPresentation, sal_uInt16 nFlags ) +void WorkWindow::StartPresentationMode( bool bPresentation, PresentationFlags nFlags ) { return StartPresentationMode( bPresentation, nFlags, GetScreenNumber()); } -void WorkWindow::StartPresentationMode( bool bPresentation, sal_uInt16 nFlags, sal_Int32 nDisplayScreen ) +void WorkWindow::StartPresentationMode( bool bPresentation, PresentationFlags nFlags, sal_Int32 nDisplayScreen ) { if ( !bPresentation == !mbPresentationMode ) return; @@ -174,18 +174,18 @@ void WorkWindow::StartPresentationMode( bool bPresentation, sal_uInt16 nFlags, s mbPresentationFull = mbFullScreenMode; mnPresentationFlags = nFlags; - if ( !(mnPresentationFlags & PRESENTATION_NOFULLSCREEN) ) + if ( !(mnPresentationFlags & PresentationFlags::NoFullScreen) ) ShowFullScreenMode( true, nDisplayScreen ); if ( !mbSysChild ) { - if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS ) + if ( mnPresentationFlags & PresentationFlags::HideAllApps ) mpWindowImpl->mpFrame->SetAlwaysOnTop( true ); - if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) ) + if ( !(mnPresentationFlags & PresentationFlags::NoAutoShow) ) ToTop(); mpWindowImpl->mpFrame->StartPresentation( true ); } - if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) ) + if ( !(mnPresentationFlags & PresentationFlags::NoAutoShow) ) Show(); } else @@ -194,7 +194,7 @@ void WorkWindow::StartPresentationMode( bool bPresentation, sal_uInt16 nFlags, s if ( !mbSysChild ) { mpWindowImpl->mpFrame->StartPresentation( false ); - if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS ) + if ( mnPresentationFlags & PresentationFlags::HideAllApps ) mpWindowImpl->mpFrame->SetAlwaysOnTop( false ); } ShowFullScreenMode( mbPresentationFull, nDisplayScreen ); @@ -202,7 +202,7 @@ void WorkWindow::StartPresentationMode( bool bPresentation, sal_uInt16 nFlags, s mbPresentationMode = false; mbPresentationVisible = false; mbPresentationFull = false; - mnPresentationFlags = 0; + mnPresentationFlags = PresentationFlags::NONE; } } |