[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Caolán McNamara caolanm at redhat.com
Fri Oct 7 09:11:55 UTC 2016


 include/sfx2/sidebar/Sidebar.hrc          |   60 +++++++++++
 include/sfx2/sidebar/SidebarResource.hxx  |   35 ++++++
 sfx2/source/sidebar/DeckTitleBar.cxx      |    2 
 sfx2/source/sidebar/PanelTitleBar.cxx     |    2 
 sfx2/source/sidebar/Sidebar.hrc           |   28 -----
 sfx2/source/sidebar/Sidebar.src           |  153 ++++++++++++++++++++++++++----
 sfx2/source/sidebar/SidebarController.cxx |   10 +
 sfx2/source/sidebar/TabBar.cxx            |    2 
 sfx2/source/sidebar/Theme.cxx             |    3 
 9 files changed, 244 insertions(+), 51 deletions(-)

New commits:
commit caa1874ad72005de263e6fd13ee8c660bedc01c2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 7 10:06:05 2016 +0100

    Revert "SidebarResource doesn't do anything useful"
    
    This reverts commit e9886d32923e5fa3995f44701f27148f59df5c0f.

diff --git a/include/sfx2/sidebar/Sidebar.hrc b/include/sfx2/sidebar/Sidebar.hrc
new file mode 100644
index 0000000..96597cf
--- /dev/null
+++ b/include/sfx2/sidebar/Sidebar.hrc
@@ -0,0 +1,60 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#include <sfx2/sfx.hrc>
+
+#define RID_SIDEBAR_RESOURCE  (RID_SFX_SIDEBAR_START +  0)
+
+#define IMAGE_SIDEBAR_PLUS                        1
+#define IMAGE_SIDEBAR_MINUS                       3
+#define IMAGE_SIDEBAR_GRIP                        5
+#define IMAGE_SIDEBAR_MENU                        7
+#define IMAGE_SIDEBAR_DETAIL_DIALOG               9
+#define IMAGE_SIDEBAR_DECK_3D_LARGE              20
+#define IMAGE_SIDEBAR_DECK_3D_SMALL              22
+#define IMAGE_SIDEBAR_DECK_ANIMATION_LARGE       30
+#define IMAGE_SIDEBAR_DECK_ANIMATION_SMALL       32
+#define IMAGE_SIDEBAR_DECK_COLORS_LARGE          40
+#define IMAGE_SIDEBAR_DECK_COLORS_SMALL          42
+#define IMAGE_SIDEBAR_DECK_EYEDROPPER_LARGE      50
+#define IMAGE_SIDEBAR_DECK_EYEDROPPER_SMALL      52
+#define IMAGE_SIDEBAR_DECK_GALLERY_LARGE         60
+#define IMAGE_SIDEBAR_DECK_GALLERY_SMALL         62
+#define IMAGE_SIDEBAR_DECK_IMGANIM_LARGE         70
+#define IMAGE_SIDEBAR_DECK_IMGANIM_SMALL         72
+#define IMAGE_SIDEBAR_DECK_NAVIGATOR_LARGE       80
+#define IMAGE_SIDEBAR_DECK_NAVIGATOR_SMALL       82
+#define IMAGE_SIDEBAR_PROPERTIES_DECK_LARGE      90
+#define IMAGE_SIDEBAR_PROPERTIES_DECK_SMALL      92
+#define IMAGE_SIDEBAR_DECK_STYLE_LARGE          100
+#define IMAGE_SIDEBAR_DECK_STYLE_SMALL          102
+#define IMAGE_SIDEBAR_DECK_TEMPLATE_LARGE       110
+#define IMAGE_SIDEBAR_DECK_TEMPLATE_SMALL       112
+#define IMAGE_SIDEBAR_DECK_TRANSITION_LARGE     120
+#define IMAGE_SIDEBAR_DECK_TRANSITION_SMALL     122
+#define IMAGE_SIDEBAR_DECK_FUNCTIONS_LARGE      130
+#define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL      132
+#define STRING_CUSTOMIZATION                    200
+#define STRING_RESTORE                          201
+#define STRING_HIDE_SIDEBAR                     202
+
+#define SFX_STR_SIDEBAR_MORE_OPTIONS                (RID_SFX_SIDEBAR_START +  1)
+#define SFX_STR_SIDEBAR_CLOSE_DECK                  (RID_SFX_SIDEBAR_START +  2)
+#define SFX_STR_SIDEBAR_SETTINGS                    (RID_SFX_SIDEBAR_START +  3)
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/Sidebar.hrc b/include/sfx2/sidebar/SidebarResource.hxx
similarity index 65%
rename from sfx2/source/sidebar/Sidebar.hrc
rename to include/sfx2/sidebar/SidebarResource.hxx
index 5d2b685..78ce96b 100644
--- a/sfx2/source/sidebar/Sidebar.hrc
+++ b/include/sfx2/sidebar/SidebarResource.hxx
@@ -16,13 +16,20 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#include <sfx2/sfx.hrc>
+#ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_SIDEBARRESOURCE_HXX
+#define INCLUDED_SFX2_SOURCE_SIDEBAR_SIDEBARRESOURCE_HXX
 
-#define SFX_STR_SIDEBAR_MORE_OPTIONS                (RID_SFX_SIDEBAR_START + 1)
-#define SFX_STR_SIDEBAR_CLOSE_DECK                  (RID_SFX_SIDEBAR_START + 2)
-#define SFX_STR_SIDEBAR_SETTINGS                    (RID_SFX_SIDEBAR_START + 3)
-#define SFX_STR_SIDEBAR_CUSTOMIZATION               (RID_SFX_SIDEBAR_START + 4)
-#define SFX_STR_SIDEBAR_RESTORE                     (RID_SFX_SIDEBAR_START + 5)
-#define SFX_STR_SIDEBAR_HIDE_SIDEBAR                (RID_SFX_SIDEBAR_START + 6)
+#include <sfx2/sidebar/Sidebar.hrc>
+#include <sfx2/sfxresid.hxx>
+#include <tools/rc.hxx>
+
+class SidebarResource : public Resource
+{
+public:
+    SidebarResource() : Resource(SfxResId(RID_SIDEBAR_RESOURCE)){}
+    ~SidebarResource() { FreeResource(); }
+};
+
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx
index 29067d1..22ddec1 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -21,7 +21,7 @@
 #include <sfx2/sidebar/Theme.hxx>
 #include <sfx2/sfxresid.hxx>
 
-#include "Sidebar.hrc"
+#include <sfx2/sidebar/Sidebar.hrc>
 
 #include <vcl/image.hxx>
 
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx
index d13dc74..7a16f33 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -20,7 +20,7 @@
 #include <sfx2/sidebar/PanelTitleBar.hxx>
 #include <sfx2/sfxresid.hxx>
 
-#include "Sidebar.hrc"
+#include <sfx2/sidebar/Sidebar.hrc>
 
 #include <sfx2/sidebar/Paint.hxx>
 #include <sfx2/sidebar/Panel.hxx>
diff --git a/sfx2/source/sidebar/Sidebar.src b/sfx2/source/sidebar/Sidebar.src
index e889dbe8..2320307 100644
--- a/sfx2/source/sidebar/Sidebar.src
+++ b/sfx2/source/sidebar/Sidebar.src
@@ -16,8 +16,144 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+#include <sfx2/sidebar/Sidebar.hrc>
 
-#include "Sidebar.hrc"
+Resource RID_SIDEBAR_RESOURCE
+{
+    Image IMAGE_SIDEBAR_PLUS
+    {
+        ImageBitmap = Bitmap { File = "plus.png" ;};
+    };
+
+    Image IMAGE_SIDEBAR_MINUS
+    {
+        ImageBitmap = Bitmap { File = "minus.png" ;};
+    };
+
+    Image IMAGE_SIDEBAR_GRIP
+    {
+        ImageBitmap = Bitmap { File = "grip.png" ;};
+    };
+
+    Image IMAGE_SIDEBAR_MENU
+    {
+        ImageBitmap = Bitmap { File = "symphony/open_more.png" ;};
+    };
+
+    Image IMAGE_SIDEBAR_DETAIL_DIALOG
+    {
+        ImageBitmap = Bitmap { File = "symphony/morebutton.png" ;};
+    };
+
+    Image IMAGE_SIDEBAR_DECK_3D_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-3d-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_3D_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-3d-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_ANIMATION_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-animation-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_ANIMATION_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-animation-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_COLORS_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-colors-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_COLORS_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-colors-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_EYEDROPPER_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-eyedropper-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_EYEDROPPER_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-eyedropper-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_GALLERY_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-gallery-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_GALLERY_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-gallery-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_IMGANIM_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-imganim-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_IMGANIM_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-imganim-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_NAVIGATOR_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-navigator-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_NAVIGATOR_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-navigator-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_PROPERTIES_DECK_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-property-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_PROPERTIES_DECK_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-property-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_STYLE_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-style-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_STYLE_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-style-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_TEMPLATE_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-template-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_TEMPLATE_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-template-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_TRANSITION_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-transition-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_TRANSITION_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-transition-small.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_FUNCTIONS_LARGE
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-functions-large.png" ;};
+    };
+    Image IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL
+    {
+        ImageBitmap = Bitmap { File = "symphony/sidebar-functions-small.png" ;};
+    };
+    String STRING_CUSTOMIZATION
+    {
+    Text [en-US] = "Customization";
+    };
+    String STRING_RESTORE
+    {
+    Text [en-US] = "Restore Default";
+    };
+    String STRING_HIDE_SIDEBAR
+    {
+    Text [en-US] = "Close Sidebar";
+    };
+};
 
 String SFX_STR_SIDEBAR_MORE_OPTIONS
 {
@@ -34,19 +170,4 @@ String SFX_STR_SIDEBAR_SETTINGS
     Text [en-US] = "Sidebar Settings";
 };
 
