summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-01-24 03:09:02 +0200
committerTor Lillqvist <tlillqvist@novell.com>2011-01-24 03:09:02 +0200
commite46003644b7a109f6e7a856b5730ff28cb01e206 (patch)
treea0add0298c8233db7cbeb9cdbe67084488780564 /vcl
parent6cd6af5b9daea7a95359b1b16f0cc8f98a572cb6 (diff)
Kill Win9x and NT4 code
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/inc/saldata.hxx3
-rw-r--r--vcl/win/source/app/salinfo.cxx132
-rw-r--r--vcl/win/source/app/salinst.cxx139
3 files changed, 94 insertions, 180 deletions
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index 5e8a91f6085c..4c87484a5398 100644
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -154,9 +154,6 @@ struct SalShlData
UINT mnWheelScrollLines; // WheelScrollLines
UINT mnWheelScrollChars; // WheelScrollChars
UINT mnWheelMsgId; // Wheel-Message-Id fuer W95
- WORD mnVersion; // System-Version (311 == 3.11)
- WIN_BOOL mbWNT; // kein W16/W95/W98 sondern ein NT
- WIN_BOOL mbW40; // Is System-Version >= 4.0
WIN_BOOL mbWXP; // Windows XP
WIN_BOOL mbWPrinter; // true: use unicode printer functions
// false: use anis compat printer functions
diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx
index 943344c189a1..2280fd6e0ddf 100644
--- a/vcl/win/source/app/salinfo.cxx
+++ b/vcl/win/source/app/salinfo.cxx
@@ -121,88 +121,8 @@ bool WinSalSystem::initMonitors()
if( m_aMonitors.size() > 0 )
return true;
- bool winVerOk = true;
-
- // multi monitor calls not available on Win95/NT
- if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
- {
- if ( aSalShlData.maVersionInfo.dwMajorVersion <= 4 )
- winVerOk = false; // NT
- }
- else if( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
- {
- if ( aSalShlData.maVersionInfo.dwMajorVersion == 4 && aSalShlData.maVersionInfo.dwMinorVersion == 0 )
- winVerOk = false; // Win95
- }
- if( winVerOk )
- {
- int nMonitors = GetSystemMetrics( SM_CMONITORS );
- if( nMonitors == 1 )
- {
- int w = GetSystemMetrics( SM_CXSCREEN );
- int h = GetSystemMetrics( SM_CYSCREEN );
- m_aMonitors.push_back( DisplayMonitor( rtl::OUString(),
- rtl::OUString(),
- Rectangle( Point(), Size( w, h ) ),
- Rectangle( Point(), Size( w, h ) ),
- 0 ) );
- m_aDeviceNameToMonitor[ rtl::OUString() ] = 0;
- m_nPrimary = 0;
- RECT aWorkRect;
- if( SystemParametersInfo( SPI_GETWORKAREA, 0, &aWorkRect, 0 ) )
- m_aMonitors.back().m_aWorkArea = Rectangle( aWorkRect.left, aWorkRect.top,
- aWorkRect.right, aWorkRect.bottom );
- }
- else
- {
- DISPLAY_DEVICEW aDev;
- aDev.cb = sizeof( aDev );
- DWORD nDevice = 0;
- std::hash_map< rtl::OUString, int, rtl::OUStringHash > aDeviceStringCount;
- while( EnumDisplayDevicesW( NULL, nDevice++, &aDev, 0 ) )
- {
- if( (aDev.StateFlags & DISPLAY_DEVICE_ACTIVE)
- && !(aDev.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) ) // sort out non/disabled monitors
- {
- aDev.DeviceName[31] = 0;
- aDev.DeviceString[127] = 0;
- rtl::OUString aDeviceName( reinterpret_cast<const sal_Unicode *>(aDev.DeviceName) );
- rtl::OUString aDeviceString( reinterpret_cast<const sal_Unicode *>(aDev.DeviceString) );
- if( aDeviceStringCount.find( aDeviceString ) == aDeviceStringCount.end() )
- aDeviceStringCount[ aDeviceString ] = 1;
- else
- aDeviceStringCount[ aDeviceString ]++;
- m_aDeviceNameToMonitor[ aDeviceName ] = m_aMonitors.size();
- m_aMonitors.push_back( DisplayMonitor( aDeviceString,
- aDeviceName,
- Rectangle(),
- Rectangle(),
- aDev.StateFlags ) );
- }
- }
- HDC aDesktopRC = GetDC( NULL );
- EnumDisplayMonitors( aDesktopRC, NULL, ImplEnumMonitorProc, reinterpret_cast<LPARAM>(this) );
-
- // append monitor numbers to name strings
- std::hash_map< rtl::OUString, int, rtl::OUStringHash > aDevCount( aDeviceStringCount );
- unsigned int nMonitors = m_aMonitors.size();
- for( unsigned int i = 0; i < nMonitors; i++ )
- {
- const rtl::OUString& rDev( m_aMonitors[i].m_aName );
- if( aDeviceStringCount[ rDev ] > 1 )
- {
- int nInstance = aDeviceStringCount[ rDev ] - (-- aDevCount[ rDev ] );
- rtl::OUStringBuffer aBuf( rDev.getLength() + 8 );
- aBuf.append( rDev );
- aBuf.appendAscii( " (" );
- aBuf.append( sal_Int32( nInstance ) );
- aBuf.append( sal_Unicode(')') );
- m_aMonitors[ i ].m_aName = aBuf.makeStringAndClear();
- }
- }
- }
- }
- else
+ int nMonitors = GetSystemMetrics( SM_CMONITORS );
+ if( nMonitors == 1 )
{
int w = GetSystemMetrics( SM_CXSCREEN );
int h = GetSystemMetrics( SM_CYSCREEN );
@@ -218,6 +138,54 @@ bool WinSalSystem::initMonitors()
m_aMonitors.back().m_aWorkArea = Rectangle( aWorkRect.left, aWorkRect.top,
aWorkRect.right, aWorkRect.bottom );
}
+ else
+ {
+ DISPLAY_DEVICEW aDev;
+ aDev.cb = sizeof( aDev );
+ DWORD nDevice = 0;
+ std::hash_map< rtl::OUString, int, rtl::OUStringHash > aDeviceStringCount;
+ while( EnumDisplayDevicesW( NULL, nDevice++, &aDev, 0 ) )
+ {
+ if( (aDev.StateFlags & DISPLAY_DEVICE_ACTIVE)
+ && !(aDev.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) ) // sort out non/disabled monitors
+ {
+ aDev.DeviceName[31] = 0;
+ aDev.DeviceString[127] = 0;
+ rtl::OUString aDeviceName( reinterpret_cast<const sal_Unicode *>(aDev.DeviceName) );
+ rtl::OUString aDeviceString( reinterpret_cast<const sal_Unicode *>(aDev.DeviceString) );
+ if( aDeviceStringCount.find( aDeviceString ) == aDeviceStringCount.end() )
+ aDeviceStringCount[ aDeviceString ] = 1;
+ else
+ aDeviceStringCount[ aDeviceString ]++;
+ m_aDeviceNameToMonitor[ aDeviceName ] = m_aMonitors.size();
+ m_aMonitors.push_back( DisplayMonitor( aDeviceString,
+ aDeviceName,
+ Rectangle(),
+ Rectangle(),
+ aDev.StateFlags ) );
+ }
+ }
+ HDC aDesktopRC = GetDC( NULL );
+ EnumDisplayMonitors( aDesktopRC, NULL, ImplEnumMonitorProc, reinterpret_cast<LPARAM>(this) );
+
+ // append monitor numbers to name strings
+ std::hash_map< rtl::OUString, int, rtl::OUStringHash > aDevCount( aDeviceStringCount );
+ unsigned int nMonitors = m_aMonitors.size();
+ for( unsigned int i = 0; i < nMonitors; i++ )
+ {
+ const rtl::OUString& rDev( m_aMonitors[i].m_aName );
+ if( aDeviceStringCount[ rDev ] > 1 )
+ {
+ int nInstance = aDeviceStringCount[ rDev ] - (-- aDevCount[ rDev ] );
+ rtl::OUStringBuffer aBuf( rDev.getLength() + 8 );
+ aBuf.append( rDev );
+ aBuf.appendAscii( " (" );
+ aBuf.append( sal_Int32( nInstance ) );
+ aBuf.append( sal_Unicode(')') );
+ m_aMonitors[ i ].m_aName = aBuf.makeStringAndClear();
+ }
+ }
+ }
return m_aMonitors.size() > 0;
}
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index cee88a2726d2..d69337bf356d 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -512,27 +512,19 @@ SalInstance* CreateSalInstance()
SalData* pSalData = GetSalData();
// determine the windows version
- aSalShlData.mbWNT = 0;
aSalShlData.mbWXP = 0;
aSalShlData.mbWPrinter = 0;
WORD nVer = (WORD)GetVersion();
- aSalShlData.mnVersion = (((WORD)LOBYTE(nVer)) * 100) + HIBYTE(nVer);
- if ( aSalShlData.mnVersion >= 400 )
- aSalShlData.mbW40 = 1;
rtl_zeroMemory( &aSalShlData.maVersionInfo, sizeof(aSalShlData.maVersionInfo) );
aSalShlData.maVersionInfo.dwOSVersionInfoSize = sizeof( aSalShlData.maVersionInfo );
if ( GetVersionEx( &aSalShlData.maVersionInfo ) )
{
- if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
- {
- aSalShlData.mbWNT = 1;
- // Windows XP ?
- if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 ||
- ( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) )
- aSalShlData.mbWXP = 1;
- if( aSalShlData.maVersionInfo.dwMajorVersion >= 5 )
- aSalShlData.mbWPrinter = 1;
- }
+ // Windows XP ?
+ if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 ||
+ ( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) )
+ aSalShlData.mbWXP = 1;
+ if( aSalShlData.maVersionInfo.dwMajorVersion >= 5 )
+ aSalShlData.mbWPrinter = 1;
}
pSalData->mnAppThreadId = GetCurrentThreadId();
@@ -540,90 +532,47 @@ SalInstance* CreateSalInstance()
// register frame class
if ( !pSalData->mhPrevInst )
{
- if ( aSalShlData.mbWNT )
- {
- WNDCLASSEXW aWndClassEx;
- aWndClassEx.cbSize = sizeof( aWndClassEx );
- aWndClassEx.style = CS_OWNDC;
- aWndClassEx.lpfnWndProc = SalFrameWndProcW;
- aWndClassEx.cbClsExtra = 0;
- aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA;
- aWndClassEx.hInstance = pSalData->mhInst;
- aWndClassEx.hCursor = 0;
- aWndClassEx.hbrBackground = 0;
- aWndClassEx.lpszMenuName = 0;
- aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEW;
- ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm );
- if ( !RegisterClassExW( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.hIcon = 0;
- aWndClassEx.hIconSm = 0;
- aWndClassEx.style |= CS_SAVEBITS;
- aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEW;
- if ( !RegisterClassExW( &aWndClassEx ) )
- return NULL;
-
- // shadow effect for popups on XP
- if( aSalShlData.mbWXP )
- aWndClassEx.style |= CS_DROPSHADOW;
- aWndClassEx.lpszClassName = SAL_TMPSUBFRAME_CLASSNAMEW;
- if ( !RegisterClassExW( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.style = 0;
- aWndClassEx.lpfnWndProc = SalComWndProcW;
- aWndClassEx.cbWndExtra = 0;
- aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEW;
- if ( !RegisterClassExW( &aWndClassEx ) )
- return NULL;
- }
- else
- {
- WNDCLASSEXA aWndClassEx;
- aWndClassEx.cbSize = sizeof( aWndClassEx );
- aWndClassEx.style = CS_OWNDC;
- aWndClassEx.lpfnWndProc = SalFrameWndProcA;
- aWndClassEx.cbClsExtra = 0;
- aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA;
- aWndClassEx.hInstance = pSalData->mhInst;
- aWndClassEx.hCursor = 0;
- aWndClassEx.hbrBackground = 0;
- aWndClassEx.lpszMenuName = 0;
- aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEA;
- ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm );
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.hIcon = 0;
- aWndClassEx.hIconSm = 0;
- aWndClassEx.style |= CS_SAVEBITS;
- aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEA;
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
-
- aWndClassEx.style = 0;
- aWndClassEx.lpfnWndProc = SalComWndProcA;
- aWndClassEx.cbWndExtra = 0;
- aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEA;
- if ( !RegisterClassExA( &aWndClassEx ) )
- return NULL;
- }
+ WNDCLASSEXW aWndClassEx;
+ aWndClassEx.cbSize = sizeof( aWndClassEx );
+ aWndClassEx.style = CS_OWNDC;
+ aWndClassEx.lpfnWndProc = SalFrameWndProcW;
+ aWndClassEx.cbClsExtra = 0;
+ aWndClassEx.cbWndExtra = SAL_FRAME_WNDEXTRA;
+ aWndClassEx.hInstance = pSalData->mhInst;
+ aWndClassEx.hCursor = 0;
+ aWndClassEx.hbrBackground = 0;
+ aWndClassEx.lpszMenuName = 0;
+ aWndClassEx.lpszClassName = SAL_FRAME_CLASSNAMEW;
+ ImplLoadSalIcon( SAL_RESID_ICON_DEFAULT, aWndClassEx.hIcon, aWndClassEx.hIconSm );
+ if ( !RegisterClassExW( &aWndClassEx ) )
+ return NULL;
+
+ aWndClassEx.hIcon = 0;
+ aWndClassEx.hIconSm = 0;
+ aWndClassEx.style |= CS_SAVEBITS;
+ aWndClassEx.lpszClassName = SAL_SUBFRAME_CLASSNAMEW;
+ if ( !RegisterClassExW( &aWndClassEx ) )
+ return NULL;
+
+ // shadow effect for popups on XP
+ if( aSalShlData.mbWXP )
+ aWndClassEx.style |= CS_DROPSHADOW;
+ aWndClassEx.lpszClassName = SAL_TMPSUBFRAME_CLASSNAMEW;
+ if ( !RegisterClassExW( &aWndClassEx ) )
+ return NULL;
+
+ aWndClassEx.style = 0;
+ aWndClassEx.lpfnWndProc = SalComWndProcW;
+ aWndClassEx.cbWndExtra = 0;
+ aWndClassEx.lpszClassName = SAL_COM_CLASSNAMEW;
+ if ( !RegisterClassExW( &aWndClassEx ) )
+ return NULL;
}
HWND hComWnd;
- if ( aSalShlData.mbWNT )
- {
- hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
- L"", WS_POPUP, 0, 0, 0, 0, 0, 0,
- pSalData->mhInst, NULL );
- }
- else
- {
- hComWnd = CreateWindowExA( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEA,
- "", WS_POPUP, 0, 0, 0, 0, 0, 0,
- pSalData->mhInst, NULL );
- }
+ hComWnd = CreateWindowExW( WS_EX_TOOLWINDOW, SAL_COM_CLASSNAMEW,
+ L"", WS_POPUP, 0, 0, 0, 0, 0, 0,
+ pSalData->mhInst, NULL );
if ( !hComWnd )
return NULL;