MingaEditor.Shell.Traditional.ClickRegions (Minga v0.1.0)

Copy Markdown View Source

Pure owner of renderer-installed Traditional click regions.

Both region sets come from one correlated render receipt and are installed or reset together, preventing mouse hit testing from combining different frames.

Summary

Functions

Installs both region sets from one render observation.

Returns the modeline command under a rendered column.

Clears all regions when their render identity is no longer active.

Returns the tab-bar command under a rendered cell.

Types

t()

@type t() :: %MingaEditor.Shell.Traditional.ClickRegions{
  modeline: [MingaEditor.Shell.Traditional.Modeline.click_region()],
  tab_bar: [tab_bar_region()]
}

tab_bar_command()

@type tab_bar_command() ::
  atom() | {:workspace_goto, non_neg_integer()} | {:tab_goto_id, pos_integer()}

tab_bar_region()

@type tab_bar_region() ::
  {col_start :: non_neg_integer(), col_end :: non_neg_integer(),
   command :: tab_bar_command()}
  | {row :: non_neg_integer(), col_start :: non_neg_integer(),
     col_end :: non_neg_integer(), command :: tab_bar_command()}

Functions

install(regions, modeline, tab_bar)

Installs both region sets from one render observation.

modeline_command_at(click_regions, col)

@spec modeline_command_at(t(), non_neg_integer()) :: atom() | nil

Returns the modeline command under a rendered column.

reset(regions)

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

Clears all regions when their render identity is no longer active.

tab_bar_command_at(click_regions, row, col)

@spec tab_bar_command_at(t(), non_neg_integer(), non_neg_integer()) ::
  tab_bar_command() | nil

Returns the tab-bar command under a rendered cell.