Expose WorkWindow fullscreen mode via new XTopWindow3
...deriving from the existing XTopWindow2. (Exposing this functionality via UNO is useful e.g. for some embedded LOWA example application.) Change-Id: Ib92f75510b7a2ca26933ea35afcc78882a7804fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171403 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
This commit is contained in:
@@ -1901,6 +1901,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/awt,\
|
||||
XToolkitRobot \
|
||||
XTopWindow \
|
||||
XTopWindow2 \
|
||||
XTopWindow3 \
|
||||
XTopWindowListener \
|
||||
XUnitConversion \
|
||||
XUnoControlContainer \
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
module com { module sun { module star { module awt {
|
||||
|
||||
/** extends XTopWindow with additional functionality
|
||||
|
||||
@since LibreOffice 25.2
|
||||
*/
|
||||
interface XTopWindow3: XTopWindow2 {
|
||||
/** controls whether the window is currently shown full screen */
|
||||
[attribute] boolean FullScreen;
|
||||
};
|
||||
|
||||
}; }; }; };
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
@@ -21,7 +21,7 @@
|
||||
#define INCLUDED_TOOLKIT_AWT_VCLXTOPWINDOW_HXX
|
||||
|
||||
#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
|
||||
#include <com/sun/star/awt/XTopWindow2.hpp>
|
||||
#include <com/sun/star/awt/XTopWindow3.hpp>
|
||||
|
||||
#include <cppuhelper/implbase.hxx>
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace com::sun::star::awt { class XMenuBar; }
|
||||
|
||||
|
||||
class VCLXTopWindow: public cppu::ImplInheritanceHelper<
|
||||
VCLXContainer, css::awt::XTopWindow2, css::awt::XSystemDependentWindowPeer >
|
||||
VCLXContainer, css::awt::XTopWindow3, css::awt::XSystemDependentWindowPeer >
|
||||
{
|
||||
public:
|
||||
VCLXTopWindow();
|
||||
@@ -55,6 +55,10 @@ public:
|
||||
virtual ::sal_Int32 SAL_CALL getDisplay() override;
|
||||
virtual void SAL_CALL setDisplay( ::sal_Int32 _display ) override;
|
||||
|
||||
// XTopWindow3
|
||||
virtual sal_Bool SAL_CALL getFullScreen() override;
|
||||
virtual void SAL_CALL setFullScreen(sal_Bool value) override;
|
||||
|
||||
static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds );
|
||||
virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); }
|
||||
};
|
||||
|
||||
@@ -209,6 +209,20 @@ void SAL_CALL VCLXTopWindow::setDisplay( ::sal_Int32 _display )
|
||||
pWindow->SetScreenNumber( _display );
|
||||
}
|
||||
|
||||
sal_Bool VCLXTopWindow::getFullScreen() {
|
||||
SolarMutexGuard g;
|
||||
if (auto const win = VCLXContainer::GetAsDynamic<WorkWindow>()) {
|
||||
return win->IsFullScreenMode();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void VCLXTopWindow::setFullScreen(sal_Bool value) {
|
||||
SolarMutexGuard g;
|
||||
if (auto const win = VCLXContainer::GetAsDynamic<WorkWindow>()) {
|
||||
return win->ShowFullScreenMode(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user