Ophestra Umiker
4b7d616862
Exit cleanup state information is now stored in a dedicated struct and built up using methods of that struct. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
35 lines
455 B
Go
35 lines
455 B
Go
package internal
|
|
|
|
type (
|
|
Enablement uint8
|
|
Enablements uint64
|
|
)
|
|
|
|
const (
|
|
EnableWayland Enablement = iota
|
|
EnableX
|
|
EnableDBus
|
|
EnablePulse
|
|
|
|
EnableLength
|
|
)
|
|
|
|
var enablementString = [EnableLength]string{
|
|
"Wayland",
|
|
"X11",
|
|
"D-Bus",
|
|
"PulseAudio",
|
|
}
|
|
|
|
func (e Enablement) String() string {
|
|
return enablementString[e]
|
|
}
|
|
|
|
func (e Enablement) Mask() Enablements {
|
|
return 1 << e
|
|
}
|
|
|
|
func (es Enablements) Has(e Enablement) bool {
|
|
return es&e.Mask() != 0
|
|
}
|