aerc/ui/types.go

61 lines
843 B
Go
Raw Normal View History

2018-01-11 04:03:56 +01:00
package ui
2018-01-11 04:41:15 +01:00
import (
tb "github.com/nsf/termbox-go"
"git.sr.ht/~sircmpwn/aerc2/config"
)
2018-01-11 04:03:56 +01:00
const (
2018-01-11 04:54:55 +01:00
Valid = 0
InvalidateTabList = 1 << iota
InvalidateTabView
2018-01-11 04:03:56 +01:00
InvalidateSidebar
InvalidateStatusBar
)
const (
2018-01-11 04:54:55 +01:00
InvalidateAll = InvalidateTabList |
InvalidateTabView |
InvalidateSidebar |
InvalidateStatusBar
2018-01-11 04:03:56 +01:00
)
type Geometry struct {
2018-01-11 04:41:15 +01:00
Row int
Col int
Width int
Height int
2018-01-11 04:03:56 +01:00
}
type AercTab interface {
Name() string
Render(at Geometry)
2018-01-11 04:41:15 +01:00
SetParent(parent *UIState)
2018-01-11 04:03:56 +01:00
}
type UIState struct {
2018-01-11 04:41:15 +01:00
Config *config.AercConfig
2018-01-11 04:03:56 +01:00
Exit bool
InvalidPanes uint
Panes struct {
TabList Geometry
TabView Geometry
Sidebar Geometry
StatusBar Geometry
}
Tabs []AercTab
SelectedTab int
Prompt struct {
Prompt *string
Text *string
Index int
Scroll int
}
2018-01-11 04:41:15 +01:00
tbEvents chan tb.Event
2018-01-11 04:03:56 +01:00
}