From a09430113fe4ab720d1d8ce62b7ba548f3796dce Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 7 Apr 2015 03:12:34 -0400 Subject: [PATCH] Fixed build issues. Now I just need to hook resizing into uiWindow and implement a control and we'll be set... --- init_windows.c | 2 +- newcontrol_windows.c | 2 +- ui.h | 2 ++ uipriv_windows.h | 7 +++++++ window_windows.c | 4 ++-- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/init_windows.c b/init_windows.c index 5620f760..e2cc1f27 100644 --- a/init_windows.c +++ b/init_windows.c @@ -84,7 +84,7 @@ uiInitError *uiInit(uiInitOptions *o) // give each control a reasonable initial parent // don't free the initial parent! // TODO tune this better; it shouldn't be closed, for instance - initialParent = uiWindowHandle(uiNewWindow("", 0, 0)); + initialParent = (HWND) uiWindowHandle(uiNewWindow("", 0, 0)); uiFree(err); return NULL; diff --git a/newcontrol_windows.c b/newcontrol_windows.c index 61f802a1..f301a540 100644 --- a/newcontrol_windows.c +++ b/newcontrol_windows.c @@ -100,7 +100,7 @@ uiControl *uiWindowsNewControl(uiWindowsNewControlParams *p) c->onCommandNotifyData = p->onCommandNotifyData; c->preferredSize = p->preferredSize; - if ((*fv_SetWindowSubclass)(c->hwnd, singleSubclassProc, 0, c) == FALSE) + if ((*fv_SetWindowSubclass)(c->hwnd, singleSubclassProc, 0, (DWORD_PTR) c) == FALSE) logLastError("error subclassing Windows control in uiWindowsNewControl()"); return (uiControl *) c; diff --git a/ui.h b/ui.h index 11f3615e..ce0a44bf 100644 --- a/ui.h +++ b/ui.h @@ -24,4 +24,6 @@ void uiWindowShow(uiWindow *); void uiWindowHide(uiWindow *); void uiWindowOnClosing(uiWindow *, int (*)(uiWindow *, void *), void *); +typedef struct uiControl uiControl; + #endif diff --git a/uipriv_windows.h b/uipriv_windows.h index a17fbfea..c7527c0d 100644 --- a/uipriv_windows.h +++ b/uipriv_windows.h @@ -36,6 +36,13 @@ enum { msgNOTIFY, }; +// TODO move this to the right place +struct uiSizing { + int baseX; + int baseY; + LONG internalLeading; +}; + // alloc_windows.c extern void *uiAlloc(size_t); // TODO use this in existing files diff --git a/window_windows.c b/window_windows.c index aac61db4..c0ca6c35 100644 --- a/window_windows.c +++ b/window_windows.c @@ -14,7 +14,7 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA { uiWindow *w; CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam; - LRESULT lr; + LRESULT lResult; w = (uiWindow *) GetWindowLongPtrW(hwnd, GWLP_USERDATA); if (w == NULL) { @@ -23,7 +23,7 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA // fall through to DefWindowProc() anyway return DefWindowProcW(hwnd, uMsg, wParam, lParam); } - if (sharedWindowProc(hwnd, uMsg, wParam, lParam, &lResult) != FALSE) + if (sharedWndProc(hwnd, uMsg, wParam, lParam, &lResult) != FALSE) return lResult; switch (uMsg) { case WM_CLOSE: