Storing the *container in the Windows GWLP_USERDATA is no longer needed; strip it.

This commit is contained in:
Pietro Gagliardi 2014-10-16 14:09:11 -04:00
parent 6cefa04d71
commit a1f9dca68c
3 changed files with 6 additions and 12 deletions

View File

@ -13,13 +13,8 @@ If this is seriously an issue in the future, I can roll it back.
static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
void *data;
RECT r;
LRESULT lResult;
data = getWindowData(hwnd, uMsg, wParam, lParam, &lResult);
if (data == NULL)
return lResult;
if (sharedWndProc(hwnd, uMsg, wParam, lParam, &lResult))
return lResult;
switch (uMsg) {
@ -48,7 +43,7 @@ DWORD makeContainerWindowClass(char **errmsg)
return 0;
}
HWND newContainer(void *data)
HWND newContainer(void)
{
HWND hwnd;
@ -58,7 +53,7 @@ HWND newContainer(void *data)
WS_CHILD | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT,
100, 100,
msgwin, NULL, hInstance, data);
msgwin, NULL, hInstance, NULL);
if (hwnd == NULL)
xpanic("container creation failed", GetLastError());
return hwnd;

View File

@ -5,7 +5,6 @@ package ui
import (
"fmt"
"syscall"
"unsafe"
)
// #include "winapi_windows.h"
@ -38,10 +37,10 @@ func makeContainerWindowClass() error {
}
func newContainer() *container {
c := new(container)
c.controlSingleHWND = newControlSingleHWND(C.newContainer(unsafe.Pointer(c)))
// don't set preferredSize(); it should never be called
return c
return &container{
controlSingleHWND: newControlSingleHWND(C.newContainer()),
}
}
// TODO merge with controlSingleHWND

View File

@ -123,7 +123,7 @@ extern void tableSelectItem(HWND, intptr_t);
// container_windows.c
extern DWORD makeContainerWindowClass(char **);
extern HWND newContainer(void *);
extern HWND newContainer();
extern void calculateBaseUnits(HWND, int *, int *, LONG *);
// area_windows.c