Struct i_slint_core::items::ItemVTable
source · [−]#[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 layout_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) -> FocusEventResult,
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, self_rc: &ItemRc) -> RenderingResult,
}
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
layout_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) -> FocusEventResult
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, self_rc: &ItemRc) -> RenderingResult
Implementations
sourceimpl 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
sourceimpl HasStaticVTable<ItemVTable> for Rectangle
impl HasStaticVTable<ItemVTable> for Rectangle
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for BorderRectangle
impl HasStaticVTable<ItemVTable> for BorderRectangle
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for BoxShadow
impl HasStaticVTable<ItemVTable> for BoxShadow
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for Text
impl HasStaticVTable<ItemVTable> for Text
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for TextInput
impl HasStaticVTable<ItemVTable> for TextInput
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for ImageItem
impl HasStaticVTable<ItemVTable> for ImageItem
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for ClippedImage
impl HasStaticVTable<ItemVTable> for ClippedImage
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for Path
impl HasStaticVTable<ItemVTable> for Path
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for TouchArea
impl HasStaticVTable<ItemVTable> for TouchArea
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for FocusScope
impl HasStaticVTable<ItemVTable> for FocusScope
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for Clip
impl HasStaticVTable<ItemVTable> for Clip
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for Opacity
impl HasStaticVTable<ItemVTable> for Opacity
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for Layer
impl HasStaticVTable<ItemVTable> for Layer
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for Rotate
impl HasStaticVTable<ItemVTable> for Rotate
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for Flickable
impl HasStaticVTable<ItemVTable> for Flickable
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl HasStaticVTable<ItemVTable> for WindowItem
impl HasStaticVTable<ItemVTable> for WindowItem
sourcefn static_vtable() -> &'static ItemVTable
fn static_vtable() -> &'static ItemVTable
Safety: must be a valid VTable for Self
sourceimpl VTableMeta for ItemVTable
impl VTableMeta for ItemVTable
type VTable = ItemVTable
type VTable = ItemVTable
That’s the VTable itself (so most likely Self)
Auto Trait Implementations
impl RefUnwindSafe for ItemVTable
impl Send for ItemVTable
impl Sync for ItemVTable
impl Unpin for ItemVTable
impl UnwindSafe for ItemVTable
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more