pub(super) struct Ui<'a, 'p, M: Module> {
pub(super) emitter: &'a mut Emitter<M>,
pub(super) shared: &'a mut Shared<'p>,
}Fields§
§emitter: &'a mut Emitter<M>Implementations§
Source§impl<M: Module> Ui<'_, '_, M>
impl<M: Module> Ui<'_, '_, M>
A menu’s entries, whose items’ actions see aliases, as a context menu’s do.
Source§impl<M: Module> Ui<'_, '_, M>
impl<M: Module> Ui<'_, '_, M>
pub(super) fn list( &mut self, blob: Blob, len: usize, ) -> Result<List, CodegenError>
pub(super) fn frame_types( &mut self, frame: &Frame<'_>, ) -> Result<List, CodegenError>
Sourcefn templates(
&mut self,
frame: &mut Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
nodes: &Nodes,
) -> Result<List, CodegenError>
fn templates( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, nodes: &Nodes, ) -> Result<List, CodegenError>
Emits nodes as an array of templates.
fn template( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, node: &Node, slot: &mut Slot<'_>, ) -> Result<TemplateKind, CodegenError>
Sourcefn control(
&mut self,
frame: &mut Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
node: &Node,
slot: &mut Slot<'_>,
) -> Result<TemplateKind, CodegenError>
fn control( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, node: &Node, slot: &mut Slot<'_>, ) -> Result<TemplateKind, CodegenError>
A control’s template: the functions behind what it shows and edits.
Sourcefn display(
&mut self,
frame: &mut Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
node: &Node,
slot: &mut Slot<'_>,
) -> Result<TemplateKind, CodegenError>
fn display( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, node: &Node, slot: &mut Slot<'_>, ) -> Result<TemplateKind, CodegenError>
A control that only shows something.
Sourcefn input(
&mut self,
frame: &mut Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
node: &Node,
slot: &mut Slot<'_>,
) -> Result<TemplateKind, CodegenError>
fn input( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, node: &Node, slot: &mut Slot<'_>, ) -> Result<TemplateKind, CodegenError>
A control the user works: the functions behind what it shows, edits and runs.
Sourcefn for_region(
&mut self,
frame: &mut Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
head: &Loop,
body: &Nodes,
slot: &mut Slot<'_>,
) -> Result<(), CodegenError>
fn for_region( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, head: &Loop, body: &Nodes, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>
Shows body once for each item head loops over.
A button’s title, whether it is selected if it shows that, and its action.
Sourcefn if_region(
&mut self,
frame: &mut Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
branches: &[(Rc<Expr>, Nodes)],
otherwise: &Nodes,
slot: &mut Slot<'_>,
) -> Result<(), CodegenError>
fn if_region( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, branches: &[(Rc<Expr>, Nodes)], otherwise: &Nodes, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>
Shows the first branch whose condition holds, or else otherwise, which is the
last list.
Sourcefn for_value(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
head: &Loop,
list: &Expr,
) -> Result<FuncId, CodegenError>
fn for_value( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, head: &Loop, list: &Expr, ) -> Result<FuncId, CodegenError>
Shows the body once per item of a copy of the list, with the item in the loop’s item.
Sourcefn for_range(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
local: LocalId,
start: &Expr,
end: &Expr,
) -> Result<FuncId, CodegenError>
fn for_range( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, local: LocalId, start: &Expr, end: &Expr, ) -> Result<FuncId, CodegenError>
Shows the body once per count from start up to, but not including, end, with the
count in local.
Sourcefn for_place(
&mut self,
frame: &mut Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
head: &Loop,
place: &Place,
nodes: &Nodes,
) -> Result<(FuncId, List), CodegenError>
fn for_place( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, head: &Loop, place: &Place, nodes: &Nodes, ) -> Result<(FuncId, List), CodegenError>
Shows the body once per item of the list at place, through an alias whose list
positions are kept in extra frame slots.
Sourcefn view(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
view: ViewId,
args: &[Expr],
) -> Result<FuncId, CodegenError>
fn view( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, view: ViewId, args: &[Expr], ) -> Result<FuncId, CodegenError>
Shows the view’s body in a new frame holding its arguments.
Sourcefn function(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
extra: bool,
build: impl FnOnce(&mut Body<'_, '_, '_, M>, Value) -> Result<(), CodegenError>,
) -> Result<FuncId, CodegenError>
fn function( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, extra: bool, build: impl FnOnce(&mut Body<'_, '_, '_, M>, Value) -> Result<(), CodegenError>, ) -> Result<FuncId, CodegenError>
A function the runtime calls with the context, the template’s frame, and extra
if there is one. It returns true where build leaves it.
Sourcefn expansion(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
build: impl FnOnce(&mut Body<'_, '_, '_, M>, Value) -> Result<(), CodegenError>,
) -> Result<FuncId, CodegenError>
fn expansion( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, build: impl FnOnce(&mut Body<'_, '_, '_, M>, Value) -> Result<(), CodegenError>, ) -> Result<FuncId, CodegenError>
A region’s expansion, which tells the sink it’s given what the region shows.
Sourcefn shown(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
shown: &Dynamic,
slot: &mut Slot<'_>,
field: usize,
) -> Result<(), CodegenError>
fn shown( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, shown: &Dynamic, slot: &mut Slot<'_>, field: usize, ) -> Result<(), CodegenError>
The function that works out shown, put in the template’s field at offset field.
Sourcefn value(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
shown: &Dynamic,
) -> Result<FuncId, CodegenError>
fn value( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, shown: &Dynamic, ) -> Result<FuncId, CodegenError>
Writes what the UI shows, owned, to the pointer it’s given.
pub(super) fn action( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, action: &Stmts, ) -> Result<FuncId, CodegenError>
Sourcefn optional_action(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
action: Option<&Stmts>,
slot: &mut Slot<'_>,
) -> Result<(), CodegenError>
fn optional_action( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, action: Option<&Stmts>, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>
The action of a control that may have one, such as a text field’s on Return.
Sourcefn binding(
&mut self,
frame: &Frame<'_>,
aliases: &HashMap<LocalId, Alias>,
binding: &Binding,
slot: &mut Slot<'_>,
) -> Result<(), CodegenError>
fn binding( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, binding: &Binding, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>
The functions that read a binding’s place, and write the user’s edits to it.