summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2006-10-06 09:08:15 +0000
committerKurt Zenker <kz@openoffice.org>2006-10-06 09:08:15 +0000
commitf8f328b0c09e73fe16165598eb145844a73460b0 (patch)
tree597ce2515bbab2801cb6a3d09de393d18daf9b61 /vcl
parentINTEGRATION: CWS impresshydra (1.15.260); FILE MERGED (diff)
downloadcore-f8f328b0c09e73fe16165598eb145844a73460b0.tar.gz
core-f8f328b0c09e73fe16165598eb145844a73460b0.zip
INTEGRATION: CWS impresshydra (1.7.48); FILE MERGED
2006/09/20 13:55:27 cl 1.7.48.7: RESYNC: (1.9-1.10); FILE MERGED 2006/09/18 10:03:48 pl 1.7.48.6: #i12719# new API 2006/09/04 14:23:33 cl 1.7.48.5: #i67721# fixed typo 2006/08/29 14:48:55 cl 1.7.48.4: fixed merge conflicts 2006/08/28 13:14:06 cl 1.7.48.3: RESYNC: (1.7-1.9); FILE MERGED 2006/08/07 16:41:16 pl 1.7.48.2: make compile 2006/08/07 14:44:25 pl 1.7.48.1: #i67721# preparations for multi monitor support
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/source/app/salinfo.cxx63
1 files changed, 53 insertions, 10 deletions
diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx
index 9dcb34e1bb74..bf9c08c3388c 100644
--- a/vcl/win/source/app/salinfo.cxx
+++ b/vcl/win/source/app/salinfo.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: salinfo.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: obo $ $Date: 2006-09-17 12:43:10 $
+ * last change: $Author: kz $ $Date: 2006-10-06 10:08:15 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -62,19 +62,25 @@
class WinSalSystem : public SalSystem
{
std::vector< Rectangle > m_aMonitors;
+ std::vector< Rectangle > m_aWorkAreas;
+ unsigned int m_nPrimary;
public:
- WinSalSystem() {}
+ WinSalSystem() : m_nPrimary( 0 ) {}
virtual ~WinSalSystem();
virtual unsigned int GetDisplayScreenCount();
+ virtual bool IsMultiDisplay();
+ virtual unsigned int GetDefaultDisplayNumber();
virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
+ virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen );
virtual int ShowNativeMessageBox( const String& rTitle,
const String& rMessage,
int nButtonCombination,
int nDefaultButton);
-
bool initMonitors();
void addMonitor( const Rectangle& rRect) { m_aMonitors.push_back( rRect ); }
+ void addWorkArea( const Rectangle& rRect) { m_aWorkAreas.push_back( rRect ); }
+ void setLastToPrimary() { m_nPrimary = m_aMonitors.size()-1; }
};
SalSystem* WinSalInstance::CreateSalSystem()
@@ -88,16 +94,25 @@ WinSalSystem::~WinSalSystem()
// -----------------------------------------------------------------------
-static BOOL CALLBACK ImplEnumMonitorProc( HMONITOR,
+static BOOL CALLBACK ImplEnumMonitorProc( HMONITOR hMonitor,
HDC,
- LPRECT lprcMonitor,
+ LPRECT,
LPARAM dwData )
{
+ MONITORINFO aInfo;
+ aInfo.cbSize = sizeof( aInfo );
+ GetMonitorInfo( hMonitor, &aInfo );
WinSalSystem* pSys = reinterpret_cast<WinSalSystem*>(dwData);
- pSys->addMonitor( Rectangle( Point( lprcMonitor->left,
- lprcMonitor->top ),
- Size( lprcMonitor->right - lprcMonitor->left,
- lprcMonitor->bottom - lprcMonitor->top ) ) );
+ pSys->addMonitor( Rectangle( Point( aInfo.rcMonitor.left,
+ aInfo.rcMonitor.top ),
+ Size( aInfo.rcMonitor.right - aInfo.rcMonitor.left,
+ aInfo.rcMonitor.bottom - aInfo.rcMonitor.top ) ) );
+ pSys->addWorkArea( Rectangle( Point( aInfo.rcWork.left,
+ aInfo.rcWork.top ),
+ Size( aInfo.rcWork.right - aInfo.rcWork.left,
+ aInfo.rcWork.bottom - aInfo.rcWork.top ) ) );
+ if( (aInfo.dwFlags & MONITORINFOF_PRIMARY) != 0 )
+ pSys->setLastToPrimary();
return TRUE;
}
@@ -132,6 +147,12 @@ bool WinSalSystem::initMonitors()
int w = GetSystemMetrics( SM_CXSCREEN );
int h = GetSystemMetrics( SM_CYSCREEN );
m_aMonitors.push_back( Rectangle( Point(), Size( w, h ) ) );
+ RECT aWorkRect;
+ if( SystemParametersInfo( SPI_GETWORKAREA, 0, &aWorkRect, 0 ) )
+ m_aWorkAreas.push_back( Rectangle( aWorkRect.left, aWorkRect.top,
+ aWorkRect.right, aWorkRect.bottom ) );
+ else
+ m_aWorkAreas.push_back( m_aMonitors.front() );
}
else
{
@@ -144,6 +165,12 @@ bool WinSalSystem::initMonitors()
int w = GetSystemMetrics( SM_CXSCREEN );
int h = GetSystemMetrics( SM_CYSCREEN );
m_aMonitors.push_back( Rectangle( Point(), Size( w, h ) ) );
+ RECT aWorkRect;
+ if( SystemParametersInfo( SPI_GETWORKAREA, 0, &aWorkRect, 0 ) )
+ m_aWorkAreas.push_back( Rectangle( aWorkRect.left, aWorkRect.top,
+ aWorkRect.right, aWorkRect.bottom ) );
+ else
+ m_aWorkAreas.push_back( m_aMonitors.front() );
}
return m_aMonitors.size() > 0;
@@ -155,12 +182,28 @@ unsigned int WinSalSystem::GetDisplayScreenCount()
return m_aMonitors.size();
}
+bool WinSalSystem::IsMultiDisplay()
+{
+ return false;
+}
+
+unsigned int WinSalSystem::GetDefaultDisplayNumber()
+{
+ return m_nPrimary;
+}
+
Rectangle WinSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
{
initMonitors();
return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen] : Rectangle();
}
+Rectangle WinSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen )
+{
+ initMonitors();
+ return (nScreen < m_aWorkAreas.size()) ? m_aWorkAreas[nScreen] : Rectangle();
+}
+
// -----------------------------------------------------------------------
/* We have to map the button identifier to the identifier used by the Win32
Platform SDK to specify the default button for the MessageBox API.