Documentation ¶
Overview ¶
package gui implements the SeedHammer controller user interface.
Index ¶
- Variables
- type AddressesScreen
- type App
- type Button
- type ButtonEvent
- type ButtonStyle
- type ChoiceScreen
- type Colors
- type ConfirmDelay
- type ConfirmResult
- type ConfirmWarningScreen
- type Context
- type DescriptorScreen
- type EngraveScreen
- type ErrorScreen
- type Event
- type FrameEvent
- type Instruction
- type InstructionType
- type Keyboard
- type MainScreen
- type NavButton
- type Plate
- type Platform
- type ProgressImage
- type Result
- type SDCardEvent
- type ScanScreen
- type SeedScreen
- type Styles
- type Warning
- type WordKeyboardScreen
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EngraveFirstSideA = []Instruction{ { Body: "Make sure the fingerprint above represents the intended share.", Lead: "seedhammer.com/tip#1", }, { Body: "Turn off the engraver and disconnect it from this device.", Lead: "seedhammer.com/tip#2", }, { Body: "Manually move the hammerhead to the far upper left position.", Lead: "seedhammer.com/tip#3", }, { Body: "Place a {{.Name}} on top\nof a protective plate.", Image: assets.Sh01, Lead: "seedhammer.com/tip#4", }, { Body: "Tighten the nuts firmly.", Lead: "seedhammer.com/tip#4", }, { Body: "Loosen the hammerhead finger screw. Adjust needle distance to ~1.5 mm above the plate.", Lead: "seedhammer.com/tip#5", }, { Body: "Tighten the hammerhead finger screw and make sure the depth selector is set to \"Strong\".", Lead: "seedhammer.com/tip#6", }, { Body: "Turn on the engraving machine and connect this device via the middle port.", Lead: "seedhammer.com/tip#7", }, { Body: "Hold button to start the engraving process. The process is loud, use hearing protection.", Type: ConnectInstruction, Lead: "seedhammer.com/tip#8", }, { Lead: "Engraving plate", Type: EngraveInstruction, Side: 0, }, } EngraveSideA = []Instruction{ { Body: "Make sure the fingerprint above represents the intended share.", Lead: "seedhammer.com/tip#1", }, { Body: "Place a {{.Name}} on top\nof a protective plate.", Image: assets.Sh01, Lead: "seedhammer.com/tip#4", }, { Body: "Tighten the nuts firmly.", Lead: "seedhammer.com/tip#4", }, { Body: "Hold button to start the engraving process. The process is loud, use hearing protection.", Type: ConnectInstruction, Lead: "seedhammer.com/tip#8", }, { Lead: "Engraving plate", Type: EngraveInstruction, Side: 0, }, } EngraveSideB = []Instruction{ { Body: "Unscrew the 4 nuts and flip the top metal plate horizontally.", }, { Body: "Tighten the nuts firmly.", }, { Body: "Hold button to start the engraving process. The process is loud, use hearing protection.", Type: ConnectInstruction, }, { Lead: "Engraving plate", Type: EngraveInstruction, Side: 1, }, } EngraveSuccess = []Instruction{ { Body: "Engraving completed successfully.", }, } )
Functions ¶
This section is empty.
Types ¶
type AddressesScreen ¶ added in v0.12.0
type AddressesScreen struct {
// contains filtered or unexported fields
}
func NewAddressesScreen ¶ added in v0.12.0
func NewAddressesScreen(desc urtypes.OutputDescriptor) *AddressesScreen
type ButtonEvent ¶ added in v1.2.0
type ButtonEvent struct { Button Button Pressed bool // Rune is only valid if Button is Rune. Rune rune Click bool }
func (ButtonEvent) ImplementsEvent ¶ added in v1.2.0
func (ButtonEvent) ImplementsEvent()
type ButtonStyle ¶
type ButtonStyle int
const ( StyleNone ButtonStyle = iota StyleSecondary StylePrimary )
type ChoiceScreen ¶
type ConfirmDelay ¶
type ConfirmDelay struct {
// contains filtered or unexported fields
}
func (*ConfirmDelay) Progress ¶
func (c *ConfirmDelay) Progress(ctx *Context) float32
func (*ConfirmDelay) Running ¶
func (c *ConfirmDelay) Running() bool
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) Update ¶ added in v1.2.0
func (s *ConfirmWarningScreen) Update(ctx *Context) ConfirmResult
type Context ¶
type Context struct { Buttons [nbuttons]bool Repeats [nbuttons]time.Time Platform Platform Styles Styles Version string Calibrated bool NoSDCard bool RotateCamera bool // contains filtered or unexported fields }
func NewContext ¶
func (*Context) Frame ¶ added in v1.2.0
func (c *Context) Frame() (FrameEvent, bool)
type DescriptorScreen ¶
type DescriptorScreen struct { Descriptor urtypes.OutputDescriptor Mnemonic bip39.Mnemonic // contains filtered or unexported fields }
type EngraveScreen ¶
type EngraveScreen struct {
// contains filtered or unexported fields
}
func NewEngraveScreen ¶
func NewEngraveScreen(ctx *Context, plate Plate) *EngraveScreen
type ErrorScreen ¶
func NewErrorScreen ¶
func NewErrorScreen(err error) *ErrorScreen
func (*ErrorScreen) Update ¶ added in v1.2.0
func (s *ErrorScreen) Update(ctx *Context) bool
type FrameEvent ¶ added in v1.2.0
type Instruction ¶
type Instruction struct { Body string Lead string Type InstructionType Side int Image image.RGBA64Image // contains filtered or unexported fields }
type InstructionType ¶
type InstructionType int
const ( PrepareInstruction InstructionType = iota ConnectInstruction EngraveInstruction )
type Keyboard ¶
type Keyboard struct { Word string // contains filtered or unexported fields }
func NewKeyboard ¶
type MainScreen ¶
type MainScreen struct {
// contains filtered or unexported fields
}
func (*MainScreen) Select ¶
func (s *MainScreen) Select(ctx *Context)
type Platform ¶
type Platform interface { Events() []Event Wakeup() Engraver() (io.ReadWriteCloser, error) CameraFrame(size image.Point) Now() time.Time 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) ScanQR(qr *image.Gray) ([][]byte, error) Debug() bool }
type ProgressImage ¶
type ProgressImage struct { Progress float32 Src image.RGBA64Image }
func (ProgressImage) Bounds ¶
func (p ProgressImage) Bounds() image.Rectangle
func (ProgressImage) ColorModel ¶
func (p ProgressImage) ColorModel() color.Model
type SDCardEvent ¶ added in v1.2.0
type SDCardEvent struct {
Inserted bool
}
func (SDCardEvent) ImplementsEvent ¶ added in v1.2.0
func (SDCardEvent) ImplementsEvent()
type ScanScreen ¶
type SeedScreen ¶
func NewEmptySeedScreen ¶
func NewEmptySeedScreen(title string) *SeedScreen
Click to show internal directories.
Click to hide internal directories.