Storing the *container in the Windows GWLP_USERDATA is no longer needed; strip it.
This commit is contained in:
parent
6cefa04d71
commit
a1f9dca68c
|
@ -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)
|
static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
void *data;
|
|
||||||
RECT r;
|
|
||||||
LRESULT lResult;
|
LRESULT lResult;
|
||||||
|
|
||||||
data = getWindowData(hwnd, uMsg, wParam, lParam, &lResult);
|
|
||||||
if (data == NULL)
|
|
||||||
return lResult;
|
|
||||||
if (sharedWndProc(hwnd, uMsg, wParam, lParam, &lResult))
|
if (sharedWndProc(hwnd, uMsg, wParam, lParam, &lResult))
|
||||||
return lResult;
|
return lResult;
|
||||||
switch (uMsg) {
|
switch (uMsg) {
|
||||||
|
@ -48,7 +43,7 @@ DWORD makeContainerWindowClass(char **errmsg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWND newContainer(void *data)
|
HWND newContainer(void)
|
||||||
{
|
{
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
|
|
||||||
|
@ -58,7 +53,7 @@ HWND newContainer(void *data)
|
||||||
WS_CHILD | WS_VISIBLE,
|
WS_CHILD | WS_VISIBLE,
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
100, 100,
|
100, 100,
|
||||||
msgwin, NULL, hInstance, data);
|
msgwin, NULL, hInstance, NULL);
|
||||||
if (hwnd == NULL)
|
if (hwnd == NULL)
|
||||||
xpanic("container creation failed", GetLastError());
|
xpanic("container creation failed", GetLastError());
|
||||||
return hwnd;
|
return hwnd;
|
||||||
|
|
|
@ -5,7 +5,6 @@ package ui
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// #include "winapi_windows.h"
|
// #include "winapi_windows.h"
|
||||||
|
@ -38,10 +37,10 @@ func makeContainerWindowClass() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newContainer() *container {
|
func newContainer() *container {
|
||||||
c := new(container)
|
|
||||||
c.controlSingleHWND = newControlSingleHWND(C.newContainer(unsafe.Pointer(c)))
|
|
||||||
// don't set preferredSize(); it should never be called
|
// don't set preferredSize(); it should never be called
|
||||||
return c
|
return &container{
|
||||||
|
controlSingleHWND: newControlSingleHWND(C.newContainer()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO merge with controlSingleHWND
|
// TODO merge with controlSingleHWND
|
||||||
|
|
|
@ -123,7 +123,7 @@ extern void tableSelectItem(HWND, intptr_t);
|
||||||
|
|
||||||
// container_windows.c
|
// container_windows.c
|
||||||
extern DWORD makeContainerWindowClass(char **);
|
extern DWORD makeContainerWindowClass(char **);
|
||||||
extern HWND newContainer(void *);
|
extern HWND newContainer();
|
||||||
extern void calculateBaseUnits(HWND, int *, int *, LONG *);
|
extern void calculateBaseUnits(HWND, int *, int *, LONG *);
|
||||||
|
|
||||||
// area_windows.c
|
// area_windows.c
|
||||||
|
|
Loading…
Reference in New Issue