[Libreoffice-commits] core.git: include/sfx2 include/svx officecfg/registry sfx2/sdi sfx2/source svx/Library_svx.mk svx/source svx/uiconfig svx/UIConfig_svx.mk sw/source sw/uiconfig

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Sat Jan 9 03:04:33 UTC 2021


 include/sfx2/sfxsids.hrc                                             |    2 
 include/svx/devtools/DevelopmentToolDockingWindow.hxx                |   37 ++++++
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    8 +
 sfx2/sdi/appslots.sdi                                                |    9 -
 sfx2/sdi/sfx.sdi                                                     |   16 ++
 sfx2/source/appl/appserv.cxx                                         |   28 +++++
 svx/Library_svx.mk                                                   |    1 
 svx/UIConfig_svx.mk                                                  |    1 
 svx/source/devtools/DevelopmentToolDockingWindow.cxx                 |   55 ++++++++++
 svx/uiconfig/ui/developmenttool.ui                                   |   26 ++++
 sw/source/uibase/app/swmodule.cxx                                    |    2 
 sw/source/uibase/shells/basesh.cxx                                   |    3 
 sw/uiconfig/sglobal/menubar/menubar.xml                              |    1 
 sw/uiconfig/swriter/menubar/menubar.xml                              |    1 
 14 files changed, 185 insertions(+), 5 deletions(-)

New commits:
commit 5f5ee992bd8377dc984b576950d468f6407d5c63
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Jan 8 22:41:56 2021 +0900
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Jan 9 04:01:39 2021 +0100

    devtools: Implement development tools docking window
    
    Change-Id: Id3b8f424e24bac5164b8b3069580ffee65dd265c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107993
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 2fd69fd3e1e2..8cb256ff998a 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -50,6 +50,8 @@ class SvxSearchItem;
 #define SID_SETUPPRINTER                    (SID_SFX_START + 302)
 #define SID_SAFE_MODE                       (SID_SFX_START + 303)
 
+#define SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW (SID_SFX_START + 306)
+
 #define SID_CONTEXT                         (SID_SFX_START + 310)
 
 #define SID_PASTE_SPECIAL                   (SID_SFX_START + 311)
diff --git a/include/svx/devtools/DevelopmentToolDockingWindow.hxx b/include/svx/devtools/DevelopmentToolDockingWindow.hxx
new file mode 100644
index 000000000000..89030c0652e1
--- /dev/null
+++ b/include/svx/devtools/DevelopmentToolDockingWindow.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include <svx/svxdllapi.h>
+#include <sfx2/dockwin.hxx>
+#include <vcl/customweld.hxx>
+#include <vcl/weld.hxx>
+
+class SAL_WARN_UNUSED SVX_DLLPUBLIC DevelopmentToolChildWindow final : public SfxChildWindow
+{
+    SFX_DECL_CHILDWINDOW_WITHID(DevelopmentToolChildWindow);
+
+    DevelopmentToolChildWindow(vcl::Window* pParentWindow, sal_uInt16 nId, SfxBindings* pBindings,
+                               SfxChildWinInfo* pInfo);
+    virtual ~DevelopmentToolChildWindow() override;
+};
+
+class SAL_WARN_UNUSED SVX_DLLPUBLIC DevelopmentToolDockingWindow final : public SfxDockingWindow
+{
+public:
+    DevelopmentToolDockingWindow(SfxBindings* pBindings, SfxChildWindow* pChildWindow,
+                                 vcl::Window* pParent);
+    virtual ~DevelopmentToolDockingWindow() override;
+
+    virtual void ToggleFloatingMode() override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 1ce707e99f12..c9aee96ee153 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -6531,6 +6531,14 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:DevelopmentToolsDockingWindow" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Development Tool</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
     </node>
     <node oor:name="Popups">
       <node oor:name=".uno:PasteSpecialMenu" oor:op="replace">
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index 4b049488921a..ee620ff3fa8c 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -214,6 +214,11 @@ interface Application
         ExecMethod = MiscExec_Impl ;
         StateMethod = MiscState_Impl ;
     ]
+    SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW
+    [
+        ExecMethod = MiscExec_Impl ;
+        StateMethod = MiscState_Impl ;
+    ]
 }
 
 
