summaryrefslogtreecommitdiff
path: root/vcl/win/source/window/salframe.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/win/source/window/salframe.cxx')
-rw-r--r--vcl/win/source/window/salframe.cxx397
1 files changed, 216 insertions, 181 deletions
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 4548427addef..15be14eac5be 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -96,6 +96,7 @@ using ::std::max;
#include <time.h>
using ::rtl::OUString;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
@@ -120,8 +121,8 @@ void MyOutputDebugString( char *s) { OutputDebugString( s ); }
// misssing prototypes and constants for LayeredWindows
extern "C" {
- //WINUSERAPI BOOL WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD);
- typedef BOOL ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD);
+ //WINUSERAPI sal_Bool WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD);
+ typedef sal_Bool ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD);
static SetLayeredWindowAttributes_Proc_T lpfnSetLayeredWindowAttributes;
};
@@ -129,7 +130,7 @@ extern "C" {
const unsigned int WM_USER_SYSTEM_WINDOW_ACTIVATED = RegisterWindowMessageA("SYSTEM_WINDOW_ACTIVATED");
-BOOL WinSalFrame::mbInReparent = FALSE;
+sal_Bool WinSalFrame::mbInReparent = FALSE;
// =======================================================================
@@ -160,7 +161,7 @@ static void ImplSaveFrameState( WinSalFrame* pFrame )
// Position, Groesse und Status fuer GetWindowState() merken
if ( !pFrame->mbFullScreen )
{
- BOOL bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( pFrame->mhWnd ) & WS_VISIBLE) != 0;
if ( IsIconic( pFrame->mhWnd ) )
{
pFrame->maState.mnState |= SAL_FRAMESTATE_MINIMIZED;
@@ -344,13 +345,13 @@ void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect )
// =======================================================================
SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
- HWND hWndParent, ULONG nSalFrameStyle )
+ HWND hWndParent, sal_uLong nSalFrameStyle )
{
WinSalFrame* pFrame = new WinSalFrame;
HWND hWnd;
DWORD nSysStyle = 0;
DWORD nExSysStyle = 0;
- BOOL bSubFrame = FALSE;
+ sal_Bool bSubFrame = FALSE;
if( getenv( "SAL_SYNCHRONIZE" ) ) // no buffering of drawing commands
GdiSetBatchLimit( 1 );
@@ -583,11 +584,11 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
// helper that only creates the HWND
// to allow for easy reparenting of system windows, (i.e. destroy and create new)
-HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
+HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild )
{
HINSTANCE hInstance = GetSalData()->mhInst;
- ULONG nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
- ULONG nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
+ sal_uLong nSysStyle = GetWindowLong( oldhWnd, GWL_STYLE );
+ sal_uLong nExSysStyle = GetWindowLong( oldhWnd, GWL_EXSTYLE );
if( bAsChild )
{
@@ -606,7 +607,7 @@ HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, BOOL bAsChild )
// Uebersetzungstabelle von System-Keycodes in StarView-Keycodes
#define KEY_TAB_SIZE 146
-static USHORT aImplTranslateKeyTab[KEY_TAB_SIZE] =
+static sal_uInt16 aImplTranslateKeyTab[KEY_TAB_SIZE] =
{
// StarView-Code System-Code Index
0, // 0
@@ -863,11 +864,11 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
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 );
+ uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ uno::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 );
+ uno::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 )
{
@@ -903,7 +904,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame,
// -----------------------------------------------------------------------
-static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, BOOL bAlways = FALSE )
+static void ImplSalFrameFullScreenPos( WinSalFrame* pFrame, sal_Bool bAlways = FALSE )
{
if ( bAlways || !IsIconic( pFrame->mhWnd ) )
{
@@ -1167,9 +1168,9 @@ void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
// -----------------------------------------------------------------------
-BOOL WinSalFrame::PostEvent( void* pData )
+sal_Bool WinSalFrame::PostEvent( void* pData )
{
- return (BOOL)ImplPostMessage( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
+ return (sal_Bool)ImplPostMessage( mhWnd, SAL_MSG_USEREVENT, 0, (LPARAM)pData );
}
// -----------------------------------------------------------------------
@@ -1187,7 +1188,7 @@ void WinSalFrame::SetTitle( const XubString& rTitle )
// -----------------------------------------------------------------------
-void WinSalFrame::SetIcon( USHORT nIcon )
+void WinSalFrame::SetIcon( sal_uInt16 nIcon )
{
// If we have a window without an Icon (for example a dialog), ignore this call
if ( mbNoIcon )
@@ -1244,7 +1245,7 @@ SalFrame* WinSalFrame::GetParent() const
// -----------------------------------------------------------------------
-static void ImplSalShow( HWND hWnd, BOOL bVisible, BOOL bNoActivate )
+static void ImplSalShow( HWND hWnd, sal_Bool bVisible, sal_Bool bNoActivate )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if ( !pFrame )
@@ -1329,7 +1330,7 @@ void WinSalFrame::SetExtendedFrameStyle( SalExtStyle )
// -----------------------------------------------------------------------
-void WinSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
+void WinSalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate )
{
// Post this Message to the window, because this only works
// in the thread of the window, which has create this window.
@@ -1342,7 +1343,7 @@ void WinSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
// -----------------------------------------------------------------------
-void WinSalFrame::Enable( BOOL bEnable )
+void WinSalFrame::Enable( sal_Bool bEnable )
{
EnableWindow( mhWnd, bEnable );
}
@@ -1364,9 +1365,9 @@ void WinSalFrame::SetMaxClientSize( long nWidth, long nHeight )
// -----------------------------------------------------------------------
void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
- USHORT nFlags )
+ sal_uInt16 nFlags )
{
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( !bVisible )
{
Window *pClientWin = GetWindow()->ImplGetClientWindow();
@@ -1381,7 +1382,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
ShowWindow( mhWnd, SW_RESTORE );
}
- USHORT nEvent = 0;
+ sal_uInt16 nEvent = 0;
UINT nPosSize = 0;
RECT aClientRect, aWindowRect;
GetClientRect( mhWnd, &aClientRect ); // x,y always 0,0, but width and height without border
@@ -1533,7 +1534,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// Adjust Window in the screen
- BOOL bCheckOffScreen = TRUE;
+ sal_Bool bCheckOffScreen = TRUE;
// but don't do this for floaters or ownerdraw windows that are currently moved interactively
if( (mnStyle & SAL_FRAME_STYLE_FLOAT) && !(mnStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
@@ -1576,7 +1577,7 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// -----------------------------------------------------------------------
-static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, BOOL bAsChild )
+static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, sal_Bool bAsChild )
{
// save hwnd, will be overwritten in WM_CREATE during createwindow
HWND hWndOld = pThis->mhWnd;
@@ -1609,8 +1610,8 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, BOOL bAs
pObject = pObject->mpNextObject;
}
- BOOL bNeedGraphics = pThis->mbGraphics;
- BOOL bNeedCacheDC = FALSE;
+ sal_Bool bNeedGraphics = pThis->mbGraphics;
+ sal_Bool bNeedCacheDC = FALSE;
HFONT hFont = NULL;
HPEN hPen = NULL;
@@ -1850,8 +1851,8 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
GetWindowPlacement( mhWnd, &aPlacement );
// Status setzen
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
- BOOL bUpdateHiddenFramePos = FALSE;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bUpdateHiddenFramePos = FALSE;
if ( !bVisible )
{
aPlacement.showCmd = SW_HIDE;
@@ -1932,7 +1933,7 @@ void WinSalFrame::SetWindowState( const SalFrameState* pState )
// -----------------------------------------------------------------------
-BOOL WinSalFrame::GetWindowState( SalFrameState* pState )
+sal_Bool WinSalFrame::GetWindowState( SalFrameState* pState )
{
if ( maState.mnWidth && maState.mnHeight )
{
@@ -1986,7 +1987,7 @@ void WinSalFrame::SetApplicationID( const rtl::OUString &/*rApplicationID*/ )
// -----------------------------------------------------------------------
-void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
+void WinSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
{
if ( (mbFullScreen == bFullScreen) && (!bFullScreen || (mnDisplay == nDisplay)) )
return;
@@ -2019,7 +2020,7 @@ void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
{
// wenn ShowState wieder hergestellt werden muss, hiden wir zuerst
// das Fenster, damit es nicht so sehr flackert
- BOOL bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
+ sal_Bool bVisible = (GetWindowStyle( mhWnd ) & WS_VISIBLE) != 0;
if ( bVisible && (mnShowState != mnFullScreenShowState) )
ShowWindow( mhWnd, SW_HIDE );
@@ -2051,7 +2052,7 @@ void WinSalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nDisplay )
// -----------------------------------------------------------------------
-void WinSalFrame::StartPresentation( BOOL bStart )
+void WinSalFrame::StartPresentation( sal_Bool bStart )
{
if ( mbPresentation == bStart )
return;
@@ -2106,7 +2107,7 @@ void WinSalFrame::StartPresentation( BOOL bStart )
// -----------------------------------------------------------------------
-void WinSalFrame::SetAlwaysOnTop( BOOL bOnTop )
+void WinSalFrame::SetAlwaysOnTop( sal_Bool bOnTop )
{
HWND hWnd;
if ( bOnTop )
@@ -2118,7 +2119,7 @@ void WinSalFrame::SetAlwaysOnTop( BOOL bOnTop )
// -----------------------------------------------------------------------
-static void ImplSalToTop( HWND hWnd, USHORT nFlags )
+static void ImplSalToTop( HWND hWnd, sal_uInt16 nFlags )
{
WinSalFrame* pToTopFrame = GetWindowPtr( hWnd );
if( pToTopFrame && (pToTopFrame->mnStyle & SAL_FRAME_STYLE_SYSTEMCHILD) != 0 )
@@ -2174,7 +2175,7 @@ static void ImplSalToTop( HWND hWnd, USHORT nFlags )
// -----------------------------------------------------------------------
-void WinSalFrame::ToTop( USHORT nFlags )
+void WinSalFrame::ToTop( sal_uInt16 nFlags )
{
nFlags &= ~SAL_FRAME_TOTOP_GRABFOCUS; // this flag is not needed on win32
// Post this Message to the window, because this only works
@@ -2325,7 +2326,7 @@ void WinSalFrame::SetPointer( PointerStyle ePointerStyle )
// -----------------------------------------------------------------------
-void WinSalFrame::CaptureMouse( BOOL bCapture )
+void WinSalFrame::CaptureMouse( sal_Bool bCapture )
{
// Send this Message to the window, because CaptureMouse() only work
// in the thread of the window, which has create this window
@@ -2367,7 +2368,7 @@ void WinSalFrame::Sync()
static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pContext )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
- BOOL bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0;
+ sal_Bool bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0;
if ( bIME )
{
if ( !pFrame->mbIME )
@@ -2434,7 +2435,7 @@ void WinSalFrame::SetInputContext( SalInputContext* pContext )
// -----------------------------------------------------------------------
-static void ImplSalFrameEndExtTextInput( HWND hWnd, USHORT nFlags )
+static void ImplSalFrameEndExtTextInput( HWND hWnd, sal_uInt16 nFlags )
{
HIMC hIMC = ImmGetContext( hWnd );
if ( hIMC )
@@ -2452,7 +2453,7 @@ static void ImplSalFrameEndExtTextInput( HWND hWnd, USHORT nFlags )
// -----------------------------------------------------------------------
-void WinSalFrame::EndExtTextInput( USHORT nFlags )
+void WinSalFrame::EndExtTextInput( sal_uInt16 nFlags )
{
// Must be called in the main thread!
ImplSendMessage( mhWnd, SAL_MSG_ENDEXTTEXTINPUT, (WPARAM)nFlags, 0 );
@@ -2523,7 +2524,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
// -----------------------------------------------------------------------
-XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
+XubString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
static const int nMaxKeyLen = 350;
sal_Unicode aKeyBuf[ nMaxKeyLen ];
@@ -2533,26 +2534,26 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
if ( nKeyCode & KEY_MOD1 )
{
nSysCode = MapVirtualKey( VK_CONTROL, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Ctrl" );
}
if ( nKeyCode & KEY_MOD2 )
{
nSysCode = MapVirtualKey( VK_MENU, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Alt" );
}
if ( nKeyCode & KEY_SHIFT )
{
nSysCode = MapVirtualKey( VK_SHIFT, 0 );
- nSysCode = (nSysCode << 16) | (((ULONG)1) << 25);
+ nSysCode = (nSysCode << 16) | (((sal_uLong)1) << 25);
ImplGetKeyNameText( nSysCode, aKeyBuf, nKeyBufLen, nMaxKeyLen, "Shift" );
}
- USHORT nCode = nKeyCode & 0x0FFF;
- ULONG nSysCode2 = 0;
+ sal_uInt16 nCode = nKeyCode & 0x0FFF;
+ sal_uLong nSysCode2 = 0;
sal_Char* pReplace = NULL;
sal_Unicode cSVCode = 0;
sal_Char aFBuf[4];
@@ -2591,42 +2592,42 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
{
case KEY_DOWN:
nSysCode = VK_DOWN;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Down";
break;
case KEY_UP:
nSysCode = VK_UP;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Up";
break;
case KEY_LEFT:
nSysCode = VK_LEFT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Left";
break;
case KEY_RIGHT:
nSysCode = VK_RIGHT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Right";
break;
case KEY_HOME:
nSysCode = VK_HOME;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Home";
break;
case KEY_END:
nSysCode = VK_END;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "End";
break;
case KEY_PAGEUP:
nSysCode = VK_PRIOR;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Page Up";
break;
case KEY_PAGEDOWN:
nSysCode = VK_NEXT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Page Down";
break;
case KEY_RETURN:
@@ -2651,12 +2652,12 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
break;
case KEY_INSERT:
nSysCode = VK_INSERT;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Insert";
break;
case KEY_DELETE:
nSysCode = VK_DELETE;
- nSysCode2 = (((ULONG)1) << 24);
+ nSysCode2 = (((sal_uLong)1) << 24);
pReplace = "Delete";
break;
@@ -2720,12 +2721,12 @@ XubString WinSalFrame::GetKeyName( USHORT nKeyCode )
if( !nKeyBufLen )
return XubString();
- return XubString( aKeyBuf, sal::static_int_cast< USHORT >(nKeyBufLen) );
+ return XubString( aKeyBuf, sal::static_int_cast< sal_uInt16 >(nKeyBufLen) );
}
// -----------------------------------------------------------------------
-XubString WinSalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode )
+XubString WinSalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode )
{
return GetKeyName( nKeyCode );
}
@@ -2803,6 +2804,29 @@ static long ImplA2I( const BYTE* pStr )
}
// -----------------------------------------------------------------------
+static HRESULT WINAPI backwardCompatibleDwmIsCompositionEnabled( BOOL* pOut )
+{
+ *pOut = FALSE;
+ return S_OK;
+}
+
+static BOOL ImplDwmIsCompositionEnabled()
+{
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->mpDwmIsCompositionEnabled )
+ {
+ rtl::OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "Dwmapi.dll" ) );
+ pSalData->maDwmLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+ if( pSalData->maDwmLib )
+ pSalData->mpDwmIsCompositionEnabled = (DwmIsCompositionEnabled_ptr)osl_getAsciiFunctionSymbol( pSalData->maDwmLib, "DwmIsCompositionEnabled" );
+ if( ! pSalData->mpDwmIsCompositionEnabled ) // something failed
+ pSalData->mpDwmIsCompositionEnabled = backwardCompatibleDwmIsCompositionEnabled;
+ }
+ BOOL aResult = FALSE;
+ HRESULT nError = pSalData->mpDwmIsCompositionEnabled( &aResult );
+ return nError == S_OK && aResult;
+}
+
void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
@@ -2828,34 +2852,30 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
&nType, aValueBuf, &nValueSize ) == ERROR_SUCCESS )
{
if ( nType == REG_SZ )
- aMouseSettings.SetMenuDelay( (ULONG)ImplA2I( aValueBuf ) );
+ aMouseSettings.SetMenuDelay( (sal_uLong)ImplA2I( aValueBuf ) );
}
RegCloseKey( hRegKey );
}
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- BOOL bCompBorder = (aStyleSettings.GetOptions() & (STYLE_OPTION_MACSTYLE | STYLE_OPTION_UNIXSTYLE)) == 0;
// TODO: once those options vanish: just set bCompBorder to TRUE
// to have the system colors read
aStyleSettings.SetScrollBarSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetSpinSize( GetSystemMetrics( SM_CXVSCROLL ) );
aStyleSettings.SetCursorBlinkTime( GetCaretBlinkTime() );
- if ( bCompBorder )
- {
- aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
- aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
- aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
- aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
- aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) );
- aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
- aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
- aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
- aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
- aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
- aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
- aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
- }
+ aStyleSettings.SetFloatTitleHeight( GetSystemMetrics( SM_CYSMCAPTION ) );
+ aStyleSettings.SetTitleHeight( GetSystemMetrics( SM_CYCAPTION ) );
+ aStyleSettings.SetActiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVEBORDER ) ) );
+ aStyleSettings.SetDeactiveBorderColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVEBORDER ) ) );
+ aStyleSettings.SetActiveColor2( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTACTIVECAPTION ) ) );
+ aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
+ aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
+ aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
+ aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
+ aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
+ aStyleSettings.SetDarkShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DDKSHADOW ) ) );
aStyleSettings.SetWorkspaceColor( ImplWinColorToSal( GetSysColor( COLOR_APPWORKSPACE ) ) );
aStyleSettings.SetHelpColor( ImplWinColorToSal( GetSysColor( COLOR_INFOBK ) ) );
aStyleSettings.SetHelpTextColor( ImplWinColorToSal( GetSysColor( COLOR_INFOTEXT ) ) );
@@ -2877,37 +2897,52 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() );
aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() );
- if ( bCompBorder )
- {
- aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
- aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
- aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus
- aStyleSettings.SetUseFlatBorders( FALSE );
- aStyleSettings.SetUseFlatMenues( FALSE );
- aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
- aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
- aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
- aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
- aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
- if ( aSalShlData.mbWXP )
+
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 0;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
+ GetSalData()->mbThemeMenuSupport = FALSE;
+ aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
+ aStyleSettings.SetMenuBarColor( aStyleSettings.GetMenuColor() );
+ aStyleSettings.SetMenuBorderColor( aStyleSettings.GetLightBorderColor() ); // overriden below for flat menus
+ aStyleSettings.SetUseFlatBorders( FALSE );
+ aStyleSettings.SetUseFlatMenues( FALSE );
+ aStyleSettings.SetMenuTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+ aStyleSettings.SetMenuBarTextColor( ImplWinColorToSal( GetSysColor( COLOR_MENUTEXT ) ) );
+ aStyleSettings.SetActiveColor( ImplWinColorToSal( GetSysColor( COLOR_ACTIVECAPTION ) ) );
+ aStyleSettings.SetActiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_CAPTIONTEXT ) ) );
+ aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTION ) ) );
+ aStyleSettings.SetDeactiveTextColor( ImplWinColorToSal( GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ) );
+ if ( aSalShlData.mbWXP )
+ {
+ // only xp supports a different menu bar color
+ long bFlatMenues = 0;
+ SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0);
+ if( bFlatMenues )
{
- // only xp supports a different menu bar color
- long bFlatMenues = 0;
- SystemParametersInfo( SPI_GETFLATMENU, 0, &bFlatMenues, 0);
- if( bFlatMenues )
- {
- aStyleSettings.SetUseFlatMenues( TRUE );
- aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
- aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
- aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
-
- // flat borders for our controls etc. as well in this mode (ie, no 3d borders)
- // this is not active in the classic style appearance
- aStyleSettings.SetUseFlatBorders( TRUE );
- }
+ aStyleSettings.SetUseFlatMenues( TRUE );
+ aStyleSettings.SetMenuBarColor( ImplWinColorToSal( GetSysColor( COLOR_MENUBAR ) ) );
+ aStyleSettings.SetMenuHighlightColor( ImplWinColorToSal( GetSysColor( COLOR_MENUHILIGHT ) ) );
+ aStyleSettings.SetMenuBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
+
+ // flat borders for our controls etc. as well in this mode (ie, no 3d borders)
+ // this is not active in the classic style appearance
+ aStyleSettings.SetUseFlatBorders( TRUE );
}
}
+ // check if vista or newer runs
+ // in Aero theme (and similar ?) the menu text color does not change
+ // for selected items; also on WinXP and earlier menus are not themed
+ if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 &&
+ ImplDwmIsCompositionEnabled()
+ )
+ {
+ // in aero menuitem highlight text is drawn in the same color as normal
+ aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() );
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 2;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor();
+ GetSalData()->mbThemeMenuSupport = TRUE;
+ }
// Bei hellgrau geben wir die Farbe vor, damit es besser aussieht
if ( aStyleSettings.GetFaceColor() == COL_LIGHTGRAY )
aStyleSettings.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) );
@@ -2916,9 +2951,9 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
// Checked-Color berechnen
Color aColor1 = aStyleSettings.GetFaceColor();
Color aColor2 = aStyleSettings.GetLightColor();
- BYTE nRed = (BYTE)(((USHORT)aColor1.GetRed() + (USHORT)aColor2.GetRed())/2);
- BYTE nGreen = (BYTE)(((USHORT)aColor1.GetGreen() + (USHORT)aColor2.GetGreen())/2);
- BYTE nBlue = (BYTE)(((USHORT)aColor1.GetBlue() + (USHORT)aColor2.GetBlue())/2);
+ BYTE nRed = (BYTE)(((sal_uInt16)aColor1.GetRed() + (sal_uInt16)aColor2.GetRed())/2);
+ BYTE nGreen = (BYTE)(((sal_uInt16)aColor1.GetGreen() + (sal_uInt16)aColor2.GetGreen())/2);
+ BYTE nBlue = (BYTE)(((sal_uInt16)aColor1.GetBlue() + (sal_uInt16)aColor2.GetBlue())/2);
aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) );
}
@@ -2998,10 +3033,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetInfoFont( aAppFont );
aStyleSettings.SetToolFont( aAppFont );
- WIN_BOOL bDragFull;
+ BOOL bDragFull;
if ( SystemParametersInfo( SPI_GETDRAGFULLWINDOWS, 0, &bDragFull, 0 ) )
{
- ULONG nDragFullOptions = aStyleSettings.GetDragFullOptions();
+ sal_uLong nDragFullOptions = aStyleSettings.GetDragFullOptions();
if ( bDragFull )
nDragFullOptions |= DRAGFULL_OPTION_WINDOWMOVE | DRAGFULL_OPTION_WINDOWSIZE | DRAGFULL_OPTION_DOCKING | DRAGFULL_OPTION_SPLIT;
else
@@ -3024,7 +3059,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
if ( nType == REG_SZ )
{
- nValue = (ULONG)ImplA2I( aValueBuf );
+ nValue = (sal_uLong)ImplA2I( aValueBuf );
if ( (nValue > 1000) && (nValue < 10000) )
{
MiscSettings aMiscSettings = rSettings.GetMiscSettings();
@@ -3055,7 +3090,7 @@ SalBitmap* WinSalFrame::SnapShot()
HDC hDC = GetWindowDC( mhWnd );
HBITMAP hBmpBitmap = CreateCompatibleBitmap( hDC, nDX, nDY );
HDC hBmpDC = ImplGetCachedDC( CACHED_HDC_1, hBmpBitmap );
- BOOL bRet;
+ sal_Bool bRet;
bRet = BitBlt( hBmpDC, 0, 0, nDX, nDY, hDC, 0, 0, SRCCOPY ) ? TRUE : FALSE;
ImplReleaseCachedDC( CACHED_HDC_1 );
@@ -3143,7 +3178,7 @@ SalFrame::SalIndicatorState WinSalFrame::GetIndicatorState()
return aState;
}
-void WinSalFrame::SimulateKeyPress( USHORT nKeyCode )
+void WinSalFrame::SimulateKeyPress( sal_uInt16 nKeyCode )
{
BYTE nVKey = 0;
switch (nKeyCode)
@@ -3175,11 +3210,11 @@ void WinSalFrame::ResetClipRegion()
// -----------------------------------------------------------------------
-void WinSalFrame::BeginSetClipRegion( ULONG nRects )
+void WinSalFrame::BeginSetClipRegion( sal_uLong nRects )
{
if( mpClipRgnData )
delete [] (BYTE*)mpClipRgnData;
- ULONG nRectBufSize = sizeof(RECT)*nRects;
+ sal_uLong nRectBufSize = sizeof(RECT)*nRects;
mpClipRgnData = (RGNDATA*)new BYTE[sizeof(RGNDATA)-1+nRectBufSize];
mpClipRgnData->rdh.dwSize = sizeof( RGNDATAHEADER );
mpClipRgnData->rdh.iType = RDH_RECTANGLES;
@@ -3251,7 +3286,7 @@ void WinSalFrame::EndSetClipRegion()
}
else
{
- ULONG nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
+ sal_uLong nSize = mpClipRgnData->rdh.nRgnSize+sizeof(RGNDATAHEADER);
hRegion = ExtCreateRegion( NULL, nSize, mpClipRgnData );
}
delete [] (BYTE*)mpClipRgnData;
@@ -3296,8 +3331,8 @@ static long ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
}
SalMouseEvent aMouseEvt;
long nRet;
- USHORT nEvent = 0;
- BOOL bCall = TRUE;
+ sal_uInt16 nEvent = 0;
+ sal_Bool bCall = TRUE;
aMouseEvt.mnX = (short)LOWORD( lParam );
aMouseEvt.mnY = (short)HIWORD( lParam );
@@ -3531,9 +3566,9 @@ static long ImplHandleWheelMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lPar
// -----------------------------------------------------------------------
-static USHORT ImplSalGetKeyCode( WPARAM wParam )
+static sal_uInt16 ImplSalGetKeyCode( WPARAM wParam )
{
- USHORT nKeyCode;
+ sal_uInt16 nKeyCode;
// convert KeyCode
if ( wParam < KEY_TAB_SIZE )
@@ -3541,7 +3576,7 @@ static USHORT ImplSalGetKeyCode( WPARAM wParam )
else
{
SalData* pSalData = GetSalData();
- std::map< UINT, USHORT >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
+ std::map< UINT, sal_uInt16 >::const_iterator it = pSalData->maVKMap.find( (UINT)wParam );
if( it != pSalData->maVKMap.end() )
nKeyCode = it->second;
else
@@ -3555,7 +3590,7 @@ static USHORT ImplSalGetKeyCode( WPARAM wParam )
static UINT ImplStrToNum( const sal_Char* pStr )
{
- USHORT n = 0;
+ sal_uInt16 n = 0;
// Solange es sich um eine Ziffer handelt, String umwandeln
while( (*pStr >= 48) && (*pStr <= 57) )
@@ -3572,7 +3607,7 @@ static UINT ImplStrToNum( const sal_Char* pStr )
static void ImplUpdateInputLang( WinSalFrame* pFrame )
{
- BOOL bLanguageChange = FALSE;
+ sal_Bool bLanguageChange = FALSE;
UINT nLang = LOWORD( GetKeyboardLayout( 0 ) );
if ( nLang && nLang != pFrame->mnInputLang )
{
@@ -3612,9 +3647,9 @@ LanguageType WinSalFrame::GetInputLanguage()
// -----------------------------------------------------------------------
-BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode )
+sal_Bool WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = FALSE;
HKL hkl = 0;
// just use the passed language identifier, do not try to load additional keyboard support
@@ -3654,14 +3689,14 @@ BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangT
static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, LRESULT& rResult )
{
- static BOOL bIgnoreCharMsg = FALSE;
+ static sal_Bool bIgnoreCharMsg = FALSE;
static WPARAM nDeadChar = 0;
static WPARAM nLastVKChar = 0;
- static USHORT nLastChar = 0;
- static USHORT nLastModKeyCode = 0;
+ static sal_uInt16 nLastChar = 0;
+ static sal_uInt16 nLastModKeyCode = 0;
static bool bWaitForModKeyRelease = false;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
// Key wurde evtl. durch SysChild an uns weitergeleitet und
// darf somit dann nicht doppelt verarbeitet werden
@@ -3721,11 +3756,11 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
SalKeyEvent aKeyEvt;
if ( (wParam >= '0') && (wParam <= '9') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_NUM + wParam - '0');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_NUM + wParam - '0');
else if ( (wParam >= 'A') && (wParam <= 'Z') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + wParam - 'A');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'A');
else if ( (wParam >= 'a') && (wParam <= 'z') )
- aKeyEvt.mnCode = sal::static_int_cast<USHORT>(KEYGROUP_ALPHA + wParam - 'a');
+ aKeyEvt.mnCode = sal::static_int_cast<sal_uInt16>(KEYGROUP_ALPHA + wParam - 'a');
else if ( wParam == 0x0D ) // RETURN
aKeyEvt.mnCode = KEY_RETURN;
else if ( wParam == 0x1B ) // ESCAPE
@@ -3793,7 +3828,7 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
aModEvt.mnCode = nModCode;
aModEvt.mnModKeyCode = 0; // no command events will be sent if this member is 0
- USHORT tmpCode = 0;
+ sal_uInt16 tmpCode = 0;
if( GetKeyState( VK_LSHIFT ) & 0x8000 )
tmpCode |= MODKEY_LSHIFT;
if( GetKeyState( VK_RSHIFT ) & 0x8000 )
@@ -3827,11 +3862,11 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
else
{
SalKeyEvent aKeyEvt;
- USHORT nEvent;
+ sal_uInt16 nEvent;
MSG aCharMsg;
- WIN_BOOL bCharPeek = FALSE;
+ BOOL bCharPeek = FALSE;
UINT nCharMsg = WM_CHAR;
- BOOL bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
+ sal_Bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
nLastModKeyCode = 0; // make sure no modkey messages are sent if they belong to a hotkey (see above)
aKeyEvt.mnCharCode = 0;
@@ -3946,8 +3981,8 @@ long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
if ( !pFrame )
return 0;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
@@ -3960,8 +3995,8 @@ long ImplHandleSalObjKeyMsg( HWND hWnd, UINT nMsg,
if ( (wParam != VK_SHIFT) && (wParam != VK_CONTROL) && (wParam != VK_MENU) )
{
SalKeyEvent aKeyEvt;
- USHORT nEvent;
- BOOL bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
+ sal_uInt16 nEvent;
+ sal_Bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP);
// convert KeyCode
aKeyEvt.mnCode = ImplSalGetKeyCode( wParam );
@@ -3996,9 +4031,9 @@ long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( !pFrame )
return 0;
- USHORT nRepeat = LOWORD( lParam )-1;
- USHORT nModCode = 0;
- USHORT cKeyCode = (USHORT)wParam;
+ sal_uInt16 nRepeat = LOWORD( lParam )-1;
+ sal_uInt16 nModCode = 0;
+ sal_uInt16 cKeyCode = (sal_uInt16)wParam;
// determine modifiers
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
@@ -4030,7 +4065,7 @@ long ImplHandleSalObjSysCharMsg( HWND hWnd, WPARAM wParam, LPARAM lParam )
static bool ImplHandlePaintMsg( HWND hWnd )
{
- BOOL bMutex = FALSE;
+ sal_Bool bMutex = FALSE;
if ( ImplSalYieldMutexTryToAcquire() )
bMutex = TRUE;
@@ -4386,7 +4421,7 @@ static long ImplHandleShutDownMsg( HWND hWnd )
static void ImplHandleSettingsChangeMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{
- USHORT nSalEvent = SALEVENT_SETTINGSCHANGED;
+ sal_uInt16 nSalEvent = SALEVENT_SETTINGSCHANGED;
if ( nMsg == WM_DEVMODECHANGE )
nSalEvent = SALEVENT_PRINTERCHANGED;
@@ -4482,7 +4517,7 @@ static void ImplHandleForcePalette( HWND hWnd )
// -----------------------------------------------------------------------
-static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
+static LRESULT ImplHandlePalette( sal_Bool bFrame, HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam, int& rDef )
{
SalData* pSalData = GetSalData();
@@ -4500,7 +4535,7 @@ static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
return 0;
}
- BOOL bReleaseMutex = FALSE;
+ sal_Bool bReleaseMutex = FALSE;
if ( (nMsg == WM_QUERYNEWPALETTE) || (nMsg == WM_PALETTECHANGED) )
{
// Da Windows diese Messages auch sendet, muss hier auch die
@@ -4519,8 +4554,8 @@ static LRESULT ImplHandlePalette( BOOL bFrame, HWND hWnd, UINT nMsg,
HDC hDC;
HPALETTE hOldPal;
UINT nCols;
- BOOL bStdDC;
- BOOL bUpdate;
+ sal_Bool bStdDC;
+ sal_Bool bUpdate;
pSalData->mbInPalChange = TRUE;
@@ -4713,7 +4748,7 @@ static int ImplHandleMinMax( HWND hWnd, LPARAM lParam )
// the pointer is stored in every item, so if no position
// is specified we just use the first item (ie, pos=0)
// if bByPosition is FALSE then nPos denotes a menu id instead of a position
-static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, BOOL bByPosition=TRUE )
+static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, sal_Bool bByPosition=TRUE )
{
DWORD err=0;
@@ -4868,9 +4903,9 @@ static int ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
COLORREF clrPrevText, clrPrevBkgnd;
HFONT hfntOld;
HBRUSH hbrOld;
- BOOL fChecked = (pDI->itemState & ODS_CHECKED) ? TRUE : FALSE;
- BOOL fSelected = (pDI->itemState & ODS_SELECTED) ? TRUE : FALSE;
- BOOL fDisabled = (pDI->itemState & (ODS_DISABLED | ODS_GRAYED)) ? TRUE : FALSE;
+ sal_Bool fChecked = (pDI->itemState & ODS_CHECKED) ? TRUE : FALSE;
+ sal_Bool fSelected = (pDI->itemState & ODS_SELECTED) ? TRUE : FALSE;
+ sal_Bool fDisabled = (pDI->itemState & (ODS_DISABLED | ODS_GRAYED)) ? TRUE : FALSE;
// Set the appropriate foreground and background colors.
RECT aRect = pDI->rcItem;
@@ -5014,7 +5049,7 @@ static int ImplHandleMenuActivate( HWND hWnd, WPARAM wParam, LPARAM )
HMENU hMenu = (HMENU) wParam;
// WORD nPos = LOWORD (lParam);
- // BOOL bWindowMenu = (BOOL) HIWORD(lParam);
+ // sal_Bool bWindowMenu = (sal_Bool) HIWORD(lParam);
// Send activate and deactivate together, so we have not keep track of opened menues
// this will be enough to have the menues updated correctly
@@ -5049,7 +5084,7 @@ static int ImplHandleMenuSelect( HWND hWnd, WPARAM wParam, LPARAM lParam )
if( !GetSalData()->IsKnownMenuHandle( hMenu ) )
return 0;
- BOOL bByPosition = FALSE;
+ sal_Bool bByPosition = FALSE;
if( nFlags & MF_POPUP )
bByPosition = TRUE;
@@ -5149,8 +5184,8 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( pFrame->mbFullScreen )
{
- WIN_BOOL bMaximize = IsZoomed( pFrame->mhWnd );
- WIN_BOOL bMinimize = IsIconic( pFrame->mhWnd );
+ BOOL bMaximize = IsZoomed( pFrame->mhWnd );
+ BOOL bMinimize = IsIconic( pFrame->mhWnd );
if ( (nCommand == SC_SIZE) ||
(!bMinimize && (nCommand == SC_MOVE)) ||
(!bMaximize && (nCommand == SC_MAXIMIZE)) ||
@@ -5214,7 +5249,7 @@ static int ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam )
if ( ((cKeyCode >= 48) && (cKeyCode <= 57)) ||
((cKeyCode >= 97) && (cKeyCode <= 122)) )
{
- USHORT nModCode = 0;
+ sal_uInt16 nModCode = 0;
if ( GetKeyState( VK_SHIFT ) & 0x8000 )
nModCode |= KEY_SHIFT;
if ( GetKeyState( VK_CONTROL ) & 0x8000 )
@@ -5303,9 +5338,9 @@ static void ImplUpdateIMECursorPos( WinSalFrame* pFrame, HIMC hIMC )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEStartComposition( HWND hWnd )
+static sal_Bool ImplHandleIMEStartComposition( HWND hWnd )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
@@ -5333,10 +5368,10 @@ static BOOL ImplHandleIMEStartComposition( HWND hWnd )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
+static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
HIMC hIMC, LPARAM lParam )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
// Init Event
SalExtTextInputEvent aEvt;
@@ -5377,7 +5412,7 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
{
bDef = FALSE;
- USHORT* pSalAttrAry = NULL;
+ sal_uInt16* pSalAttrAry = NULL;
LONG nTextLen = ImmGetCompositionStringW( hIMC, GCS_COMPSTR, 0, 0 ) / sizeof( WCHAR );
if ( nTextLen > 0 )
{
@@ -5386,23 +5421,23 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
aEvt.maText = XubString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (xub_StrLen)nTextLen );
delete [] pTextBuf;
- WIN_BYTE* pAttrBuf = NULL;
+ BYTE* pAttrBuf = NULL;
LONG nAttrLen = ImmGetCompositionStringW( hIMC, GCS_COMPATTR, 0, 0 );
if ( nAttrLen > 0 )
{
- pAttrBuf = new WIN_BYTE[nAttrLen];
+ pAttrBuf = new BYTE[nAttrLen];
ImmGetCompositionStringW( hIMC, GCS_COMPATTR, pAttrBuf, nAttrLen );
}
if ( pAttrBuf )
{
xub_StrLen nTextLen = aEvt.maText.Len();
- pSalAttrAry = new USHORT[nTextLen];
- memset( pSalAttrAry, 0, nTextLen*sizeof( USHORT ) );
+ pSalAttrAry = new sal_uInt16[nTextLen];
+ memset( pSalAttrAry, 0, nTextLen*sizeof( sal_uInt16 ) );
for ( xub_StrLen i = 0; (i < nTextLen) && (i < nAttrLen); i++ )
{
- WIN_BYTE nWinAttr = pAttrBuf[i];
- USHORT nSalAttr;
+ BYTE nWinAttr = pAttrBuf[i];
+ sal_uInt16 nSalAttr;
if ( nWinAttr == ATTR_TARGET_CONVERTED )
{
nSalAttr = SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE;
@@ -5465,9 +5500,9 @@ static BOOL ImplHandleIMECompositionInput( WinSalFrame* pFrame,
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
+static sal_Bool ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
WinSalFrame* pFrame = GetWindowPtr( hWnd );
@@ -5513,9 +5548,9 @@ static BOOL ImplHandleIMEComposition( HWND hWnd, LPARAM lParam )
// -----------------------------------------------------------------------
-static BOOL ImplHandleIMEEndComposition( HWND hWnd )
+static sal_Bool ImplHandleIMEEndComposition( HWND hWnd )
{
- BOOL bDef = TRUE;
+ sal_Bool bDef = TRUE;
ImplSalYieldMutexAcquireWithWait();
@@ -5701,8 +5736,8 @@ static LRESULT ImplHandleIMEConfirmReconvertString( HWND hWnd, LPARAM lParam )
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
- ULONG nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
- ULONG nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
+ sal_uLong nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
+ sal_uLong nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
if( nTmpStart != aEvt.mnStart || nTmpEnd != aEvt.mnEnd )
{
@@ -6090,11 +6125,11 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
rDef = FALSE;
break;
case SAL_MSG_TOTOP:
- ImplSalToTop( hWnd, (USHORT)wParam );
+ ImplSalToTop( hWnd, (sal_uInt16)wParam );
rDef = FALSE;
break;
case SAL_MSG_SHOW:
- ImplSalShow( hWnd, (BOOL)wParam, (BOOL)lParam );
+ ImplSalShow( hWnd, (sal_Bool)wParam, (sal_Bool)lParam );
rDef = FALSE;
break;
case SAL_MSG_SETINPUTCONTEXT:
@@ -6102,7 +6137,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
rDef = FALSE;
break;
case SAL_MSG_ENDEXTTEXTINPUT:
- ImplSalFrameEndExtTextInput( hWnd, (USHORT)(ULONG)(void*)wParam );
+ ImplSalFrameEndExtTextInput( hWnd, (sal_uInt16)(sal_uLong)(void*)wParam );
rDef = FALSE;
break;
@@ -6269,11 +6304,11 @@ LRESULT CALLBACK SalFrameWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
// -----------------------------------------------------------------------
-BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult )
+sal_Bool ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT& rlResult )
{
// handle all messages concerning all frames so they get processed only once
// Must work for Unicode and none Unicode
- BOOL bResult = FALSE;
+ sal_Bool bResult = FALSE;
if ( (nMsg == WM_PALETTECHANGED) || (nMsg == SAL_MSG_POSTPALCHANGED) )
{
int bDef = TRUE;
@@ -6292,7 +6327,7 @@ BOOL ImplHandleGlobalMsg( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LR
// -----------------------------------------------------------------------
-BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall )
+sal_Bool ImplWriteLastError( DWORD lastError, const char *szApiCall )
{
static int first=1;
// if VCL_LOGFILE_ENABLED is set, Win32 API error messages can be written
@@ -6300,7 +6335,7 @@ BOOL ImplWriteLastError( DWORD lastError, const char *szApiCall )
static char *logEnabled = getenv("VCL_LOGFILE_ENABLED");
if( logEnabled )
{
- BOOL bSuccess = FALSE;
+ sal_Bool bSuccess = FALSE;
static char *szTmp = getenv("TMP");
if( !szTmp || !*szTmp )
szTmp = getenv("TEMP");