avyos.dev/pkg/graphics/backend/display
package displaybackend
Package Overview
No package-level documentation is provided.
| Export Group | Count |
|---|---|
| Constants | 0 |
| Variables | 0 |
| Functions | 0 |
| Types | 2 |
Types
Backend
type Backend struct {
// contains filtered or unexported fields
}Backend implements graphics.Backend and graphics.InputHandler using the custom display protocol client.
Functions
func New() *BackendNew creates a display backend with default 800x600 size.
Methods
func (b *Backend) Buffer() *graphics.BufferBuffer returns the shared memory pixel buffer.
func (b *Backend) Close() errorClose stops the event loop and disconnects.
func (b *Backend) ClosePopup(p *Popup)ClosePopup destroys a popup window. Safe to call multiple times.
func (b *Backend) Flush() errorFlush marks the entire window as damaged.
func (b *Backend) FlushRect(r graphics.Rect) errorFlushRect marks a region as damaged.
func (b *Backend) HasSystemCursor() boolHasSystemCursor returns true since the server draws the cursor.
func (b *Backend) Info() stringInfo returns backend information.
func (b *Backend) ListWindows() ([]display.WindowInfo, error)ListWindows returns current managed normal windows from the display server.
func (b *Backend) MousePosition() (int, int)MousePosition returns the last known pointer position.
func (b *Backend) Open() errorOpen connects to the display server and creates a window or layer surface.
func (b *Backend) OpenPopup(x, y, w, h int, content graphics.Widget, onClose func()) *PopupOpenPopup creates a popup window positioned relative to the main window. The content widget is rendered into the popup buffer and receives events. onClose is called when the popup is dismissed (e.g. click outside).
func (b *Backend) Poll() *graphics.EventPoll returns the next event or nil.
func (b *Backend) ReconfigureLayer(anchor uint32, exclusive int) errorReconfigureLayer updates anchor/exclusive for an already-open layer surface. The main layer surface is recreated in-place to apply new positioning.
func (b *Backend) RegisterShortcut(shortcutID, windowID, scope uint32, key graphics.Key, modifiers graphics.Modifiers) errorRegisterShortcut registers a compositor shortcut for this client. Use ShortcutScopeGlobal for compositor-wide shortcuts and ShortcutScopeClient for shortcuts scoped to this client (optionally a specific window ID).
func (b *Backend) RegisterShortcutEx(shortcutID, windowID, scope uint32, key graphics.Key, ch rune, modifiers graphics.Modifiers) errorRegisterShortcutEx registers a shortcut keyed either by graphics.Key, or by a printable rune when key is graphics.KeyNone.
func (b *Backend) Resize(width, height int) errorResize changes the main surface size at runtime. For layer surfaces this allows dynamic content-sized bars/docks.
func (b *Backend) SetLayer(layer, anchor uint32, exclusive int)SetLayer configures this backend as a layer surface. Call before Open(). Layer surfaces are anchored to screen edges and can reserve exclusive zones (e.g. 32px for a panel).
func (b *Backend) SetLayerOpaqueHint(opaque bool)SetLayerOpaqueHint hints that the layer content is fully opaque.
func (b *Backend) SetScreenSize(_, _ int)SetScreenSize is a no-op for window-based backends.
func (b *Backend) SetSize(width, height int)SetSize sets the window size (call before Open).
func (b *Backend) SetTitle(title string)SetTitle sets the window title (call before Open).
func (b *Backend) SetWindowState(windowID, action uint32) errorSetWindowState updates a managed window state (minimize/maximize/restore/focus).
func (b *Backend) Size() (int, int)Size returns the window dimensions.
func (b *Backend) Start()Start begins the event loop goroutine.
func (b *Backend) UnregisterShortcut(shortcutID uint32) errorUnregisterShortcut removes a previously registered shortcut.
Popup
type Popup struct {
// contains filtered or unexported fields
}Popup represents a popup window managed by the display backend.
Methods
func (p *Popup) Redraw()Redraw re-renders the popup widget into the popup buffer.