aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/libui/windows/utilwin.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-04-25 18:51:08 +0200
committerArisotura <thetotalworm@gmail.com>2020-04-25 18:51:08 +0200
commita85d41c53eed50f188502925ed34674397b86550 (patch)
treee33b042b8114f7ad587257d79bad021d5e617a44 /src/libui_sdl/libui/windows/utilwin.cpp
parent3b3a09ed2b7a1f3d6f81ba6d1ddd7fbf17acd52d (diff)
berp.
Diffstat (limited to 'src/libui_sdl/libui/windows/utilwin.cpp')
-rw-r--r--src/libui_sdl/libui/windows/utilwin.cpp76
1 files changed, 0 insertions, 76 deletions
diff --git a/src/libui_sdl/libui/windows/utilwin.cpp b/src/libui_sdl/libui/windows/utilwin.cpp
deleted file mode 100644
index 414ae83..0000000
--- a/src/libui_sdl/libui/windows/utilwin.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-// 14 may 2015
-#include "uipriv_windows.hpp"
-
-// The utility window is a special window that performs certain tasks internal to libui.
-// It is not a message-only window, and it is always hidden and disabled.
-// Its roles:
-// - It is the initial parent of all controls. When a control loses its parent, it also becomes that control's parent.
-// - It handles WM_QUERYENDSESSION and console end session requests.
-// - It handles WM_WININICHANGE and forwards the message to any child windows that request it.
-// - It handles executing functions queued to run by uiQueueMain().
-
-#define utilWindowClass L"libui_utilWindowClass"
-
-HWND utilWindow;
-
-static LRESULT CALLBACK utilWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- void (*qf)(void *);
- LRESULT lResult;
-
- if (handleParentMessages(hwnd, uMsg, wParam, lParam, &lResult) != FALSE)
- return lResult;
- switch (uMsg) {
- case WM_QUERYENDSESSION:
- // TODO block handler
- if (shouldQuit()) {
- uiQuit();
- return TRUE;
- }
- return FALSE;
- case WM_WININICHANGE:
- issueWM_WININICHANGE(wParam, lParam);
- return 0;
- case msgQueued:
- qf = (void (*)(void *)) wParam;
- (*qf)((void *) lParam);
- return 0;
- }
- return DefWindowProcW(hwnd, uMsg, wParam, lParam);
-}
-
-const char *initUtilWindow(HICON hDefaultIcon, HCURSOR hDefaultCursor)
-{
- WNDCLASSW wc;
-
- ZeroMemory(&wc, sizeof (WNDCLASSW));
- wc.lpszClassName = utilWindowClass;
- wc.lpfnWndProc = utilWindowWndProc;
- wc.hInstance = hInstance;
- wc.hIcon = hDefaultIcon;
- wc.hCursor = hDefaultCursor;
- wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
- if (RegisterClass(&wc) == 0)
- // see init.cpp for an explanation of the =s
- return "=registering utility window class";
-
- utilWindow = CreateWindowExW(0,
- utilWindowClass, L"libui utility window",
- WS_OVERLAPPEDWINDOW,
- 0, 0, 100, 100,
- NULL, NULL, hInstance, NULL);
- if (utilWindow == NULL)
- return "=creating utility window";
- // and just to be safe
- EnableWindow(utilWindow, FALSE);
-
- return NULL;
-}
-
-void uninitUtilWindow(void)
-{
- if (DestroyWindow(utilWindow) == 0)
- logLastError(L"error destroying utility window");
- if (UnregisterClass(utilWindowClass, hInstance) == 0)
- logLastError(L"error unregistering utility window class");
-}