+namespace
+{
+
+const std::string DALI_WINDOW_CLASS_NAME = "DaliWindow";
+
+uint32_t sNumWindows = 0;
+
+void EnsureWindowClassRegistered()
+{
+ if (sNumWindows == 0)
+ {
+ 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 = DALI_WINDOW_CLASS_NAME.c_str();
+ cs.lpszMenuName = NULL;
+ cs.style = CS_VREDRAW | CS_HREDRAW;
+ RegisterClass(&cs);
+ }
+}
+
+void EnsureWindowClassUnregistered()
+{
+ if (sNumWindows == 0)
+ {
+ UnregisterClass(DALI_WINDOW_CLASS_NAME.c_str(), GetModuleHandle(NULL));
+ }
+}
+
+std::map<uint64_t, WindowImpl*> sHWndToListener;
+
+void RemoveListener(uint64_t hWnd)
+{
+ std::map<uint64_t, WindowImpl*>::iterator x = sHWndToListener.find(hWnd);
+ if (sHWndToListener.end() != x)
+ {
+ sHWndToListener.erase(x);
+ }
+}
+
+}
+
+const uint32_t WindowImpl::STYLE = WS_OVERLAPPED;
+const int32_t WindowImpl::EDGE_WIDTH = 8;
+const int32_t WindowImpl::EDGE_HEIGHT = 18;