#[repr(C)]pub struct ItemVTable {
pub init: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, my_item: &ItemRc),
pub cached_rendering_data_offset: usize,
pub layout_info: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, orientation: Orientation, window_adapter: &WindowAdapterRc) -> LayoutInfo,
pub input_event_filter_before_children: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: MouseEvent, window_adapter: &WindowAdapterRc, self_rc: &ItemRc) -> InputEventFilterResult,
pub input_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: MouseEvent, window_adapter: &WindowAdapterRc, self_rc: &ItemRc) -> InputEventResult,
pub focus_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: &FocusEvent, window_adapter: &WindowAdapterRc, self_rc: &ItemRc) -> FocusEventResult,
pub key_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: &KeyEvent, window_adapter: &WindowAdapterRc, self_rc: &ItemRc) -> KeyEventResult,
pub render: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, backend: &mut &'_ mut dyn ItemRenderer, self_rc: &ItemRc, size: LogicalSize) -> RenderingResult,
}
Expand description
Items are the nodes in the render tree.
Fields§
§init: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, my_item: &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.
cached_rendering_data_offset: usize
offset in bytes from the *const ItemImpl. isize::MAX means None
layout_info: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, orientation: Orientation, window_adapter: &WindowAdapterRc) -> 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_adapter: &WindowAdapterRc, 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_adapter: &WindowAdapterRc, self_rc: &ItemRc) -> InputEventResult
Handle input event for mouse and touch event
focus_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: &FocusEvent, window_adapter: &WindowAdapterRc, self_rc: &ItemRc) -> FocusEventResult
§key_event: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, _: &KeyEvent, window_adapter: &WindowAdapterRc, self_rc: &ItemRc) -> KeyEventResult
§render: unsafe extern "C" fn(_: Pin<VRef<'_, ItemVTable>>, backend: &mut &'_ mut dyn ItemRenderer, self_rc: &ItemRc, size: LogicalSize) -> RenderingResult
Implementations§
Source§impl ItemVTable
impl ItemVTable
Sourcepub fn new<T: Item + ItemConsts>() -> Self
pub fn new<T: Item + ItemConsts>() -> Self
Create a vtable suitable for a given type implementing the trait.
Trait Implementations§
Source§impl HasStaticVTable<ItemVTable> for BasicBorderRectangle
impl HasStaticVTable<ItemVTable> for BasicBorderRectangle
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for BorderRectangle
impl HasStaticVTable<ItemVTable> for BorderRectangle
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for BoxShadow
impl HasStaticVTable<ItemVTable> for BoxShadow
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for Clip
impl HasStaticVTable<ItemVTable> for Clip
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for ClippedImage
impl HasStaticVTable<ItemVTable> for ClippedImage
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for ComplexText
impl HasStaticVTable<ItemVTable> for ComplexText
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for ComponentContainer
impl HasStaticVTable<ItemVTable> for ComponentContainer
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for ContextMenu
impl HasStaticVTable<ItemVTable> for ContextMenu
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for Empty
impl HasStaticVTable<ItemVTable> for Empty
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for Flickable
impl HasStaticVTable<ItemVTable> for Flickable
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for FocusScope
impl HasStaticVTable<ItemVTable> for FocusScope
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for ImageItem
impl HasStaticVTable<ItemVTable> for ImageItem
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for Layer
impl HasStaticVTable<ItemVTable> for Layer
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for Opacity
impl HasStaticVTable<ItemVTable> for Opacity
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for Path
impl HasStaticVTable<ItemVTable> for Path
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for Rectangle
impl HasStaticVTable<ItemVTable> for Rectangle
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for Rotate
impl HasStaticVTable<ItemVTable> for Rotate
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for SimpleText
impl HasStaticVTable<ItemVTable> for SimpleText
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for SwipeGestureHandler
impl HasStaticVTable<ItemVTable> for SwipeGestureHandler
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for TextInput
impl HasStaticVTable<ItemVTable> for TextInput
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for TouchArea
impl HasStaticVTable<ItemVTable> for TouchArea
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl HasStaticVTable<ItemVTable> for WindowItem
impl HasStaticVTable<ItemVTable> for WindowItem
Source§fn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
Source§impl VTableMeta for ItemVTable
impl VTableMeta for ItemVTable
Auto Trait Implementations§
impl Freeze for ItemVTable
impl RefUnwindSafe for ItemVTable
impl Send for ItemVTable
impl Sync for ItemVTable
impl Unpin for ItemVTable
impl UnwindSafe for ItemVTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more