utils

package
v0.0.0-...-38d74a0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SizeAuto = iota * -1
	SizeFitParent
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Align

type Align int
const (
	AlignVerticallyStart Align = 1 << iota
	AlignHorizontallyEnd
	AlignHorizontallyCenter
	AlignHorizontallyStart
	AlignVerticallyCenter
	AlignVerticallyEnd
)

type Orientation

type Orientation int
const (
	OrientationHorizontal Orientation = iota
	OrientationVertical
)

type Pool

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

func NewPool

func NewPool(size int) *Pool

func (*Pool) Enqueue

func (p *Pool) Enqueue(job func())

type RateLimiter

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

func NewRateLimiter

func NewRateLimiter(maxRequests int, interval time.Duration) *RateLimiter

func (*RateLimiter) Enqueue

func (rl *RateLimiter) Enqueue(job func())

type Rect

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

func NewRect

func NewRect(width, height int) *Rect

func (*Rect) AddLayoutChild

func (r *Rect) AddLayoutChild(width, height int) *Rect

func (*Rect) AddRectChild

func (r *Rect) AddRectChild(width, height int) *Rect

func (*Rect) AddTextChild

func (r *Rect) AddTextChild(dc *gg.Context, text string, ft *truetype.Font, size float64) *TextRect

func (*Rect) Children

func (r *Rect) Children() []*Rect

func (*Rect) Height

func (r *Rect) Height() int

func (*Rect) SetAlignment

func (r *Rect) SetAlignment(alignment Align)

func (*Rect) SetInset

func (r *Rect) SetInset(inset int)

func (*Rect) SetMargin

func (r *Rect) SetMargin(left, top, right, bottom int)

func (*Rect) SetOrientation

func (r *Rect) SetOrientation(orientation Orientation)

func (*Rect) Width

func (r *Rect) Width() int

func (*Rect) X

func (r *Rect) X() int

func (*Rect) Y

func (r *Rect) Y() int

type SmartMutex

type SmartMutex[K comparable] struct {
	// contains filtered or unexported fields
}

func NewSmartMutex

func NewSmartMutex[K comparable]() *SmartMutex[K]

func (*SmartMutex[K]) Lock

func (ctx *SmartMutex[K]) Lock(id K)

func (*SmartMutex[K]) Unlock

func (ctx *SmartMutex[K]) Unlock(id K)

type TextRect

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

func (*TextRect) Font

func (tr *TextRect) Font() font.Face

func (*TextRect) Height

func (tr *TextRect) Height() int

func (*TextRect) SetMargin

func (tr *TextRect) SetMargin(left, top, right, bottom int)

func (*TextRect) String

func (tr *TextRect) String() string

func (*TextRect) Width

func (tr *TextRect) Width() int

func (*TextRect) X

func (tr *TextRect) X() int

func (*TextRect) Y

func (tr *TextRect) Y() int

Jump to

Keyboard shortcuts

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