aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/state/register.go
blob: be9ce54012897d76d888cc67d983b6ffff5a23ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package state

import "git.ophivana.moe/cat/fortify/dbus"

var (
	cleanupCandidate  []string
	enablements       *Enablements
	xcbActionComplete bool

	dbusProxy *dbus.Proxy
	dbusDone  *chan struct{}
)

func RegisterRevertPath(p string) {
	cleanupCandidate = append(cleanupCandidate, p)
}

func RegisterEnablement(e Enablements) {
	if enablements != nil {
		panic("enablement state set twice")
	}
	enablements = &e
}

func XcbActionComplete() {
	if xcbActionComplete {
		Fatal("xcb inserted twice")
	}
	xcbActionComplete = true
}

func RegisterDBus(p *dbus.Proxy, done *chan struct{}) {
	dbusProxy = p
	dbusDone = done
}