widget

package
v0.0.0-...-0c309f4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeHookFunc

func DecodeHookFunc() mapstructure.DecodeHookFunc

Types

type Gauge

type Gauge struct {
	WidgetBase

	Min float64 `yaml:"min"`
	Max float64 `yaml:"min"`

	Value   float64 `yaml:"value"`
	ValueOf string  `yaml:"value_of"`

	Position [2]float64 `yaml:"position"`
	Size     [2]float64 `yaml:"size"`
}

func (*Gauge) Close

func (W *Gauge) Close() error

func (*Gauge) Draw

func (w *Gauge) Draw(ctx *canvas.Context, s *store.Store) error

func (*Gauge) Init

func (w *Gauge) Init() error

func (*Gauge) UnmarshalJSON

func (w *Gauge) UnmarshalJSON(b []byte) error

type Image

type Image struct {
	WidgetBase

	File       string            `yaml:"file"`
	Animate    bool              `yaml:"animate"`
	Loop       bool              `yaml:"loop"`
	Position   [2]float64        `yaml:"position"`
	Size       [2]float64        `yaml:"size"`
	Resolution canvas.Resolution `yaml:"resolution"`
	// contains filtered or unexported fields
}

func (*Image) Close

func (W *Image) Close() error

func (*Image) Draw

func (w *Image) Draw(ctx *canvas.Context, s *store.Store) error

func (*Image) Init

func (w *Image) Init() error

func (*Image) UnmarshalJSON

func (w *Image) UnmarshalJSON(b []byte) error

type Line

type Line struct {
	WidgetBase

	From [2]float64 `yaml:"from"`
	To   [2]float64 `yaml:"to"`
}

func (*Line) Close

func (W *Line) Close() error

func (*Line) Draw

func (w *Line) Draw(ctx *canvas.Context, s *store.Store) error

func (*Line) Init

func (w *Line) Init() error

func (*Line) UnmarshalJSON

func (w *Line) UnmarshalJSON(b []byte) error

type Text

type Text struct {
	WidgetBase

	Position [2]float64  `yaml:"position"`
	Size     float64     `yaml:"size"`
	Color    color.Color `yaml:"color"`
	Font     string      `yaml:"font"`
	Template string      `yaml:"template"`
	Align    string      `yaml:"align"`
	// contains filtered or unexported fields
}

func (*Text) Close

func (W *Text) Close() error

func (*Text) Draw

func (w *Text) Draw(ctx *canvas.Context, s *store.Store) error

func (*Text) Init

func (w *Text) Init() error

type Widget

type Widget interface {
	io.Closer

	Init() error
	Draw(ctx *canvas.Context, s *store.Store) error
}

type WidgetBase

type WidgetBase struct {
	Type string `yaml:"type"`
}

Jump to

Keyboard shortcuts

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