Raxol.Terminal.Window.Registry (Raxol v0.5.0)

View Source

Registry for managing multiple terminal windows.

Summary

Functions

Returns a specification to start this module under a supervisor.

Gets the active window.

Gets a window by ID.

Lists all registered windows.

Registers a new window.

Sets the active window.

Starts the window registry.

Unregisters a window.

Updates a window's properties.

Updates a window's state.

Types

window_id()

@type window_id() :: String.t()

window_state()

@type window_state() :: :active | :inactive | :minimized | :maximized

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_active_window()

@spec get_active_window() :: {:ok, Raxol.Terminal.Window.t()} | {:error, term()}

Gets the active window.

get_window(window_id)

@spec get_window(window_id()) :: {:ok, Raxol.Terminal.Window.t()} | {:error, term()}

Gets a window by ID.

list_windows()

@spec list_windows() :: {:ok, [Raxol.Terminal.Window.t()]}

Lists all registered windows.

register_window(window)

@spec register_window(Raxol.Terminal.Window.t()) ::
  {:ok, window_id()} | {:error, term()}

Registers a new window.

set_active_window(window_id)

@spec set_active_window(window_id()) :: :ok | {:error, term()}

Sets the active window.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts the window registry.

unregister_window(window_id)

@spec unregister_window(window_id()) :: :ok | {:error, term()}

Unregisters a window.

update_window(window_id, properties)

@spec update_window(String.t(), map()) :: :ok | {:error, term()}

Updates a window's properties.

update_window_state(window_id, state)

@spec update_window_state(window_id(), window_state()) :: :ok | {:error, term()}

Updates a window's state.