about summary refs log tree commit diff stats
path: root/ui/types.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/types.go')
-rw-r--r--ui/types.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/ui/types.go b/ui/types.go
index 14a91c3..5437642 100644
--- a/ui/types.go
+++ b/ui/types.go
@@ -4,20 +4,19 @@ import (
 	tb "github.com/nsf/termbox-go"
 
 	"git.sr.ht/~sircmpwn/aerc2/config"
+	"git.sr.ht/~sircmpwn/aerc2/worker/types"
 )
 
 const (
 	Valid             = 0
 	InvalidateTabList = 1 << iota
 	InvalidateTabView
-	InvalidateSidebar
 	InvalidateStatusBar
 )
 
 const (
 	InvalidateAll = InvalidateTabList |
 		InvalidateTabView |
-		InvalidateSidebar |
 		InvalidateStatusBar
 )
 
@@ -34,6 +33,16 @@ type AercTab interface {
 	SetParent(parent *UIState)
 }
 
+type WorkerListener interface {
+	GetChannel() chan types.WorkerMessage
+	HandleMessage(msg types.WorkerMessage)
+}
+
+type wrappedMessage struct {
+	msg      types.WorkerMessage
+	listener WorkerListener
+}
+
 type UIState struct {
 	Config       *config.AercConfig
 	Exit         bool
@@ -57,4 +66,6 @@ type UIState struct {
 	}
 
 	tbEvents chan tb.Event
+	// Aggregate channel for all worker messages
+	workerEvents chan wrappedMessage
 }