summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-07 03:12:34 -0400
committerPietro Gagliardi <[email protected]>2015-04-07 03:12:34 -0400
commitc4045909606cbc7733846ef7ca482d27bddd2e30 (patch)
tree6fe708a9bc6a0092b746fb3c42610d34f3e811ec
parenta3c26ff6522d5f383e011f4a2a2ff702dd855171 (diff)
Fixed build issues. Now I just need to hook resizing into uiWindow and implement a control and we'll be set...
-rw-r--r--new/init_windows.c2
-rw-r--r--new/newcontrol_windows.c2
-rw-r--r--new/ui.h2
-rw-r--r--new/uipriv_windows.h7
-rw-r--r--new/window_windows.c4
5 files changed, 13 insertions, 4 deletions
diff --git a/new/init_windows.c b/new/init_windows.c
index 5620f76..e2cc1f2 100644
--- a/new/init_windows.c
+++ b/new/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/new/newcontrol_windows.c b/new/newcontrol_windows.c
index 61f802a..f301a54 100644
--- a/new/newcontrol_windows.c
+++ b/new/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/new/ui.h b/new/ui.h
index 11f3615..ce0a44b 100644
--- a/new/ui.h
+++ b/new/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/new/uipriv_windows.h b/new/uipriv_windows.h
index a17fbfe..c7527c0 100644
--- a/new/uipriv_windows.h
+++ b/new/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/new/window_windows.c b/new/window_windows.c
index aac61db..c0ca6c3 100644
--- a/new/window_windows.c
+++ b/new/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: