i_slint_core::items

Struct ItemVTable

Source
#[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

Source

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

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for BorderRectangle

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for BoxShadow

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for Clip

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for ClippedImage

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for ComplexText

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for ComponentContainer

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for ContextMenu

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for Empty

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for Flickable

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for FocusScope

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for ImageItem

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for Layer

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for Opacity

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for Path

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for Rectangle

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for Rotate

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for SimpleText

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for SwipeGestureHandler

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for TextInput

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for TouchArea

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl HasStaticVTable<ItemVTable> for WindowItem

Source§

fn static_vtable() -> &'static ItemVTable

Safety: must be a valid VTable for Self
Source§

impl VTableMeta for ItemVTable

Source§

type VTable = ItemVTable

That’s the VTable itself (so most likely Self)
Source§

type Target = ItemTO

That’s the trait object that implements the functions Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.