Fix IME Window is not shown issue.
[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) 2021 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 <dali/public-api/signals/callback.h>\r
23 #include <stdint.h>\r
24 #include <string>\r
25 \r
26 typedef uintptr_t WinWindowHandle;\r
27 typedef uint64_t  WinPixmap;\r
28 \r
29 namespace Dali\r
30 {\r
31 namespace Internal\r
32 {\r
33 namespace Adaptor\r
34 {\r
35 namespace WindowsPlatform\r
36 {\r
37 bool PostWinThreadMessage(\r
38   _In_ uint32_t Msg,\r
39   _In_ uint64_t wParam,\r
40   _In_ uint64_t lParam,\r
41   _In_ uint64_t threadID = -1);\r
42 \r
43 using timerCallback = bool (*)(void* data);\r
44 \r
45 intptr_t SetTimer(int interval, timerCallback callback, void* data);\r
46 \r
47 void KillTimer(intptr_t id);\r
48 \r
49 std::string GetKeyName(int keyCode);\r
50 \r
51 uint64_t GetCurrentThreadId();\r
52 \r
53 void GetNanoseconds(uint64_t& timeInNanoseconds);\r
54 \r
55 unsigned int GetCurrentMilliSeconds(void);\r
56 \r
57 class WindowImpl\r
58 {\r
59 public:\r
60   static const uint32_t STYLE;\r
61   static const int32_t  EDGE_WIDTH;\r
62   static const int32_t  EDGE_HEIGHT;\r
63 \r
64   WindowImpl();\r
65 \r
66   virtual ~WindowImpl();\r
67 \r
68   static void ProcWinMessage(uint64_t hWnd, uint32_t uMsg, uint64_t wParam, uint64_t lParam);\r
69 \r
70   static uint64_t CreateHwnd(\r
71     _In_opt_ const char* lpWindowName,\r
72     _In_ int             X,\r
73     _In_ int             Y,\r
74     _In_ int             nWidth,\r
75     _In_ int             nHeight,\r
76     _In_opt_ uint64_t    parent);\r
77 \r
78   static void DestroyHWnd(uint64_t hWnd);\r
79 \r
80   void GetDPI(float& xDpi, float& yDpi);\r
81 \r
82   int GetColorDepth();\r
83 \r
84   void SetListener(CallbackBase* callback);\r
85 \r
86   bool PostWinMessage(\r
87     _In_ uint32_t Msg,\r
88     _In_ uint64_t wParam,\r
89     _In_ uint64_t lParam);\r
90 \r
91   void SetHWND(uint64_t inHWnd);\r
92   void SetWinProc();\r
93 \r
94 private:\r
95   int      colorDepth;\r
96   uint64_t mHWnd; // no ownership, managed outside\r
97   uint64_t mHdc;\r
98 \r
99   CallbackBase* listener;\r
100 };\r
101 \r
102 } // namespace WindowsPlatform\r
103 \r
104 } // namespace Adaptor\r
105 \r
106 } // namespace Internal\r
107 \r
108 } // namespace Dali\r
109 \r
110 #endif // WIN32_WINDOWS_SYSTEM_INCLUDE\r