dpiHorizontal = dpiVertical = 96;
};
-int TestRenderSurface::GetOrientation() const
-{
- return 0;
-};
-
void TestRenderSurface::InitializeGraphics()
{
}
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical );
/**
- * @copydoc Dali::Integration::RenderSurface::GetOrientation
- */
- virtual int GetOrientation() const;
-
- /**
* @copydoc Dali::Integration::RenderSurface::InitializeGraphics
*/
virtual void InitializeGraphics();
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
/**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const = 0;
-
- /**
* @brief InitializeGraphics the platform specific graphics surface interfaces
*/
virtual void InitializeGraphics() = 0;
OnSurfaceSet( surface );
}
-void SceneHolder::SurfaceResized( bool forceUpdate )
+void SceneHolder::SurfaceResized()
{
- mScene.SurfaceResized( forceUpdate );
+ mScene.SurfaceResized();
}
Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const
/**
* @brief Called when the surface set is resized.
*/
- void SurfaceResized( bool forceUpdate );
+ void SurfaceResized();
/**
* @brief Get the render surface
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
/**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const = 0;
-
- /**
* @brief Get the screen rotation angle of the window
*/
virtual int GetScreenRotationAngle() = 0;
*/
virtual void SetWindowRotationAngle( int degree ) = 0;
- /**
- * @brief Get the rotation angle of the window
- */
- virtual int GetWindowRotationAngle() = 0;
-
/**
* @brief Inform the window rotation is completed
*/
{
Uint16Pair newSize( newRect.width, newRect.height );
- bool forceUpdate = false;
- if( mWindowBase->IsEglWindowRotationSupported() )
- {
- forceUpdate = true;
- }
-
- SurfaceResized( forceUpdate );
+ SurfaceResized();
mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
{
Uint16Pair newSize( newRect.width, newRect.height );
- bool forceUpdate = false;
- if( mWindowBase->IsEglWindowRotationSupported() )
- {
- forceUpdate = true;
- }
-
- SurfaceResized( forceUpdate );
+ SurfaceResized();
mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
void Window::OnOutputTransformed()
{
- bool forceUpdate = false;
- if( mWindowBase->IsEglWindowRotationSupported() )
- {
- forceUpdate = true;
- }
PositionSize positionSize = mSurface->GetPositionSize();
- SurfaceResized( forceUpdate );
+ SurfaceResized();
mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
}
mWindowSurface->RequestRotation( mRotationAngle, mWindowWidth, mWindowHeight );
- bool forceUpdate = false;
- if( mWindowBase->IsEglWindowRotationSupported() )
- {
- forceUpdate = true;
- }
-
- SurfaceResized( forceUpdate );
+ SurfaceResized();
mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( mRotationAngle, mWindowHeight ) );
if( mScreenRotationAngle != 0 )
{
mScreenRotationFinished = false;
- mResizeFinished = false;
}
}
void WindowRenderSurface::RequestRotation( int angle, int width, int height )
{
+ if( !mRotationSupported )
+ {
+ DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: Rotation is not supported!\n" );
+ return;
+ }
+
if( !mRotationTrigger )
{
TriggerEventFactoryInterface& triggerFactory = Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetTriggerEventFactoryInterface();
}
}
-int WindowRenderSurface::GetOrientation() const
-{
- return mWindowBase->GetOrientation();
-}
-
void WindowRenderSurface::InitializeGraphics()
{
if( resizingSurface )
{
- int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360;
-
// Window rotate or screen rotate
if( !mRotationFinished || !mScreenRotationFinished )
{
+ int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360;
+
mWindowBase->SetEglWindowRotation( totalAngle );
mWindowBase->SetEglWindowBufferTransform( totalAngle );
}
// Resize case
- if ( !mResizeFinished )
+ if( !mResizeFinished )
{
- Dali::PositionSize positionSize;
- positionSize.x = mPositionSize.x;
- positionSize.y = mPositionSize.y;
- if( totalAngle == 0 || totalAngle == 180 )
- {
- positionSize.width = mPositionSize.width;
- positionSize.height = mPositionSize.height;
- }
- else
- {
- positionSize.width = mPositionSize.height;
- positionSize.height = mPositionSize.width;
- }
-
- mWindowBase->ResizeEglWindow( positionSize );
+ mWindowBase->ResizeEglWindow( mPositionSize );
mResizeFinished = true;
DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" );
{
mScreenRotationAngle = screenRotationAngle;
mScreenRotationFinished = false;
- mResizeFinished = false;
mOutputTransformedSignal.Emit();
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const override;
-
- /**
* @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
*/
virtual void InitializeGraphics() override;
mBrightness( 0 ),
mBrightnessChangeState( 0 ),
mBrightnessChangeDone( true ),
- mOwnSurface( false ),
- mWindowRotationAngle( 0 ),
- mScreenRotationAngle( 0 ),
- mSupportedPreProtation( 0 )
+ mOwnSurface( false )
#ifdef DALI_ELDBUS_AVAILABLE
, mSystemConnection( NULL )
#endif
wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) );
if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED )
{
- mSupportedPreProtation = true;
return true;
}
- mSupportedPreProtation = false;
+
return false;
}
dpiVertical = int( yres + 0.5f );
}
-int WindowBaseEcoreWl::GetOrientation() const
-{
- int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360;
- if( mSupportedPreProtation )
- {
- orientation = 0;
- }
- return orientation;
-}
-
int WindowBaseEcoreWl::GetScreenRotationAngle()
{
int transform = 0;
transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mEcoreWindow ) );
}
- mScreenRotationAngle = transform * 90;
- return mScreenRotationAngle;
+ return transform * 90;
}
void WindowBaseEcoreWl::SetWindowRotationAngle( int degree )
{
- mWindowRotationAngle = degree;
ecore_wl_window_rotation_set( mEcoreWindow, degree );
}
-int WindowBaseEcoreWl::GetWindowRotationAngle()
-{
- return mWindowRotationAngle;
-}
-
void WindowBaseEcoreWl::WindowRotationCompleted( int degree, int width, int height )
{
ecore_wl_window_rotation_change_done_send( mEcoreWindow );
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
virtual int GetScreenRotationAngle() override;
virtual void SetWindowRotationAngle( int degree ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
- */
- virtual int GetWindowRotationAngle() override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
virtual void WindowRotationCompleted( int degree, int width, int height ) override;
bool mOwnSurface;
- int mWindowRotationAngle;
- int mScreenRotationAngle;
- int mSupportedPreProtation;
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Connection* mSystemConnection;
#endif // DALI_ELDBUS_AVAILABLE
mBrightnessChangeDone( true ),
mOwnSurface( false ),
mMoveResizeSerial( 0 ),
- mLastSubmittedMoveResizeSerial( 0 ),
- mWindowRotationAngle( 0 ),
- mScreenRotationAngle( 0 ),
- mSupportedPreProtation( 0 )
+ mLastSubmittedMoveResizeSerial( 0 )
#ifdef DALI_ELDBUS_AVAILABLE
, mSystemConnection( NULL )
#endif
if( ev->win == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnRotation\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnRotation\n" );
RotationEvent rotationEvent;
rotationEvent.angle = ev->angle;
mTouchEventSignal.Emit( point, touchEvent->timestamp );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n" );
}
}
if( mouseWheelEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::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 );
{
Ecore_Event_Detent_Rotate* detentEvent = static_cast< Ecore_Event_Detent_Rotate* >( event );
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnDetentRotation\n" );
int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1;
int timeStamp = detentEvent->timestamp;
if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyDown\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" );
std::string keyName( keyEvent->keyname );
std::string logicalKey( "" );
if( keyEvent->window == static_cast< unsigned int >( ecore_wl2_window_id_get( mEcoreWindow ) ) )
{
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp\n" );
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" );
std::string keyName( keyEvent->keyname );
std::string logicalKey( "" );
wl_egl_window_tizen_capability capability = static_cast< wl_egl_window_tizen_capability >( wl_egl_window_tizen_get_capabilities( mEglWindow ) );
if( capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED )
{
- mSupportedPreProtation = true;
return true;
}
- mSupportedPreProtation = false;
+
return false;
}
dpiVertical = int( yres + 0.5f );
}
-int WindowBaseEcoreWl2::GetOrientation() const
-{
- int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360;
- if( mSupportedPreProtation )
- {
- orientation = 0;
- }
- return orientation;
-}
-
int WindowBaseEcoreWl2::GetScreenRotationAngle()
{
int transform = 0;
{
transform = ecore_wl2_output_transform_get( ecore_wl2_window_output_find( mEcoreWindow ) );
}
- mScreenRotationAngle = transform * 90;
- return mScreenRotationAngle;
+
+ return transform * 90;
}
void WindowBaseEcoreWl2::SetWindowRotationAngle( int degree )
{
- mWindowRotationAngle = degree;
ecore_wl2_window_rotation_set( mEcoreWindow, degree );
}
-int WindowBaseEcoreWl2::GetWindowRotationAngle()
-{
- return mWindowRotationAngle;
-}
-
void WindowBaseEcoreWl2::WindowRotationCompleted( int degree, int width, int height )
{
ecore_wl2_window_rotation_change_done_send( mEcoreWindow, degree, width, height );
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
virtual int GetScreenRotationAngle() override;
virtual void SetWindowRotationAngle( int degree ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
- */
- virtual int GetWindowRotationAngle() override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
virtual void WindowRotationCompleted( int degree, int width, int height ) override;
volatile uint32_t mMoveResizeSerial;
uint32_t mLastSubmittedMoveResizeSerial;
- int mWindowRotationAngle;
- int mScreenRotationAngle;
- int mSupportedPreProtation;
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Connection* mSystemConnection;
#endif // DALI_ELDBUS_AVAILABLE
dpiVertical = int( yres + 0.5f );
}
-int NativeRenderSurfaceEcoreWl::GetOrientation() const
-{
- return 0;
-}
-
void NativeRenderSurfaceEcoreWl::InitializeGraphics()
{
DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const override;
-
- /**
* @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
*/
virtual void InitializeGraphics() override;
dpiVertical = int( yres + 0.5f );
}
-int PixmapRenderSurfaceEcoreX::GetOrientation() const
-{
- return 0;
-}
-
void PixmapRenderSurfaceEcoreX::InitializeGraphics()
{
mGraphics = &mAdaptor->GetGraphicsInterface();
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const override;
-
- /**
* @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
*/
virtual void InitializeGraphics() override;
dpiVertical = ecore_x_dpi_get();
}
-int WindowBaseEcoreX::GetOrientation() const
-{
- return 0;
-}
-
int WindowBaseEcoreX::GetScreenRotationAngle()
{
return 0;
{
}
-int WindowBaseEcoreX::GetWindowRotationAngle()
-{
- return 0;
-}
-
void WindowBaseEcoreX::WindowRotationCompleted( int degree, int width, int height )
{
}
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
*/
virtual int GetScreenRotationAngle() override;
virtual void SetWindowRotationAngle( int degree ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
- */
- virtual int GetWindowRotationAngle() override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
virtual void WindowRotationCompleted( int degree, int width, int height ) override;
-/*
-* Copyright (c) 2018 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.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
-
-// CLASS HEADER
-#include <dali/internal/window-system/windows/platform-implement-win.h>
-
-// EXTERNAL INCLUDES
-#include <windows.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/window-system/windows/event-system-win.h>
-
-static constexpr float INCH = 25.4;
-
-using namespace std;
-
+/*\r
+* Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+*\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+*\r
+*/\r
+\r
+// CLASS HEADER\r
+#include <dali/internal/window-system/windows/platform-implement-win.h>\r
+\r
+// EXTERNAL INCLUDES\r
+#include <windows.h>\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/internal/window-system/windows/event-system-win.h>\r
+\r
+static constexpr float INCH = 25.4;\r
+\r
+using namespace std;\r
+\r
namespace Dali
{
namespace Adaptor
{
-
-namespace WindowsPlatformImplementation
-{
-
-void RunLoop()
-{
- MSG nMsg = { 0 };
-
- while( GetMessage( &nMsg, 0, NULL, NULL ) )
- {
- if( WIN_CALLBACK_EVENT == nMsg.message )
- {
- Dali::CallbackBase *callback = ( Dali::CallbackBase* )nMsg.wParam;
- Dali::CallbackBase::Execute( *callback );
- }
-
- TranslateMessage( &nMsg );
- DispatchMessage( &nMsg );
-
- if( WM_CLOSE == nMsg.message )
- {
- break;
- }
- }
-}
-
-void GetDPI( uint64_t hWnd, float &xDpi, float &yDpi )
-{
- HDC hdcScreen = GetDC( reinterpret_cast<HWND>( hWnd ) );
-
- int32_t iX = GetDeviceCaps( hdcScreen, HORZRES ); // pixel
- int32_t iY = GetDeviceCaps( hdcScreen, VERTRES ); // pixel
- int32_t iPhsX = GetDeviceCaps( hdcScreen, HORZSIZE ); // mm
- int32_t iPhsY = GetDeviceCaps( hdcScreen, VERTSIZE ); // mm
-
- xDpi = static_cast<float>( iX ) / static_cast<float>( iPhsX ) * INCH;
- yDpi = static_cast<float>( iY ) / static_cast<float>( iPhsY ) * INCH;
-}
-
-int GetOrientation()
-{
- return 0;
-}
-
-CallbackBase *listener = NULL;
-
-LRESULT CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- if( NULL != listener )
- {
- TWinEventInfo eventInfo( reinterpret_cast<uint64_t>( hWnd ), uMsg, wParam, lParam);
- CallbackBase::Execute( *listener, &eventInfo );
- }
-
- LRESULT ret = DefWindowProc( hWnd, uMsg, wParam, lParam );
- return ret;
-}
-
-DWORD windowStyle = WS_OVERLAPPED;
-
-int32_t GetEdgeWidth()
-{
- switch( windowStyle )
- {
- case WS_OVERLAPPED:
- {
- return 8;
- }
- default:
- {
- return 0;
- }
- }
-}
-
-int32_t GetEdgeHeight()
-{
- switch( windowStyle )
- {
- case WS_OVERLAPPED:
- {
- return 18;
- }
- default:
- {
- return 0;
- }
- }
-}
-
-class WindowsDisplayInfo
-{
-public:
- static int GetColorDepth()
- {
- DALI_ASSERT_DEBUG(colorDepth >= 0 && "HWND hasn't been created, no color depth");
- return colorDepth;
- }
-
- static void SetHWND( HWND inHWnd )
- {
- if( hWnd != inHWnd )
- {
- hWnd = inHWnd;
- hdc = GetDC( hWnd );
- colorDepth = GetDeviceCaps( WindowsDisplayInfo::hdc, BITSPIXEL ) * GetDeviceCaps( WindowsDisplayInfo::hdc, PLANES );
- }
- }
-
-private:
- static int colorDepth;
- static HWND hWnd;
- static HDC hdc;
-};
-
-int WindowsDisplayInfo::colorDepth = -1;
-HWND WindowsDisplayInfo::hWnd = NULL;
-HDC WindowsDisplayInfo::hdc = NULL;
-
-int GetColorDepth()
-{
- return WindowsDisplayInfo::GetColorDepth();
-}
-
-uint64_t CreateHwnd(
- _In_opt_ const char *lpClassName,
- _In_opt_ const char *lpWindowName,
- _In_ int X,
- _In_ int Y,
- _In_ int nWidth,
- _In_ int nHeight,
- _In_opt_ uint64_t parent)
-{
- WNDCLASS cs = { 0 };
- cs.cbClsExtra = 0;
- cs.cbWndExtra = 0;
- cs.hbrBackground = (HBRUSH)( COLOR_WINDOW + 2 );
- cs.hCursor = NULL;
- cs.hIcon = NULL;
- cs.hInstance = GetModuleHandle( NULL );
- cs.lpfnWndProc = (WNDPROC)WinProc;
- cs.lpszClassName = lpClassName;
- cs.lpszMenuName = NULL;
- cs.style = CS_VREDRAW | CS_HREDRAW;
- RegisterClass( &cs );
-
- HWND hWnd = CreateWindow( lpClassName, lpWindowName, windowStyle, X, Y, nWidth + 2 * GetEdgeWidth(), nHeight + 2 * GetEdgeHeight(), NULL, NULL, cs.hInstance, NULL );
- ShowWindow( hWnd, SW_SHOW );
-
- WindowsDisplayInfo::SetHWND( hWnd );
-
- return reinterpret_cast<uint64_t>( hWnd );
-}
-
-void SetListener( CallbackBase *callback )
-{
- listener = callback;
-}
-
-bool PostWinMessage(
- _In_ uint32_t Msg,
- _In_ uint32_t wParam,
- _In_ uint64_t lParam,
- _In_ uint64_t hWnd)
-{
- return (bool)PostMessage( reinterpret_cast<HWND>( hWnd ), Msg, wParam, lParam );
-}
-
-bool PostWinThreadMessage(
- _In_ uint32_t Msg,
- _In_ uint32_t wParam,
- _In_ uint64_t lParam,
- _In_ uint64_t threadID/* = -1*/ )
-{
- if( -1 == threadID )
- {
- threadID = GetCurrentThreadId();
- }
-
- return (bool)PostThreadMessage( threadID, Msg, wParam, lParam );
-}
-
-void ShowWindow( uint64_t hWnd)
-{
- ::ShowWindow( reinterpret_cast<HWND>( hWnd ), SW_SHOW);
-}
-
-void HideWindow( uint64_t hWnd)
-{
- ::ShowWindow( reinterpret_cast<HWND>( hWnd ), SW_HIDE);
-}
-
-struct TTimerCallbackInfo
-{
- void *data;
- timerCallback callback;
- HWND hWnd;
-};
-
-void CALLBACK TimerProc(HWND hWnd, UINT nMsg, UINT_PTR nTimerid, DWORD dwTime)
-{
- TTimerCallbackInfo *info = (TTimerCallbackInfo*)nTimerid;
- info->callback( info->data );
-}
-
-int SetTimer(int interval, timerCallback callback, void *data)
-{
- TTimerCallbackInfo *callbackInfo = new TTimerCallbackInfo;
- callbackInfo->data = data;
- callbackInfo->callback = callback;
- callbackInfo->hWnd = ::GetActiveWindow();
-
- UINT_PTR timerID = (UINT_PTR)callbackInfo;
- ::SetTimer( callbackInfo->hWnd, timerID, interval, TimerProc );
-
- return timerID;
-}
-
-void KillTimer(int id)
-{
- TTimerCallbackInfo *info = (TTimerCallbackInfo*)id;
- ::KillTimer( info->hWnd, id );
- delete info;
-}
-
-const char* GetKeyName( int keyCode )
-{
- switch( keyCode )
- {
- case VK_BACK:
- {
- return "Backspace";
- }
- case VK_TAB:
- {
- return "Tab";
- }
- case VK_RETURN:
- {
- return "Return";
- }
- case VK_ESCAPE:
- {
- return "Escape";
- }
- case VK_SPACE:
- {
- return "Space";
- }
- case VK_LEFT:
- {
- return "Left";
- }
- case VK_UP:
- {
- return "Up";
- }
- case VK_RIGHT:
- {
- return "Right";
- }
- case VK_DOWN:
- {
- return "Down";
- }
- case 48:
- {
- return "0";
- }
- case 49:
- {
- return "1";
- }
- case 50:
- {
- return "2";
- }
- case 51:
- {
- return "3";
- }
- case 52:
- {
- return "4";
- }
- case 53:
- {
- return "5";
- }
- case 54:
- {
- return "6";
- }
- case 55:
- {
- return "7";
- }
- case 56:
- {
- return "8";
- }
- case 57:
- {
- return "9";
- }
- default:
- {
- break;
- }
- }
-
- return "";
-}
-
-static LARGE_INTEGER cpuFrequency;
-static LARGE_INTEGER *pCpuFrequency = NULL;
-
-uint64_t GetCurrentThreadId()
-{
- return ::GetCurrentThreadId();
-}
-
-void GetNanoseconds( uint64_t& timeInNanoseconds )
-{
- if( NULL == pCpuFrequency )
- {
- pCpuFrequency = &cpuFrequency;
- QueryPerformanceFrequency( pCpuFrequency );
- }
-
- LARGE_INTEGER curTime;
- QueryPerformanceCounter( &curTime );
-
- timeInNanoseconds = static_cast<double>(curTime.QuadPart) / static_cast<double>(pCpuFrequency->QuadPart) * 1000000000;
-}
-
-unsigned int GetCurrentMilliSeconds( void )
-{
- if( NULL == pCpuFrequency )
- {
- pCpuFrequency = &cpuFrequency;
- QueryPerformanceFrequency( pCpuFrequency );
- }
-
- LARGE_INTEGER curTime;
- QueryPerformanceCounter( &curTime );
-
- return curTime.QuadPart * 1000 / pCpuFrequency->QuadPart;
-}
+\r
+namespace WindowsPlatformImplementation\r
+{\r
+\r
+void RunLoop()\r
+{\r
+ MSG nMsg = { 0 };\r
+\r
+ while( GetMessage( &nMsg, 0, NULL, NULL ) )\r
+ {\r
+ if( WIN_CALLBACK_EVENT == nMsg.message )\r
+ {\r
+ Dali::CallbackBase *callback = ( Dali::CallbackBase* )nMsg.wParam;\r
+ Dali::CallbackBase::Execute( *callback );\r
+ }\r
+\r
+ TranslateMessage( &nMsg );\r
+ DispatchMessage( &nMsg );\r
+\r
+ if( WM_CLOSE == nMsg.message )\r
+ {\r
+ break;\r
+ }\r
+ }\r
+}\r
+\r
+void GetDPI( uint64_t hWnd, float &xDpi, float &yDpi )\r
+{\r
+ HDC hdcScreen = GetDC( reinterpret_cast<HWND>( hWnd ) );\r
+\r
+ int32_t iX = GetDeviceCaps( hdcScreen, HORZRES ); // pixel\r
+ int32_t iY = GetDeviceCaps( hdcScreen, VERTRES ); // pixel\r
+ int32_t iPhsX = GetDeviceCaps( hdcScreen, HORZSIZE ); // mm\r
+ int32_t iPhsY = GetDeviceCaps( hdcScreen, VERTSIZE ); // mm\r
+\r
+ xDpi = static_cast<float>( iX ) / static_cast<float>( iPhsX ) * INCH;\r
+ yDpi = static_cast<float>( iY ) / static_cast<float>( iPhsY ) * INCH;\r
+}\r
+\r
+CallbackBase *listener = NULL;\r
+\r
+LRESULT CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
+{\r
+ if( NULL != listener )\r
+ {\r
+ TWinEventInfo eventInfo( reinterpret_cast<uint64_t>( hWnd ), uMsg, wParam, lParam);\r
+ CallbackBase::Execute( *listener, &eventInfo );\r
+ }\r
+\r
+ LRESULT ret = DefWindowProc( hWnd, uMsg, wParam, lParam );\r
+ return ret;\r
+}\r
+\r
+DWORD windowStyle = WS_OVERLAPPED;\r
+\r
+int32_t GetEdgeWidth()\r
+{\r
+ switch( windowStyle )\r
+ {\r
+ case WS_OVERLAPPED:\r
+ {\r
+ return 8;\r
+ }\r
+ default:\r
+ {\r
+ return 0;\r
+ }\r
+ }\r
+}\r
+\r
+int32_t GetEdgeHeight()\r
+{\r
+ switch( windowStyle )\r
+ {\r
+ case WS_OVERLAPPED:\r
+ {\r
+ return 18;\r
+ }\r
+ default:\r
+ {\r
+ return 0;\r
+ }\r
+ }\r
+}\r
+\r
+class WindowsDisplayInfo\r
+{\r
+public:\r
+ static int GetColorDepth()\r
+ {\r
+ DALI_ASSERT_DEBUG(colorDepth >= 0 && "HWND hasn't been created, no color depth");\r
+ return colorDepth;\r
+ }\r
+\r
+ static void SetHWND( HWND inHWnd )\r
+ {\r
+ if( hWnd != inHWnd )\r
+ {\r
+ hWnd = inHWnd;\r
+ hdc = GetDC( hWnd );\r
+ colorDepth = GetDeviceCaps( WindowsDisplayInfo::hdc, BITSPIXEL ) * GetDeviceCaps( WindowsDisplayInfo::hdc, PLANES );\r
+ }\r
+ }\r
+\r
+private:\r
+ static int colorDepth;\r
+ static HWND hWnd;\r
+ static HDC hdc;\r
+};\r
+\r
+int WindowsDisplayInfo::colorDepth = -1;\r
+HWND WindowsDisplayInfo::hWnd = NULL;\r
+HDC WindowsDisplayInfo::hdc = NULL;\r
+\r
+int GetColorDepth()\r
+{\r
+ return WindowsDisplayInfo::GetColorDepth();\r
+}\r
+\r
+uint64_t CreateHwnd(\r
+ _In_opt_ const char *lpClassName,\r
+ _In_opt_ const char *lpWindowName,\r
+ _In_ int X,\r
+ _In_ int Y,\r
+ _In_ int nWidth,\r
+ _In_ int nHeight,\r
+ _In_opt_ uint64_t parent)\r
+{\r
+ WNDCLASS cs = { 0 };\r
+ cs.cbClsExtra = 0;\r
+ cs.cbWndExtra = 0;\r
+ cs.hbrBackground = (HBRUSH)( COLOR_WINDOW + 2 );\r
+ cs.hCursor = NULL;\r
+ cs.hIcon = NULL;\r
+ cs.hInstance = GetModuleHandle( NULL );\r
+ cs.lpfnWndProc = (WNDPROC)WinProc;\r
+ cs.lpszClassName = lpClassName;\r
+ cs.lpszMenuName = NULL;\r
+ cs.style = CS_VREDRAW | CS_HREDRAW;\r
+ RegisterClass( &cs );\r
+\r
+ HWND hWnd = CreateWindow( lpClassName, lpWindowName, windowStyle, X, Y, nWidth + 2 * GetEdgeWidth(), nHeight + 2 * GetEdgeHeight(), NULL, NULL, cs.hInstance, NULL );\r
+ ShowWindow( hWnd, SW_SHOW );\r
+\r
+ WindowsDisplayInfo::SetHWND( hWnd );\r
+\r
+ return reinterpret_cast<uint64_t>( hWnd );\r
+}\r
+\r
+void SetListener( CallbackBase *callback )\r
+{\r
+ listener = callback;\r
+}\r
+\r
+bool PostWinMessage(\r
+ _In_ uint32_t Msg,\r
+ _In_ uint32_t wParam,\r
+ _In_ uint64_t lParam,\r
+ _In_ uint64_t hWnd)\r
+{\r
+ return (bool)PostMessage( reinterpret_cast<HWND>( hWnd ), Msg, wParam, lParam );\r
+}\r
+\r
+bool PostWinThreadMessage(\r
+ _In_ uint32_t Msg,\r
+ _In_ uint32_t wParam,\r
+ _In_ uint64_t lParam,\r
+ _In_ uint64_t threadID/* = -1*/ )\r
+{\r
+ if( -1 == threadID )\r
+ {\r
+ threadID = GetCurrentThreadId();\r
+ }\r
+\r
+ return (bool)PostThreadMessage( threadID, Msg, wParam, lParam );\r
+}\r
+\r
+void ShowWindow( uint64_t hWnd)\r
+{\r
+ ::ShowWindow( reinterpret_cast<HWND>( hWnd ), SW_SHOW);\r
+}\r
+\r
+void HideWindow( uint64_t hWnd)\r
+{\r
+ ::ShowWindow( reinterpret_cast<HWND>( hWnd ), SW_HIDE);\r
+}\r
+\r
+struct TTimerCallbackInfo\r
+{\r
+ void *data;\r
+ timerCallback callback;\r
+ HWND hWnd;\r
+};\r
+\r
+void CALLBACK TimerProc(HWND hWnd, UINT nMsg, UINT_PTR nTimerid, DWORD dwTime)\r
+{\r
+ TTimerCallbackInfo *info = (TTimerCallbackInfo*)nTimerid;\r
+ info->callback( info->data );\r
+}\r
+\r
+int SetTimer(int interval, timerCallback callback, void *data)\r
+{\r
+ TTimerCallbackInfo *callbackInfo = new TTimerCallbackInfo;\r
+ callbackInfo->data = data;\r
+ callbackInfo->callback = callback;\r
+ callbackInfo->hWnd = ::GetActiveWindow();\r
+\r
+ UINT_PTR timerID = (UINT_PTR)callbackInfo;\r
+ ::SetTimer( callbackInfo->hWnd, timerID, interval, TimerProc );\r
+\r
+ return timerID;\r
+}\r
+\r
+void KillTimer(int id)\r
+{\r
+ TTimerCallbackInfo *info = (TTimerCallbackInfo*)id;\r
+ ::KillTimer( info->hWnd, id );\r
+ delete info;\r
+}\r
+\r
+const char* GetKeyName( int keyCode )\r
+{\r
+ switch( keyCode )\r
+ {\r
+ case VK_BACK:\r
+ {\r
+ return "Backspace";\r
+ }\r
+ case VK_TAB:\r
+ {\r
+ return "Tab";\r
+ }\r
+ case VK_RETURN:\r
+ {\r
+ return "Return";\r
+ }\r
+ case VK_ESCAPE:\r
+ {\r
+ return "Escape";\r
+ }\r
+ case VK_SPACE:\r
+ {\r
+ return "Space";\r
+ }\r
+ case VK_LEFT:\r
+ {\r
+ return "Left";\r
+ }\r
+ case VK_UP:\r
+ {\r
+ return "Up";\r
+ }\r
+ case VK_RIGHT:\r
+ {\r
+ return "Right";\r
+ }\r
+ case VK_DOWN:\r
+ {\r
+ return "Down";\r
+ }\r
+ case 48:\r
+ {\r
+ return "0";\r
+ }\r
+ case 49:\r
+ {\r
+ return "1";\r
+ }\r
+ case 50:\r
+ {\r
+ return "2";\r
+ }\r
+ case 51:\r
+ {\r
+ return "3";\r
+ }\r
+ case 52:\r
+ {\r
+ return "4";\r
+ }\r
+ case 53:\r
+ {\r
+ return "5";\r
+ }\r
+ case 54:\r
+ {\r
+ return "6";\r
+ }\r
+ case 55:\r
+ {\r
+ return "7";\r
+ }\r
+ case 56:\r
+ {\r
+ return "8";\r
+ }\r
+ case 57:\r
+ {\r
+ return "9";\r
+ }\r
+ default:\r
+ {\r
+ break;\r
+ }\r
+ }\r
+\r
+ return "";\r
+}\r
+
+static LARGE_INTEGER cpuFrequency;\r
+static LARGE_INTEGER *pCpuFrequency = NULL;\r
+\r
+uint64_t GetCurrentThreadId()\r
+{\r
+ return ::GetCurrentThreadId();\r
+}\r
+\r
+void GetNanoseconds( uint64_t& timeInNanoseconds )\r
+{\r
+ if( NULL == pCpuFrequency )\r
+ {\r
+ pCpuFrequency = &cpuFrequency;\r
+ QueryPerformanceFrequency( pCpuFrequency );\r
+ }\r
+\r
+ LARGE_INTEGER curTime;\r
+ QueryPerformanceCounter( &curTime );\r
+\r
+ timeInNanoseconds = static_cast<double>(curTime.QuadPart) / static_cast<double>(pCpuFrequency->QuadPart) * 1000000000;\r
+}\r
+\r
+unsigned int GetCurrentMilliSeconds( void )\r
+{\r
+ if( NULL == pCpuFrequency )\r
+ {\r
+ pCpuFrequency = &cpuFrequency;\r
+ QueryPerformanceFrequency( pCpuFrequency );\r
+ }\r
+\r
+ LARGE_INTEGER curTime;\r
+ QueryPerformanceCounter( &curTime );\r
+\r
+ return curTime.QuadPart * 1000 / pCpuFrequency->QuadPart;\r
+}\r
} // namespace WindowsPlatformImplement
} // namespace internal
-} // namespace Dali
+} // namespace Dali\r
#ifndef PLATFORM_IMPLEMENT_WIN_INCLUDE\r
#define PLATFORM_IMPLEMENT_WIN_INCLUDE\r
\r
-/*\r
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
-*\r
-* Licensed under the Apache License, Version 2.0 (the "License");\r
-* you may not use this file except in compliance with the License.\r
-* You may obtain a copy of the License at\r
-*\r
-* http://www.apache.org/licenses/LICENSE-2.0\r
-*\r
-* Unless required by applicable law or agreed to in writing, software\r
-* distributed under the License is distributed on an "AS IS" BASIS,\r
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-* See the License for the specific language governing permissions and\r
-* limitations under the License.\r
-*\r
+/*
+* Copyright (c) 2018 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
*/\r
\r
// EXTERNAL_HEADERS\r
typedef uint64_t WinWindowHandle;\r
typedef uint64_t WinPixmap;\r
\r
-namespace Dali\r
-{\r
-\r
-namespace Internal\r
-{\r
-\r
-namespace Adaptor\r
-{\r
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
\r
namespace WindowsPlatformImplementation\r
{\r
\r
void GetDPI( uint64_t hWnd, float &xDpi, float &yDpi );\r
\r
-int GetOrientation() const;\r
-\r
const char* GetKeyName( int keyCode );\r
\r
uint64_t GetCurrentThreadId();\r
\r
unsigned int GetCurrentMilliSeconds( void );\r
\r
-} // namespace WindowsPlatformImplement\r
-\r
-} // namespace Adaptor\r
-\r
-} // namespace internal\r
-\r
-} // namespace Dali\r
-\r
+} // namespace WindowsPlatformImplement
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
+
#endif // WIN32_WINDOWS_SYSTEM_INCLUDE\r
-/*\r
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-// CLASS HEADER\r
-#include <dali/internal/window-system/windows/window-base-win.h>\r
-\r
-// EXTERNAL_HEADERS\r
-#include <dali/public-api/object/any.h>\r
-#include <dali/integration-api/debug.h>\r
-\r
-// INTERNAL HEADERS\r
-#include <dali/internal/window-system/common/window-impl.h>\r
-#include <dali/internal/window-system/common/window-render-surface.h>\r
-#include <dali/internal/window-system/common/window-system.h>\r
-\r
-namespace Dali\r
-{\r
-\r
-namespace Internal\r
-{\r
-\r
-namespace Adaptor\r
-{\r
-\r
-namespace\r
-{\r
-\r
-const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE;\r
-const Device::Subclass::Type DEFAULT_DEVICE_SUBCLASS = Device::Subclass::NONE;\r
-\r
-const unsigned int PRIMARY_TOUCH_BUTTON_ID( 1 );\r
-\r
-#if defined(DEBUG_ENABLED)\r
-Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW_BASE" );\r
-#endif\r
-\r
-} // unnamed namespace\r
-\r
-WindowBaseWin::WindowBaseWin( Dali::PositionSize positionSize, Any surface, bool isTransparent )\r
-: mWin32Window( 0 ),\r
- mOwnSurface( false ),\r
- mIsTransparent( false ), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.\r
- mRotationAppSet( false )\r
-{\r
- Initialize( positionSize, surface, isTransparent );\r
-}\r
-\r
-WindowBaseWin::~WindowBaseWin()\r
-{\r
- WindowsPlatformImplementation::PostWinMessage( WM_CLOSE, 0, 0, mWin32Window );\r
-}\r
-\r
-void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isTransparent )\r
-{\r
- // see if there is a surface in Any surface\r
- unsigned int surfaceId = GetSurfaceId( surface );\r
-\r
- // if the surface is empty, create a new one.\r
- if( surfaceId == 0 )\r
- {\r
- // we own the surface about to created\r
- mOwnSurface = true;\r
- CreateWinWindow( positionSize, isTransparent );\r
- }\r
- else\r
- {\r
- // XLib should already be initialized so no point in calling XInitThreads\r
- mWin32Window = static_cast< WinWindowHandle >( surfaceId );\r
- }\r
-\r
- WindowsPlatformImplementation::SetListener( MakeCallback( this, &WindowBaseWin::EventEntry ) );\r
-}\r
-\r
-void WindowBaseWin::OnDeleteRequest()\r
-{\r
- mDeleteRequestSignal.Emit();\r
-}\r
-\r
-void WindowBaseWin::OnFocusIn( int type, TWinEventInfo *event )\r
-{\r
-}\r
-\r
-void WindowBaseWin::OnFocusOut( int type, TWinEventInfo *event )\r
-{\r
-}\r
-\r
-void WindowBaseWin::OnWindowDamaged( int type, TWinEventInfo *event )\r
-{\r
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/windows/window-base-win.h>
+
+// EXTERNAL_HEADERS
+#include <dali/public-api/object/any.h>
+#include <dali/integration-api/debug.h>
+
+// INTERNAL HEADERS
+#include <dali/internal/window-system/common/window-impl.h>
+#include <dali/internal/window-system/common/window-render-surface.h>
+#include <dali/internal/window-system/common/window-system.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace
+{
+
+const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE;
+const Device::Subclass::Type DEFAULT_DEVICE_SUBCLASS = Device::Subclass::NONE;
+
+const unsigned int PRIMARY_TOUCH_BUTTON_ID( 1 );
+
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW_BASE" );
+#endif
+
+} // unnamed namespace
+
+WindowBaseWin::WindowBaseWin( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+: mWin32Window( 0 ),
+ mOwnSurface( false ),
+ mIsTransparent( false ), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.
+ mRotationAppSet( false )
+{
+ Initialize( positionSize, surface, isTransparent );
+}
+
+WindowBaseWin::~WindowBaseWin()
+{
+ WindowsPlatformImplementation::PostWinMessage( WM_CLOSE, 0, 0, mWin32Window );
+}
+
+void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isTransparent )
+{
+ // see if there is a surface in Any surface
+ unsigned int surfaceId = GetSurfaceId( surface );
+
+ // if the surface is empty, create a new one.
+ if( surfaceId == 0 )
+ {
+ // we own the surface about to created
+ mOwnSurface = true;
+ CreateWinWindow( positionSize, isTransparent );
+ }
+ else
+ {
+ // XLib should already be initialized so no point in calling XInitThreads
+ mWin32Window = static_cast< WinWindowHandle >( surfaceId );
+ }
+
+ WindowsPlatformImplementation::SetListener( MakeCallback( this, &WindowBaseWin::EventEntry ) );
+}
+
+void WindowBaseWin::OnDeleteRequest()
+{
+ mDeleteRequestSignal.Emit();
+}
+
+void WindowBaseWin::OnFocusIn( int type, TWinEventInfo *event )
+{
+}
+
+void WindowBaseWin::OnFocusOut( int type, TWinEventInfo *event )
+{
+}
+
+void WindowBaseWin::OnWindowDamaged( int type, TWinEventInfo *event )
+{
Event_Mouse_Button* windowDamagedEvent( (Event_Mouse_Button*)event );\r
\r
if( windowDamagedEvent->window == mWin32Window )\r
\r
mWindowDamagedSignal.Emit( area );\r
}\r
-}\r
-\r
-void WindowBaseWin::OnMouseButtonDown( int type, TWinEventInfo *event )\r
-{\r
- Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);\r
- touchEvent.timestamp = GetTickCount();\r
+}
+
+void WindowBaseWin::OnMouseButtonDown( int type, TWinEventInfo *event )
+{
+ Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);
+ touchEvent.timestamp = GetTickCount();
touchEvent.x = LOWORD( event->lParam );\r
touchEvent.y = HIWORD( event->lParam );\r
- touchEvent.multi.device = DEVICE_MOUSE;\r
-\r
- if( touchEvent.window == mWin32Window )\r
- {\r
- PointState::Type state ( PointState::DOWN );\r
-\r
- Integration::Point point;\r
- point.SetDeviceId( touchEvent.multi.device );\r
- point.SetState( state );\r
- point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::GetEdgeHeight() ) );\r
- point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );\r
- point.SetPressure( touchEvent.multi.pressure );\r
- point.SetAngle( Degree( touchEvent.multi.angle ) );\r
-\r
- mTouchEventSignal.Emit( point, touchEvent.timestamp );\r
- }\r
-}\r
-\r
-void WindowBaseWin::OnMouseButtonUp( int type, TWinEventInfo *event )\r
-{\r
- Event_Mouse_Button touchEvent = *( (Event_Mouse_Button*)event );\r
- touchEvent.timestamp = GetTickCount();\r
+ touchEvent.multi.device = DEVICE_MOUSE;
+
+ if( touchEvent.window == mWin32Window )
+ {
+ PointState::Type state ( PointState::DOWN );
+
+ Integration::Point point;
+ point.SetDeviceId( touchEvent.multi.device );
+ point.SetState( state );
+ point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::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 ) );
+
+ mTouchEventSignal.Emit( point, touchEvent.timestamp );
+ }
+}
+
+void WindowBaseWin::OnMouseButtonUp( int type, TWinEventInfo *event )
+{
+ Event_Mouse_Button touchEvent = *( (Event_Mouse_Button*)event );
+ touchEvent.timestamp = GetTickCount();
touchEvent.x = LOWORD( event->lParam );\r
touchEvent.y = HIWORD( event->lParam );\r
- touchEvent.multi.device = DEVICE_MOUSE;\r
-\r
- if( touchEvent.window == mWin32Window )\r
- {\r
- PointState::Type state( PointState::UP );\r
-\r
- Integration::Point point;\r
- point.SetDeviceId( touchEvent.multi.device );\r
- point.SetState( state );\r
- point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::GetEdgeHeight() ) );\r
- point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );\r
- point.SetPressure( touchEvent.multi.pressure );\r
- point.SetAngle( Degree( touchEvent.multi.angle ) );\r
-\r
- mTouchEventSignal.Emit( point, touchEvent.timestamp );\r
- }\r
-}\r
-\r
-void WindowBaseWin::OnMouseButtonMove( int type, TWinEventInfo *event )\r
-{\r
- Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);\r
- touchEvent.timestamp = GetTickCount();\r
+ touchEvent.multi.device = DEVICE_MOUSE;
+
+ if( touchEvent.window == mWin32Window )
+ {
+ PointState::Type state( PointState::UP );
+
+ Integration::Point point;
+ point.SetDeviceId( touchEvent.multi.device );
+ point.SetState( state );
+ point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::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 ) );
+
+ mTouchEventSignal.Emit( point, touchEvent.timestamp );
+ }
+}
+
+void WindowBaseWin::OnMouseButtonMove( int type, TWinEventInfo *event )
+{
+ Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);
+ touchEvent.timestamp = GetTickCount();
touchEvent.x = LOWORD( event->lParam );\r
touchEvent.y = HIWORD( event->lParam );\r
- touchEvent.multi.device = DEVICE_MOUSE;\r
-\r
- if( touchEvent.window == mWin32Window )\r
- {\r
- PointState::Type state( PointState::MOTION );\r
-\r
- Integration::Point point;\r
- point.SetDeviceId( touchEvent.multi.device );\r
- point.SetState( state );\r
- point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::GetEdgeHeight() ) );\r
- point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );\r
- point.SetPressure( touchEvent.multi.pressure );\r
- point.SetAngle( Degree( touchEvent.multi.angle ) );\r
-\r
- mTouchEventSignal.Emit( point, touchEvent.timestamp );\r
- }\r
-}\r
-\r
-void WindowBaseWin::OnMouseWheel( int type, TWinEventInfo *event )\r
-{\r
- Event_Mouse_Wheel mouseWheelEvent = *((Event_Mouse_Wheel*)( event ));\r
-\r
- if( mouseWheelEvent.window == mWin32Window )\r
- {\r
- 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 );\r
-\r
- WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent.direction, mouseWheelEvent.modifiers, Vector2( mouseWheelEvent.x, mouseWheelEvent.y ), mouseWheelEvent.z, mouseWheelEvent.timestamp );\r
-\r
- mWheelEventSignal.Emit( wheelEvent );\r
- }\r
-}\r
-\r
-void WindowBaseWin::OnKeyDown( int type, TWinEventInfo *event )\r
-{\r
- if( event->mWindow == mWin32Window )\r
- {\r
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );\r
-\r
- int keyCode = event->wParam;\r
- std::string keyName( WindowsPlatformImplementation::GetKeyName( keyCode ) );\r
- std::string keyString;\r
- std::string emptyString;\r
-\r
- int modifier( 0 );\r
- unsigned long time( 0 );\r
-\r
- // Ensure key event string is not NULL as keys like SHIFT have a null string.\r
- keyString.push_back( event->wParam );\r
-\r
- Integration::KeyEvent keyEvent( keyName, emptyString, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, emptyString, emptyString, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS );\r
-\r
- mKeyEventSignal.Emit( keyEvent );\r
- }\r
-}\r
-\r
-void WindowBaseWin::OnKeyUp( int type, TWinEventInfo *event )\r
-{\r
- if( event->mWindow == mWin32Window )\r
- {\r
- DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );\r
-\r
- int keyCode = event->wParam;\r
- std::string keyName( WindowsPlatformImplementation::GetKeyName( keyCode ) );\r
- std::string keyString;\r
- std::string emptyString;\r
-\r
- int modifier( 0 );\r
- unsigned long time( 0 );\r
-\r
- // Ensure key event string is not NULL as keys like SHIFT have a null string.\r
- keyString.push_back( event->wParam );\r
-\r
- Integration::KeyEvent keyEvent( keyName, emptyString, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, emptyString, emptyString, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS );\r
-\r
- mKeyEventSignal.Emit( keyEvent );\r
- }\r
-}\r
-\r
-Any WindowBaseWin::GetNativeWindow()\r
-{\r
- return mWin32Window;\r
-}\r
-\r
-int WindowBaseWin::GetNativeWindowId()\r
-{\r
- return mWin32Window;\r
-}\r
-\r
-EGLNativeWindowType WindowBaseWin::CreateEglWindow( int width, int height )\r
-{\r
- return reinterpret_cast< EGLNativeWindowType >( mWin32Window );\r
-}\r
-\r
-void WindowBaseWin::DestroyEglWindow()\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetEglWindowRotation( int angle )\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetEglWindowBufferTransform( int angle )\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetEglWindowTransform( int angle )\r
-{\r
-}\r
-\r
-void WindowBaseWin::ResizeEglWindow( PositionSize positionSize )\r
-{\r
-}\r
-\r
-bool WindowBaseWin::IsEglWindowRotationSupported()\r
-{\r
- return false;\r
-}\r
-\r
-void WindowBaseWin::Move( PositionSize positionSize )\r
-{\r
-}\r
-\r
-void WindowBaseWin::Resize( PositionSize positionSize )\r
-{\r
-}\r
-\r
-void WindowBaseWin::MoveResize( PositionSize positionSize )\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetClass( const std::string& name, const std::string& className )\r
-{\r
-}\r
-\r
-void WindowBaseWin::Raise()\r
-{\r
-}\r
-\r
-void WindowBaseWin::Lower()\r
-{\r
-}\r
-\r
-void WindowBaseWin::Activate()\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetAcceptFocus( bool accept )\r
-{\r
-}\r
-\r
-void WindowBaseWin::Show()\r
-{\r
-}\r
-\r
-void WindowBaseWin::Hide()\r
-{\r
-}\r
-\r
-unsigned int WindowBaseWin::GetSupportedAuxiliaryHintCount() const\r
-{\r
- return 0;\r
-}\r
-\r
-std::string WindowBaseWin::GetSupportedAuxiliaryHint( unsigned int index ) const\r
-{\r
- return std::string();\r
-}\r
-\r
-unsigned int WindowBaseWin::AddAuxiliaryHint( const std::string& hint, const std::string& value )\r
-{\r
- return 0;\r
-}\r
-\r
-bool WindowBaseWin::RemoveAuxiliaryHint( unsigned int id )\r
-{\r
- return false;\r
-}\r
-\r
-bool WindowBaseWin::SetAuxiliaryHintValue( unsigned int id, const std::string& value )\r
-{\r
- return false;\r
-}\r
-\r
-std::string WindowBaseWin::GetAuxiliaryHintValue( unsigned int id ) const\r
-{\r
- return std::string();\r
-}\r
-\r
-unsigned int WindowBaseWin::GetAuxiliaryHintId( const std::string& hint ) const\r
-{\r
- return 0;\r
-}\r
-\r
-void WindowBaseWin::SetInputRegion( const Rect< int >& inputRegion )\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetType( Dali::Window::Type type )\r
-{\r
-}\r
-\r
-bool WindowBaseWin::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )\r
-{\r
- return false;\r
-}\r
-\r
-Dali::Window::NotificationLevel::Type WindowBaseWin::GetNotificationLevel() const\r
-{\r
- return Dali::Window::NotificationLevel::NONE;\r
-}\r
-\r
-void WindowBaseWin::SetOpaqueState( bool opaque )\r
-{\r
-}\r
-\r
-bool WindowBaseWin::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)\r
-{\r
- return false;\r
-}\r
-\r
-Dali::Window::ScreenOffMode::Type WindowBaseWin::GetScreenOffMode() const\r
-{\r
- return Dali::Window::ScreenOffMode::TIMEOUT;\r
-}\r
-\r
-bool WindowBaseWin::SetBrightness( int brightness )\r
-{\r
- return false;\r
-}\r
-\r
-int WindowBaseWin::GetBrightness() const\r
-{\r
- return 0;\r
-}\r
-\r
-bool WindowBaseWin::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )\r
-{\r
- return false;\r
-}\r
-\r
-bool WindowBaseWin::UngrabKey( Dali::KEY key )\r
-{\r
- return false;\r
-}\r
-\r
-bool WindowBaseWin::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )\r
-{\r
- return false;\r
-}\r
-\r
-bool WindowBaseWin::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )\r
-{\r
- return false;\r
-}\r
-\r
-void WindowBaseWin::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )\r
-{\r
- // calculate DPI\r
- float xres, yres;\r
-\r
- //// 1 inch = 25.4 millimeters\r
- WindowsPlatformImplementation::GetDPI( mWin32Window, xres, yres );\r
-\r
- xres *= 1.5f;\r
- yres *= 1.5f;\r
-\r
- dpiHorizontal = static_cast<int>( xres + 0.5f ); // rounding\r
- dpiVertical = static_cast<int>( yres + 0.5f );\r
-}\r
-\r
-int WindowBaseWin::GetScreenRotationAngle()\r
-{\r
- return 0;\r
-}\r
-\r
-void WindowBaseWin::SetWindowRotationAngle( int degree )\r
-{\r
-}\r
-\r
-int WindowBaseWin::GetWindowRotationAngle()\r
-{\r
-}\r
-\r
-void WindowBaseWin::WindowRotationCompleted( int degree, int width, int height )\r
-{\r
-}\r
-\r
-void WindowBaseWin::SetTransparency( bool transparent )\r
-{\r
-}\r
-\r
-int WindowBaseWin::GetOrientation() const\r
-{\r
-}\r
-\r
-unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const\r
-{\r
- unsigned int surfaceId = 0;\r
-\r
- if ( surface.Empty() == false )\r
- {\r
- // check we have a valid type\r
- DALI_ASSERT_ALWAYS( (surface.GetType() == typeid ( WinWindowHandle ) )\r
- && "Surface type is invalid" );\r
-\r
- surfaceId = AnyCast< WinWindowHandle >( surface );\r
- }\r
- return surfaceId;\r
-}\r
-\r
-void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent )\r
-{\r
+ touchEvent.multi.device = DEVICE_MOUSE;
+
+ if( touchEvent.window == mWin32Window )
+ {
+ PointState::Type state( PointState::MOTION );
+
+ Integration::Point point;
+ point.SetDeviceId( touchEvent.multi.device );
+ point.SetState( state );
+ point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplementation::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 ) );
+
+ mTouchEventSignal.Emit( point, touchEvent.timestamp );
+ }
+}
+
+void WindowBaseWin::OnMouseWheel( int type, TWinEventInfo *event )
+{
+ Event_Mouse_Wheel mouseWheelEvent = *((Event_Mouse_Wheel*)( event ));
+
+ if( mouseWheelEvent.window == mWin32Window )
+ {
+ 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 );
+
+ mWheelEventSignal.Emit( wheelEvent );
+ }
+}
+
+void WindowBaseWin::OnKeyDown( int type, TWinEventInfo *event )
+{
+ if( event->mWindow == mWin32Window )
+ {
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );
+
+ int keyCode = event->wParam;
+ std::string keyName( WindowsPlatformImplementation::GetKeyName( keyCode ) );
+ std::string keyString;
+ std::string emptyString;
+
+ int modifier( 0 );
+ unsigned long time( 0 );
+
+ // 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 );
+
+ mKeyEventSignal.Emit( keyEvent );
+ }
+}
+
+void WindowBaseWin::OnKeyUp( int type, TWinEventInfo *event )
+{
+ if( event->mWindow == mWin32Window )
+ {
+ DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );
+
+ int keyCode = event->wParam;
+ std::string keyName( WindowsPlatformImplementation::GetKeyName( keyCode ) );
+ std::string keyString;
+ std::string emptyString;
+
+ int modifier( 0 );
+ unsigned long time( 0 );
+
+ // 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 );
+
+ mKeyEventSignal.Emit( keyEvent );
+ }
+}
+
+Any WindowBaseWin::GetNativeWindow()
+{
+ return mWin32Window;
+}
+
+int WindowBaseWin::GetNativeWindowId()
+{
+ return mWin32Window;
+}
+
+EGLNativeWindowType WindowBaseWin::CreateEglWindow( int width, int height )
+{
+ return reinterpret_cast< EGLNativeWindowType >( mWin32Window );
+}
+
+void WindowBaseWin::DestroyEglWindow()
+{
+}
+
+void WindowBaseWin::SetEglWindowRotation( int angle )
+{
+}
+
+void WindowBaseWin::SetEglWindowBufferTransform( int angle )
+{
+}
+
+void WindowBaseWin::SetEglWindowTransform( int angle )
+{
+}
+
+void WindowBaseWin::ResizeEglWindow( PositionSize positionSize )
+{
+}
+
+bool WindowBaseWin::IsEglWindowRotationSupported()
+{
+ return false;
+}
+
+void WindowBaseWin::Move( PositionSize positionSize )
+{
+}
+
+void WindowBaseWin::Resize( PositionSize positionSize )
+{
+}
+
+void WindowBaseWin::MoveResize( PositionSize positionSize )
+{
+}
+
+void WindowBaseWin::SetClass( const std::string& name, const std::string& className )
+{
+}
+
+void WindowBaseWin::Raise()
+{
+}
+
+void WindowBaseWin::Lower()
+{
+}
+
+void WindowBaseWin::Activate()
+{
+}
+
+void WindowBaseWin::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
+{
+}
+
+void WindowBaseWin::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
+{
+}
+
+void WindowBaseWin::SetAcceptFocus( bool accept )
+{
+}
+
+void WindowBaseWin::Show()
+{
+}
+
+void WindowBaseWin::Hide()
+{
+}
+
+unsigned int WindowBaseWin::GetSupportedAuxiliaryHintCount() const
+{
+ return 0;
+}
+
+std::string WindowBaseWin::GetSupportedAuxiliaryHint( unsigned int index ) const
+{
+ return std::string();
+}
+
+unsigned int WindowBaseWin::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+ return 0;
+}
+
+bool WindowBaseWin::RemoveAuxiliaryHint( unsigned int id )
+{
+ return false;
+}
+
+bool WindowBaseWin::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+ return false;
+}
+
+std::string WindowBaseWin::GetAuxiliaryHintValue( unsigned int id ) const
+{
+ return std::string();
+}
+
+unsigned int WindowBaseWin::GetAuxiliaryHintId( const std::string& hint ) const
+{
+ return 0;
+}
+
+void WindowBaseWin::SetInputRegion( const Rect< int >& inputRegion )
+{
+}
+
+void WindowBaseWin::SetType( Dali::Window::Type type )
+{
+}
+
+bool WindowBaseWin::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+{
+ return false;
+}
+
+Dali::Window::NotificationLevel::Type WindowBaseWin::GetNotificationLevel() const
+{
+ return Dali::Window::NotificationLevel::NONE;
+}
+
+void WindowBaseWin::SetOpaqueState( bool opaque )
+{
+}
+
+bool WindowBaseWin::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+{
+ return false;
+}
+
+Dali::Window::ScreenOffMode::Type WindowBaseWin::GetScreenOffMode() const
+{
+ return Dali::Window::ScreenOffMode::TIMEOUT;
+}
+
+bool WindowBaseWin::SetBrightness( int brightness )
+{
+ return false;
+}
+
+int WindowBaseWin::GetBrightness() const
+{
+ return 0;
+}
+
+bool WindowBaseWin::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
+{
+ return false;
+}
+
+bool WindowBaseWin::UngrabKey( Dali::KEY key )
+{
+ return false;
+}
+
+bool WindowBaseWin::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
+{
+ return false;
+}
+
+bool WindowBaseWin::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
+{
+ return false;
+}
+
+void WindowBaseWin::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
+{
+ // calculate DPI
+ float xres, yres;
+
+ //// 1 inch = 25.4 millimeters
+ WindowsPlatformImplementation::GetDPI( mWin32Window, xres, yres );
+
+ xres *= 1.5f;
+ yres *= 1.5f;
+
+ dpiHorizontal = static_cast<int>( xres + 0.5f ); // rounding
+ dpiVertical = static_cast<int>( yres + 0.5f );
+}
+
+int WindowBaseWin::GetScreenRotationAngle()
+{
+ return 0;
+}
+
+void WindowBaseWin::SetWindowRotationAngle( int degree )
+{
+}
+
+void WindowBaseWin::WindowRotationCompleted( int degree, int width, int height )
+{
+}
+
+void WindowBaseWin::SetTransparency( bool transparent )
+{
+}
+
+unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const
+{
+ unsigned int surfaceId = 0;
+
+ if ( surface.Empty() == false )
+ {
+ // check we have a valid type
+ DALI_ASSERT_ALWAYS( (surface.GetType() == typeid ( WinWindowHandle ) )
+ && "Surface type is invalid" );
+
+ surfaceId = AnyCast< WinWindowHandle >( surface );
+ }
+ return surfaceId;
+}
+
+void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent )
+{
long hWnd = WindowsPlatformImplementation::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL );\r
\r
WindowsPlatformImplementation::ShowWindow( hWnd );\r
\r
mWin32Window = (WinWindowHandle)hWnd;\r
- DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" );\r
-}\r
-\r
-void WindowBaseWin::EventEntry( TWinEventInfo *event )\r
-{\r
- unsigned int uMsg = event->uMsg;\r
-\r
+ DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" );
+}
+
+void WindowBaseWin::EventEntry( TWinEventInfo *event )
+{
+ unsigned int uMsg = event->uMsg;
+
switch( uMsg )\r
{\r
case WM_SETFOCUS:\r
break;\r
}\r
\r
- default:\r
+ default:
break;\r
- }\r
-}\r
-\r
-} // namespace Adaptor\r
-\r
-} // namespace Internal\r
-\r
-} // namespace Dali\r
-\r
+ }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
virtual void SetWindowRotationAngle( int degree ) override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle()
- */
- virtual void GetWindowRotationAngle() override;
-
- /**
* @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
*/
virtual void WindowRotationCompleted( int degree, int width, int height ) override;
*/
virtual void SetTransparency( bool transparent ) override;
- /**
- * @brief Return the orientation of the surface.
- * @return The orientation
- */
- virtual int GetOrientation() const override;
private:
/**