utility-screen/screen.go

29 lines
532 B
Go
Raw Normal View History

2015-11-30 14:17:53 +00:00
package main
import "github.com/nsf/termbox-go"
// Screen TODO: Comment
type Screen interface {
2016-01-01 18:15:43 +00:00
handleKeyPress(event termbox.Event) int
2015-11-30 14:17:53 +00:00
performLayout(style style)
drawScreen(style style)
}
// ViewPort TODO: Comment
type ViewPort struct {
bytesPerRow int
numberOfRows int
2016-01-01 18:15:43 +00:00
firstRow int
2015-11-30 14:17:53 +00:00
}
func drawBackground(bg termbox.Attribute) {
termbox.Clear(0, bg)
}
func layoutAndDrawScreen(screen Screen, style style) {
screen.performLayout(style)
drawBackground(style.defaultBg)
screen.drawScreen(style)
termbox.Flush()
}