Raxol.Terminal.Window.Manager.Operations (Raxol v2.0.1)

View Source

Operations module for window management functionality. Handles all the complex logic for window creation, updates, and hierarchy management.

Summary

Functions

Creates a child window.

Creates a window with configuration.

Destroys a window by ID.

Gets the active window.

Gets child windows for a parent.

Gets the parent window for a child.

Gets a window by ID with proper error handling.

Lists all windows.

Sets the active window.

Updates a window property.

Types

window_id()

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

window_state()

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

Functions

create_child_window(parent_id, config)

@spec create_child_window(window_id(), Raxol.Terminal.Config.t()) ::
  {:ok, Raxol.Terminal.Window.t()} | {:error, :not_found}

Creates a child window.

create_window_with_config(config)

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

Creates a window with configuration.

destroy_window_by_id(id)

@spec destroy_window_by_id(window_id()) :: :ok | {:error, :not_found}

Destroys a window by ID.

get_active_window()

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

Gets the active window.

get_child_windows(parent_id)

@spec get_child_windows(window_id()) ::
  {:ok, [Raxol.Terminal.Window.t()]} | {:error, :not_found}

Gets child windows for a parent.

get_parent_window(child_id)

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

Gets the parent window for a child.

get_window_by_id(id)

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

Gets a window by ID with proper error handling.

list_all_windows()

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

Lists all windows.

set_active_window(id)

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

Sets the active window.

update_window_property(id, property, value)

@spec update_window_property(window_id(), atom(), any()) ::
  {:ok, Raxol.Terminal.Window.t()} | {:error, :not_found}

Updates a window property.