URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [exp/] [wingui/] [winapi.go] - Rev 747
Compare with Previous | Blame | View Log
// Copyright 2011 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.// +build windowspackage mainimport ("syscall""unsafe")type Wndclassex struct {Size uint32Style uint32WndProc uintptrClsExtra int32WndExtra int32Instance syscall.HandleIcon syscall.HandleCursor syscall.HandleBackground syscall.HandleMenuName *uint16ClassName *uint16IconSm syscall.Handle}type Point struct {X uintptrY uintptr}type Msg struct {Hwnd syscall.HandleMessage uint32Wparam uintptrLparam uintptrTime uint32Pt Point}const (// Window stylesWS_OVERLAPPED = 0WS_POPUP = 0x80000000WS_CHILD = 0x40000000WS_MINIMIZE = 0x20000000WS_VISIBLE = 0x10000000WS_DISABLED = 0x8000000WS_CLIPSIBLINGS = 0x4000000WS_CLIPCHILDREN = 0x2000000WS_MAXIMIZE = 0x1000000WS_CAPTION = WS_BORDER | WS_DLGFRAMEWS_BORDER = 0x800000WS_DLGFRAME = 0x400000WS_VSCROLL = 0x200000WS_HSCROLL = 0x100000WS_SYSMENU = 0x80000WS_THICKFRAME = 0x40000WS_GROUP = 0x20000WS_TABSTOP = 0x10000WS_MINIMIZEBOX = 0x20000WS_MAXIMIZEBOX = 0x10000WS_TILED = WS_OVERLAPPEDWS_ICONIC = WS_MINIMIZEWS_SIZEBOX = WS_THICKFRAME// Common Window StylesWS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOXWS_TILEDWINDOW = WS_OVERLAPPEDWINDOWWS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENUWS_CHILDWINDOW = WS_CHILDWS_EX_CLIENTEDGE = 0x200// Some windows messagesWM_CREATE = 1WM_DESTROY = 2WM_CLOSE = 16WM_COMMAND = 273// Some button control stylesBS_DEFPUSHBUTTON = 1// Some color constantsCOLOR_WINDOW = 5COLOR_BTNFACE = 15// Default window positionCW_USEDEFAULT = 0x80000000 - 0x100000000// Show window default styleSW_SHOWDEFAULT = 10)var (// Some globally known cursorsIDC_ARROW = MakeIntResource(32512)IDC_IBEAM = MakeIntResource(32513)IDC_WAIT = MakeIntResource(32514)IDC_CROSS = MakeIntResource(32515)// Some globally known iconsIDI_APPLICATION = MakeIntResource(32512)IDI_HAND = MakeIntResource(32513)IDI_QUESTION = MakeIntResource(32514)IDI_EXCLAMATION = MakeIntResource(32515)IDI_ASTERISK = MakeIntResource(32516)IDI_WINLOGO = MakeIntResource(32517)IDI_WARNING = IDI_EXCLAMATIONIDI_ERROR = IDI_HANDIDI_INFORMATION = IDI_ASTERISK)//sys GetModuleHandle(modname *uint16) (handle syscall.Handle, err error) = GetModuleHandleW//sys RegisterClassEx(wndclass *Wndclassex) (atom uint16, err error) = user32.RegisterClassExW//sys CreateWindowEx(exstyle uint32, classname *uint16, windowname *uint16, style uint32, x int32, y int32, width int32, height int32, wndparent syscall.Handle, menu syscall.Handle, instance syscall.Handle, param uintptr) (hwnd syscall.Handle, err error) = user32.CreateWindowExW//sys DefWindowProc(hwnd syscall.Handle, msg uint32, wparam uintptr, lparam uintptr) (lresult uintptr) = user32.DefWindowProcW//sys DestroyWindow(hwnd syscall.Handle) (err error) = user32.DestroyWindow//sys PostQuitMessage(exitcode int32) = user32.PostQuitMessage//sys ShowWindow(hwnd syscall.Handle, cmdshow int32) (wasvisible bool) = user32.ShowWindow//sys UpdateWindow(hwnd syscall.Handle) (err error) = user32.UpdateWindow//sys GetMessage(msg *Msg, hwnd syscall.Handle, MsgFilterMin uint32, MsgFilterMax uint32) (ret int32, err error) [failretval==-1] = user32.GetMessageW//sys TranslateMessage(msg *Msg) (done bool) = user32.TranslateMessage//sys DispatchMessage(msg *Msg) (ret int32) = user32.DispatchMessageW//sys LoadIcon(instance syscall.Handle, iconname *uint16) (icon syscall.Handle, err error) = user32.LoadIconW//sys LoadCursor(instance syscall.Handle, cursorname *uint16) (cursor syscall.Handle, err error) = user32.LoadCursorW//sys SetCursor(cursor syscall.Handle) (precursor syscall.Handle, err error) = user32.SetCursor//sys SendMessage(hwnd syscall.Handle, msg uint32, wparam uintptr, lparam uintptr) (lresult uintptr) = user32.SendMessageW//sys PostMessage(hwnd syscall.Handle, msg uint32, wparam uintptr, lparam uintptr) (err error) = user32.PostMessageWfunc MakeIntResource(id uint16) *uint16 {return (*uint16)(unsafe.Pointer(uintptr(id)))}
