pub trait Item {
// Required methods
fn init(self: Pin<&Self>, _1: &ItemRc);
fn layout_info(
self: Pin<&Self>,
_1: Orientation,
_2: &WindowAdapterRc,
) -> LayoutInfo;
fn input_event_filter_before_children(
self: Pin<&Self>,
_1: MouseEvent,
_2: &WindowAdapterRc,
_3: &ItemRc,
) -> InputEventFilterResult;
fn input_event(
self: Pin<&Self>,
_1: MouseEvent,
_2: &WindowAdapterRc,
_3: &ItemRc,
) -> InputEventResult;
fn focus_event(
self: Pin<&Self>,
_1: &FocusEvent,
_2: &WindowAdapterRc,
_3: &ItemRc,
) -> FocusEventResult;
fn key_event(
self: Pin<&Self>,
_1: &KeyEvent,
_2: &WindowAdapterRc,
_3: &ItemRc,
) -> KeyEventResult;
fn render(
self: Pin<&Self>,
_1: &mut &'_ mut dyn ItemRenderer,
_2: &ItemRc,
_3: LogicalSize,
) -> RenderingResult;
}
Expand description
Items are the nodes in the render tree.
Note: Was generated from the #[vtable]
macro on ItemVTable
Required Methods§
Sourcefn init(self: Pin<&Self>, _1: &ItemRc)
fn init(self: Pin<&Self>, _1: &ItemRc)
This function is called by the run-time after the memory for the item has been allocated and initialized. It will be called before any user specified bindings are set.
Sourcefn layout_info(
self: Pin<&Self>,
_1: Orientation,
_2: &WindowAdapterRc,
) -> LayoutInfo
fn layout_info( self: Pin<&Self>, _1: Orientation, _2: &WindowAdapterRc, ) -> LayoutInfo
We would need max/min/preferred size, and all layout info
Sourcefn input_event_filter_before_children(
self: Pin<&Self>,
_1: MouseEvent,
_2: &WindowAdapterRc,
_3: &ItemRc,
) -> InputEventFilterResult
fn input_event_filter_before_children( self: Pin<&Self>, _1: MouseEvent, _2: &WindowAdapterRc, _3: &ItemRc, ) -> InputEventFilterResult
Event handler for mouse and touch event. This function is called before being called on children.
Then, depending on the return value, it is called for the children, and their children, then
Self::input_event
is called on the children, and finally Self::input_event
is called
on this item again.
Sourcefn input_event(
self: Pin<&Self>,
_1: MouseEvent,
_2: &WindowAdapterRc,
_3: &ItemRc,
) -> InputEventResult
fn input_event( self: Pin<&Self>, _1: MouseEvent, _2: &WindowAdapterRc, _3: &ItemRc, ) -> InputEventResult
Handle input event for mouse and touch event