offapi/UnoApi_offapi.mk                 |    1 +
 offapi/com/sun/star/awt/XTopWindow3.idl |   23 +++++++++++++++++++++++
 toolkit/inc/awt/vclxtopwindow.hxx       |    8 ++++++--
 toolkit/source/awt/vclxtopwindow.cxx    |   14 ++++++++++++++
 4 files changed, 44 insertions(+), 2 deletions(-)

New commits:
commit af5c4092052c98853b88cf886adb11b4a1532fff
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri Aug 2 13:37:44 2024 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri Aug 2 15:47:54 2024 +0200

    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.bergm...@allotropia.de>

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 9613a54eb27a..959f805d3894 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1901,6 +1901,7 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/awt,\
        XToolkitRobot \
        XTopWindow \
        XTopWindow2 \
+       XTopWindow3 \
        XTopWindowListener \
        XUnitConversion \
        XUnoControlContainer \
diff --git a/offapi/com/sun/star/awt/XTopWindow3.idl 
b/offapi/com/sun/star/awt/XTopWindow3.idl
new file mode 100644
index 000000000000..d64076423132
--- /dev/null
+++ b/offapi/com/sun/star/awt/XTopWindow3.idl
@@ -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: */
diff --git a/toolkit/inc/awt/vclxtopwindow.hxx 
b/toolkit/inc/awt/vclxtopwindow.hxx
index 1913c4594f6d..9e77edcef43b 100644
--- a/toolkit/inc/awt/vclxtopwindow.hxx
+++ b/toolkit/inc/awt/vclxtopwindow.hxx
@@ -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 ); }
 };
diff --git a/toolkit/source/awt/vclxtopwindow.cxx 
b/toolkit/source/awt/vclxtopwindow.cxx
index c0ce4d891d94..55dbb8070b91 100644
--- a/toolkit/source/awt/vclxtopwindow.cxx
+++ b/toolkit/source/awt/vclxtopwindow.cxx
@@ -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);
+    }
+}
 
 
 

Reply via email to