win

package
v0.0.0-...-5f41422 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

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

Variables

This section is empty.

Functions

func CreateWindow

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

func RegClassOnlyOnce

func RegClassOnlyOnce(className string) error

func RegMsgHandler

func RegMsgHandler(window *OSWindow)

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 OSWindow

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

func GetMsgHandler

func GetMsgHandler(hwnd w32.HWND) *OSWindow

func NewOSWindow

func NewOSWindow(width, height int) (w *OSWindow, err error)

func (*OSWindow) Center

func (this *OSWindow) Center()

func (*OSWindow) Close

func (this *OSWindow) Close() error

func (*OSWindow) EventChan

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

func (*OSWindow) FlushImage

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

func (*OSWindow) HandleWndMessages

func (this *OSWindow) HandleWndMessages()

func (*OSWindow) LockSize

func (w *OSWindow) LockSize(lock bool)

func (*OSWindow) Pos

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

func (*OSWindow) Repaint

func (this *OSWindow) Repaint()

func (*OSWindow) Screen

func (this *OSWindow) Screen() oswin.WinImage

func (*OSWindow) SetCursor

func (w *OSWindow) SetCursor(cursor oswin.Cursor)

func (*OSWindow) SetPos

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

func (*OSWindow) SetSize

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

func (*OSWindow) SetTitle

func (this *OSWindow) SetTitle(title string)

func (*OSWindow) Show

func (this *OSWindow) Show()

func (*OSWindow) Size

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

Jump to

Keyboard shortcuts

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