-String SFX_STR_SIDEBAR_HIDE_SIDEBAR
-{
-    Text [en-US] = "Close Sidebar";
-};
-
-String SFX_STR_SIDEBAR_RESTORE
-{
-    Text [en-US] = "Restore Default";
-};
-
-String SFX_STR_SIDEBAR_CUSTOMIZATION
-{
-    Text [en-US] = "Customization";
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index e90c9ae..56e8888 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -21,6 +21,7 @@
 #include <sfx2/sidebar/DeckTitleBar.hxx>
 #include <sfx2/sidebar/Panel.hxx>
 #include <sfx2/sidebar/PanelTitleBar.hxx>
+#include <sfx2/sidebar/SidebarResource.hxx>
 #include <sfx2/sidebar/TabBar.hxx>
 #include <sfx2/sidebar/Theme.hxx>
 #include <sfx2/sidebar/SidebarChildWindow.hxx>
@@ -33,7 +34,6 @@
 #include <sfx2/sfxresid.hxx>
 #include <sfx2/sfxsids.hrc>
 #include <sfx2/titledockwin.hxx>
-#include "Sidebar.hrc"
 #include "sfxlocal.hrc"
 #include <framework/ContextChangeEventMultiplexerTunnel.hxx>
 #include <vcl/floatwin.hxx>
@@ -943,6 +943,8 @@ VclPtr<PopupMenu> SidebarController::CreatePopupMenu (
     // Create sub menu for customization (hiding of deck tabs.)
     VclPtr<PopupMenu> pCustomizationMenu = VclPtr<PopupMenu>::Create();
 
+    SidebarResource aLocalResource;
+
     // Add one entry for every tool panel element to individually make
     // them visible or hide them.
     sal_Int32 nIndex (0);
@@ -979,11 +981,11 @@ VclPtr<PopupMenu> SidebarController::CreatePopupMenu (
     else
         pMenu->InsertItem(MID_UNLOCK_TASK_PANEL, SFX2_RESSTR(STR_SFX_UNDOCK));
 
-    pMenu->InsertItem(MID_HIDE_SIDEBAR, SFX2_RESSTR(SFX_STR_SIDEBAR_HIDE_SIDEBAR));
+    pMenu->InsertItem(MID_HIDE_SIDEBAR, SFX2_RESSTR(STRING_HIDE_SIDEBAR));
     pCustomizationMenu->InsertSeparator();
-    pCustomizationMenu->InsertItem(MID_RESTORE_DEFAULT, SFX2_RESSTR(SFX_STR_SIDEBAR_RESTORE));
+    pCustomizationMenu->InsertItem(MID_RESTORE_DEFAULT, SFX2_RESSTR(STRING_RESTORE));
 
-    pMenu->InsertItem(MID_CUSTOMIZATION, SFX2_RESSTR(SFX_STR_SIDEBAR_CUSTOMIZATION));
+    pMenu->InsertItem(MID_CUSTOMIZATION, SFX2_RESSTR(STRING_CUSTOMIZATION));
     pMenu->SetPopupMenu(MID_CUSTOMIZATION, pCustomizationMenu);
 
     pMenu->RemoveDisabledEntries(false);
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 87777de..0471cac 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -28,7 +28,7 @@
 #include <sfx2/sidebar/SidebarController.hxx>
 
 #include <sfx2/sfxresid.hxx>
-#include "Sidebar.hrc"
+#include <sfx2/sidebar/Sidebar.hrc>
 
 #include <vcl/gradient.hxx>
 #include <vcl/image.hxx>
diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index b821f4f..6858627 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -18,6 +18,7 @@
  */
 #include <sfx2/sidebar/Theme.hxx>
 #include <sfx2/sidebar/Paint.hxx>
+#include <sfx2/sidebar/SidebarResource.hxx>
 #include <sfx2/sidebar/Tools.hxx>
 #include <sfx2/app.hxx>
 
@@ -143,6 +144,8 @@ void Theme::InitializeTheme()
 
 void Theme::UpdateTheme()
 {
+    SidebarResource aLocalResource;
+
     try
     {
         const StyleSettings& rStyle (Application::GetSettings().GetStyleSettings());


More information about the Libreoffice-commits mailing list