summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-12-02 13:40:39 +0100
committerMathias Bauer <mba@openoffice.org>2009-12-02 13:40:39 +0100
commitb09ad35b40b9de8f3e9f1d57abb6533a209c3ebd (patch)
tree6893176bab1d99dac3a4f6b16c27930deccfc093 /framework
parent726f87d603a38c988a8425d42f023b03bda725b1 (diff)
parent041210d90f162084e98b1fc0acbe744926ac8f60 (diff)
merge with db33a
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/macros/registration.hxx6
-rw-r--r--framework/inc/properties.h17
-rw-r--r--framework/inc/services.h1
-rw-r--r--framework/inc/services/layoutmanager.hxx38
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx302
-rw-r--r--framework/source/layoutmanager/makefile.mk2
-rw-r--r--framework/source/register/makefile.mk2
-rw-r--r--framework/source/xml/menuconfiguration.cxx4
8 files changed, 178 insertions, 194 deletions
diff --git a/framework/inc/macros/registration.hxx b/framework/inc/macros/registration.hxx
index 7a48fad1f84c..d026c1b0f04c 100644
--- a/framework/inc/macros/registration.hxx
+++ b/framework/inc/macros/registration.hxx
@@ -139,7 +139,7 @@ ________________________________________________________________________________
// define helper to get information about service environment
//*****************************************************************************************************************
#define COMPONENTGETIMPLEMENTATIONENVIRONMENT \
- extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName , \
+ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName , \
uno_Environment** ) \
{ \
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; \
@@ -150,7 +150,7 @@ ________________________________________________________________________________
// define registration of service
//*****************************************************************************************************************
#define COMPONENTWRITEINFO( INFOS ) \
- extern "C" sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/ , \
+ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/ , \
void* pRegistryKey ) \
{ \
LOG_REGISTRATION_WRITEINFO( "\t[start]\n" ) \
@@ -185,7 +185,7 @@ ________________________________________________________________________________
// define method to instanciate new services
//*****************************************************************************************************************
#define COMPONENTGETFACTORY( IFFACTORIES ) \
- extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , \
+ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , \
void* pServiceManager , \
void* /*pRegistryKey*/ ) \
{ \
diff --git a/framework/inc/properties.h b/framework/inc/properties.h
index d09fde5a5fc4..d2619cd9ee87 100644
--- a/framework/inc/properties.h
+++ b/framework/inc/properties.h
@@ -193,25 +193,26 @@ namespace framework{
//_______________________________________________
/** properties for "LayoutManager" class */
-#define LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER "MenuBarCloser"
-#define LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS "AutomaticToolbars"
-#define LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY "RefreshContextToolbarVisibility"
-#define LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI "HideCurrentUI"
-#define LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT "LockCount"
+#define LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER "MenuBarCloser"
+#define LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS "AutomaticToolbars"
+#define LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY "RefreshContextToolbarVisibility"
+#define LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI "HideCurrentUI"
+#define LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT "LockCount"
+#define LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE "PreserveContentSize"
#define LAYOUTMANAGER_PROPNAME_MENUBARCLOSER ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER )
#define LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS )
#define LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY )
#define LAYOUTMANAGER_PROPNAME_HIDECURRENTUI ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI )
#define LAYOUTMANAGER_PROPNAME_LOCKCOUNT ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT )
+#define LAYOUTMANAGER_PROPNAME_PRESERVE_CONTENT_SIZE ::rtl::OUString::createFromAscii( LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE )
#define LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER 0
#define LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS 1
#define LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY 2
#define LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI 3
#define LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT 4
-
-#define LAYOUTMANAGER_PROPCOUNT 5
+#define LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE 5
//_______________________________________________
/** properties for "UICommandDescription" class */
@@ -271,7 +272,7 @@ namespace framework{
#define TABWINDOWSERVICE_PROPNAME_WINDOW ::rtl::OUString::createFromAscii( TABWINDOWSERVICE_PROPNAME_ASCII_WINDOW )
#define TABWINDOWSERVICE_PROPHANDLE_WINDOW 0
-#define TABWINDOWSERVICE_PROPCOUNT 1
+#define TABWINDOWSERVICE_PROPCOUNT 1
//_______________________________________________
/** properties of tabreg service */
diff --git a/framework/inc/services.h b/framework/inc/services.h
index e9f3e1bfe3ce..70f4f8fde9a2 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -127,6 +127,7 @@ namespace framework{
#define SERVICENAME_IMAGEMANAGER DECLARE_ASCII("com.sun.star.ui.ImageManager" )
#define SERVICENAME_TABWINDOWSERVICE DECLARE_ASCII("com.sun.star.ui.dialogs.TabContainerWindow" )
#define SERVICENAME_WINDOWCONTENTFACTORYMANAGER DECLARE_ASCII("com.sun.star.ui.WindowContentFactoryManager" )
+#define SERVICENAME_DISPLAYACCESS DECLARE_ASCII("com.sun.star.awt.DisplayAccess" )
//_________________________________________________________________________________________________________________
// used implementationnames by framework
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index 86dec1a938bf..8c412e5d6237 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -69,6 +69,7 @@
#include <com/sun/star/ui/XUIElementFactory.hpp>
#include <com/sun/star/frame/XInplaceLayout.hpp>
#include <com/sun/star/ui/DockingArea.hpp>
+#include <com/sun/star/awt/XTopWindow2.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
#include <com/sun/star/awt/XDockableWindowListener.hpp>
#include <com/sun/star/frame/XMenuBarMergingAcceptor.hpp>
@@ -78,8 +79,9 @@
// other includes
//_________________________________________________________________________________________________________________
#include <cppuhelper/propshlp.hxx>
+#include <cppuhelper/implbase9.hxx>
#include <cppuhelper/interfacecontainer.hxx>
-#include <cppuhelper/weak.hxx>
+#include <comphelper/propertycontainer.hxx>
#include <vcl/wintypes.hxx>
#include <svtools/miscopt.hxx>
#include <vcl/toolbox.hxx>
@@ -89,22 +91,23 @@ class MenuBar;
namespace framework
{
class GlobalSettings;
- class LayoutManager : public css::lang::XTypeProvider ,
- public css::lang::XServiceInfo ,
- public ::com::sun::star::frame::XLayoutManager ,
- public css::awt::XWindowListener ,
- public css::frame::XFrameActionListener ,
- public ::com::sun::star::ui::XUIConfigurationListener ,
- public ::com::sun::star::frame::XInplaceLayout ,
- public css::awt::XDockableWindowListener ,
- public ::com::sun::star::frame::XMenuBarMergingAcceptor,
- public css::frame::XLayoutManagerEventBroadcaster ,
+ typedef ::cppu::WeakImplHelper9 < ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::frame::XLayoutManager
+ , ::com::sun::star::awt::XWindowListener
+ , ::com::sun::star::frame::XFrameActionListener
+ , ::com::sun::star::ui::XUIConfigurationListener
+ , ::com::sun::star::frame::XInplaceLayout
+ , ::com::sun::star::awt::XDockableWindowListener
+ , ::com::sun::star::frame::XMenuBarMergingAcceptor
+ , ::com::sun::star::frame::XLayoutManagerEventBroadcaster
+ > LayoutManager_Base;
+ typedef ::comphelper::OPropertyContainer LayoutManager_PBase;
+ class LayoutManager : public LayoutManager_Base ,
// base classes
// Order is neccessary for right initialization!
private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
public ::cppu::OBroadcastHelper ,
- public ::cppu::OPropertySetHelper , // => XPropertySet / XFastPropertySet / XMultiPropertySet
- public ::cppu::OWeakObject // => XWeak, XInterface
+ public LayoutManager_PBase
{
public:
enum { DOCKINGAREAS_COUNT = 4 };
@@ -388,6 +391,7 @@ namespace framework
// layouting methods
sal_Bool implts_compareRectangles( const ::com::sun::star::awt::Rectangle& rRect1, const ::com::sun::star::awt::Rectangle& rRect2 );
+ sal_Bool implts_resizeContainerWindow( const ::com::sun::star::awt::Size& rContainerSize, const ::com::sun::star::awt::Point& rComponentPos );
::Size implts_getTopBottomDockingAreaSizes();
::Size implts_getContainerWindowOutputSize();
::com::sun::star::awt::Rectangle implts_getDockingAreaWindowSizes();
@@ -399,7 +403,8 @@ namespace framework
void implts_findNextDockingPos( ::com::sun::star::ui::DockingArea DockingArea, const ::Size& aUIElementSize, ::Point& rVirtualPos, ::Point& rPixelPos );
::com::sun::star::awt::Rectangle implts_calcDockingAreaSizes();
void implts_setDockingAreaWindowSizes( const com::sun::star::awt::Rectangle& rBorderSpace );
- sal_Bool implts_doLayout( sal_Bool bForceRequestBorderSpace );
+ sal_Bool implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_Bool bOuterResize );
+ void implts_doLayout_notify( sal_Bool bOuterResize );
// internal methods to control status/progress bar
::Size implts_getStatusBarSize();
@@ -449,15 +454,15 @@ namespace framework
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException);
- static const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
-
css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; /** reference to factory, which has created this instance. */
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
+ css::uno::Reference< css::container::XIndexAccess > m_xDisplayAccess;
css::uno::Reference< css::frame::XFrame > m_xFrame;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr;
css::uno::WeakReference< css::frame::XModel > m_xModel;
css::uno::Reference< css::awt::XWindow > m_xContainerWindow;
+ css::uno::Reference< css::awt::XTopWindow2 > m_xContainerTopWindow;
css::uno::Reference< css::awt::XWindow > m_xDockAreaWindows[DOCKINGAREAS_COUNT];
sal_Int32 m_nLockCount;
UIElementVector m_aUIElements;
@@ -474,6 +479,7 @@ namespace framework
bool m_bStoreWindowState;
bool m_bHideCurrentUI;
bool m_bGlobalSettings;
+ bool m_bPreserveContentSize;
DockingOperation m_eDockOperation;
UIElement m_aDockUIElement;
css::awt::Rectangle m_aDockingArea;
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 9c3c85008569..01934dfb47df 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -67,17 +67,13 @@
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/XSystemDependentMenuPeer.hpp>
-#ifndef _COM_SUN_STAR_LANG_XYSTEMDEPENDENT_HPP_
#include <com/sun/star/lang/SystemDependent.hpp>
-#endif
#include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
-#ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGER_HPP_
#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
-#endif
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
@@ -92,18 +88,18 @@
// other includes
//_________________________________________________________________________________________________________________
#include <svtools/imgdef.hxx>
+#include <tools/diagnose_ex.h>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/dockingarea.hxx>
#include <vcl/svapp.hxx>
#include <vcl/i18nhelp.hxx>
#include <vcl/wall.hxx>
-#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/unohlp.hxx>
-#endif
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/uno3.hxx>
#include <rtl/logfile.hxx>
#include <unotools/cmdoptions.hxx>
@@ -354,40 +350,8 @@ static void impl_setDockingWindowVisibility( const css::uno::Reference< css::lan
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_14 ( LayoutManager ,
- OWeakObject ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::lang::XServiceInfo ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XLayoutManager ),
- DIRECT_INTERFACE( css::awt::XWindowListener ),
- DIRECT_INTERFACE( css::frame::XFrameActionListener ),
- DIRECT_INTERFACE( ::com::sun::star::ui::XUIConfigurationListener ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XInplaceLayout ),
- DIRECT_INTERFACE( css::awt::XDockableWindowListener ),
- DIRECT_INTERFACE( ::com::sun::star::frame::XMenuBarMergingAcceptor ),
- DIRECT_INTERFACE( css::frame::XLayoutManagerEventBroadcaster ),
- DERIVED_INTERFACE( css::lang::XEventListener, css::frame::XFrameActionListener ),
- DIRECT_INTERFACE( ::com::sun::star::beans::XMultiPropertySet ),
- DIRECT_INTERFACE( ::com::sun::star::beans::XFastPropertySet ),
- DIRECT_INTERFACE( ::com::sun::star::beans::XPropertySet )
- )
-
-DEFINE_XTYPEPROVIDER_14 ( LayoutManager ,
- css::lang::XTypeProvider ,
- css::lang::XServiceInfo ,
- ::com::sun::star::frame::XLayoutManager ,
- css::awt::XWindowListener ,
- css::frame::XFrameActionListener ,
- css::lang::XEventListener ,
- ::com::sun::star::ui::XUIConfigurationListener ,
- ::com::sun::star::frame::XInplaceLayout ,
- css::awt::XDockableWindowListener ,
- ::com::sun::star::frame::XMenuBarMergingAcceptor ,
- css::frame::XLayoutManagerEventBroadcaster ,
- ::com::sun::star::beans::XMultiPropertySet ,
- ::com::sun::star::beans::XFastPropertySet ,
- ::com::sun::star::beans::XPropertySet
- )
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( LayoutManager, LayoutManager_Base, LayoutManager_PBase )
+IMPLEMENT_FORWARD_XINTERFACE2( LayoutManager, LayoutManager_Base, LayoutManager_PBase )
DEFINE_XSERVICEINFO_MULTISERVICE ( LayoutManager ,
::cppu::OWeakObject ,
@@ -398,15 +362,14 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( LayoutManager
DEFINE_INIT_SERVICE ( LayoutManager, {} )
-LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceManager ) :
- ThreadHelpBase( &Application::GetSolarMutex() )
+LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceManager )
+ : LayoutManager_Base ( )
+ , ThreadHelpBase ( &Application::GetSolarMutex() )
, ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aLock.getShareableOslMutex() )
- , ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
- , ::cppu::OWeakObject ( )
+ , LayoutManager_PBase ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, m_xSMGR( xServiceManager )
- , m_xURLTransformer( Reference< XURLTransformer >( xServiceManager->createInstance(
- SERVICENAME_URLTRANSFORMER),
- UNO_QUERY ))
+ , m_xURLTransformer( xServiceManager->createInstance( SERVICENAME_URLTRANSFORMER ), UNO_QUERY )
+ , m_xDisplayAccess( xServiceManager->createInstance( SERVICENAME_DISPLAYACCESS ), UNO_QUERY )
, m_nLockCount( 0 )
, m_bActive( sal_False )
, m_bInplaceMenuSet( sal_False )
@@ -421,6 +384,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
, m_bStoreWindowState( sal_False )
, m_bHideCurrentUI( false )
, m_bGlobalSettings( sal_False )
+ , m_bPreserveContentSize( false )
, m_eDockOperation( DOCKOP_ON_COLROW )
, m_pInplaceMenuBar( NULL )
, m_xModuleManager( Reference< XModuleManager >(
@@ -462,6 +426,15 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM
m_aAsyncLayoutTimer.SetTimeout( 50 );
m_aAsyncLayoutTimer.SetTimeoutHdl( LINK( this, LayoutManager, AsyncLayoutHdl ) );
+
+
+ registerProperty( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, css::beans::PropertyAttribute::TRANSIENT, &m_bAutomaticToolbars, ::getCppuType( &m_bAutomaticToolbars ) );
+ registerProperty( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, css::beans::PropertyAttribute::TRANSIENT, &m_bHideCurrentUI, ::getCppuType( &m_bHideCurrentUI ) );
+ registerProperty( LAYOUTMANAGER_PROPNAME_LOCKCOUNT, LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT, css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY, &m_nLockCount, getCppuType( &m_nLockCount ) );
+ registerProperty( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, css::beans::PropertyAttribute::TRANSIENT, &m_bMenuBarCloser, ::getCppuType( &m_bMenuBarCloser ) );
+ const sal_Bool bRefreshVisibility = sal_False;
+ registerPropertyNoMember( LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY, LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, css::beans::PropertyAttribute::TRANSIENT, ::getCppuType( &bRefreshVisibility ), &bRefreshVisibility );
+ registerProperty( LAYOUTMANAGER_PROPNAME_PRESERVE_CONTENT_SIZE, LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE, css::beans::PropertyAttribute::TRANSIENT, &m_bPreserveContentSize, ::getCppuType( &m_bPreserveContentSize ) );
}
LayoutManager::~LayoutManager()
@@ -3240,7 +3213,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible )
if ( bSetVisible )
{
implts_createNonContextSensitiveToolBars();
- doLayout();
+ implts_doLayout_notify( sal_False );
}
else
{
@@ -3516,7 +3489,7 @@ sal_Bool LayoutManager::implts_showProgressBar()
if ( !pWindow->IsVisible() )
{
pWindow->Show();
- doLayout();
+ implts_doLayout_notify( sal_False );
}
return sal_True;
}
@@ -3557,7 +3530,7 @@ sal_Bool LayoutManager::implts_hideProgressBar()
( bHideStatusBar || bInternalStatusBar ))
{
pWindow->Hide();
- doLayout();
+ implts_doLayout_notify( sal_False );
return sal_True;
}
@@ -3829,6 +3802,7 @@ throw ( RuntimeException )
{
m_aDockingArea = css::awt::Rectangle();
m_xContainerWindow = m_xDockingAreaAcceptor->getContainerWindow();
+ m_xContainerTopWindow.set( m_xContainerWindow, UNO_QUERY );
m_xContainerWindow->addWindowListener( Reference< css::awt::XWindowListener >( static_cast< OWeakObject* >( this ), UNO_QUERY ));
// we always must keep a connection to the window of our frame for resize events
@@ -3913,7 +3887,7 @@ throw ( RuntimeException )
implts_createNonContextSensitiveToolBars();
}
implts_sortUIElements();
- implts_doLayout( sal_True );
+ implts_doLayout( sal_True, sal_False );
}
}
@@ -5477,26 +5451,33 @@ throw (RuntimeException)
implts_notifyListeners( css::frame::LayoutManagerEvents::UNLOCK, a );
if ( bDoLayout )
- doLayout();
+ implts_doLayout_notify( sal_True );
}
void SAL_CALL LayoutManager::doLayout()
throw (RuntimeException)
{
- sal_Bool bLayouted = implts_doLayout( sal_False );
+ implts_doLayout_notify( sal_True );
+}
+void LayoutManager::implts_doLayout_notify( sal_Bool bOuterResize )
+{
+ sal_Bool bLayouted = implts_doLayout( sal_False, bOuterResize );
if ( bLayouted )
implts_notifyListeners( css::frame::LayoutManagerEvents::LAYOUT, Any() );
}
-sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
+sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_Bool bOuterResize )
{
RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::LayoutManager::implts_doLayout" );
sal_Bool bNoLock( sal_False );
css::awt::Rectangle aCurrBorderSpace;
Reference< css::awt::XWindow > xContainerWindow;
+ Reference< css::awt::XTopWindow2 > xContainerTopWindow;
+ Reference< css::awt::XWindow > xComponentWindow;
Reference< XDockingAreaAcceptor > xDockingAreaAcceptor;
+ bool bPreserveContentSize( false );
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
ReadGuard aReadLock( m_aLock );
@@ -5507,8 +5488,11 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
bNoLock = ( m_nLockCount == 0 );
xContainerWindow = m_xContainerWindow;
+ xContainerTopWindow = m_xContainerTopWindow;
+ xComponentWindow = m_xFrame->getComponentWindow();
xDockingAreaAcceptor = m_xDockingAreaAcceptor;
aCurrBorderSpace = m_aDockingArea;
+ bPreserveContentSize = m_bPreserveContentSize;
aReadLock.unlock();
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
@@ -5516,7 +5500,8 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
if ( bNoLock &&
xDockingAreaAcceptor.is() &&
- xContainerWindow.is() )
+ xContainerWindow.is() &&
+ xComponentWindow.is() )
{
bLayouted = sal_True;
@@ -5532,11 +5517,44 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace )
if ( !bEqual || bForceRequestBorderSpace || bMustDoLayout )
{
- bGotRequestedBorderSpace = xDockingAreaAcceptor->requestDockingAreaSpace( aBorderSpace );
- if ( bGotRequestedBorderSpace )
+ // we always resize the content window (instead of the complete container window) if we're not set up
+ // to (attempt to) preserve the content window's size
+ if ( bOuterResize && !bPreserveContentSize )
+ bOuterResize = sal_False;
+
+ // maximized windows can resized their content window only, not their container window
+ if ( bOuterResize && xContainerTopWindow.is() && xContainerTopWindow->getIsMaximized() )
+ bOuterResize = sal_False;
+
+ // if the component window does not have a size (yet), then we can't use it to calc the container
+ // window size
+ css::awt::Rectangle aComponentRect = xComponentWindow->getPosSize();
+ if ( bOuterResize && ( aComponentRect.Width == 0 ) && ( aComponentRect.Height == 0 ) )
+ bOuterResize = sal_False;
+
+ bGotRequestedBorderSpace = sal_False;
+ if ( bOuterResize )
{
- xDockingAreaAcceptor->setDockingAreaSpace( aBorderSpace );
+ Reference< awt::XDevice > xDevice( xContainerWindow, uno::UNO_QUERY );
+ awt::DeviceInfo aContainerInfo = xDevice->getInfo();
+ awt::Size aRequestedSize( aComponentRect.Width + aContainerInfo.LeftInset + aContainerInfo.RightInset + aBorderSpace.X + aBorderSpace.Width,
+ aComponentRect.Height + aContainerInfo.TopInset + aContainerInfo.BottomInset + aBorderSpace.Y + aBorderSpace.Height );
+ awt::Point aComponentPos( aBorderSpace.X, aBorderSpace.Y );
+
+ bGotRequestedBorderSpace = implts_resizeContainerWindow( aRequestedSize, aComponentPos );
+ }
+
+ // if we did not do an container window resize, or it failed, then use the DockingAcceptor as usual
+ if ( !bGotRequestedBorderSpace )
+ {
+ bGotRequestedBorderSpace = xDockingAreaAcceptor->requestDockingAreaSpace( aBorderSpace );
+ if ( bGotRequestedBorderSpace )
+ xDockingAreaAcceptor->setDockingAreaSpace( aBorderSpace );
+ }
+
+ if ( bGotRequestedBorderSpace )
+ {
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
aWriteGuard.lock();
m_aDockingArea = aBorderSpace;
@@ -5603,6 +5621,52 @@ sal_Bool LayoutManager::implts_compareRectangles( const css::awt::Rectangle& rRe
( rRect1.Height == rRect2.Height ));
}
+sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContainerSize,
+ const awt::Point& rComponentPos )
+{
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+ ReadGuard aReadLock( m_aLock );
+ Reference< awt::XWindow > xContainerWindow = m_xContainerWindow;
+ Reference< awt::XTopWindow2 > xContainerTopWindow = m_xContainerTopWindow;
+ Reference< awt::XWindow > xComponentWindow = m_xFrame->getComponentWindow();
+ Reference< container::XIndexAccess > xDisplayAccess = m_xDisplayAccess;
+ aReadLock.unlock();
+ /* SAFE AREA ----------------------------------------------------------------------------------------------- */
+
+ // calculate the maximum size we have for the container window
+ awt::Rectangle aWorkArea;
+ try
+ {
+ sal_Int32 nDisplay = xContainerTopWindow->getDisplay();
+ Reference< beans::XPropertySet > xDisplayInfo( xDisplayAccess->getByIndex( nDisplay ), UNO_QUERY_THROW );
+ OSL_VERIFY( xDisplayInfo->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WorkArea" ) ) ) >>= aWorkArea );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ if ( ( aWorkArea.Width > 0 ) && ( aWorkArea.Height > 0 ) )
+ {
+ if ( ( rContainerSize.Width > aWorkArea.Width )
+ || ( rContainerSize.Height > aWorkArea.Height )
+ )
+ return sal_False;
+ // Strictly, this is not correct. If we have a multi-screen display (css.awt.DisplayAccess.MultiDisplay == true),
+ // the the "effective work area" would be much larger than the work area of a single display, since we could in theory
+ // position the container window across multiple screens.
+ // However, this should suffice as a heuristics here ... (nobody really wants to check whethere the different screens are
+ // stacked horizontally or vertically, whether their work areas can really be combined, or are separated by non-work-areas,
+ // and the like ... right?)
+ }
+
+ // resize our container window
+ xContainerWindow->setPosSize( 0, 0, rContainerSize.Width, rContainerSize.Height, css::awt::PosSize::SIZE );
+ // position the component window
+ xComponentWindow->setPosSize( rComponentPos.X, rComponentPos.Y, 0, 0, css::awt::PosSize::POS );
+ return sal_True;
+}
+
void SAL_CALL LayoutManager::setVisible( sal_Bool bVisible )
throw (::com::sun::star::uno::RuntimeException)
{
@@ -7028,7 +7092,7 @@ IMPL_LINK( LayoutManager, AsyncLayoutHdl, Timer *, EMPTYARG )
aReadLock.unlock();
implts_setDockingAreaWindowSizes( aDockingArea );
- implts_doLayout( sal_True );
+ implts_doLayout( sal_True, sal_False );
return 0;
}
@@ -7079,7 +7143,8 @@ throw ( RuntimeException )
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
implts_reset( sal_True );
- implts_doLayout( sal_True );
+ implts_doLayout( sal_True, sal_False );
+ implts_doLayout( sal_True, sal_True );
}
else if (( aEvent.Action == FrameAction_FRAME_UI_ACTIVATED ) ||
( aEvent.Action == FrameAction_FRAME_UI_DEACTIVATING ))
@@ -7106,7 +7171,6 @@ throw ( RuntimeException )
// SAFE AREA -----------------------------------------------------------------------------------------------
implts_reset( sal_False );
-
}
}
@@ -7148,6 +7212,7 @@ throw( RuntimeException )
}
m_xInplaceMenuBar.clear();
m_xContainerWindow.clear();
+ m_xContainerTopWindow.clear();
implts_destroyDockingAreaWindows();
if ( m_xModuleCfgMgr.is() )
@@ -7198,6 +7263,7 @@ throw( RuntimeException )
}
m_xInplaceMenuBar.clear();
m_xContainerWindow.clear();
+ m_xContainerTopWindow.clear();
}
else if ( rEvent.Source == Reference< XInterface >( m_xDocCfgMgr, UNO_QUERY ))
{
@@ -7412,65 +7478,21 @@ sal_Bool SAL_CALL LayoutManager::convertFastPropertyValue( Any& aConverted
sal_Int32 nHandle ,
const Any& aValue ) throw( com::sun::star::lang::IllegalArgumentException )
{
- // Initialize state with FALSE !!!
- // (Handle can be invalid)
- sal_Bool bReturn = sal_False;
-
- switch( nHandle )
- {
- case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER :
- bReturn = PropHelper::willPropertyBeChanged(
- com::sun::star::uno::makeAny(m_bMenuBarCloser),
- aValue,
- aOldValue,
- aConvertedValue);
- break;
- case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS:
- bReturn = PropHelper::willPropertyBeChanged(
- com::sun::star::uno::makeAny(m_bAutomaticToolbars),
- aValue,
- aOldValue,
- aConvertedValue);
- break;
- case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY:
- bReturn = PropHelper::willPropertyBeChanged(
- com::sun::star::uno::makeAny(sal_False),
- aValue,
- aOldValue,
- aConvertedValue);
- break;
- case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI:
- bReturn = PropHelper::willPropertyBeChanged(
- com::sun::star::uno::makeAny(m_bHideCurrentUI),
- aValue,
- aOldValue,
- aConvertedValue);
- break;
- }
-
- // Return state of operation.
- return bReturn ;
+ return LayoutManager_PBase::convertFastPropertyValue( aConvertedValue, aOldValue, nHandle, aValue );
}
void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle ,
const com::sun::star::uno::Any& aValue ) throw( com::sun::star::uno::Exception )
{
+ if ( nHandle != LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY )
+ LayoutManager_PBase::setFastPropertyValue_NoBroadcast( nHandle, aValue );
+
switch( nHandle )
{
case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER:
- {
- sal_Bool bCloserState = sal_False;
- aValue >>= bCloserState;
- implts_setMenuBarCloser( bCloserState );
- break;
- }
- case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS:
- {
- sal_Bool bValue = sal_Bool();
- if ( aValue >>= bValue )
- m_bAutomaticToolbars = bValue;
+ implts_updateMenuBarClose();
break;
- }
+
case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY:
{
sal_Bool bValue = sal_Bool();
@@ -7478,40 +7500,17 @@ void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32
implts_refreshContextToolbarsVisibility();
break;
}
+
case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI:
- {
- sal_Bool bValue = sal_Bool();
- if ( aValue >>= bValue )
- {
- m_bHideCurrentUI = bValue;
- implts_setCurrentUIVisibility( !bValue );
- }
+ implts_setCurrentUIVisibility( !m_bHideCurrentUI );
break;
- }
}
}
void SAL_CALL LayoutManager::getFastPropertyValue( com::sun::star::uno::Any& aValue ,
sal_Int32 nHandle ) const
{
- switch( nHandle )
- {
- case LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER:
- aValue <<= m_bMenuBarCloser;
- break;
- case LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS:
- aValue <<= m_bAutomaticToolbars;
- break;
- case LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY:
- aValue <<= sal_False;
- break;
- case LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI:
- aValue <<= m_bHideCurrentUI;
- break;
- case LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT:
- aValue <<= m_nLockCount;
- break;
- }
+ LayoutManager_PBase::getFastPropertyValue( aValue, nHandle );
}
::cppu::IPropertyArrayHelper& SAL_CALL LayoutManager::getInfoHelper()
@@ -7530,9 +7529,9 @@ void SAL_CALL LayoutManager::getFastPropertyValue( com::sun::star::uno::Any& aVa
if( pInfoHelper == NULL )
{
// Define static member to give structure of properties to baseclass "OPropertySetHelper".
- // "impl_getStaticPropertyDescriptor" is a non exported and static funtion, who will define a static propertytable.
- // "sal_True" say: Table is sorted by name.
- static ::cppu::OPropertyArrayHelper aInfoHelper( impl_getStaticPropertyDescriptor(), sal_True );
+ uno::Sequence< beans::Property > aProperties;
+ describeProperties( aProperties );
+ static ::cppu::OPropertyArrayHelper aInfoHelper( aProperties, sal_True );
pInfoHelper = &aInfoHelper;
}
}
@@ -7564,28 +7563,5 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CA
return (*pInfo);
}
-const com::sun::star::uno::Sequence< com::sun::star::beans::Property > LayoutManager::impl_getStaticPropertyDescriptor()
-{
- // Create a new static property array to initialize sequence!
- // Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
- // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
- // It's necessary for methods of OPropertySetHelper.
- // ATTENTION:
- // YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
-
- static const com::sun::star::beans::Property pProperties[] =
- {
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ),
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ),
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_LOCKCOUNT, LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT, ::getCppuType((const sal_Int32*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT|com::sun::star::beans::PropertyAttribute::READONLY ),
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_MENUBARCLOSER, LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ),
- com::sun::star::beans::Property( LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY, LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY, ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT )
- };
- // Use it to initialize sequence!
- static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, LAYOUTMANAGER_PROPCOUNT );
- // Return static "PropertyDescriptor"
- return lPropertyDescriptor;
-}
-
} // namespace framework
diff --git a/framework/source/layoutmanager/makefile.mk b/framework/source/layoutmanager/makefile.mk
index b9b6bcf248ff..3af616971ad7 100644
--- a/framework/source/layoutmanager/makefile.mk
+++ b/framework/source/layoutmanager/makefile.mk
@@ -39,6 +39,8 @@ ENABLE_EXCEPTIONS= TRUE
.INCLUDE : settings.mk
+VISIBILITY_HIDDEN = TRUE
+
# --- Generate -----------------------------------------------------
SLOFILES= \
diff --git a/framework/source/register/makefile.mk b/framework/source/register/makefile.mk
index 1e15c55bd23a..7d7f00e94512 100644
--- a/framework/source/register/makefile.mk
+++ b/framework/source/register/makefile.mk
@@ -40,6 +40,8 @@ LIBTARGET= NO
.INCLUDE : settings.mk
+VISIBILITY_HIDDEN = TRUE
+
# --- Generate -----------------------------------------------------
SLOFILES= \
diff --git a/framework/source/xml/menuconfiguration.cxx b/framework/source/xml/menuconfiguration.cxx
index 7b0520219ef6..dcaf354891f6 100644
--- a/framework/source/xml/menuconfiguration.cxx
+++ b/framework/source/xml/menuconfiguration.cxx
@@ -44,10 +44,6 @@
#include <xml/saxnamespacefilter.hxx>
#include <services.h>
-#ifndef _FRAMEWORK_SERVICES_LAYOUTMANAGER_HXX_
-#include <services/layoutmanager.hxx>
-#endif
-
#ifndef _FRAMEWORK_UIELEMENT_ROOTITEMCONTAINER_HXX_
#include <uielement/rootitemcontainer.hxx>
#endif