Documentation
¶
Overview ¶
This sub library is for simulating gadgets on desktop Supports keys and monochrome display.
Rough but can help when developing ui and button layout for gadget.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ButtonSettings ¶
type DisplayUpdate ¶
type DisplayUpdate struct {
ID string
Bitmap gomonochromebitmap.MonoBitmap
}
type GadgetWindow ¶
type GadgetWindow struct {
Title string
//ImageFile string
MonoDisplays []MonochromeDisplay
Buttons []ButtonSettings
BgImage image.Image //image.RGBA
FromKeys chan KeyboardStatus
ToDisplay chan DisplayUpdate
// contains filtered or unexported fields
}
func (*GadgetWindow) Initialize ¶
func (p *GadgetWindow) Initialize(backgroundPicture image.Image) error
Assuming that background image stays same and LCD/OLED display is static
func (*GadgetWindow) Quit ¶
func (p *GadgetWindow) Quit()
func (*GadgetWindow) Render ¶
func (p *GadgetWindow) Render() error
Render if content changes or window resizes
func (*GadgetWindow) Run ¶
func (p *GadgetWindow) Run() error
func (*GadgetWindow) ScaleWinOnPicCoord ¶
func (p *GadgetWindow) ScaleWinOnPicCoord(x int, y int) (int, int)
type KeyboardStatus ¶
type KeyboardStatus struct {
KeysDown []string //array if multitouch support
}
type MonochromeDisplay ¶
type MonochromeDisplay struct {
Bitmap gomonochromebitmap.MonoBitmap
ID string `json:"id"`
Corner XyIntPair `json:"corner"` //Coordinate on bitmap
PixelSize XyIntPair `json:"pixelSize"`
PixelGap XyIntPair `json:"pixelGap"`
UpperRows int `json:"upperRows"` //Allows to simulate two color OLED displays with 8 rows up or down with yellow and others are blue
OnColor color.RGBA `json:"onColor"` //Hex format with transparent, upper rows
OnColorDown color.RGBA `json:"onColorDown"` //Hex format with transparent
OffColor color.RGBA `json:"offColor"` //Hex format with transparent
}
Click to show internal directories.
Click to hide internal directories.