server

package
v1.0.260758 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server owns windows and surfaces.

func New

func New(cfg config.Config) *Server

func (*Server) CaptureSession

func (s *Server) CaptureSession() session.State

CaptureSession builds a restorable snapshot of open windows.

func (*Server) CloseAll

func (s *Server) CloseAll()

func (*Server) CloseWindow

func (s *Server) CloseWindow(id string)

func (*Server) Config

func (s *Server) Config() config.Config

func (*Server) CreateApp

func (s *Server) CreateApp(appName, title string) (*Window, error)

func (*Server) CreateAppPath

func (s *Server) CreateAppPath(appName, title, path string) (*Window, error)

CreateAppPath creates a native app with an optional path (Files start dir, etc.).

func (*Server) CreateBridge

func (s *Server) CreateBridge(title, command string) (*Window, error)

CreateBridge opens command as a bridged GUI app (see internal/bridge) — an off-screen Xvfb rendering the target X11 program, captured into cells.

func (*Server) CreateExtApp

func (s *Server) CreateExtApp(title, command string, args []string) (*Window, error)

CreateExtApp spawns command (with args) as an out-of-process App SDK window (see internal/surface.ExtAppSurface, docs/extapp.md) — any executable speaking the NDJSON protocol over its own stdin/stdout, rather than a Go uiapp.App linked into this binary.

func (*Server) CreateFilePicker

func (s *Server) CreateFilePicker(startDir string, extensions []string, onResult func(path string, ok bool)) (*Window, error)

CreateFilePicker opens a small modal file browser rooted at startDir, restricted to extensions if any are given. onResult fires exactly once, asynchronously, with ok=false if the user cancels — see Host.PickFile.

func (*Server) CreateGfx

func (s *Server) CreateGfx(title, path string) (*Window, error)

func (*Server) CreateProgram

func (s *Server) CreateProgram(p config.Program) (*Window, error)

CreateProgram opens a registered program with pinned title and prog: launch key.

func (*Server) CreatePty

func (s *Server) CreatePty(title string) (*Window, error)

func (*Server) CreatePtyCmd

func (s *Server) CreatePtyCmd(title, command string, args []string) (*Window, error)

CreatePtyCmd spawns a PTY running command with optional args.

func (*Server) CreatePtyCmdPinned

func (s *Server) CreatePtyCmdPinned(title, command string, args []string) (*Window, error)

CreatePtyCmdPinned keeps the desk title (custom registered programs).

func (*Server) Focus

func (s *Server) Focus(id string)

func (*Server) FocusOrCreateApp

func (s *Server) FocusOrCreateApp(appName, title string) error

FocusOrCreateApp focuses an existing app window by launch id or title, or creates one.

func (*Server) Focused

func (s *Server) Focused() string

func (*Server) Get

func (s *Server) Get(id string) *Window

func (*Server) HandleInput

func (s *Server) HandleInput(id string, ev surface.InputEvent)

func (*Server) LaunchAction

func (s *Server) LaunchAction(action string) (err error)

LaunchAction runs a desktop/Start-menu action string.

func (*Server) Move

func (s *Server) Move(id string, x, y int)

func (*Server) NotifyService

func (s *Server) NotifyService() *notify.Service

func (*Server) Nudge

func (s *Server) Nudge(id string, dx, dy, dw, dh int)

func (*Server) OpenPath

func (s *Server) OpenPath(path string) error

OpenPath opens a file with default-app associations, or a directory in Files.

func (*Server) RefreshTitles

func (s *Server) RefreshTitles()

func (*Server) ResizeWindow

func (s *Server) ResizeWindow(id string, w, h int)

func (*Server) RestoreSession

func (s *Server) RestoreSession(st session.State) int

RestoreSession recreates windows from a saved session (geometry applied after create).

func (*Server) SetConfig

func (s *Server) SetConfig(cfg config.Config)

func (*Server) SetConfigListener

func (s *Server) SetConfigListener(fn func(config.Config))

func (*Server) SetDock

func (s *Server) SetDock(dock string)

func (*Server) SetGeometry

func (s *Server) SetGeometry(id string, x, y, w, h int)

SetGeometry moves and resizes a window (used for edge/corner drag).

func (*Server) SetHostSize

func (s *Server) SetHostSize(cols, rows int)

func (*Server) SetNotify

func (s *Server) SetNotify(n *notify.Service)

func (*Server) SetWindowTitle

func (s *Server) SetWindowTitle(id, title string)

SetWindowTitle updates a window's title bar text.

func (*Server) Snap

func (s *Server) Snap(id, region string)

Snap tiles the window into a desktop region: left|right|top|bottom. Snapping again to the same region restores the previous geometry.

func (*Server) Snapshot

func (s *Server) Snapshot() proto.Snapshot

func (*Server) ToggleMaximize

func (s *Server) ToggleMaximize(id string)

func (*Server) ToggleMinimize

func (s *Server) ToggleMinimize(id string)

func (*Server) Windows

func (s *Server) Windows() []*Window

type Window

type Window struct {
	ID          string
	Title       string
	TitlePinned bool
	Launch      string // recreate action: terminal, notes, prog:id, …
	X, Y        int
	W, H        int // outer size including chrome
	Z           int
	Maximized   bool
	Minimized   bool
	Restore     struct{ X, Y, W, H int }
	Surface     surface.Surface
	Kind        string
}

Window is a floating managed window.

func (*Window) ContentSize

func (w *Window) ContentSize() (cols, rows int)

content size inside chrome: title(1)+borders(2) horizontal, borders+title

Jump to

Keyboard shortcuts

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