diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-04 20:04:16 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-04 20:04:16 -0400 |
| commit | ef513c433732f3a12f2d83417b9b1fb92d152930 (patch) | |
| tree | 38fce59bea3461b2122a2ee32a5499eb94f7cd23 /redo/layout_windows.go | |
| parent | 9ed4ec52597e03b080331efeac526322b669e565 (diff) | |
Completed the migration of the Windows backend to the new container system.
Diffstat (limited to 'redo/layout_windows.go')
| -rw-r--r-- | redo/layout_windows.go | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/redo/layout_windows.go b/redo/layout_windows.go deleted file mode 100644 index 3010be9..0000000 --- a/redo/layout_windows.go +++ /dev/null @@ -1,61 +0,0 @@ -// 4 august 2014 - -package ui - -// TODO clean this up relative to window_windows.go - -import ( - "fmt" - "unsafe" -) - -// #include "winapi_windows.h" -import "C" - -type layout struct { - hwnd C.HWND - - closing *event - - *sizer -} - -func makeContainerWindowClass() error { - var errmsg *C.char - - err := C.makeContainerWindowClass(&errmsg) - if err != 0 || errmsg != nil { - return fmt.Errorf("%s: %v", C.GoString(errmsg), syscall.Errno(err)) - } - return nil -} - -func newLayout(title string, width int, height int, child C.BOOL, control Control) *layout { - l := &layout{ - sizer: new(sizer), - } - hwnd := C.newContainer(unsafe.Pointer(l)) - if hwnd != l.hwnd { - panic(fmt.Errorf("inconsistency: hwnd returned by CreateWindowEx() (%p) and hwnd stored in container (%p) differ", hwnd, l.hwnd)) - } - l.child = control - l.child.setParent(&controlParent{l.hwnd}) - return l -} - -func (l *layout) setParent(p *controlParent) { - C.controlSetParent(l.hwnd, p.hwnd) -} - -//export storeContainerHWND -func storeContainerHWND(data unsafe.Pointer, hwnd C.HWND) { - l := (*layout)(data) - l.hwnd = hwnd -} - -//export containerResize -func containerResize(data unsafe.Pointer, r *C.RECT) { - l := (*layout)(data) - // the origin of the window's content area is always (0, 0), but let's use the values from the RECT just to be safe - l.resize(int(r.left), int(r.top), int(r.right - r.left), int(r.bottom - r.top)) -} |
