From 2b1c9f5c63f4d90db0137b1c8c91340bb2559115 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 22 Jun 2010 11:12:01 +0200 Subject: dockingwindows: #i112595# First refactoring version of the layout manager including skeleton classes for new docking windows --- framework/source/layoutmanager/helpers.hxx | 85 ++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 framework/source/layoutmanager/helpers.hxx (limited to 'framework/source/layoutmanager/helpers.hxx') diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx new file mode 100755 index 000000000000..71eb623df6ff --- /dev/null +++ b/framework/source/layoutmanager/helpers.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: layoutmanager.hxx,v $ + * $Revision: 1.34 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __FRAMEWORK_LAYOUTMANAGER_HELPERS_HXX_ +#define __FRAMEWORK_LAYOUTMANAGER_HELPERS_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#include +#include +#include + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +#include +#include +#include +#include +#include + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +#include + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +#define UIRESOURCE_PROTOCO_ASCII "private:" +#define UIRESOURCE_RESOURCE_ASCII "resource" +#define UIRESOURCE_URL_ASCII "private:resource" +#define UIRESOURCE_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( UIRESOURCE_URL_ASCII )) + +namespace framework +{ + +bool lcl_checkUIElement(const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement,::com::sun::star::awt::Rectangle& _rPosSize, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xWindow); +::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rFactory, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService ); +WindowAlign ImplConvertAlignment( sal_Int16 aAlignment ); +bool impl_parseResourceURL( const rtl::OUString aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName ); +::com::sun::star::awt::Rectangle impl_convertRectangleToAWT( const ::Rectangle& rRect ); +::Rectangle impl_convertAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect ); +::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > impl_getModelFromFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); +sal_Bool implts_isPreviewModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); +sal_Bool implts_isFrameOrWindowTop( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ); +void impl_setDockingWindowVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& rSMGR, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rDockingWindowName, bool bVisible ); +void impl_addWindowListeners( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xThis, const ::com::sun::star::uno::Reference< css::ui::XUIElement >& xUIElement ); +::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > implts_createToolkitWindow( const css::uno::Reference< ::com::sun::star::awt::XToolkit >& rToolkit, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent ); + +} + +#endif // __FRAMEWORK_LAYOUTMANAGER_HELPERS_HXX_ -- cgit From 06513cd01e1db6ca7ab4f9b05aff22d5c0f1b048 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Fri, 24 Sep 2010 16:25:13 +0200 Subject: dockingwindows: Fixed many issues regarding the layout manager rework --- framework/source/layoutmanager/helpers.hxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'framework/source/layoutmanager/helpers.hxx') diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index 71eb623df6ff..61b05d771278 100755 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -67,12 +67,16 @@ namespace framework { +bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 ); +void setZeroRectangle( ::Rectangle& rRect ); bool lcl_checkUIElement(const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement,::com::sun::star::awt::Rectangle& _rPosSize, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xWindow); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rFactory, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService ); WindowAlign ImplConvertAlignment( sal_Int16 aAlignment ); bool impl_parseResourceURL( const rtl::OUString aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName ); -::com::sun::star::awt::Rectangle impl_convertRectangleToAWT( const ::Rectangle& rRect ); -::Rectangle impl_convertAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect ); +::Rectangle putAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect ); +::com::sun::star::awt::Rectangle putRectangleValueToAWT( const ::Rectangle& rRect ); +::com::sun::star::awt::Rectangle convertRectangleToAWT( const ::Rectangle& rRect ); +::Rectangle convertAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect ); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > impl_getModelFromFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); sal_Bool implts_isPreviewModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); sal_Bool implts_isFrameOrWindowTop( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ); -- cgit From 3dc5bef2459e2d8981a06cb9d69a4481bcd91dbd Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 7 Oct 2010 16:33:21 +0200 Subject: dockingwindows: More code rework to prepare LayoutManager to control more ui element types. Move more code to other ui element type specific classes --- framework/source/layoutmanager/helpers.hxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'framework/source/layoutmanager/helpers.hxx') diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index 61b05d771278..f48f1278fc52 100755 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -54,6 +54,7 @@ //_________________________________________________________________________________________________________________ #include +#include //_________________________________________________________________________________________________________________ // namespace @@ -64,15 +65,23 @@ #define UIRESOURCE_URL_ASCII "private:resource" #define UIRESOURCE_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( UIRESOURCE_URL_ASCII )) +#define UIRESOURCETYPE_TOOLBAR "toolbar" +#define UIRESOURCETYPE_STATUSBAR "statusbar" +#define UIRESOURCETYPE_MENUBAR "menubar" + namespace framework { +::rtl::OUString retrieveToolbarNameFromHelpURL( Window* pWindow ); +ToolBox* getToolboxPtr( Window* pWindow ); +Window* getWindowFromXUIElement( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement ); +SystemWindow* getTopSystemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& xWindow ); bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 ); void setZeroRectangle( ::Rectangle& rRect ); bool lcl_checkUIElement(const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement,::com::sun::star::awt::Rectangle& _rPosSize, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xWindow); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rFactory, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService ); WindowAlign ImplConvertAlignment( sal_Int16 aAlignment ); -bool impl_parseResourceURL( const rtl::OUString aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName ); +void parseResourceURL( const rtl::OUString aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName ); ::Rectangle putAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect ); ::com::sun::star::awt::Rectangle putRectangleValueToAWT( const ::Rectangle& rRect ); ::com::sun::star::awt::Rectangle convertRectangleToAWT( const ::Rectangle& rRect ); -- cgit From da6bba7cb6fed8052fe6929f6a666fa5387b0e55 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Fri, 15 Oct 2010 16:18:57 +0200 Subject: dockingwindows: Fix serveral issues for the reworked LayoutManager class --- framework/source/layoutmanager/helpers.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'framework/source/layoutmanager/helpers.hxx') diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index f48f1278fc52..f7f0b3f4ca5c 100755 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -81,7 +81,8 @@ void setZeroRectangle( ::Rectangle& rRect ); bool lcl_checkUIElement(const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement,::com::sun::star::awt::Rectangle& _rPosSize, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xWindow); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rFactory, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService ); WindowAlign ImplConvertAlignment( sal_Int16 aAlignment ); -void parseResourceURL( const rtl::OUString aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName ); +::rtl::OUString getElementTypeFromResourceURL( const ::rtl::OUString& aResourceURL ); +void parseResourceURL( const rtl::OUString& aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName ); ::Rectangle putAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect ); ::com::sun::star::awt::Rectangle putRectangleValueToAWT( const ::Rectangle& rRect ); ::com::sun::star::awt::Rectangle convertRectangleToAWT( const ::Rectangle& rRect ); -- cgit From 7cd05cb69a4f49a84c4cfadb0f36943350f8e783 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 26 Oct 2010 14:58:05 +0200 Subject: #i112595# Fixed problems with sub-toolbars and docking --- framework/source/layoutmanager/helpers.hxx | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'framework/source/layoutmanager/helpers.hxx') diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index f7f0b3f4ca5c..5a5f851f597d 100755 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -31,40 +31,27 @@ #ifndef __FRAMEWORK_LAYOUTMANAGER_HELPERS_HXX_ #define __FRAMEWORK_LAYOUTMANAGER_HELPERS_HXX_ -//_________________________________________________________________________________________________________________ -// my own includes -//_________________________________________________________________________________________________________________ - +// my own includes #include #include #include -//_________________________________________________________________________________________________________________ -// interface includes -//_________________________________________________________________________________________________________________ - +// interface includes #include #include #include #include #include +#include -//_________________________________________________________________________________________________________________ -// other includes -//_________________________________________________________________________________________________________________ - +// other includes #include #include -//_________________________________________________________________________________________________________________ -// namespace -//_________________________________________________________________________________________________________________ - #define UIRESOURCE_PROTOCO_ASCII "private:" #define UIRESOURCE_RESOURCE_ASCII "resource" #define UIRESOURCE_URL_ASCII "private:resource" #define UIRESOURCE_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( UIRESOURCE_URL_ASCII )) - #define UIRESOURCETYPE_TOOLBAR "toolbar" #define UIRESOURCETYPE_STATUSBAR "statusbar" #define UIRESOURCETYPE_MENUBAR "menubar" @@ -72,6 +59,9 @@ namespace framework { +bool isToolboxHorizontalAligned( ToolBox* pToolBox ); +bool isHorizontalDockingArea( const sal_Int16 nDockArea ); +bool isHorizontalDockingArea( const ::com::sun::star::ui::DockingArea& nDockArea ); ::rtl::OUString retrieveToolbarNameFromHelpURL( Window* pWindow ); ToolBox* getToolboxPtr( Window* pWindow ); Window* getWindowFromXUIElement( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement ); -- cgit From 1d6df0d19d9fccc559c91dfb864d5cb2b38d864a Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 27 Oct 2010 14:09:04 +0200 Subject: dockingwindows: #i112595# Improve layout function so docking areas are now only shown when completely layouted. No more overlay effects or other artifacts visible --- framework/source/layoutmanager/helpers.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'framework/source/layoutmanager/helpers.hxx') diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index 5a5f851f597d..c2b9695dd9f2 100755 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -60,6 +60,7 @@ namespace framework { bool isToolboxHorizontalAligned( ToolBox* pToolBox ); +bool isReverseOrderDockingArea( const sal_Int16 nDockArea ); bool isHorizontalDockingArea( const sal_Int16 nDockArea ); bool isHorizontalDockingArea( const ::com::sun::star::ui::DockingArea& nDockArea ); ::rtl::OUString retrieveToolbarNameFromHelpURL( Window* pWindow ); -- cgit From 30404a1cea9999f7be7904fd2627162d02793e00 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 28 Oct 2010 14:13:05 +0200 Subject: dockingwindows: #i112595# Fix problem using dockWindow() and toolbar is not correctly shown. Further code cleanup. --- framework/source/layoutmanager/helpers.hxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'framework/source/layoutmanager/helpers.hxx') diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index c2b9695dd9f2..f2d5f1de15d5 100755 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -43,6 +43,7 @@ #include #include #include +#include // other includes #include @@ -59,6 +60,10 @@ namespace framework { +bool hasEmptySize( const:: Size& aSize ); +bool hasDefaultPosValue( const ::Point& aPos ); +bool isDefaultPos( const ::com::sun::star::awt::Point& aPos ); +bool isDefaultPos( const ::Point& aPos ); bool isToolboxHorizontalAligned( ToolBox* pToolBox ); bool isReverseOrderDockingArea( const sal_Int16 nDockArea ); bool isHorizontalDockingArea( const sal_Int16 nDockArea ); -- cgit From 560e5132f606b1fcd790e3cf97d665cec8c442fc Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 1 Nov 2010 13:29:26 +0100 Subject: dockingwindows: #i112595# Fixed problem related to changes for better layouting. Further code rework --- framework/source/layoutmanager/helpers.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'framework/source/layoutmanager/helpers.hxx') diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index f2d5f1de15d5..d4e9ce313d0e 100755 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -65,8 +65,8 @@ bool hasDefaultPosValue( const ::Point& aPos ); bool isDefaultPos( const ::com::sun::star::awt::Point& aPos ); bool isDefaultPos( const ::Point& aPos ); bool isToolboxHorizontalAligned( ToolBox* pToolBox ); -bool isReverseOrderDockingArea( const sal_Int16 nDockArea ); -bool isHorizontalDockingArea( const sal_Int16 nDockArea ); +bool isReverseOrderDockingArea( const sal_Int32 nDockArea ); +bool isHorizontalDockingArea( const sal_Int32 nDockArea ); bool isHorizontalDockingArea( const ::com::sun::star::ui::DockingArea& nDockArea ); ::rtl::OUString retrieveToolbarNameFromHelpURL( Window* pWindow ); ToolBox* getToolboxPtr( Window* pWindow ); -- cgit