Merge "[Windows version] WindowImpl cleanup, fixes and improvements." into devel...
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / windows / platform-implement-win.h
1 #ifndef PLATFORM_IMPLEMENT_WIN_INCLUDE\r
2 #define PLATFORM_IMPLEMENT_WIN_INCLUDE\r
3 \r
4 /*\r
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
6 *\r
7 * Licensed under the Apache License, Version 2.0 (the "License");\r
8 * you may not use this file except in compliance with the License.\r
9 * You may obtain a copy of the License at\r
10 *\r
11 * http://www.apache.org/licenses/LICENSE-2.0\r
12 *\r
13 * Unless required by applicable law or agreed to in writing, software\r
14 * distributed under the License is distributed on an "AS IS" BASIS,\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16 * See the License for the specific language governing permissions and\r
17 * limitations under the License.\r
18 *\r
19 */\r
20 \r
21 // EXTERNAL_HEADERS\r
22 #include <stdint.h>\r
23 #include <dali/public-api/signals/callback.h>\r
24 \r
25 typedef uintptr_t  WinWindowHandle;\r
26 typedef uint64_t   WinPixmap;\r
27 \r
28 namespace Dali\r
29 {\r
30 \r
31 namespace Internal\r
32 {\r
33 \r
34 namespace Adaptor\r
35 {\r
36 \r
37 namespace WindowsPlatform\r
38 {\r
39 \r
40 bool PostWinThreadMessage(\r
41     _In_ uint32_t Msg,\r
42     _In_ uint64_t wParam,\r
43     _In_ uint64_t lParam,\r
44     _In_ uint64_t threadID = -1 );\r
45 \r
46 using timerCallback = bool(*)(void *data);\r
47 \r
48 intptr_t SetTimer(int interval, timerCallback callback, void *data);\r
49 \r
50 void KillTimer(intptr_t id);\r
51 \r
52 const char* GetKeyName( int keyCode );\r
53 \r
54 uint64_t GetCurrentThreadId();\r
55 \r
56 void GetNanoseconds( uint64_t& timeInNanoseconds );\r
57 \r
58 unsigned int GetCurrentMilliSeconds( void );\r
59 \r
60 class WindowImpl\r
61 {\r
62 public:\r
63   static const uint32_t STYLE;\r
64   static const int32_t EDGE_WIDTH;\r
65   static const int32_t EDGE_HEIGHT;\r
66 \r
67   WindowImpl();\r
68 \r
69   virtual ~WindowImpl();\r
70 \r
71   static void ProcWinMessage( uint64_t hWnd, uint32_t uMsg, uint64_t wParam, uint64_t lParam );\r
72 \r
73   static uint64_t CreateHwnd(\r
74     _In_opt_ const char *lpWindowName,\r
75     _In_ int X,\r
76     _In_ int Y,\r
77     _In_ int nWidth,\r
78     _In_ int nHeight,\r
79     _In_opt_ uint64_t parent );\r
80 \r
81   static void DestroyHWnd(uint64_t hWnd);\r
82 \r
83   void GetDPI( float &xDpi, float &yDpi );\r
84 \r
85   int GetColorDepth();\r
86 \r
87   void SetListener( CallbackBase *callback );\r
88 \r
89   bool PostWinMessage(\r
90     _In_ uint32_t Msg,\r
91     _In_ uint64_t wParam,\r
92     _In_ uint64_t lParam );\r
93 \r
94   void SetHWND(uint64_t inHWnd);\r
95   void SetWinProc();\r
96 \r
97 protected:\r
98 \r
99 private:\r
100   int colorDepth;\r
101   uint64_t mHWnd; // no ownership, managed outside\r
102   uint64_t mHdc;\r
103 \r
104   CallbackBase *listener;\r
105 };\r
106 \r
107 } // namespace WindowsPlatformImplement\r
108 \r
109 } // namespace Adaptor\r
110 \r
111 } // namespace internal\r
112 \r
113 } // namespace Dali\r
114 \r
115 #endif // WIN32_WINDOWS_SYSTEM_INCLUDE\r