2024-09-17 13:48:42 +09:00
|
|
|
package internal
|
2024-09-08 02:24:01 +09:00
|
|
|
|
|
|
|
type (
|
|
|
|
Enablement uint8
|
|
|
|
Enablements uint64
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
EnableWayland Enablement = iota
|
|
|
|
EnableX
|
|
|
|
EnableDBus
|
|
|
|
EnablePulse
|
|
|
|
|
2024-09-17 13:48:42 +09:00
|
|
|
EnableLength
|
2024-09-08 02:24:01 +09:00
|
|
|
)
|
|
|
|
|
2024-09-17 13:48:42 +09:00
|
|
|
var enablementString = [EnableLength]string{
|
2024-09-08 02:24:01 +09:00
|
|
|
"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
|
|
|
|
}
|