avmedia/source/win/player.cxx | 12 ++++++------ avmedia/source/win/player.hxx | 8 ++++++-- avmedia/source/win/window.cxx | 22 +++++++++++----------- avmedia/source/win/window.hxx | 8 ++++++-- 4 files changed, 29 insertions(+), 21 deletions(-)
New commits: commit 22c276885e5ebd9c0c1ec06ccb6b021a471a452f Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Nov 25 23:38:25 2015 +0100 Use Get/SetWindowLongPtr, for 64-bit build Change-Id: I3041d93f98e491e4600da78a0d1f6100be1177a7 (cherry picked from commit cff54fb87a25a5445a2110e102a3de2b8226a21c) diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx index 56ec969..3f4f296 100644 --- a/avmedia/source/win/window.cxx +++ b/avmedia/source/win/window.cxx @@ -62,7 +62,7 @@ static ::osl::Mutex& ImplGetOwnStaticMutex() LRESULT CALLBACK MediaPlayerWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 ) { - Window* pWindow = (Window*) ::GetWindowLong( hWnd, 0 ); + Window* pWindow = (Window*) ::GetWindowLongPtr( hWnd, 0 ); bool bProcessed = true; if( pWindow ) @@ -305,7 +305,7 @@ bool Window::create( const uno::Sequence< uno::Any >& rArguments ) if( mnFrameWnd ) { - ::SetWindowLong( mnFrameWnd, 0, (DWORD) this ); + ::SetWindowLongPtr( mnFrameWnd, 0, (LONG_PTR) this ); pVideoWindow->put_Owner( (OAHWND) mnFrameWnd ); pVideoWindow->put_MessageDrain( (OAHWND) mnFrameWnd ); commit 79a4e216048cd8655e91531f34d3474e04f24bf1 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Nov 25 23:30:41 2015 +0100 Use Get/SetWindowLongPtr, for 64-bit build Change-Id: I6d763369aa0c142ec0b0b9fb08aeb212eaae7f2f (cherry picked from commit 0e8c79ab99d284e08a85293e58c94530df69230f) diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx index 4f6cd78..8bf50f2 100644 --- a/avmedia/source/win/player.cxx +++ b/avmedia/source/win/player.cxx @@ -47,7 +47,7 @@ namespace avmedia { namespace win { LRESULT CALLBACK MediaPlayerWndProc_2( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 ) { - Player* pPlayer = (Player*) ::GetWindowLong( hWnd, 0 ); + Player* pPlayer = (Player*) ::GetWindowLongPtr( hWnd, 0 ); bool bProcessed = true; if( pPlayer ) @@ -273,7 +273,7 @@ void SAL_CALL Player::start( ) if ( mnFrameWnd ) { ::ShowWindow(mnFrameWnd, SW_HIDE); - ::SetWindowLong( mnFrameWnd, 0, (DWORD) this ); + ::SetWindowLongPtr( mnFrameWnd, 0, (LONG_PTR) this ); // mpVW->put_Owner( (OAHWND) mnFrameWnd ); setNotifyWnd( mnFrameWnd ); } commit 2bd890e190b66a6027594f657a6f05b1b5a803bb Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Nov 25 23:14:04 2015 +0100 -Werror,-Wint-to-pointer-cast Change-Id: Iec98a5a3df5dcfcd3fcf658bf27e9b5fe57ffc44 (cherry picked from commit 6cd09d31f48539d2ba8ae89f0725e6fbef37b920) diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx index 61b073d..4f6cd78 100644 --- a/avmedia/source/win/player.cxx +++ b/avmedia/source/win/player.cxx @@ -113,7 +113,7 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : Player::~Player() { if( mnFrameWnd ) - ::DestroyWindow( (HWND) mnFrameWnd ); + ::DestroyWindow( mnFrameWnd ); ::CoUninitialize(); } @@ -207,7 +207,7 @@ const IVideoWindow* Player::getVideoWindow() const return mpVW; } -void Player::setNotifyWnd( int nNotifyWnd ) +void Player::setNotifyWnd( HWND nNotifyWnd ) { mbAddWindow = false; if( mpME ) @@ -266,14 +266,14 @@ void SAL_CALL Player::start( ) } if ( !mnFrameWnd ) { - mnFrameWnd = (int) ::CreateWindow( mpWndClass->lpszClassName, NULL, + mnFrameWnd = ::CreateWindow( mpWndClass->lpszClassName, NULL, 0, 0, 0, 0, 0, (HWND) NULL, NULL, mpWndClass->hInstance, 0 ); if ( mnFrameWnd ) { - ::ShowWindow((HWND) mnFrameWnd, SW_HIDE); - ::SetWindowLong( (HWND) mnFrameWnd, 0, (DWORD) this ); + ::ShowWindow(mnFrameWnd, SW_HIDE); + ::SetWindowLong( mnFrameWnd, 0, (DWORD) this ); // mpVW->put_Owner( (OAHWND) mnFrameWnd ); setNotifyWnd( mnFrameWnd ); } diff --git a/avmedia/source/win/player.hxx b/avmedia/source/win/player.hxx index 79287bb..e7c8401 100644 --- a/avmedia/source/win/player.hxx +++ b/avmedia/source/win/player.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_AVMEDIA_SOURCE_WIN_PLAYER_HXX #define INCLUDED_AVMEDIA_SOURCE_WIN_PLAYER_HXX +#include <sal/config.h> + +#include <WinDef.h> + #include "wincommon.hxx" #include "com/sun/star/media/XPlayer.hpp" @@ -59,7 +63,7 @@ public: bool create( const OUString& rURL ); - void setNotifyWnd( int nNotifyWnd ); + void setNotifyWnd( HWND nNotifyWnd ); long processEvent(); const IVideoWindow* getVideoWindow() const; @@ -105,7 +109,7 @@ private: IVideoWindow* mpVW; IDDrawExclModeVideo* mpEV; long mnUnmutedVolume; - int mnFrameWnd; + HWND mnFrameWnd; bool mbMuted; bool mbLooping; bool mbAddWindow; diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx index 341ea6a..56ec969 100644 --- a/avmedia/source/win/window.cxx +++ b/avmedia/source/win/window.cxx @@ -195,7 +195,7 @@ Window::Window( const uno::Reference< lang::XMultiServiceFactory >& rxMgr, Playe Window::~Window() { if( mnFrameWnd ) - ::DestroyWindow( (HWND) mnFrameWnd ); + ::DestroyWindow( mnFrameWnd ); } void Window::ImplLayoutVideoWindow() @@ -296,16 +296,16 @@ bool Window::create( const uno::Sequence< uno::Any >& rArguments ) rArguments[ 0 ] >>= nWnd; rArguments[ 1 ] >>= aRect; - mnParentWnd = static_cast<int>(nWnd); + mnParentWnd = reinterpret_cast<HWND>(nWnd); - mnFrameWnd = (int) ::CreateWindow( mpWndClass->lpszClassName, NULL, + mnFrameWnd = ::CreateWindow( mpWndClass->lpszClassName, NULL, WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, aRect.X, aRect.Y, aRect.Width, aRect.Height, - (HWND) mnParentWnd, NULL, mpWndClass->hInstance, 0 ); + mnParentWnd, NULL, mpWndClass->hInstance, 0 ); if( mnFrameWnd ) { - ::SetWindowLong( (HWND) mnFrameWnd, 0, (DWORD) this ); + ::SetWindowLong( mnFrameWnd, 0, (DWORD) this ); pVideoWindow->put_Owner( (OAHWND) mnFrameWnd ); pVideoWindow->put_MessageDrain( (OAHWND) mnFrameWnd ); @@ -387,7 +387,7 @@ void SAL_CALL Window::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal { if( mnFrameWnd ) { - ::SetWindowPos( (HWND) mnFrameWnd, HWND_TOP, X, Y, Width, Height, 0 ); + ::SetWindowPos( mnFrameWnd, HWND_TOP, X, Y, Width, Height, 0 ); ImplLayoutVideoWindow(); } } @@ -401,7 +401,7 @@ awt::Rectangle SAL_CALL Window::getPosSize() { ::RECT aWndRect; - if( ::GetClientRect( (HWND) mnFrameWnd, &aWndRect ) ) + if( ::GetClientRect( mnFrameWnd, &aWndRect ) ) { aRet.X = aWndRect.left; aRet.Y = aWndRect.top; @@ -423,7 +423,7 @@ void SAL_CALL Window::setVisible( sal_Bool bVisible ) if( pVideoWindow ) pVideoWindow->put_Visible( bVisible ? OATRUE : OAFALSE ); - ::ShowWindow( (HWND) mnFrameWnd, bVisible ? SW_SHOW : SW_HIDE ); + ::ShowWindow( mnFrameWnd, bVisible ? SW_SHOW : SW_HIDE ); } } @@ -431,14 +431,14 @@ void SAL_CALL Window::setEnable( sal_Bool bEnable ) throw (uno::RuntimeException) { if( mnFrameWnd ) - ::EnableWindow( (HWND) mnFrameWnd, bEnable ); + ::EnableWindow( mnFrameWnd, bEnable ); } void SAL_CALL Window::setFocus( ) throw (uno::RuntimeException) { if( mnFrameWnd ) - ::SetFocus( (HWND) mnFrameWnd ); + ::SetFocus( mnFrameWnd ); } void SAL_CALL Window::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) diff --git a/avmedia/source/win/window.hxx b/avmedia/source/win/window.hxx index 79f1832..fa01b19 100644 --- a/avmedia/source/win/window.hxx +++ b/avmedia/source/win/window.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_AVMEDIA_SOURCE_WIN_WINDOW_HXX #define INCLUDED_AVMEDIA_SOURCE_WIN_WINDOW_HXX +#include <sal/config.h> + +#include <WinDef.h> + #include "wincommon.hxx" #include <cppuhelper/implbase.hxx> #include <cppuhelper/interfacecontainer.h> @@ -101,8 +105,8 @@ private: ::cppu::OMultiTypeInterfaceContainerHelper maListeners; css::media::ZoomLevel meZoomLevel; Player& mrPlayer; - int mnFrameWnd; - int mnParentWnd; + HWND mnFrameWnd; + HWND mnParentWnd; int mnPointerType; void ImplLayoutVideoWindow(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits