Updates to ensure compilation with Visual Studio 25/217925/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 15 Nov 2019 22:34:25 +0000 (22:34 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 15 Nov 2019 22:39:23 +0000 (22:39 +0000)
Change-Id: I4c84321639880b09b977b61eeffaca9e3f55b25c

13 files changed:
dali/devel-api/adaptor-framework/file-stream.cpp
dali/devel-api/adaptor-framework/file-stream.h
dali/internal/imaging/windows/curl-environment-win.cpp
dali/internal/imaging/windows/file-download-win.cpp
dali/internal/imaging/windows/native-image-source-impl-win.cpp
dali/internal/input/common/input-method-context-impl.h
dali/internal/system/windows/file-closer-win.cpp [deleted file]
dali/internal/system/windows/trigger-event.cpp
dali/internal/system/windows/trigger-event.h
dali/internal/window-system/windows/platform-implement-win.cpp
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 f6528e4..83dc907 100644 (file)
@@ -40,10 +40,12 @@ FileStream::FileStream(Dali::Vector<uint8_t>& buffer, size_t dataSize, uint8_t m
   mImpl.reset( new Impl( buffer, dataSize, mode ) );
 }
 
-FileStream::~FileStream() = default;
+FileStream::FileStream(FileStream&&) = default;
 
 FileStream& FileStream::operator=(FileStream&&) = default;
 
+FileStream::~FileStream() = default;
+
 std::iostream& FileStream::GetStream()
 {
   return mImpl->GetStream();
index de69f06..32f373e 100644 (file)
@@ -76,7 +76,7 @@ public:
   /**
    * Default move constructor
    */
-  FileStream(FileStream&&) = default;
+  FileStream(FileStream&&);
 
   /**
    * Non copyable
index d727848..7c377e5 100755 (executable)
@@ -42,11 +42,6 @@ const long EXCLUDE_BODY = 1L;
 namespace Network\r
 {\r
 \r
-void CurlEnvironment::GetThreadId( CRYPTO_THREADID* tid )\r
-{\r
-  // If dali uses c++ thread, we may replace pthread_self() to this_thread::get_id()\r
-  tid->val = Internal::Adaptor::WindowsPlatformImplementation::GetCurrentThreadId();\r
-}\r
 }\r
 }\r
 }\r
index 198e828..2a137af 100755 (executable)
@@ -85,7 +85,7 @@ size_t __cdecl ChunkLoader(char *ptr, size_t size, size_t nmemb, void *userdata)
 
 static size_t __cdecl WriteFunction( void *input, size_t uSize, size_t uCount, void *avg )
 {
-  fwrite( input, uSize, uCount, (FILE*)avg );
+  fwrite( (const char*)input, uSize, uCount, (FILE*)avg );
   return uSize * uCount;
 }
 
index eb96bb2..b0e78fb 100755 (executable)
@@ -192,7 +192,7 @@ int NativeImageSourceWin::GetPixelDepth(Dali::NativeImageSource::ColorDepth dept
   {
     case Dali::NativeImageSource::COLOR_DEPTH_DEFAULT:
     {
-      return WindowsPlatformImplementation::GetColorDepth();
+      return 32;
     }
     case Dali::NativeImageSource::COLOR_DEPTH_8:
     {
index dd1db18..35e1765 100755 (executable)
@@ -19,6 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
+#include <functional>
+#include <memory>
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/base-object.h>
@@ -27,8 +29,6 @@
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
 
-#include <memory>
-
 namespace Dali
 {
 
diff --git a/dali/internal/system/windows/file-closer-win.cpp b/dali/internal/system/windows/file-closer-win.cpp
deleted file mode 100755 (executable)
index 7cadd88..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*\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
-// Internal\r
-#include <dali/integration-api/debug.h>\r
-#include <dali/public-api/common/dali-vector.h>\r
-#include <dali/internal/system/common/file-closer.h>\r
-\r
-// External\r
-#include <CustomFile.h>\r
-#include <string>\r
-\r
-namespace Dali\r
-{\r
-\r
-namespace Internal\r
-{\r
-\r
-namespace Platform\r
-{\r
-\r
-namespace InternalFile\r
-{\r
-\r
-std::string GetRealName( const char *name )\r
-{\r
-  if( NULL != name && '*' == name[0] )\r
-  {\r
-    std::string envName;\r
-\r
-    const char *p = name + 1;\r
-    \r
-    while( 0 != *p && '*' != *p )\r
-    {\r
-      envName.push_back( *p );\r
-      p++;\r
-    }\r
-\r
-    p++;\r
-\r
-    char *envValue = std::getenv( envName.c_str() );\r
-\r
-    std::string realName = envValue;\r
-    realName += p;\r
-\r
-    return realName;\r
-  }\r
-  else\r
-  {\r
-    return "";\r
-  }\r
-}\r
-\r
-FILE *FOpen( const char *name, const char *mode )\r
-{\r
-  if( NULL != name && '*' == name[0] )\r
-  {\r
-    std::string realName = GetRealName( name );\r
-    return (FILE*)CustomFile::FOpen( realName.c_str(), mode );\r
-  }\r
-  else\r
-  {\r
-    return (FILE*)CustomFile::FOpen( name, mode );\r
-  }\r
-}\r
-\r
-FILE *FMemopen( void *__s, size_t __len, const char *__modes )\r
-{\r
-  FILE *ret = (FILE*)CustomFile::FMemopen( __s, __len, __modes );\r
-  return ret;\r
-}\r
-\r
-size_t FRead( void*  _Buffer, size_t _ElementSize, size_t _ElementCount, FILE*  _Stream )\r
-{\r
-  return CustomFile::FRead( _Buffer, _ElementSize, _ElementCount, _Stream );\r
-}\r
-\r
-int FClose( FILE *__stream )\r
-{\r
-  return CustomFile::FClose( __stream );\r
-}\r
-\r
-void FWrite( void *buf, int size, int count, FILE *fp )\r
-{\r
-  CustomFile::FWrite( buf, size * count, fp );\r
-}\r
-\r
-int FSeek( FILE *fp, int offset, int origin )\r
-{\r
-  return CustomFile::FSeek( fp, offset, origin );\r
-}\r
-\r
-int FTell( FILE *fp )\r
-{\r
-  return CustomFile::FTell( fp );\r
-}\r
-\r
-bool FEof( FILE *fp )\r
-{\r
-  return CustomFile::FEof( fp );\r
-}\r
-} //InternalFile\r
-} //Platform\r
-} //Internal\r
-} //Dali\r
index cbd5b33..af42ad6 100755 (executable)
@@ -48,11 +48,14 @@ TriggerEvent::TriggerEvent( CallbackBase* callback, TriggerEventInterface::Optio
   {\r
     DALI_LOG_ERROR("Unable to create TriggerEvent File descriptor\n");\r
   }\r
+\r
+  mSelfCallback = MakeCallback( this, &TriggerEvent::Triggered );\r
 }\r
 \r
 TriggerEvent::~TriggerEvent()\r
 {\r
   delete mCallback;\r
+  delete mSelfCallback;\r
 \r
   if ( mThreadID >= 0)\r
   {\r
@@ -67,8 +70,7 @@ void TriggerEvent::Trigger()
     // Increment event counter by 1.\r
     // Writing to the file descriptor triggers the Dispatch() method in the other thread\r
     // (if in multi-threaded environment).\r
-    CallbackBase *callback = MakeCallback( this, &TriggerEvent::Triggered );\r
-    WindowsPlatformImplementation::PostWinThreadMessage( WIN_CALLBACK_EVENT, reinterpret_cast<uint64_t>( callback ), 0, mThreadID );\r
+    WindowsPlatformImplementation::PostWinThreadMessage( WIN_CALLBACK_EVENT, reinterpret_cast<uint64_t>( mSelfCallback ), 0, mThreadID );\r
   }\r
   else\r
   {\r
index 4c86810..6bf2264 100755 (executable)
@@ -74,6 +74,7 @@ private:
 private:
 
   CallbackBase* mCallback;
+  CallbackBase* mSelfCallback;
   int32_t mThreadID;
   TriggerEventInterface::Options mOptions;
 };
@@ -84,4 +85,4 @@ private:
 
 } // namespace Dali
 
-#endif // DALI_INTERNAL_TRIGGER_EVENT_IMPL_H
+#endif // DALI_INTERNAL_TRIGGER_EVENT_IMPL_H
\ No newline at end of file
index 1d79ce8..1816ae1 100755 (executable)
@@ -19,6 +19,7 @@
 #include <dali/internal/window-system/windows/platform-implement-win.h>\r
 \r
 // EXTERNAL INCLUDES\r
+#include <map>\r
 #include <windows.h>\r
 \r
 // INTERNAL INCLUDES\r
@@ -62,107 +63,73 @@ void RunLoop()
   }\r
 }\r
 \r
-void GetDPI( uint64_t hWnd, float &xDpi, float &yDpi )\r
+LRESULT CALLBACK WinProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )\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
+  WindowImpl::ProcWinMessge( reinterpret_cast<uint64_t>( hWnd ), uMsg, wParam, lParam );\r
 \r
   LRESULT ret = DefWindowProc( hWnd, uMsg, wParam, lParam );\r
   return ret;\r
 }\r
 \r
-DWORD windowStyle = WS_OVERLAPPED;\r
+std::map<uint64_t, WindowImpl*> mHWndToListener;\r
 \r
-int32_t GetEdgeWidth()\r
+WindowImpl::WindowImpl()\r
 {\r
-  switch( windowStyle )\r
-  {\r
-    case WS_OVERLAPPED:\r
-    {\r
-      return 8;\r
-    }\r
-    default:\r
-    {\r
-      return 0;\r
-    }\r
-  }\r
+  colorDepth = -1;\r
+  mHWnd = 0;\r
+  mHdc = 0;\r
+  listener = NULL;\r
+  windowStyle = WS_OVERLAPPED;\r
 }\r
 \r
-int32_t GetEdgeHeight()\r
+WindowImpl::~WindowImpl()\r
 {\r
-  switch( windowStyle )\r
-  {\r
-    case WS_OVERLAPPED:\r
-    {\r
-      return 18;\r
-    }\r
-    default:\r
-    {\r
-      return 0;\r
-    }\r
-  }\r
+  mHWndToListener.erase( mHWnd );\r
 }\r
 \r
-class WindowsDisplayInfo\r
+void WindowImpl::ProcWinMessge( uint64_t hWnd, uint32_t uMsg, uint64_t wParam, uint64_t lParam )\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
+  std::map<uint64_t, WindowImpl*>::iterator x = mHWndToListener.find( hWnd );\r
 \r
-  static void SetHWND( HWND inHWnd )\r
+  if( mHWndToListener.end() != x )\r
   {\r
-    if( hWnd != inHWnd )\r
+    CallbackBase* listener = x->second->listener;\r
+\r
+    if( NULL != listener )\r
     {\r
-      hWnd = inHWnd;\r
-      hdc = GetDC( hWnd );\r
-      colorDepth = GetDeviceCaps( WindowsDisplayInfo::hdc, BITSPIXEL ) * GetDeviceCaps( WindowsDisplayInfo::hdc, PLANES );\r
+      TWinEventInfo eventInfo( hWnd, uMsg, wParam, lParam );\r
+      CallbackBase::Execute( *listener, &eventInfo );\r
     }\r
   }\r
+}\r
 \r
-private:\r
-  static int colorDepth;\r
-  static HWND hWnd;\r
-  static HDC hdc;\r
-};\r
+void WindowImpl::GetDPI( float &xDpi, float &yDpi )\r
+{\r
+  HDC hdcScreen = GetDC( reinterpret_cast<HWND>( mHWnd ) );\r
 \r
-int WindowsDisplayInfo::colorDepth = -1;\r
-HWND WindowsDisplayInfo::hWnd = NULL;\r
-HDC WindowsDisplayInfo::hdc = NULL;\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
-int GetColorDepth()\r
+int WindowImpl::GetColorDepth()\r
 {\r
-  return WindowsDisplayInfo::GetColorDepth();\r
+  DALI_ASSERT_DEBUG( colorDepth >= 0 && "HWND hasn't been created, no color depth" );\r
+  return colorDepth;\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
+uint64_t WindowImpl::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
@@ -178,49 +145,89 @@ uint64_t CreateHwnd(
   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
+  ::ShowWindow( hWnd, SW_SHOW );\r
 \r
-  WindowsDisplayInfo::SetHWND( hWnd );\r
+  SetHWND( reinterpret_cast<uint64_t>(hWnd) );\r
 \r
-  return reinterpret_cast<uint64_t>( hWnd );\r
+  return mHWnd;\r
 }\r
 \r
-void SetListener( CallbackBase *callback )\r
+void WindowImpl::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
+bool WindowImpl::PostWinMessage(\r
+  _In_ uint32_t Msg,\r
+  _In_ uint32_t wParam,\r
+  _In_ uint64_t lParam )\r
 {\r
-  return (bool)PostMessage( reinterpret_cast<HWND>( hWnd ), Msg, wParam, lParam );\r
+  return (bool)PostMessage( reinterpret_cast<HWND>( mHWnd ), 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
+int32_t WindowImpl::GetEdgeWidth()\r
 {\r
-  if( -1 == threadID )\r
+  switch( windowStyle )\r
   {\r
-    threadID = GetCurrentThreadId();\r
+  case WS_OVERLAPPED:\r
+  {\r
+    return 8;\r
   }\r
+  default:\r
+  {\r
+    return 0;\r
+  }\r
+  }\r
+}\r
 \r
-  return (bool)PostThreadMessage( threadID, Msg, wParam, lParam );\r
+int32_t WindowImpl::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
-void ShowWindow( uint64_t hWnd)\r
+void WindowImpl::SetHWND( uint64_t inHWnd )\r
 {\r
-  ::ShowWindow( reinterpret_cast<HWND>( hWnd ), SW_SHOW);\r
+  if( mHWnd != inHWnd )\r
+  {\r
+    mHWnd = inHWnd;\r
+    mHdc = reinterpret_cast<uint64_t>( GetDC( reinterpret_cast<HWND>( mHWnd ) ) );\r
+    colorDepth = GetDeviceCaps( reinterpret_cast<HDC>( mHdc ), BITSPIXEL ) * GetDeviceCaps( reinterpret_cast<HDC>( mHdc ), PLANES );\r
+\r
+    std::map<uint64_t, WindowImpl*>::iterator x = mHWndToListener.find( mHWnd );\r
+\r
+    if( mHWndToListener.end() == x )\r
+    {\r
+      mHWndToListener.insert( std::make_pair( mHWnd, this ) );\r
+    }\r
+    else\r
+    {\r
+      x->second = this;\r
+    }\r
+  }\r
 }\r
 \r
-void HideWindow( uint64_t hWnd)\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
-  ::ShowWindow( reinterpret_cast<HWND>( hWnd ), SW_HIDE);\r
+  if( -1 == threadID )\r
+  {\r
+    threadID = GetCurrentThreadId();\r
+  }\r
+\r
+  return (bool)PostThreadMessage( threadID, Msg, wParam, lParam );\r
 }\r
 \r
 struct TTimerCallbackInfo\r
index 18b33c1..4ba8799 100755 (executable)
@@ -1,21 +1,21 @@
 #ifndef PLATFORM_IMPLEMENT_WIN_INCLUDE\r
 #define PLATFORM_IMPLEMENT_WIN_INCLUDE\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
+* 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
 // EXTERNAL_HEADERS\r
 typedef uint64_t   WinWindowHandle;\r
 typedef uint64_t   WinPixmap;\r
 \r
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
+namespace Dali\r
+{\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
 \r
 namespace WindowsPlatformImplementation\r
 {\r
 \r
 void RunLoop();\r
 \r
-int GetEdgeHeight();\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
+using timerCallback = bool(*)(void *data);\r
+\r
+int SetTimer(int interval, timerCallback callback, void *data);\r
+\r
+void KillTimer(int id);\r
+\r
+const char* GetKeyName( int keyCode );\r
+\r
+uint64_t GetCurrentThreadId();\r
+\r
+void GetNanoseconds( uint64_t& timeInNanoseconds );\r
+\r
+unsigned int GetCurrentMilliSeconds( void );\r
+\r
+class WindowImpl\r
+{\r
+public:\r
+  WindowImpl();\r
+\r
+  virtual ~WindowImpl();\r
+\r
+  static void ProcWinMessge( uint64_t hWnd, uint32_t uMsg, uint64_t wParam, uint64_t lParam );\r
 \r
-int GetColorDepth();\r
+  void GetDPI( float &xDpi, float &yDpi );\r
 \r
-uint64_t CreateHwnd(\r
+  int GetColorDepth();\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
+    _In_opt_ uint64_t parent );\r
 \r
-void SetListener( CallbackBase *callback );\r
+  void SetListener( CallbackBase *callback );\r
 \r
-bool PostWinMessage(\r
+  bool PostWinMessage(\r
     _In_ uint32_t Msg,\r
     _In_ uint32_t wParam,\r
-    _In_ uint64_t lParam,\r
-    _In_ uint64_t hWnd);\r
+    _In_ uint64_t lParam );\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
+  int32_t GetEdgeWidth();\r
 \r
-void ShowWindow( uint64_t hWnd );\r
-void HideWindow( uint64_t hWnd );\r
+  int32_t GetEdgeHeight();\r
 \r
-using timerCallback = bool(*)(void *data);\r
+protected:\r
 \r
-int SetTimer(int interval, timerCallback callback, void *data);\r
+private:\r
 \r
-void KillTimer(int id);\r
+  void SetHWND( uint64_t inHWnd );\r
 \r
-void GetDPI( uint64_t hWnd, float &xDpi, float &yDpi );\r
+  unsigned long windowStyle;\r
 \r
-const char* GetKeyName( int keyCode );\r
+  int colorDepth;\r
+  uint64_t mHWnd;\r
+  uint64_t mHdc;\r
 \r
-uint64_t GetCurrentThreadId();\r
+  CallbackBase *listener;\r
+};\r
 \r
-void GetNanoseconds( uint64_t& timeInNanoseconds );\r
+} // namespace WindowsPlatformImplement\r
 \r
-unsigned int GetCurrentMilliSeconds( void );\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
index ef1c28d..e1526ff 100755 (executable)
@@ -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 )
@@ -82,7 +82,7 @@ void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isT
     mWin32Window = static_cast< WinWindowHandle >( surfaceId );
   }
 
-  WindowsPlatformImplementation::SetListener( MakeCallback( this, &WindowBaseWin::EventEntry ) );
+  mWindowImpl.SetListener( MakeCallback( this, &WindowBaseWin::EventEntry ) );
 }
 
 void WindowBaseWin::OnDeleteRequest()
@@ -128,7 +128,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 +152,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 +176,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 +239,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 +291,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 )
@@ -436,7 +437,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;
@@ -479,9 +480,7 @@ 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 );
-
-  WindowsPlatformImplementation::ShowWindow( hWnd );
+  long hWnd = mWindowImpl.CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL );
 
   mWin32Window = (WinWindowHandle)hWnd;
   DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no Windows window" );
index 5e99156..f1af92f 100755 (executable)
@@ -376,6 +376,8 @@ private:
   bool                                 mOwnSurface:1;       ///< Whether we own the surface (responsible for deleting it)
   bool                                 mIsTransparent:1;    ///< Whether the window is transparent (32 bit or 24 bit)
   bool                                 mRotationAppSet:1;
+
+  WindowsPlatformImplementation::WindowImpl mWindowImpl;
 };
 
 } // namespace Adaptor