Documentation
¶
Overview ¶
package gui implements the SeedHammer controller user interface.
Index ¶
- Variables
- func Run(pl Platform, version string) func(yield func() bool)
- func ShowAddressesScreen(ctx *Context, ops op.Ctx, th *Colors, desc *bip380.Descriptor)
- type BoundedTag
- type Button
- type ButtonEvent
- type ButtonStyle
- type Choice
- type ChoiceScreen
- type Clickable
- type ClickableEvent
- type Colors
- type ConfirmDelay
- type ConfirmResult
- type ConfirmWarningScreen
- type Context
- type DescriptorScreen
- type EngraveScreen
- type Engraver
- type EngraverStats
- type ErrorScreen
- type Event
- type EventRouter
- type Features
- type Filter
- type FrameEvent
- type InputTracker
- type Keyboard
- type Knotter
- type MainScreen
- type NavButton
- type Plate
- type PlateSize
- type Platform
- type PointerEvent
- type ProgressImage
- type QRDecoder
- type RuneEvent
- type ScanEvent
- type SeedScreen
- type Styles
- type Warning
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTooLarge = errors.New("backup: data does not fit plate")
View Source
var ProgressImageGen = op.RegisterParameterizedImage(func(args op.ImageArguments, x, y int) color.RGBA64 { src := args.Refs[0].(image.RGBA64Image) progress := math.Float32frombits(args.Args[0]) b := src.Bounds() c := b.Max.Add(b.Min).Div(2) d := image.Pt(x, y).Sub(c) angle := float32(math.Atan2(float64(d.X), float64(d.Y))) angle = math.Pi - angle if angle > 2*math.Pi*progress { return color.RGBA64{} } return src.RGBA64At(x, y) })
Functions ¶
func ShowAddressesScreen ¶ added in v1.3.2
Types ¶
type ButtonEvent ¶ added in v1.2.0
func (ButtonEvent) Event ¶ added in v1.3.0
func (b ButtonEvent) Event() Event
type ButtonStyle ¶
type ButtonStyle int
const ( StyleNone ButtonStyle = iota StyleSecondary StylePrimary )
type ChoiceScreen ¶
type ChoiceScreen struct {
Title string
Lead string
Choices []string
// contains filtered or unexported fields
}
type Clickable ¶ added in v1.3.6
type ClickableEvent ¶ added in v1.3.6
type ClickableEvent struct {
Clicked bool
}
type ConfirmDelay ¶
type ConfirmDelay struct {
// contains filtered or unexported fields
}
func (*ConfirmDelay) Progress ¶
func (c *ConfirmDelay) Progress(ctx *Context) float32
type ConfirmResult ¶
type ConfirmResult int
const ( ConfirmNone ConfirmResult = iota ConfirmNo ConfirmYes )
type ConfirmWarningScreen ¶
type ConfirmWarningScreen struct {
Title string
Body string
Icon image.RGBA64Image
// contains filtered or unexported fields
}
func (*ConfirmWarningScreen) Layout ¶
func (s *ConfirmWarningScreen) Layout(ctx *Context, ops op.Ctx, th *Colors, dims image.Point) ConfirmResult
type Context ¶
type Context struct {
Platform Platform
Styles Styles
Wakeup time.Time
Done bool
FrameCallback func()
// Global UI state.
Version string
LastDescriptor *bip380.Descriptor
Router EventRouter
// contains filtered or unexported fields
}
func NewContext ¶
type DescriptorScreen ¶
type DescriptorScreen struct {
Descriptor *bip380.Descriptor
}
type EngraveScreen ¶
type EngraveScreen struct {
// contains filtered or unexported fields
}
func NewEngraveScreen ¶
func NewEngraveScreen(ctx *Context, plate Plate) *EngraveScreen
type Engraver ¶ added in v1.3.0
type Engraver interface {
stepper.Writer
Close() error
Stats() EngraverStats
}
type EngraverStats ¶ added in v1.4.0
type ErrorScreen ¶
func NewErrorScreen ¶
func NewErrorScreen(err error) *ErrorScreen
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (Event) AsButton ¶ added in v1.3.0
func (e Event) AsButton() (ButtonEvent, bool)
func (Event) AsFrame ¶ added in v1.3.0
func (e Event) AsFrame() (FrameEvent, bool)
func (Event) AsPointer ¶ added in v1.3.6
func (e Event) AsPointer() (PointerEvent, bool)
type EventRouter ¶ added in v1.4.0
type EventRouter struct {
// contains filtered or unexported fields
}
func (*EventRouter) Next ¶ added in v1.4.0
func (r *EventRouter) Next(filters ...Filter) (Event, bool)
func (*EventRouter) Reset ¶ added in v1.4.0
func (r *EventRouter) Reset() bool
type Filter ¶ added in v1.3.6
type Filter struct {
// contains filtered or unexported fields
}
func ButtonFilter ¶ added in v1.3.6
func FrameFilter ¶ added in v1.3.6
func FrameFilter() Filter
func PointerFilter ¶ added in v1.3.6
func RuneFilter ¶ added in v1.3.6
func RuneFilter() Filter
type FrameEvent ¶ added in v1.2.0
func (FrameEvent) Event ¶ added in v1.3.0
func (f FrameEvent) Event() Event
type InputTracker ¶ added in v1.3.0
type Keyboard ¶
type Keyboard struct {
Fragment string
// contains filtered or unexported fields
}
func NewKeyboard ¶
type MainScreen ¶
type MainScreen struct {
// contains filtered or unexported fields
}
type Platform ¶
type Platform interface {
LockBoot() error
AppendEvents(deadline time.Time, evts []Event) []Event
Wakeup()
Engraver(stall bool) (Engraver, error)
NFCReader() io.Reader
EngraverParams() engrave.Params
DisplaySize() image.Point
// Dirty begins a refresh of the content
// specified by r.
Dirty(r image.Rectangle) error
// NextChunk returns the next chunk of the refresh.
NextChunk() (draw.RGBA64Image, bool)
Features() Features
HardwareVersion() string
}
type PointerEvent ¶ added in v1.3.6
func (PointerEvent) Event ¶ added in v1.3.6
func (p PointerEvent) Event() Event
type ProgressImage ¶
type ProgressImage struct {
Progress float32
Src image.RGBA64Image
}
func (*ProgressImage) Add ¶ added in v1.3.2
func (p *ProgressImage) Add(ctx op.Ctx)
type QRDecoder ¶ added in v1.3.0
type QRDecoder struct {
// contains filtered or unexported fields
}
type SeedScreen ¶
type SeedScreen struct {
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.