pub trait View: Sealed + 'static {
fn print(&self, id: ViewId, cx: &mut Context);
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 tid(&self) -> TypeId { ... }
fn process(
&self,
_event: &Event,
_id: ViewId,
_cx: &mut Context,
_vger: &mut Vger
) { ... }
fn dirty(&self, _id: ViewId, _xform: LocalToWorld, _cx: &mut Context) { ... }
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> { ... }
fn is_flexible(&self) -> bool { ... }
}
Expand description
Trait for the unit of UI composition.
Required Methods
Provided Methods
Processes an event.
fn dirty(&self, _id: ViewId, _xform: LocalToWorld, _cx: &mut Context)
fn dirty(&self, _id: ViewId, _xform: LocalToWorld, _cx: &mut Context)
Determines dirty regions which need repainting.
Returns the topmost view which the point intersects.
Accumulates information about menu bar commands.
Builds an AccessKit tree. The node ID for the subtree is returned. All generated nodes are accumulated.
fn is_flexible(&self) -> bool
fn is_flexible(&self) -> bool
For detecting flexible sized things in stacks.