/*
- * 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.
WindowBaseWin::~WindowBaseWin()
{
- WindowsPlatformImplementation::PostWinMessage( WM_CLOSE, 0, 0, mWin32Window );
+ mWindowImpl.PostWinMessage( WM_CLOSE, 0, 0 );
}
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 )
}
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()
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 + 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 ) );
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 + 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 ) );
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 + 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 ) );
{
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 );
}
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;
// 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 );
}
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;
// 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 );
}
void WindowBaseWin::Resize( PositionSize positionSize )
{
+ ::SetWindowPos( (HWND)mWin32Window, NULL, positionSize.x, positionSize.y, positionSize.width, positionSize.height, SWP_SHOWWINDOW );
}
void WindowBaseWin::MoveResize( PositionSize positionSize )
{
}
-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 )
{
}
float xres, yres;
//// 1 inch = 25.4 millimeters
- WindowsPlatformImplementation::GetDPI( mWin32Window, xres, yres );
+ mWindowImpl.GetDPI( xres, yres );
xres *= 1.5f;
yres *= 1.5f;
{
}
-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 )
{
void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent )
{
- long hWnd = WindowsPlatformImplementation::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);
- WindowsPlatformImplementation::ShowWindow( hWnd );
+ mWin32Window = static_cast<WinWindowHandle>(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<WinWindowHandle>(surfaceId);
+
+ mWindowImpl.SetHWND(surfaceId);
+
+ mWindowImpl.SetWinProc();
+}
+
void WindowBaseWin::EventEntry( TWinEventInfo *event )
{
unsigned int uMsg = event->uMsg;
}
}
-void WindowBaseWin::SetParent( Any parent )
+void WindowBaseWin::SetParent( WindowBase* parentWinBase )
{
}
-bool WindowBaseWin::IsMatchedWindow( Any window )
+int WindowBaseWin::CreateFrameRenderedSyncFence()
{
- return false;
+ return -1;
+}
+
+int WindowBaseWin::CreateFramePresentedSyncFence()
+{
+ return -1;
}
} // namespace Adaptor