2024-02-29 13:45:36 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2024-02-29 17:36:45 -06:00
|
|
|
"io"
|
2024-02-29 13:45:36 -06:00
|
|
|
|
|
|
|
"go.wit.com/gui"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Size interface {
|
|
|
|
Cpus() int
|
|
|
|
Memory() float64
|
|
|
|
Disk() float64
|
|
|
|
}
|
|
|
|
|
2024-02-29 17:36:45 -06:00
|
|
|
type SquareBox struct {
|
|
|
|
Width float64
|
|
|
|
Height float64
|
|
|
|
}
|
|
|
|
|
|
|
|
type MenuNode struct {
|
|
|
|
Name string
|
|
|
|
Box *gui.Node
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s MenuNode) Area() float64 {
|
|
|
|
return 20
|
|
|
|
}
|
|
|
|
|
2024-02-29 13:45:36 -06:00
|
|
|
type Menu interface {
|
|
|
|
Widget() *gui.Node
|
2024-02-29 17:36:45 -06:00
|
|
|
SetMenu(*gui.Node)
|
2024-02-29 13:45:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
type Draw interface {
|
|
|
|
Show() bool
|
|
|
|
Hide()
|
|
|
|
}
|
|
|
|
|
|
|
|
type Droplet interface {
|
2024-02-29 17:36:45 -06:00
|
|
|
Box() *DropletBox
|
2024-02-29 13:45:36 -06:00
|
|
|
Draw
|
2024-02-29 17:36:45 -06:00
|
|
|
SetMenu(*DropletBox)
|
2024-02-29 13:45:36 -06:00
|
|
|
Size
|
2024-02-29 17:36:45 -06:00
|
|
|
PowerOn() error
|
|
|
|
PowerOff() (bool, error)
|
|
|
|
Connect()
|
2024-02-29 13:45:36 -06:00
|
|
|
// Location
|
|
|
|
fmt.Stringer
|
2024-02-29 17:36:45 -06:00
|
|
|
io.Writer
|
|
|
|
}
|
|
|
|
|
|
|
|
func addMenu(d Droplet) {
|
|
|
|
d.Show()
|
|
|
|
// d.Menu.Widget() = gui.RawBox()
|
2024-02-29 13:45:36 -06:00
|
|
|
}
|