GPUI.Display.Native (gpui_native v0.2.0)

Copy Markdown View Source

Local display backed by the native Rust GPUI runtime.

A display owns one native runtime namespace while sharing the process-global GPUI application loop with other native displays.

Summary

Functions

Waits until a complete native frame has followed the current window state.

Waits for a native frame completed after the supplied generation.

Returns a specification to start this module under a supervisor.

Returns the latest completed native frame generation for a window.

Changes the process-global native component theme and refreshes every window.

Functions

await_frame(display, window_id, timeout \\ 5000)

@spec await_frame(GenServer.server(), pos_integer(), pos_integer()) ::
  :ok | {:error, term()}

Waits until a complete native frame has followed the current window state.

await_frame_after(display, window_id, generation, timeout \\ 5000)

@spec await_frame_after(
  GenServer.server(),
  pos_integer(),
  non_neg_integer(),
  pos_integer()
) ::
  :ok | {:error, term()}

Waits for a native frame completed after the supplied generation.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

frame_token(display, window_id)

@spec frame_token(GenServer.server(), pos_integer()) ::
  {:ok, non_neg_integer()} | {:error, term()}

Returns the latest completed native frame generation for a window.

set_theme(display, mode)

@spec set_theme(GenServer.server(), :light | :dark) :: :ok | {:error, term()}

Changes the process-global native component theme and refreshes every window.