| 15 | extern void OnMainWindowCreated(HWND hWnd); |
| 16 | |
| 17 | GDKWindow::GDKWindow(const CreateWindowSettings& settings) |
| 18 | : WindowBase(settings) |
| 19 | { |
| 20 | int32 x = Math::TruncToInt(settings.Position.X); |
| 21 | int32 y = Math::TruncToInt(settings.Position.Y); |
| 22 | int32 clientWidth = Math::TruncToInt(settings.Size.X); |
| 23 | int32 clientHeight = Math::TruncToInt(settings.Size.Y); |
| 24 | int32 windowWidth = clientWidth; |
| 25 | int32 windowHeight = clientHeight; |
| 26 | _clientSize = Float2((float)clientWidth, (float)clientHeight); |
| 27 | |
| 28 | // Setup window style |
| 29 | uint32 style = WS_POPUP, exStyle = 0; |
| 30 | if (settings.SupportsTransparency) |
| 31 | exStyle |= WS_EX_LAYERED; |
| 32 | if (!settings.ActivateWhenFirstShown) |
| 33 | exStyle |= WS_EX_NOACTIVATE; |
| 34 | if (settings.ShowInTaskbar) |
| 35 | exStyle |= WS_EX_APPWINDOW; |
| 36 | else |
| 37 | exStyle |= WS_EX_TOOLWINDOW; |
| 38 | if (settings.IsTopmost) |
| 39 | exStyle |= WS_EX_TOPMOST; |
| 40 | if (!settings.AllowInput) |
| 41 | exStyle |= WS_EX_TRANSPARENT; |
| 42 | if (settings.AllowMaximize) |
| 43 | style |= WS_MAXIMIZEBOX; |
| 44 | if (settings.AllowMinimize) |
| 45 | style |= WS_MINIMIZEBOX; |
| 46 | if (settings.HasSizingFrame) |
| 47 | style |= WS_THICKFRAME; |
| 48 | |
| 49 | // Check if window should have a border |
| 50 | if (settings.HasBorder) |
| 51 | { |
| 52 | // Create window style flags |
| 53 | style |= WS_OVERLAPPED | WS_SYSMENU | WS_BORDER | WS_CAPTION; |
| 54 | exStyle |= 0; |
| 55 | |
| 56 | // Adjust window size and positions to take into account window border |
| 57 | RECT winRect = { 0, 0, clientWidth, clientHeight }; |
| 58 | AdjustWindowRectEx(&winRect, style, FALSE, exStyle); |
| 59 | x += winRect.left; |
| 60 | y += winRect.top; |
| 61 | windowWidth = winRect.right - winRect.left; |
| 62 | windowHeight = winRect.bottom - winRect.top; |
| 63 | } |
| 64 | else |
| 65 | { |
| 66 | // Create window style flags |
| 67 | style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS; |
| 68 | exStyle |= WS_EX_WINDOWEDGE; |
| 69 | } |
| 70 | |
| 71 | // Creating the window |
| 72 | _handle = CreateWindowExW( |
| 73 | exStyle, |
| 74 | Platform::ApplicationClassName, |
nothing calls this directly
no test coverage detected