@@ -306,10 +311,6 @@ shell SfxApplication
     [
         ExecMethod = OfaExec_Impl ;
     ]
-        SID_MORE_DICTIONARIES
-        [
-                ExecMethod = OfaExec_Impl ;
-        ]
 }
 
 shell SfxModule
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 40bf3e93b424..5a52dd558114 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -5624,6 +5624,22 @@ SfxVoidItem SafeMode SID_SAFE_MODE
     GroupId = SfxGroupId::Application;
 ]
 
+SfxBoolItem DevelopmentToolsDockingWindow SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW
+[
+    AutoUpdate = TRUE,
+    FastCall = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = TRUE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+    AccelConfig = FALSE,
+    MenuConfig = FALSE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::Application;
+]
+
 SfxVoidItem UnicodeNotationToggle SID_UNICODE_NOTATION_TOGGLE
 ()
 [
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 7452faff296a..b446a1e309c3 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1019,6 +1019,16 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
             bDone = true;
             break;
         }
+        case SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW:
+        {
+            SfxViewShell* pViewShell = SfxViewShell::Current();
+            SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
+            auto nID = rReq.GetSlot();
+            pViewFrame->ToggleChildWindow(nID);
+
+            bDone = true;
+            break;
+        }
         case SID_SAFE_MODE:
         {
             SafeModeQueryDialog aDialog(rReq.GetFrameWeld());
@@ -1191,6 +1201,24 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
                        rSet.DisableItem( SID_SAFE_MODE );
                     break;
                 }
+                case SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW:
+                {
+                    bool bSuccess = false;
+                    auto* pViewShell = SfxViewShell::Current();
+                    if (pViewShell)
+                    {
+                        auto* pViewFrame = pViewShell->GetViewFrame();
+                        if (pViewFrame && pViewFrame->KnowsChildWindow(nWhich))
+                        {
+                            rSet.Put(SfxBoolItem(nWhich, pViewFrame->HasChildWindow(nWhich)));
+                            bSuccess = true;
+                        }
+                    }
+
+                    if (!bSuccess)
+                        rSet.DisableItem(nWhich);
+                }
+                break;
 
                 default:
                     break;
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index b98a3cc12a6a..0e8557ecb0f8 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
     svx/source/customshapes/EnhancedCustomShapeEngine \
     svx/source/customshapes/EnhancedCustomShapeFontWork \
     svx/source/customshapes/EnhancedCustomShapeHandle \
+    svx/source/devtools/DevelopmentToolDockingWindow \
     svx/source/dialog/AccessibilityCheckDialog \
     svx/source/dialog/_bmpmask \
     svx/source/dialog/charmap \
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index b8e18d763c1f..4773c6826620 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
 	svx/uiconfig/ui/deletefooterdialog \
 	svx/uiconfig/ui/depthwindow \
 	svx/uiconfig/ui/directionwindow \
+	svx/uiconfig/ui/developmenttool \
 	svx/uiconfig/ui/docking3deffects \
 	svx/uiconfig/ui/dockingcolorreplace \
 	svx/uiconfig/ui/dockingcolorwindow \
