summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorAntonio Fernandez <antonio.fernandez@aentos.es>2012-07-30 13:11:09 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 13:52:39 +0100
commit818acaaa0d77e363c74112c435ab8bea425f34ae (patch)
tree9c204378f89a0951f8bf18284ffb1241c79114c5 /vcl/inc
parenta09c7f8e2b4d717bb488040ca096ee79c3e07609 (diff)
Menubar hierarchy fully generated. Native GTK menu is published on DBus.
Change-Id: I340d3e14b590b4a694082cfb3e2200d6ad8ef39a
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/unx/gtk/gtkinst.hxx4
-rw-r--r--vcl/inc/unx/gtk/gtksalmenu.hxx85
-rw-r--r--vcl/inc/unx/salmenu.h8
3 files changed, 93 insertions, 4 deletions
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index ad63d4a3b4b2..d4eb4cd6dc53 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -104,6 +104,10 @@ public:
virtual SalSystem* CreateSalSystem();
virtual SalInfoPrinter* CreateInfoPrinter(SalPrinterQueueInfo* pPrinterQueueInfo, ImplJobSetup* pJobSetup);
virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
+ virtual SalMenu* CreateMenu( sal_Bool, Menu* );
+ virtual void DestroyMenu( SalMenu* pMenu );
+ virtual SalMenuItem* CreateMenuItem( const SalItemParams* );
+ virtual void DestroyMenuItem( SalMenuItem* pItem );
virtual SalTimer* CreateSalTimer();
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics*,
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
new file mode 100644
index 000000000000..c925a99da960
--- /dev/null
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef GTKSALMENU_HXX
+#define GTKSALMENU_HXX
+
+#include <vcl/sv.h>
+#include <vcl/bitmap.hxx>
+#include <unx/gtk/gtkframe.hxx>
+#include <unx/salmenu.h>
+#include <gio/gio.h>
+
+
+class GtkSalMenu : public SalMenu
+{
+private:
+ sal_Bool mbMenuBar;
+
+public:
+ Menu* mpVCLMenu;
+ const GtkSalFrame* mpFrame;
+ GMenuModel* mpParentMenuModel;
+ GMenuModel* mpMenuModel;
+ gchar* aDBusMenubarPath;
+ GDBusConnection* pSessionBus;
+
+ GtkSalMenu( sal_Bool bMenuBar );
+ virtual ~GtkSalMenu();
+
+ virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ // otherwise only menu messages are processed (eg, OLE on Windows)
+
+ virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
+ virtual void RemoveItem( unsigned nPos );
+ virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
+ virtual void SetFrame( const SalFrame* pFrame );
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck );
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
+ virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& rText );
+ virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage);
+ virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const rtl::OUString& rKeyName );
+ virtual void GetSystemMenuData( SystemMenuData* pData );
+};
+
+class GtkSalMenuItem : public SalMenuItem
+{
+public:
+ GtkSalMenuItem( const SalItemParams* );
+ virtual ~GtkSalMenuItem();
+
+ sal_uInt16 mnId; // Item ID
+ Menu* mpVCLMenu; // VCL Menu into which this MenuItem is inserted
+ GtkSalMenu* mpParentMenu; // The menu in which this menu item is inserted
+ GtkSalMenu* mpSubMenu; // Sub menu of this item (if defined)
+ GMenuItem* mpMenuItem; // The GMenuItem
+};
+
+#endif // GTKSALMENU_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/unx/salmenu.h b/vcl/inc/unx/salmenu.h
index 9fae46a9be6c..0daf6ebe591f 100644
--- a/vcl/inc/unx/salmenu.h
+++ b/vcl/inc/unx/salmenu.h
@@ -22,7 +22,7 @@
#include <tools/solar.h>
#include <vcl/bitmap.hxx>
-#include <vcl/salmenu.hxx>
+#include <salmenu.hxx>
class X11SalMenu : public SalMenu
@@ -31,15 +31,15 @@ public:
X11SalMenu() {}
virtual ~X11SalMenu();
- virtual BOOL VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
+ virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars
// otherwise only menu messages are processed (eg, OLE on Windows)
virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
virtual void RemoveItem( unsigned nPos );
virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
virtual void SetFrame( const SalFrame* pFrame );
- virtual void CheckItem( unsigned nPos, BOOL bCheck );
- virtual void EnableItem( unsigned nPos, BOOL bEnable );
+ virtual void CheckItem( unsigned nPos, sal_Bool bCheck );
+ virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& rText );
virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage);
virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const rtl::OUString& rKeyName );