From 9794814e9375e597d087b94e9643c943f7999f9c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 11 Feb 2014 16:14:15 -0500 Subject: Started implementing the public API: added the Window and Control types and the skeleton of the Windows implementation. --- sysdata_windows.go | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sysdata_windows.go (limited to 'sysdata_windows.go') diff --git a/sysdata_windows.go b/sysdata_windows.go new file mode 100644 index 0000000..e7af7fd --- /dev/null +++ b/sysdata_windows.go @@ -0,0 +1,66 @@ +// 11 february 2014 +package main + +import ( + "syscall" + "unsafe" +) + +type sysData struct { + cSysData + + hwnd _HWND + cid _HMENU +} + +type classData struct { + name uintptr + style uint32 + xstyle uint32 +} + +//const controlstyle = _WS_CHILD | _WS_VISIBLE | _WS_TABSTOP +//const controlxstyle = 0 + +var classTypes = [nctypes]*classData{ + c_window: &classData{ + name: uintptr(unsafe.Pointer(windowclass)), + style: xxxx, + xstyle: xxxx, + }, +// c_button: &classData{ +// name: uintptr(unsafe.Pointer("BUTTON")) +// style: _BS_PUSHBUTTON | controlstyle, +// xstyle: 0 | controlxstyle, +// }, +} + +func (s *sysData) make() (err error) { + +} + +func (s *sysData) show() (err error) { + ret := make(chan uiret) + defer close(ret) + uitask <- &uimsg{ + call: os_showWindow, + p: []uintptr{uintptr(s.hwnd, _SW_SHOW}, + ret: ret, + } + r := <-ret + close(ret) + return r.err +} + +func (s *sysData) hide() (err error) { + ret := make(chan uiret) + defer close(ret) + uitask <- &uimsg{ + call: _showWindow, + p: []uintptr{uintptr(s.hwnd), _SW_HIDE}, + ret: ret, + } + r := <-ret + close(ret) + return r.err +} -- cgit v1.2.3