diff --git a/svx/source/devtools/DevelopmentToolDockingWindow.cxx b/svx/source/devtools/DevelopmentToolDockingWindow.cxx
new file mode 100644
index 000000000000..a435cd9b9c04
--- /dev/null
+++ b/svx/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#include <memory>
+
+#include <svx/devtools/DevelopmentToolDockingWindow.hxx>
+
+#include <sfx2/dispatch.hxx>
+#include <sfx2/sfxmodelfactory.hxx>
+#include <svx/svxids.hrc>
+
+SFX_IMPL_DOCKINGWINDOW_WITHID(DevelopmentToolChildWindow, SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW);
+
+DevelopmentToolChildWindow::DevelopmentToolChildWindow(vcl::Window* pParentWindow, sal_uInt16 nId,
+                                                       SfxBindings* pBindings,
+                                                       SfxChildWinInfo* pInfo)
+    : SfxChildWindow(pParentWindow, nId)
+{
+    VclPtr<DevelopmentToolDockingWindow> pWin
+        = VclPtr<DevelopmentToolDockingWindow>::Create(pBindings, this, pParentWindow);
+    SetWindow(pWin);
+    SetAlignment(SfxChildAlignment::BOTTOM);
+    pWin->Initialize(pInfo);
+}
+
+DevelopmentToolChildWindow::~DevelopmentToolChildWindow() {}
+
+DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBindings,
+                                                           SfxChildWindow* pChildWindow,
+                                                           vcl::Window* pParent)
+    : SfxDockingWindow(pInputBindings, pChildWindow, pParent, "DevelopmentTool",
+                       "svx/ui/developmenttool.ui")
+{
+}
+
+DevelopmentToolDockingWindow::~DevelopmentToolDockingWindow() { disposeOnce(); }
+
+void DevelopmentToolDockingWindow::ToggleFloatingMode()
+{
+    SfxDockingWindow::ToggleFloatingMode();
+
+    if (GetFloatingWindow())
+        GetFloatingWindow()->SetMinOutputSizePixel(Size(300, 300));
+
+    Invalidate();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/uiconfig/ui/developmenttool.ui b/svx/uiconfig/ui/developmenttool.ui
new file mode 100644
index 000000000000..6bb0d69a339c
--- /dev/null
+++ b/svx/uiconfig/ui/developmenttool.ui
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.2 -->
+<interface domain="svx">
+  <requires lib="gtk+" version="3.20"/>
+  <!-- n-columns=1 n-rows=1 -->
+  <object class="GtkGrid" id="DevelopmentTool">
+    <property name="visible">True</property>
+    <property name="can-focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="row-spacing">24</property>
+    <child>
+      <object class="GtkLabel">
+        <property name="visible">True</property>
+        <property name="can-focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <property name="label" translatable="no">Test</property>
+      </object>
+      <packing>
+        <property name="left-attach">0</property>
+        <property name="top-attach">0</property>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 9dded8a0b49a..ee9c5ebd286d 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -89,6 +89,7 @@
 #include <modcfg.hxx>
 #include <fontcfg.hxx>
 #include <sfx2/sidebar/SidebarChildWindow.hxx>
+#include <svx/devtools/DevelopmentToolDockingWindow.hxx>
 #include <swatrset.hxx>
 #include <idxmrk.hxx>
 #include <wordcountdialog.hxx>
@@ -305,6 +306,7 @@ void SwDLL::RegisterControls()
     SwSpellDialogChildWindow::RegisterChildWindow(
         false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE
                                                             : SfxChildWindowFlags::NONE);
+    DevelopmentToolChildWindow::RegisterChildWindow(false, pMod);
 
     SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod );
     SvxGrafGreenToolBoxControl::RegisterControl( SID_ATTR_GRAF_GREEN, pMod );
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index e0af002ba981..7dcb362ca240 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -85,6 +85,7 @@
 #include <svx/fmshell.hxx>
 #include <SwRewriter.hxx>
 #include <svx/galleryitem.hxx>
+#include <svx/devtools/DevelopmentToolDockingWindow.hxx>
 #include <com/sun/star/gallery/GalleryItemType.hpp>
 #include <memory>
 
@@ -146,9 +147,9 @@ void SwBaseShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterChildWindow(SvxIMapDlgChildWindow::GetChildWindowId());
     GetStaticInterface()->RegisterChildWindow(SvxContourDlgChildWindow::GetChildWindowId());
+    GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId());
 }
 
-
 static void lcl_UpdateIMapDlg( SwWrtShell& rSh )
 {
     Graphic aGrf( rSh.GetIMapGraphic() );
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index 8ff298b603d5..4fdd94d99894 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -781,6 +781,7 @@
   </menu:menu>
   <menu:menu menu:id=".uno:HelpMenu">
     <menu:menupopup>
+      <menu:menuitem menu:id=".uno:DevelopmentToolsDockingWindow"/>
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index f743086572a4..11b52c3945bc 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -801,6 +801,7 @@
   </menu:menu>
   <menu:menu menu:id=".uno:HelpMenu">
     <menu:menupopup>
+      <menu:menuitem menu:id=".uno:DevelopmentToolsDockingWindow"/>
       <menu:menuitem menu:id=".uno:HelpIndex"/>
       <menu:menuitem menu:id=".uno:ExtendedHelp"/>
       <menu:menuitem menu:id=".uno:Documentation"/>


More information about the Libreoffice-commits mailing list