Struct sixtyfps_corelib::items::ItemVTable [−][src]
#[repr(C)]pub struct ItemVTable {
pub init: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, window: &WindowRc),
pub geometry: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>) -> Rect,
pub cached_rendering_data_offset: usize,
pub layouting_info: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, orientation: Orientation, window: &WindowRc) -> LayoutInfo,
pub input_event_filter_before_children: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: MouseEvent, window: &WindowRc, self_rc: &ItemRc) -> InputEventFilterResult,
pub input_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: MouseEvent, window: &WindowRc, self_rc: &ItemRc) -> InputEventResult,
pub focus_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: &FocusEvent, window: &WindowRc),
pub key_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: &KeyEvent, window: &WindowRc) -> KeyEventResult,
pub render: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, backend: &mut &'_ mut dyn ItemRenderer),
}
Expand description
Items are the nodes in the render tree.
Fields
init: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, window: &WindowRc)
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.
geometry: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>) -> Rect
Returns the geometry of this item (relative to its parent item)
cached_rendering_data_offset: usize
offset in bytes from the *const ItemImpl. isize::MAX means None
layouting_info: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, orientation: Orientation, window: &WindowRc) -> LayoutInfo
We would need max/min/preferred size, and all layout info
input_event_filter_before_children: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: MouseEvent, window: &WindowRc, self_rc: &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.
input_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: MouseEvent, window: &WindowRc, self_rc: &ItemRc) -> InputEventResult
Handle input event for mouse and touch event
focus_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: &FocusEvent, window: &WindowRc)
key_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: &KeyEvent, window: &WindowRc) -> KeyEventResult
render: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, backend: &mut &'_ mut dyn ItemRenderer)
Implementations
Create a vtable suitable for a given type implementing the trait.
Trait Implementations
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
Safety: must be a valid VTable for Self
type VTable = ItemVTable
type VTable = ItemVTable
That’s the VTable itself (so most likely Self)