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 hittest(
&self,
id: ViewId,
pt: LocalPoint,
cx: &mut Context,
vger: &mut VGER
) -> Option<ViewId>;
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,
_region: &mut Region<WorldSpace>
) { ... }
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
Lays out subviews and return the size of the view.
Provided Methods
Processes an event.
fn dirty(
&self,
_id: ViewId,
_xform: LocalToWorld,
_cx: &mut Context,
_region: &mut Region<WorldSpace>
)
fn dirty(
&self,
_id: ViewId,
_xform: LocalToWorld,
_cx: &mut Context,
_region: &mut Region<WorldSpace>
)
Determines dirty regions which need repainting.
Accumulates information about menu bar commands.