win

package
v0.0.0-...-fbbb5eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

README

License

Moved from files and can be found here

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const WDEM_UI_THREAD = w32.WM_APP
View Source
const (
	WIN_CLASSNAME = "wde_win"
)

Variables

This section is empty.

Functions

func CreateWindow

func CreateWindow(className string, parent *Window, exStyle, style uint, width, height int) (w32.HWND, error)

func RegClassOnlyOnce

func RegClassOnlyOnce(className string) error

func RegMsgHandler

func RegMsgHandler(window *Window)

func RegisterClass

func RegisterClass(className string, wndproc uintptr) error

func UnRegMsgHandler

func UnRegMsgHandler(hwnd w32.HWND)

func WndProc

func WndProc(hwnd w32.HWND, msg uint32, wparam, lparam uintptr) uintptr

Types

type DIB

type DIB struct {
	// Pix holds the image's pixels, in B, G, R order. The pixel at
	// (x, y) starts at Pix[(p.Rect.Max.Y-y-p.Rect.Min.Y-1)*p.Stride + (x-p.Rect.Min.X)*3].
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

func NewDIB

func NewDIB(r image.Rectangle) *DIB

func (*DIB) At

func (p *DIB) At(x, y int) color.Color

func (*DIB) Bounds

func (p *DIB) Bounds() image.Rectangle

func (*DIB) ColorModel

func (p *DIB) ColorModel() color.Model

func (*DIB) CopyRGBA

func (p *DIB) CopyRGBA(src *image.RGBA, r image.Rectangle)

func (*DIB) Opaque

func (p *DIB) Opaque() bool

Opaque scans the entire image and returns whether or not it is fully opaque.

func (*DIB) PixOffset

func (p *DIB) PixOffset(x, y int) int

PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).

func (*DIB) Set

func (p *DIB) Set(x, y int, c color.Color)

func (*DIB) SetDIB

func (p *DIB) SetDIB(x, y int, c color.RGBA)

func (*DIB) SubImage

func (p *DIB) SubImage(r image.Rectangle) image.Image

SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.

type EventData

type EventData struct {
	// contains filtered or unexported fields
}

func (*EventData) InitEventData

func (this *EventData) InitEventData()

type Window

type Window struct {
	EventData
	// contains filtered or unexported fields
}

func GetMsgHandler

func GetMsgHandler(hwnd w32.HWND) *Window

func NewWindow

func NewWindow(width, height int) (w *Window, err error)

func (*Window) Center

func (this *Window) Center()

func (*Window) Close

func (this *Window) Close() error

func (*Window) EventChan

func (this *Window) EventChan() <-chan interface{}

func (*Window) FlushImage

func (this *Window) FlushImage(bounds ...image.Rectangle)

func (*Window) HandleWndMessages

func (this *Window) HandleWndMessages()

func (*Window) LockSize

func (w *Window) LockSize(lock bool)

func (*Window) Pos

func (this *Window) Pos() (x, y int)

func (*Window) Repaint

func (this *Window) Repaint()

func (*Window) Screen

func (this *Window) Screen() wde.Image

func (*Window) SetCursor

func (w *Window) SetCursor(cursor wde.Cursor)

func (*Window) SetPos

func (this *Window) SetPos(x, y int)

func (*Window) SetSize

func (this *Window) SetSize(width, height int)

func (*Window) SetTitle

func (this *Window) SetTitle(title string)

func (*Window) Show

func (this *Window) Show()

func (*Window) Size

func (this *Window) Size() (width, height int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL