2017-03-02 16:26:34 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "github.com/jroimartin/gocui"
|
|
|
|
|
|
|
|
type screen interface {
|
2017-03-15 19:38:37 +00:00
|
|
|
getGoCuiGui() *gocui.Gui
|
|
|
|
updateViews(*gocui.Gui)
|
|
|
|
layoutManger(*gocui.Gui) error
|
|
|
|
addView(string, int, int, int, int)
|
2017-03-02 16:26:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type position struct {
|
|
|
|
// value = pct * MAX + abs
|
|
|
|
pct float32
|
|
|
|
abs int
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p position) getCoordinate(max int) int {
|
|
|
|
return int(p.pct*float32(max)) + p.abs
|
|
|
|
}
|
|
|
|
|
|
|
|
type viewPosition struct {
|
|
|
|
x0, y0, x1, y1 position
|
|
|
|
}
|