diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-09-29 06:32:15 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-09-29 06:34:29 +0900 |
| commit | 44ba7a5f02b7575a706a22aac53c8ac608d18f23 (patch) | |
| tree | c08890b09a42c38bdf24b976421704ce83a74fad /system/enablement.go | |
| parent | dc467493d8a1461ea321ccf5ca3a2b037f880088 (diff) | |
hst/enablement: move bits from system
This is part of the hst API, should not be in the implementation package.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/enablement.go')
| -rw-r--r-- | system/enablement.go | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/system/enablement.go b/system/enablement.go deleted file mode 100644 index 9c1342db..00000000 --- a/system/enablement.go +++ /dev/null @@ -1,47 +0,0 @@ -package system - -import ( - "fmt" - "strings" -) - -// Enablement represents an optional host service to export to the target user. -type Enablement byte - -const ( - EWayland Enablement = 1 << iota - EX11 - EDBus - EPulse - - EM -) - -func (e Enablement) String() string { - switch e { - case 0: - return "(no enablements)" - case EWayland: - return "wayland" - case EX11: - return "x11" - case EDBus: - return "dbus" - case EPulse: - return "pulseaudio" - default: - buf := new(strings.Builder) - buf.Grow(32) - - for i := Enablement(1); i < EM; i <<= 1 { - if e&i != 0 { - buf.WriteString(", " + i.String()) - } - } - - if buf.Len() == 0 { - return fmt.Sprintf("e%x", byte(e)) - } - return strings.TrimPrefix(buf.String(), ", ") - } -} |
