X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Fwindow-system%2Fwindows%2Fwindow-base-win.cpp;h=ffa0035f39c0271f564a9599fcc6631910516101;hb=aa19ec5a3944989bb2eed21eb6c316775cafd38a;hp=d5cbe7be02ea7c952ca67f1b4e117a876d0d4122;hpb=f110d85fb0606f3cfac47ad8d760168078d83148;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 d5cbe7b..ffa0035 100755 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ WindowBaseWin::~WindowBaseWin() void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isTransparent ) { // see if there is a surface in Any surface - unsigned int surfaceId = GetSurfaceId( surface ); + uintptr_t surfaceId = GetSurfaceId( surface ); // if the surface is empty, create a new one. if( surfaceId == 0 ) @@ -78,8 +78,7 @@ 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 ); } mWindowImpl.SetListener( MakeCallback( this, &WindowBaseWin::EventEntry ) ); @@ -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 + mWindowImpl.GetEdgeHeight() ) ); + point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatform::WindowImpl::EDGE_HEIGHT ) ); 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 + mWindowImpl.GetEdgeHeight() ) ); + point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatform::WindowImpl::EDGE_HEIGHT ) ); 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 + mWindowImpl.GetEdgeHeight() ) ); + point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatform::WindowImpl::EDGE_HEIGHT) ); 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 ) ); @@ -193,7 +192,7 @@ void WindowBaseWin::OnMouseWheel( int type, TWinEventInfo *event ) { DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent.direction, mouseWheelEvent.modifiers, mouseWheelEvent.x, mouseWheelEvent.y, mouseWheelEvent.z ); - WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent.direction, mouseWheelEvent.modifiers, Vector2( mouseWheelEvent.x, mouseWheelEvent.y ), mouseWheelEvent.z, mouseWheelEvent.timestamp ); + Integration::WheelEvent wheelEvent( Integration::WheelEvent::MOUSE_WHEEL, mouseWheelEvent.direction, mouseWheelEvent.modifiers, Vector2( mouseWheelEvent.x, mouseWheelEvent.y ), mouseWheelEvent.z, mouseWheelEvent.timestamp ); mWheelEventSignal.Emit( wheelEvent ); } @@ -206,7 +205,7 @@ void WindowBaseWin::OnKeyDown( int type, TWinEventInfo *event ) DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" ); int keyCode = event->wParam; - std::string keyName( WindowsPlatformImplementation::GetKeyName( keyCode ) ); + std::string keyName( WindowsPlatform::GetKeyName( keyCode ) ); std::string keyString; std::string emptyString; @@ -216,7 +215,7 @@ void WindowBaseWin::OnKeyDown( 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::DOWN, emptyString, emptyString, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS ); mKeyEventSignal.Emit( keyEvent ); } @@ -229,7 +228,7 @@ void WindowBaseWin::OnKeyUp( int type, TWinEventInfo *event ) DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" ); int keyCode = event->wParam; - std::string keyName( WindowsPlatformImplementation::GetKeyName( keyCode ) ); + std::string keyName( WindowsPlatform::GetKeyName( keyCode ) ); std::string keyString; std::string emptyString; @@ -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::Up, 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 ); } @@ -471,9 +470,9 @@ int WindowBaseWin::GetOrientation() const { } -unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const +uintptr_t WindowBaseWin::GetSurfaceId( Any surface ) const { - unsigned int surfaceId = 0; + uintptr_t surfaceId = 0; if ( surface.Empty() == false ) { @@ -488,12 +487,25 @@ unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent ) { - long hWnd = mWindowImpl.CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL ); + long hWnd = WindowsPlatform::WindowImpl::CreateHwnd( "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL ); + mWindowImpl.SetHWND(hWnd); + + mWin32Window = static_cast(hWnd); - mWin32Window = (WinWindowHandle)hWnd; DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" ); } +void WindowBaseWin::SetWinWindow( uintptr_t surfaceId ) +{ + HWND hWnd = (HWND)surfaceId; + + mWin32Window = static_cast(surfaceId); + + mWindowImpl.SetHWND(surfaceId); + + mWindowImpl.SetWinProc(); +} + void WindowBaseWin::EventEntry( TWinEventInfo *event ) { unsigned int uMsg = event->uMsg; @@ -564,6 +576,16 @@ void WindowBaseWin::SetParent( WindowBase* parentWinBase ) } +int WindowBaseWin::CreateFrameRenderedSyncFence() +{ + return -1; +} + +int WindowBaseWin::CreateFramePresentedSyncFence() +{ + return -1; +} + } // namespace Adaptor } // namespace Internal