pub trait View: Sealed {
fn print(&self, id: ViewID, cx: &mut Context);
fn process(
&self,
event: &Event,
id: ViewID,
cx: &mut Context,
vger: &mut VGER
);
fn draw(&self, id: ViewID, cx: &mut Context, vger: &mut VGER);
fn layout(
&self,
id: ViewID,
sz: LocalSize,
cx: &mut Context,
vger: &mut VGER
) -> LocalSize;
fn hittest(
&self,
id: ViewID,
pt: LocalPoint,
cx: &mut Context,
vger: &mut VGER
) -> Option<ViewID>;
fn commands(
&self,
id: ViewID,
cx: &mut Context,
cmds: &mut Vec<CommandInfo>
);
fn gc(&self, _id: ViewID, _cx: &mut Context, _map: &mut Vec<ViewID>);
fn access(
&self,
id: ViewID,
cx: &mut Context,
nodes: &mut Vec<Node>
) -> Option<NodeId>;
}
Expand description
Trait for the unit of UI composition.
Required methods
Processes an event.
Lays out subviews and return the size of the view.
Returns the topmost view which the point intersects.
Accumulates information about menu bar commands.