MingaEditor.Renderer.TextPresentations (Minga v0.1.0)

Copy Markdown View Source

Owns committed, active, and explicitly discarded text-presentation leases.

Summary

Functions

Retains acknowledged presentation candidates without changing visibility.

Retains every presentation carried by one acknowledged pipeline output.

Marks an acknowledged presentation active only when its exact lease exists.

Drops only the exact candidate named by the frontend lifecycle event.

Resolves input only against the presentation currently declared visible.

Types

key()

@type key() :: {MingaEditor.Window.id(), pos_integer()}

t()

@type t() :: %MingaEditor.Renderer.TextPresentations{
  index: MingaEditor.Renderer.TextInteractionIndex.t(),
  leases: %{optional(key()) => MingaEditor.Renderer.TextPresentation.t()}
}

Functions

acknowledge(state, presentations)

@spec acknowledge(t(), [MingaEditor.Renderer.TextPresentation.t()]) :: t()

Retains acknowledged presentation candidates without changing visibility.

acknowledge_output(state, output)

@spec acknowledge_output(t(), MingaEditor.RenderPipeline.Input.t()) :: t()

Retains every presentation carried by one acknowledged pipeline output.

activate(state, window_id, presentation_id)

@spec activate(t(), MingaEditor.Window.id(), non_neg_integer()) ::
  {:ok, t()} | {:error, :unknown}

Marks an acknowledged presentation active only when its exact lease exists.

discard(state, window_id, presentation_id)

@spec discard(t(), MingaEditor.Window.id(), non_neg_integer()) :: t()

Drops only the exact candidate named by the frontend lifecycle event.

drop_buffer(state, buffer)

@spec drop_buffer(t(), pid()) :: t()

new()

@spec new() :: t()

reader(text_presentations)

reset(state)

@spec reset(t()) :: t()

resolve(state, event)

@spec resolve(t(), MingaEditor.Mouse.TextEvent.t()) ::
  {:ok, MingaEditor.Mouse.Target.Text.t()} | {:error, :inactive | atom()}

Resolves input only against the presentation currently declared visible.