common

package
v2.5.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DonePool = sync.Pool{
	New: func() any {
		return make(chan struct{})
	},
}

Functions

func CanvasForObject

func CanvasForObject(obj fyne.CanvasObject) fyne.Canvas

CanvasForObject returns the canvas for the specified object.

Types

type Canvas

type Canvas struct {
	sync.RWMutex

	OnFocus   func(obj fyne.Focusable)
	OnUnfocus func()
	// contains filtered or unexported fields
}

Canvas defines common canvas implementation.

func (*Canvas) AddShortcut

func (c *Canvas) AddShortcut(shortcut fyne.Shortcut, handler func(shortcut fyne.Shortcut))

AddShortcut adds a shortcut to the canvas.

func (*Canvas) CheckDirtyAndClear added in v2.2.0

func (c *Canvas) CheckDirtyAndClear() bool

CheckDirtyAndClear returns true if the canvas is dirty and clears the dirty state atomically.

func (*Canvas) DrawDebugOverlay added in v2.4.0

func (c *Canvas) DrawDebugOverlay(obj fyne.CanvasObject, pos fyne.Position, size fyne.Size)

func (*Canvas) EnsureMinSize

func (c *Canvas) EnsureMinSize() bool

EnsureMinSize ensure canvas min size.

This function uses lock.

func (*Canvas) Focus

func (c *Canvas) Focus(obj fyne.Focusable)

Focus makes the provided item focused.

func (*Canvas) FocusGained

func (c *Canvas) FocusGained()

FocusGained signals to the manager that its content got focus. Valid only on Desktop.

func (*Canvas) FocusLost

func (c *Canvas) FocusLost()

FocusLost signals to the manager that its content lost focus. Valid only on Desktop.

func (*Canvas) FocusNext

func (c *Canvas) FocusNext()

FocusNext focuses the next focusable item.

func (*Canvas) FocusPrevious

func (c *Canvas) FocusPrevious()

FocusPrevious focuses the previous focusable item.

func (*Canvas) Focused

func (c *Canvas) Focused() fyne.Focusable

Focused returns the current focused object.

func (*Canvas) FreeDirtyTextures

func (c *Canvas) FreeDirtyTextures() (freed uint64)

FreeDirtyTextures frees dirty textures and returns the number of freed textures.

func (*Canvas) Initialize

func (c *Canvas) Initialize(impl SizeableCanvas, onOverlayChanged func())

Initialize initializes the canvas.

func (*Canvas) ObjectTrees

func (c *Canvas) ObjectTrees() []fyne.CanvasObject

ObjectTrees return canvas object trees.

This function uses lock.

func (*Canvas) Overlays

func (c *Canvas) Overlays() fyne.OverlayStack

Overlays returns the overlay stack.

func (*Canvas) Painter

func (c *Canvas) Painter() gl.Painter

Painter returns the canvas painter.

func (*Canvas) Refresh

func (c *Canvas) Refresh(obj fyne.CanvasObject)

Refresh refreshes a canvas object.

func (*Canvas) RemoveShortcut

func (c *Canvas) RemoveShortcut(shortcut fyne.Shortcut)

RemoveShortcut removes a shortcut from the canvas.

func (*Canvas) SetContentTreeAndFocusMgr

func (c *Canvas) SetContentTreeAndFocusMgr(content fyne.CanvasObject)

SetContentTreeAndFocusMgr sets content tree and focus manager.

This function does not use the canvas lock.

func (*Canvas) SetDirty

func (c *Canvas) SetDirty()

SetDirty sets canvas dirty flag atomically.

func (*Canvas) SetMenuTreeAndFocusMgr

func (c *Canvas) SetMenuTreeAndFocusMgr(menu fyne.CanvasObject)

SetMenuTreeAndFocusMgr sets menu tree and focus manager.

This function does not use the canvas lock.

func (*Canvas) SetMobileWindowHeadTree

func (c *Canvas) SetMobileWindowHeadTree(head fyne.CanvasObject)

SetMobileWindowHeadTree sets window head tree.

This function does not use the canvas lock.

func (*Canvas) SetPainter

func (c *Canvas) SetPainter(p gl.Painter)

SetPainter sets the canvas painter.

func (*Canvas) TypedShortcut

func (c *Canvas) TypedShortcut(shortcut fyne.Shortcut)

TypedShortcut handle the registered shortcut.

func (*Canvas) Unfocus

func (c *Canvas) Unfocus()

Unfocus unfocuses all the objects in the canvas.

func (*Canvas) WalkTrees

func (c *Canvas) WalkTrees(
	beforeChildren func(*RenderCacheNode, fyne.Position),
	afterChildren func(*RenderCacheNode, fyne.Position),
)

WalkTrees walks over the trees.

type RenderCacheNode

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

RenderCacheNode represents a node in a render cache tree.

func (*RenderCacheNode) Obj

func (r *RenderCacheNode) Obj() fyne.CanvasObject

Obj returns the node object.

type SizeableCanvas

type SizeableCanvas interface {
	fyne.Canvas
	Resize(fyne.Size)
	MinSize() fyne.Size
}

SizeableCanvas defines a canvas with size related functions.

type Window

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

Window defines common functionality for windows.

func (*Window) DestroyEventQueue

func (w *Window) DestroyEventQueue()

DestroyEventQueue destroys the event queue.

func (*Window) InitEventQueue

func (w *Window) InitEventQueue()

InitEventQueue initializes the event queue.

func (*Window) QueueEvent

func (w *Window) QueueEvent(fn func())

QueueEvent uses this method to queue up a callback that handles an event. This ensures user interaction events for a given window are processed in order.

func (*Window) RunEventQueue

func (w *Window) RunEventQueue()

RunEventQueue runs the event queue. This should called inside a go routine. This function blocks.

func (*Window) WaitForEvents

func (w *Window) WaitForEvents()

WaitForEvents wait for all the events.

Jump to

Keyboard shortcuts

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