diff options
author | Kurt Zenker <kz@openoffice.org> | 2006-10-06 09:08:38 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2006-10-06 09:08:38 +0000 |
commit | 603cbd070cbfa4379ad58b21db906c8a97f6d2d1 (patch) | |
tree | 789475f2125a46bed8cbe54326abbfb03a7e8154 /vcl | |
parent | INTEGRATION: CWS impresshydra (1.7.48); FILE MERGED (diff) | |
download | core-603cbd070cbfa4379ad58b21db906c8a97f6d2d1.tar.gz core-603cbd070cbfa4379ad58b21db906c8a97f6d2d1.zip |
INTEGRATION: CWS impresshydra (1.136.48); FILE MERGED
2006/09/20 13:58:48 cl 1.136.48.4: RESYNC: (1.136-1.137); FILE MERGED
2006/09/04 14:24:40 cl 1.136.48.3: #i67721# add support for window spanning in fullscreen mode
2006/07/18 14:40:31 cl 1.136.48.2: #i12719# added support for multi monitors
2006/07/17 12:02:12 cl 1.136.48.1: #i12719# added multi monitor support for fullscreen presentation
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 79 |
1 files changed, 69 insertions, 10 deletions
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index cb4ea876de09..1529c492bfc7 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -4,9 +4,9 @@ * * $RCSfile: salframe.cxx,v $ * - * $Revision: 1.137 $ + * $Revision: 1.138 $ * - * last change: $Author: obo $ $Date: 2006-09-17 12:47:08 $ + * last change: $Author: kz $ $Date: 2006-10-06 10:08:38 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,6 +36,23 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_ +#include <com/sun/star/container/XIndexAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_RECTANGLE_HPP_ +#include <com/sun/star/awt/Rectangle.hpp> +#endif + +#ifndef _COMPHELPER_PROCESSFACTORY_HXX_ +#include <comphelper/processfactory.hxx> +#endif + #include <string.h> #include <limits.h> @@ -132,6 +149,12 @@ #include <time.h> +using ::rtl::OUString; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::beans; + // The following defines are newly added in Longhorn #ifndef WM_MOUSEHWHEEL # define WM_MOUSEHWHEEL 0x020E @@ -878,8 +901,10 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, int nFrameX; int nFrameY; int nCaptionY; - int nScreenDX; - int nScreenDY; + int nScreenX = 0; + int nScreenY = 0; + int nScreenDX = 0; + int nScreenDY = 0; if ( pFrame->mbSizeBorder ) { @@ -906,11 +931,42 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, else nCaptionY = 0; - nScreenDX = GetSystemMetrics( SM_CXSCREEN ); - nScreenDY = GetSystemMetrics( SM_CYSCREEN ); + try + { + Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); + Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW ); + if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < xMultiMon->getCount()) ) + { + Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW ); + com::sun::star::awt::Rectangle aRect; + if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect ) + { + nScreenX = aRect.X; + nScreenY = aRect.Y; + nScreenDX = aRect.Width; + nScreenDY = aRect.Height; + } + } + else + { + nScreenX = GetSystemMetrics( SM_XVIRTUALSCREEN ); + nScreenY = GetSystemMetrics( SM_YVIRTUALSCREEN ); + nScreenDX = GetSystemMetrics( SM_CXVIRTUALSCREEN ); + nScreenDY = GetSystemMetrics( SM_CYVIRTUALSCREEN ); + } + } + catch( Exception& ) + { + } - rX = -nFrameX; - rY = -(nFrameY+nCaptionY); + if( !nScreenDX || !nScreenDY ) + { + nScreenDX = GetSystemMetrics( SM_CXSCREEN ); + nScreenDY = GetSystemMetrics( SM_CYSCREEN ); + } + + rX = nScreenX -nFrameX; + rY = nScreenY -(nFrameY+nCaptionY); rDX = nScreenDX+(nFrameX*2); rDY = nScreenDY+(nFrameY*2)+nCaptionY; } @@ -976,6 +1032,7 @@ WinSalFrame::WinSalFrame() mbNoIcon = FALSE; mSelectedhMenu = 0; mLastActivatedhMenu = 0; + mnDisplay = 0; memset( &maState, 0, sizeof( SalFrameState ) ); maSysData.nSize = sizeof( SystemEnvData ); @@ -1953,12 +2010,14 @@ BOOL WinSalFrame::GetWindowState( SalFrameState* pState ) // ----------------------------------------------------------------------- -void WinSalFrame::ShowFullScreen( BOOL bFullScreen ) +void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay ) { - if ( mbFullScreen == bFullScreen ) + if ( (mbFullScreen == bFullScreen) && (!bFullScreen || (mnDisplay == nDisplay)) ) return; mbFullScreen = bFullScreen; + mnDisplay = nDisplay; + if ( bFullScreen ) { // Damit Taskleiste von Windows ausgeblendet wird |