windows: Store the window handle in a pointer sized type 64/242164/1
authorWander Lairson Costa <wander.lairson@gmail.com>
Thu, 23 Jul 2020 15:57:54 +0000 (12:57 -0300)
committerVíctor Cebollada <v.cebollada@samsung.com>
Mon, 24 Aug 2020 15:04:19 +0000 (15:04 +0000)
Under the hoods, HWND is a typedef to a void *, which is can't be stored
in the int in 64 bits systems.

Change-Id: I580170eaabf6508abc8bbca7395da98233164d9b

dali/internal/window-system/windows/platform-implement-win.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h

index e84dce7..58aa86d 100755 (executable)
@@ -22,7 +22,7 @@
 #include <stdint.h>\r
 #include <dali/public-api/signals/callback.h>\r
 \r
-typedef uint64_t   WinWindowHandle;\r
+typedef uintptr_t  WinWindowHandle;\r
 typedef uint64_t   WinPixmap;\r
 \r
 namespace Dali\r
index 86994da..6a61154 100755 (executable)
@@ -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 )
@@ -462,9 +462,9 @@ void WindowBaseWin::SetTransparency( bool transparent )
 {
 }
 
-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 )
   {
@@ -486,13 +486,13 @@ void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTranspare
   DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" );
 }
 
-void WindowBaseWin::SetWinWindow( unsigned int surfaceId )
+void WindowBaseWin::SetWinWindow( uintptr_t surfaceId )
 {
   HWND hWnd = (HWND)surfaceId;
 
   mWin32Window = static_cast<WinWindowHandle>(surfaceId);
 
-  mWindowImpl.SetHWND( reinterpret_cast<uint64_t>(hWnd));
+  mWindowImpl.SetHWND(surfaceId);
 
   mWindowImpl.SetWinProc();
 }
index 48c0560..aa5ab49 100755 (executable)
@@ -363,7 +363,7 @@ private:
    * @param surface Any containing a surface id, or can be empty
    * @return surface id, or zero if surface is empty
    */
-  unsigned int GetSurfaceId( Any surface ) const;
+  uintptr_t GetSurfaceId( Any surface ) const;
 
   /**
    * @brief Create window
@@ -373,7 +373,7 @@ private:
   /**
    * @brief Sets up an already created window.
    */
-  void SetWinWindow( unsigned int surfaceId );
+  void SetWinWindow( uintptr_t surfaceId );
 
 private: