display

package
v0.0.0-...-ba0b20d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayerBackground uint32 = 0
	LayerBottom     uint32 = 1
	LayerTop        uint32 = 2
	LayerOverlay    uint32 = 3
)
View Source
const (
	AnchorTop              uint32 = 1
	AnchorBottom           uint32 = 2
	AnchorLeft             uint32 = 4
	AnchorRight            uint32 = 8
	AnchorHorizontalCenter uint32 = 16
	AnchorVerticalCenter   uint32 = 32
)
View Source
const (
	WindowFlagFocused   uint32 = 1 << 0
	WindowFlagMinimized uint32 = 1 << 1
	WindowFlagMaximized uint32 = 1 << 2
	WindowFlagVisible   uint32 = 1 << 3
)
View Source
const (
	WindowActionToggleMinimize uint32 = 0
	WindowActionMinimize       uint32 = 1
	WindowActionRestore        uint32 = 2
	WindowActionToggleMaximize uint32 = 3
	WindowActionFocus          uint32 = 4
	WindowActionClose          uint32 = 5
)
View Source
const (
	ShortcutScopeGlobal uint32 = 0
	ShortcutScopeClient uint32 = 1
)
View Source
const (
	ServiceName        = "dev.avyos.display"
	ServiceID   uint32 = 16
)
View Source
const (
	RequestCreateWindow       uint16 = 0x0201
	RequestDestroyWindow      uint16 = 0x0202
	RequestSetTitle           uint16 = 0x0203
	RequestDamage             uint16 = 0x0204
	RequestResize             uint16 = 0x0205
	RequestMove               uint16 = 0x0206
	RequestCreateLayer        uint16 = 0x0207
	RequestCreatePopup        uint16 = 0x0208
	RequestListWindows        uint16 = 0x0209
	RequestSetWindowState     uint16 = 0x020a
	RequestRegisterSession    uint16 = 0x020b
	RequestSetActiveSession   uint16 = 0x020c
	RequestGetActiveSession   uint16 = 0x020d
	RequestRegisterShortcut   uint16 = 0x020e
	RequestUnregisterShortcut uint16 = 0x020f
)
View Source
const (
	EventWindowCreated    uint16 = 0x0301
	EventConfigure        uint16 = 0x0302
	EventClose            uint16 = 0x0303
	EventPointerEnter     uint16 = 0x0304
	EventPointerLeave     uint16 = 0x0305
	EventPointerMotion    uint16 = 0x0306
	EventPointerButton    uint16 = 0x0307
	EventKey              uint16 = 0x0308
	EventFocus            uint16 = 0x0309
	EventMoved            uint16 = 0x030a
	EventWindowList       uint16 = 0x030b
	EventSessionActivated uint16 = 0x030c
	EventSessionSuspended uint16 = 0x030d
	EventSessionResumed   uint16 = 0x030e
	EventShortcut         uint16 = 0x030f
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveSessionEvent

type ActiveSessionEvent struct {
	SessionID uint32
}

func (ActiveSessionEvent) MarshalBinary

func (v ActiveSessionEvent) MarshalBinary() []byte

func (*ActiveSessionEvent) UnmarshalBinary

func (v *ActiveSessionEvent) UnmarshalBinary(data []byte) error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(socketPath string) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) CreateLayer

func (c *Client) CreateLayer(req CreateLayerRequest) (WindowCreatedEvent, error)

func (*Client) CreatePopup

func (c *Client) CreatePopup(req CreatePopupRequest) (WindowCreatedEvent, error)

func (*Client) CreateWindow

func (c *Client) CreateWindow(req CreateWindowRequest) (WindowCreatedEvent, error)

func (*Client) Damage

func (c *Client) Damage(req DamageRequest) (Empty, error)

func (*Client) DestroyWindow

func (c *Client) DestroyWindow(req DestroyWindowRequest) (Empty, error)

func (*Client) GetActiveSession

func (c *Client) GetActiveSession(req Empty) (ActiveSessionEvent, error)

func (*Client) ListWindows

func (c *Client) ListWindows(req Empty) (WindowListEvent, error)

func (*Client) Move

func (c *Client) Move(req MoveRequest) (Empty, error)

func (*Client) OnClose

func (c *Client) OnClose(fn func(sender uint32, ev CloseEvent))

func (*Client) OnConfigure

func (c *Client) OnConfigure(fn func(sender uint32, ev ConfigureEvent))

func (*Client) OnFocus

func (c *Client) OnFocus(fn func(sender uint32, ev FocusEvent))

func (*Client) OnKey

func (c *Client) OnKey(fn func(sender uint32, ev KeyEvent))

func (*Client) OnMoved

func (c *Client) OnMoved(fn func(sender uint32, ev MovedEvent))

func (*Client) OnPointerButton

func (c *Client) OnPointerButton(fn func(sender uint32, ev PointerButtonEvent))

func (*Client) OnPointerEnter

func (c *Client) OnPointerEnter(fn func(sender uint32, ev PointerEnterEvent))

func (*Client) OnPointerLeave

func (c *Client) OnPointerLeave(fn func(sender uint32, ev PointerLeaveEvent))

func (*Client) OnPointerMotion

func (c *Client) OnPointerMotion(fn func(sender uint32, ev PointerMotionEvent))

func (*Client) OnSessionActivated

func (c *Client) OnSessionActivated(fn func(sender uint32, ev ActiveSessionEvent))

func (*Client) OnSessionResumed

func (c *Client) OnSessionResumed(fn func(sender uint32, ev ActiveSessionEvent))

func (*Client) OnSessionSuspended

func (c *Client) OnSessionSuspended(fn func(sender uint32, ev ActiveSessionEvent))

func (*Client) OnShortcut

func (c *Client) OnShortcut(fn func(sender uint32, ev ShortcutEvent))

func (*Client) OnWindowCreated

func (c *Client) OnWindowCreated(fn func(sender uint32, ev WindowCreatedEvent))

func (*Client) OnWindowList

func (c *Client) OnWindowList(fn func(sender uint32, ev WindowListEvent))

func (*Client) RegisterSession

func (c *Client) RegisterSession(req RegisterSessionRequest) (Empty, error)

func (*Client) RegisterShortcut

func (c *Client) RegisterShortcut(req RegisterShortcutRequest) (Empty, error)

func (*Client) Resize

func (c *Client) Resize(req ResizeRequest) (Empty, error)

func (*Client) SetActiveSession

func (c *Client) SetActiveSession(req SetActiveSessionRequest) (Empty, error)

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration)

func (*Client) SetTitle

func (c *Client) SetTitle(req SetTitleRequest) (Empty, error)

func (*Client) SetWindowState

func (c *Client) SetWindowState(req SetWindowStateRequest) (Empty, error)

func (*Client) UnregisterShortcut

func (c *Client) UnregisterShortcut(req UnregisterShortcutRequest) (Empty, error)

type ClientEventType

type ClientEventType int
const (
	ClientEventWindowCreated ClientEventType = iota
	ClientEventConfigure
	ClientEventClose
	ClientEventPointerEnter
	ClientEventPointerLeave
	ClientEventPointerMotion
	ClientEventPointerButton
	ClientEventKey
	ClientEventFocus
	ClientEventMoved
	ClientEventWindowList
	ClientEventShortcut
)

type ClientWindow

type ClientWindow struct {
	ID     uint32
	X, Y   int
	Width  int
	Height int
	// contains filtered or unexported fields
}

func (*ClientWindow) Buffer

func (w *ClientWindow) Buffer() *graphics.Buffer

func (*ClientWindow) Damage

func (w *ClientWindow) Damage(r graphics.Rect) error

func (*ClientWindow) DamageAll

func (w *ClientWindow) DamageAll() error

func (*ClientWindow) Destroy

func (w *ClientWindow) Destroy() error

func (*ClientWindow) Resize

func (w *ClientWindow) Resize(width, height int) error

func (*ClientWindow) SetTitle

func (w *ClientWindow) SetTitle(title string) error

type CloseEvent

type CloseEvent struct {
	WindowID uint32
}

func (CloseEvent) MarshalBinary

func (v CloseEvent) MarshalBinary() []byte

func (*CloseEvent) UnmarshalBinary

func (v *CloseEvent) UnmarshalBinary(data []byte) error

type ConfigureEvent

type ConfigureEvent struct {
	WindowID uint32
	Width    int
	Height   int
}

func (ConfigureEvent) MarshalBinary

func (v ConfigureEvent) MarshalBinary() []byte

func (*ConfigureEvent) UnmarshalBinary

func (v *ConfigureEvent) UnmarshalBinary(data []byte) error

type CreateLayerRequest

type CreateLayerRequest struct {
	Layer      uint32
	Anchor     uint32
	Exclusive  int
	OpaqueHint bool
	ShmKey     string
	Width      int
	Height     int
	Stride     int
}

func (CreateLayerRequest) MarshalBinary

func (v CreateLayerRequest) MarshalBinary() []byte

func (*CreateLayerRequest) UnmarshalBinary

func (v *CreateLayerRequest) UnmarshalBinary(data []byte) error

type CreatePopupRequest

type CreatePopupRequest struct {
	ParentID uint32
	X        int
	Y        int
	ShmKey   string
	Width    int
	Height   int
	Stride   int
}

func (CreatePopupRequest) MarshalBinary

func (v CreatePopupRequest) MarshalBinary() []byte

func (*CreatePopupRequest) UnmarshalBinary

func (v *CreatePopupRequest) UnmarshalBinary(data []byte) error

type CreateWindowRequest

type CreateWindowRequest struct {
	ShmKey string
	Width  int
	Height int
	Stride int
}

func (CreateWindowRequest) MarshalBinary

func (v CreateWindowRequest) MarshalBinary() []byte

func (*CreateWindowRequest) UnmarshalBinary

func (v *CreateWindowRequest) UnmarshalBinary(data []byte) error

type DamageRequest

type DamageRequest struct {
	WindowID uint32
	X        int
	Y        int
	Width    int
	Height   int
}

func (DamageRequest) MarshalBinary

func (v DamageRequest) MarshalBinary() []byte

func (*DamageRequest) UnmarshalBinary

func (v *DamageRequest) UnmarshalBinary(data []byte) error

type DestroyWindowRequest

type DestroyWindowRequest struct {
	WindowID uint32
}

func (DestroyWindowRequest) MarshalBinary

func (v DestroyWindowRequest) MarshalBinary() []byte

func (*DestroyWindowRequest) UnmarshalBinary

func (v *DestroyWindowRequest) UnmarshalBinary(data []byte) error

type DisplayClient

type DisplayClient struct {
	// contains filtered or unexported fields
}

func Dial

func Dial() (*DisplayClient, error)

func DialDisplay

func DialDisplay(socketPath string) (*DisplayClient, error)

func (*DisplayClient) Close

func (cl *DisplayClient) Close() error

func (*DisplayClient) CreateLayer

func (cl *DisplayClient) CreateLayer(layer, anchor uint32, exclusive, width, height int, opaqueHint bool) (*ClientWindow, error)

func (*DisplayClient) CreatePopup

func (cl *DisplayClient) CreatePopup(parent *ClientWindow, x, y, width, height int) (*ClientWindow, error)

func (*DisplayClient) CreateWindow

func (cl *DisplayClient) CreateWindow(width, height int) (*ClientWindow, error)

func (*DisplayClient) ListWindows

func (cl *DisplayClient) ListWindows() ([]WindowInfo, error)

func (*DisplayClient) Poll

func (cl *DisplayClient) Poll() *Event

func (*DisplayClient) RegisterShortcut

func (cl *DisplayClient) RegisterShortcut(shortcutID, windowID, scope uint32, key graphics.Key, modifiers graphics.Modifiers) error

func (*DisplayClient) RegisterShortcutEx

func (cl *DisplayClient) RegisterShortcutEx(shortcutID, windowID, scope uint32, key graphics.Key, ch rune, modifiers graphics.Modifiers) error

func (*DisplayClient) SetWindowState

func (cl *DisplayClient) SetWindowState(windowID, action uint32) error

func (*DisplayClient) UnregisterShortcut

func (cl *DisplayClient) UnregisterShortcut(shortcutID uint32) error

func (*DisplayClient) Wait

func (cl *DisplayClient) Wait() Event

type Empty

type Empty struct {
}

func (Empty) MarshalBinary

func (v Empty) MarshalBinary() []byte

func (*Empty) UnmarshalBinary

func (v *Empty) UnmarshalBinary(data []byte) error

type Event

type Event struct {
	Type       ClientEventType
	WindowID   uint32
	ShortcutID uint32
	Scope      uint32
	X, Y       int
	Button     int
	Key        graphics.Key
	Rune       rune
	Modifiers  graphics.Modifiers
	Char       rune
	Pressed    bool
	Focused    bool
	Width      int
	Height     int
	Windows    []WindowInfo
}

type FocusEvent

type FocusEvent struct {
	WindowID uint32
	Focused  bool
}

func (FocusEvent) MarshalBinary

func (v FocusEvent) MarshalBinary() []byte

func (*FocusEvent) UnmarshalBinary

func (v *FocusEvent) UnmarshalBinary(data []byte) error

type KeyEvent

type KeyEvent struct {
	WindowID uint32
	Key      input.Key
	Char     rune
	Pressed  bool
}

func (KeyEvent) MarshalBinary

func (v KeyEvent) MarshalBinary() []byte

func (*KeyEvent) UnmarshalBinary

func (v *KeyEvent) UnmarshalBinary(data []byte) error

type MoveRequest

type MoveRequest struct {
	WindowID uint32
	X        int
	Y        int
}

func (MoveRequest) MarshalBinary

func (v MoveRequest) MarshalBinary() []byte

func (*MoveRequest) UnmarshalBinary

func (v *MoveRequest) UnmarshalBinary(data []byte) error

type MovedEvent

type MovedEvent struct {
	WindowID uint32
	X        int
	Y        int
}

func (MovedEvent) MarshalBinary

func (v MovedEvent) MarshalBinary() []byte

func (*MovedEvent) UnmarshalBinary

func (v *MovedEvent) UnmarshalBinary(data []byte) error

type PointerButtonEvent

type PointerButtonEvent struct {
	WindowID uint32
	Button   int
	Pressed  bool
}

func (PointerButtonEvent) MarshalBinary

func (v PointerButtonEvent) MarshalBinary() []byte

func (*PointerButtonEvent) UnmarshalBinary

func (v *PointerButtonEvent) UnmarshalBinary(data []byte) error

type PointerEnterEvent

type PointerEnterEvent struct {
	WindowID uint32
	X        int
	Y        int
}

func (PointerEnterEvent) MarshalBinary

func (v PointerEnterEvent) MarshalBinary() []byte

func (*PointerEnterEvent) UnmarshalBinary

func (v *PointerEnterEvent) UnmarshalBinary(data []byte) error

type PointerLeaveEvent

type PointerLeaveEvent struct {
	WindowID uint32
}

func (PointerLeaveEvent) MarshalBinary

func (v PointerLeaveEvent) MarshalBinary() []byte

func (*PointerLeaveEvent) UnmarshalBinary

func (v *PointerLeaveEvent) UnmarshalBinary(data []byte) error

type PointerMotionEvent

type PointerMotionEvent struct {
	WindowID uint32
	X        int
	Y        int
}

func (PointerMotionEvent) MarshalBinary

func (v PointerMotionEvent) MarshalBinary() []byte

func (*PointerMotionEvent) UnmarshalBinary

func (v *PointerMotionEvent) UnmarshalBinary(data []byte) error

type RegisterSessionRequest

type RegisterSessionRequest struct {
	SessionID uint32
	UID       uint32
}

func (RegisterSessionRequest) MarshalBinary

func (v RegisterSessionRequest) MarshalBinary() []byte

func (*RegisterSessionRequest) UnmarshalBinary

func (v *RegisterSessionRequest) UnmarshalBinary(data []byte) error

type RegisterShortcutRequest

type RegisterShortcutRequest struct {
	ShortcutID uint32
	WindowID   uint32
	Scope      uint32
	Key        input.Key
	Rune       rune
	Modifiers  uint8
}

func (RegisterShortcutRequest) MarshalBinary

func (v RegisterShortcutRequest) MarshalBinary() []byte

func (*RegisterShortcutRequest) UnmarshalBinary

func (v *RegisterShortcutRequest) UnmarshalBinary(data []byte) error

type ResizeRequest

type ResizeRequest struct {
	WindowID uint32
	ShmKey   string
	Width    int
	Height   int
	Stride   int
}

func (ResizeRequest) MarshalBinary

func (v ResizeRequest) MarshalBinary() []byte

func (*ResizeRequest) UnmarshalBinary

func (v *ResizeRequest) UnmarshalBinary(data []byte) error

type SetActiveSessionRequest

type SetActiveSessionRequest struct {
	SessionID uint32
}

func (SetActiveSessionRequest) MarshalBinary

func (v SetActiveSessionRequest) MarshalBinary() []byte

func (*SetActiveSessionRequest) UnmarshalBinary

func (v *SetActiveSessionRequest) UnmarshalBinary(data []byte) error

type SetTitleRequest

type SetTitleRequest struct {
	WindowID uint32
	Title    string
}

func (SetTitleRequest) MarshalBinary

func (v SetTitleRequest) MarshalBinary() []byte

func (*SetTitleRequest) UnmarshalBinary

func (v *SetTitleRequest) UnmarshalBinary(data []byte) error

type SetWindowStateRequest

type SetWindowStateRequest struct {
	WindowID uint32
	Action   uint32
}

func (SetWindowStateRequest) MarshalBinary

func (v SetWindowStateRequest) MarshalBinary() []byte

func (*SetWindowStateRequest) UnmarshalBinary

func (v *SetWindowStateRequest) UnmarshalBinary(data []byte) error

type ShortcutEvent

type ShortcutEvent struct {
	ShortcutID uint32
	WindowID   uint32
	Scope      uint32
	Key        input.Key
	Rune       rune
	Modifiers  uint8
}

func (ShortcutEvent) MarshalBinary

func (v ShortcutEvent) MarshalBinary() []byte

func (*ShortcutEvent) UnmarshalBinary

func (v *ShortcutEvent) UnmarshalBinary(data []byte) error

type UnregisterShortcutRequest

type UnregisterShortcutRequest struct {
	ShortcutID uint32
}

func (UnregisterShortcutRequest) MarshalBinary

func (v UnregisterShortcutRequest) MarshalBinary() []byte

func (*UnregisterShortcutRequest) UnmarshalBinary

func (v *UnregisterShortcutRequest) UnmarshalBinary(data []byte) error

type WindowCreatedEvent

type WindowCreatedEvent struct {
	WindowID uint32
	X        int
	Y        int
}

func (WindowCreatedEvent) MarshalBinary

func (v WindowCreatedEvent) MarshalBinary() []byte

func (*WindowCreatedEvent) UnmarshalBinary

func (v *WindowCreatedEvent) UnmarshalBinary(data []byte) error

type WindowInfo

type WindowInfo struct {
	ID        uint32
	Title     string
	Focused   bool
	Visible   bool
	Minimized bool
	Maximized bool
}

type WindowListEvent

type WindowListEvent struct {
	Windows []WindowListItem
}

func (WindowListEvent) MarshalBinary

func (v WindowListEvent) MarshalBinary() []byte

func (*WindowListEvent) UnmarshalBinary

func (v *WindowListEvent) UnmarshalBinary(data []byte) error

type WindowListItem

type WindowListItem struct {
	ID    uint32
	Flags uint32
	Title string
}

func (WindowListItem) MarshalBinary

func (v WindowListItem) MarshalBinary() []byte

func (*WindowListItem) UnmarshalBinary

func (v *WindowListItem) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL