Raxol.Terminal.ANSI.WindowManipulation (Raxol v0.5.0)

View Source

Handles window manipulation sequences for terminal control. Supports window resizing, positioning, and state management.

Features

  • Window resizing
  • Window positioning
  • Window state (minimize, maximize, restore)
  • Window title management
  • Window icon management
  • Window stacking order
  • Window transparency
  • Window focus management
  • Window borders and decorations
  • Window events
  • Window state persistence
  • Window layout management
  • Window group management
  • Window animations

Summary

Functions

Clears the entire screen.

Disables window manipulation mode.

Enables window manipulation mode.

Formats a focus gain event into an ANSI sequence.

Formats a focus loss event into an ANSI sequence.

Formats a window event into an ANSI sequence.

Formats a key press event into an ANSI sequence.

Formats a key release event into an ANSI sequence.

Formats a mouse click event into an ANSI sequence.

Formats a mouse drag event into an ANSI sequence.

Formats a mouse release event into an ANSI sequence.

Moves the cursor to the specified position.

Processes a window manipulation sequence and returns the corresponding event.

Sets the window icon name.

Sets the window mode.

Sets the window title.

Types

window_border_style()

@type window_border_style() :: :none | :single | :double | :rounded | :custom

window_event()

@type window_event() ::
  {:window_resize, window_size()}
  | {:window_move, window_position()}
  | {:window_state, window_state()}
  | {:window_title, String.t()}
  | {:window_icon, String.t()}
  | {:window_focus, boolean()}
  | {:window_border, window_border_style()}
  | {:window_border_color,
     {non_neg_integer(), non_neg_integer(), non_neg_integer()}}
  | {:window_border_width, non_neg_integer()}
  | {:window_border_radius, non_neg_integer()}
  | {:window_shadow, boolean()}
  | {:window_shadow_color,
     {non_neg_integer(), non_neg_integer(), non_neg_integer()}}
  | {:window_shadow_blur, non_neg_integer()}
  | {:window_shadow_offset, {non_neg_integer(), non_neg_integer()}}

window_position()

@type window_position() :: {non_neg_integer(), non_neg_integer()}

window_size()

@type window_size() :: {non_neg_integer(), non_neg_integer()}

window_state()

@type window_state() :: :normal | :minimized | :maximized | :fullscreen

Functions

clear_screen()

@spec clear_screen() :: String.t()

Clears the entire screen.

disable_window_manipulation()

@spec disable_window_manipulation() :: String.t()

Disables window manipulation mode.

enable_window_manipulation()

@spec enable_window_manipulation() :: String.t()

Enables window manipulation mode.

focus_gain()

@spec focus_gain() :: String.t()

Formats a focus gain event into an ANSI sequence.

focus_loss()

@spec focus_loss() :: String.t()

Formats a focus loss event into an ANSI sequence.

format_border_color(arg)

format_border_radius(radius)

format_border_style(style)

format_border_width(width)

format_event(arg1)

@spec format_event(window_event()) :: String.t()

Formats a window event into an ANSI sequence.

format_focus(bool)

format_icon(icon)

format_move(arg)

format_resize(map)

format_shadow(bool)

format_shadow_blur(blur)

format_shadow_color(arg)

format_shadow_offset(arg)

format_stack(position)

format_state(state)

format_title(title)

format_transparency(alpha)

handle_border_color(list)

handle_border_radius(list)

handle_border_style(list)

handle_border_width(list)

handle_focus(list)

handle_icon(list)

handle_move(list)

handle_resize(list)

handle_shadow(list)

handle_shadow_blur(list)

handle_shadow_color(list)

handle_shadow_offset(list)

handle_stack(list)

handle_state(list)

handle_title(list)

handle_transparency(list)

key_press(key)

@spec key_press(String.t()) :: String.t()

Formats a key press event into an ANSI sequence.

key_release(key)

@spec key_release(String.t()) :: String.t()

Formats a key release event into an ANSI sequence.

mouse_click(button, x, y)

@spec mouse_click(atom(), non_neg_integer(), non_neg_integer()) :: String.t()

Formats a mouse click event into an ANSI sequence.

mouse_drag(button, x, y)

@spec mouse_drag(atom(), non_neg_integer(), non_neg_integer()) :: String.t()

Formats a mouse drag event into an ANSI sequence.

mouse_release(button, x, y)

@spec mouse_release(atom(), non_neg_integer(), non_neg_integer()) :: String.t()

Formats a mouse release event into an ANSI sequence.

move_cursor(x, y)

@spec move_cursor(integer(), integer()) :: String.t()

Moves the cursor to the specified position.

process_sequence(sequence, params)

@spec process_sequence(String.t(), [String.t()]) :: window_event() | nil

Processes a window manipulation sequence and returns the corresponding event.

set_icon_name(name)

@spec set_icon_name(String.t()) :: String.t()

Sets the window icon name.

set_mode(mode)

@spec set_mode(String.t()) :: String.t()

Sets the window mode.

set_title(title)

@spec set_title(String.t()) :: String.t()

Sets the window title.