summaryrefslogtreecommitdiff
path: root/alf/alf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alf.cpp')
-rw-r--r--alf/alf.cpp82
1 files changed, 3 insertions, 79 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp
index de23784..84ba71d 100644
--- a/alf/alf.cpp
+++ b/alf/alf.cpp
@@ -45,7 +45,7 @@ ALF_Initialize(void)
ALF_LoadCompatFunctions();
- ALF_RegisterWindowClass();
+ ALF_RegisterToplevelClass();
ALF_RegisterControlClass();
ALF_Compat_BufferedPaintInit();
@@ -67,7 +67,8 @@ ALF_UnInitialize(void)
if (!--_alf_initCounter) {
ALF_Compat_BufferedPaintUnInit();
- UnregisterClass(_alf_windowClass, ALF_HINSTANCE);
+ ALF_UnregisterToplevelClass();
+
UnregisterClass(_alf_controlClass, ALF_HINSTANCE);
ALF_UnloadCompatFunctions();
@@ -104,52 +105,6 @@ ALF_Free(const void *p)
HeapFree(GetProcessHeap(), 0, (void*)p);
}
-void
-ALF_DestroyWindow(HWND win)
-{
- DestroyWindow(win);
-}
-
-int
-ALF_ShowModal(HWND win)
-{
- MSG msg;
-
- ALF_SetModalResult(win, 0);
-
- // TODO: disable parent window
- ShowWindow(win, SW_SHOW);
-
- while (GetMessage(&msg, NULL, 0, 0) > 0) {
- // TODO: call application message hooks
- // TODO: call preprocess message hook
-
- if (!IsDialogMessage(win, &msg)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
- int mr = ALF_GetModalResult(win);
- if (mr)
- return mr;
- }
-
- return 0;
-}
-
-
-void
-ALF_SetModalResult(HWND win, int result)
-{
- SendMessage(win, ALF_WM_SETMODALRESULT, (WPARAM)result, 0);
-}
-
-int
-ALF_GetModalResult(HWND win)
-{
- return (int)SendMessage(win, ALF_WM_GETMODALRESULT, 0, 0);
-}
-
int
ALF_CentipointsToPixels(int cptValue, int dpi)
{
@@ -162,37 +117,6 @@ ALF_GetDpi(HWND window)
return (int)SendMessage(window, ALF_WM_GETDPI, 0, 0);
}
-void
-ALF_ResizeWindow(HWND win, int cptWidth, int cptHeight)
-{
- int dpi = ALF_GetDpi(win);
-
- int pxwidth = ALF_CentipointsToPixels(cptWidth, dpi);
- int pxheight = ALF_CentipointsToPixels(cptHeight, dpi);
-
- ALF_ResizeWindowPx(win, pxwidth, pxheight);
-}
-
-void
-ALF_ResizeWindowPx(HWND win, int pxwidth, int pxheight)
-{
- MINMAXINFO tmp = {
- { 0, 0 },
- { pxwidth, pxheight },
- { 0, 0 },
- { pxwidth, pxheight },
- { pxwidth, pxheight }
- };
- SendMessage(win, WM_GETMINMAXINFO, 0, (LPARAM)&tmp);
-
- if (tmp.ptMinTrackSize.x > pxwidth)
- pxwidth = tmp.ptMinTrackSize.x;
- if (tmp.ptMinTrackSize.y > pxheight)
- pxheight = tmp.ptMinTrackSize.y;
-
- SetWindowPos(win, NULL, 0, 0, pxwidth, pxheight, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER);
-}
-
struct ALF_WidgetHwndById_Closure {
HWND result;
WORD needle;