X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fwindows%2Fwindow-base-win.cpp;h=c846e541f08b1c737a10e2eb6806d301522e68e6;hb=d499efa34852d13f24ce1d3b2dfa8d1738c89417;hp=f7b4e6dc6ce6728333e9ad63707912fa97298aa6;hpb=88182dddac40e95258d7cff3daa2f21b1bcd6174;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index f7b4e6d..c846e54 100755 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -61,7 +61,7 @@ WindowBaseWin::WindowBaseWin( Dali::PositionSize positionSize, Any surface, bool WindowBaseWin::~WindowBaseWin() { - WindowsPlatformImplementation::PostWinMessage( WM_CLOSE, 0, 0, mWin32Window ); + mWindowImpl.PostWinMessage( WM_CLOSE, 0, 0 ); } void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isTransparent ) @@ -78,11 +78,10 @@ void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isT } else { - // XLib should already be initialized so no point in calling XInitThreads - mWin32Window = static_cast< WinWindowHandle >( surfaceId ); + SetWinWindow( surfaceId ); } - WindowsPlatformImplementation::SetListener( MakeCallback( this, &WindowBaseWin::EventEntry ) ); + mWindowImpl.SetListener( MakeCallback( this, &WindowBaseWin::EventEntry ) ); } void WindowBaseWin::OnDeleteRequest() @@ -128,7 +127,7 @@ void WindowBaseWin::OnMouseButtonDown( int type, TWinEventInfo *event ) Integration::Point point; point.SetDeviceId( touchEvent.multi.device ); point.SetState( state ); - point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::GetEdgeHeight() ) ); + point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + mWindowImpl.GetEdgeHeight() ) ); point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) ); point.SetPressure( touchEvent.multi.pressure ); point.SetAngle( Degree( touchEvent.multi.angle ) ); @@ -152,7 +151,7 @@ void WindowBaseWin::OnMouseButtonUp( int type, TWinEventInfo *event ) Integration::Point point; point.SetDeviceId( touchEvent.multi.device ); point.SetState( state ); - point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::GetEdgeHeight() ) ); + point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + mWindowImpl.GetEdgeHeight() ) ); point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) ); point.SetPressure( touchEvent.multi.pressure ); point.SetAngle( Degree( touchEvent.multi.angle ) ); @@ -176,7 +175,7 @@ void WindowBaseWin::OnMouseButtonMove( int type, TWinEventInfo *event ) Integration::Point point; point.SetDeviceId( touchEvent.multi.device ); point.SetState( state ); - point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::GetEdgeHeight() ) ); + point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + mWindowImpl.GetEdgeHeight() ) ); point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) ); point.SetPressure( touchEvent.multi.pressure ); point.SetAngle( Degree( touchEvent.multi.angle ) ); @@ -239,7 +238,7 @@ void WindowBaseWin::OnKeyUp( int type, TWinEventInfo *event ) // Ensure key event string is not NULL as keys like SHIFT have a null string. keyString.push_back( event->wParam ); - Integration::KeyEvent keyEvent( keyName, emptyString, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, emptyString, emptyString, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS ); + Integration::KeyEvent keyEvent( keyName, emptyString, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, emptyString, emptyString, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS ); mKeyEventSignal.Emit( keyEvent ); } @@ -291,6 +290,7 @@ void WindowBaseWin::Move( PositionSize positionSize ) void WindowBaseWin::Resize( PositionSize positionSize ) { + ::SetWindowPos( (HWND)mWin32Window, NULL, positionSize.x, positionSize.y, positionSize.width, positionSize.height, SWP_SHOWWINDOW ); } void WindowBaseWin::MoveResize( PositionSize positionSize ) @@ -313,11 +313,11 @@ void WindowBaseWin::Activate() { } -void WindowBaseWin::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations ) +void WindowBaseWin::SetAvailableAnlges( const std::vector< int >& angles ) { } -void WindowBaseWin::SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) +void WindowBaseWin::SetPreferredAngle( int angle ) { } @@ -436,7 +436,7 @@ void WindowBaseWin::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertic float xres, yres; //// 1 inch = 25.4 millimeters - WindowsPlatformImplementation::GetDPI( mWin32Window, xres, yres ); + mWindowImpl.GetDPI( xres, yres ); xres *= 1.5f; yres *= 1.5f; @@ -487,14 +487,24 @@ unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent ) { - long hWnd = WindowsPlatformImplementation::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL ); + long hWnd = mWindowImpl.CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL ); - WindowsPlatformImplementation::ShowWindow( hWnd ); + mWin32Window = static_cast(hWnd); - mWin32Window = (WinWindowHandle)hWnd; DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" ); } +void WindowBaseWin::SetWinWindow( unsigned int surfaceId ) +{ + HWND hWnd = (HWND)surfaceId; + + mWin32Window = static_cast(surfaceId); + + mWindowImpl.SetHWND( reinterpret_cast(hWnd)); + + mWindowImpl.SetWinProc(); +} + void WindowBaseWin::EventEntry( TWinEventInfo *event ) { unsigned int uMsg = event->uMsg; @@ -565,6 +575,16 @@ void WindowBaseWin::SetParent( WindowBase* parentWinBase ) } +int WindowBaseWin::CreateFrameRenderedSyncFence() +{ + return -1; +} + +int WindowBaseWin::CreateFramePresentedSyncFence() +{ + return -1; +} + } // namespace Adaptor } // namespace Internal