Struct i_slint_core::component::ComponentVTable
source · pub struct ComponentVTable {Show 14 fields
pub visit_children_item: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: isize, order: TraversalOrder, visitor: VRefMut<'_, ItemVisitorVTable>) -> VisitChildrenResult,
pub get_item_ref: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: usize) -> Pin<VRef<'_, ItemVTable>>,
pub get_subtree_range: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: usize) -> IndexRange,
pub get_subtree_component: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: usize, subindex: usize, result: &mut VWeak<ComponentVTable, Dyn>),
pub get_item_tree: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>) -> Slice<'_, ItemTreeNode>,
pub parent_node: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, result: &mut ItemWeak),
pub embed_component: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, parent_component: &VWeak<ComponentVTable>, parent_item_tree_index: usize) -> bool,
pub subtree_index: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>) -> usize,
pub layout_info: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, _: Orientation) -> LayoutInfo,
pub accessible_role: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, item_index: usize) -> AccessibleRole,
pub accessible_string_property: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, item_index: usize, what: AccessibleStringProperty, result: &mut SharedString),
pub window_adapter: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, do_create: bool, result: &mut Option<WindowAdapterRc>),
pub drop_in_place: unsafe extern "C" fn(_: VRefMut<'_, ComponentVTable>) -> Layout,
pub dealloc: unsafe extern "C" fn(_: &ComponentVTable, ptr: *mut u8, layout: Layout),
}Expand description
A Component is representing an unit that is allocated together
Fields§
§visit_children_item: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: isize, order: TraversalOrder, visitor: VRefMut<'_, ItemVisitorVTable>) -> VisitChildrenResultVisit the children of the item at index index.
Note that the root item is at index 0, so passing 0 would visit the item under root (the children of root).
If you want to visit the root item, you need to pass -1 as an index.
get_item_ref: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: usize) -> Pin<VRef<'_, ItemVTable>>Return a reference to an item using the given index
get_subtree_range: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: usize) -> IndexRangeReturn the range of indices below the dynamic ItemTreeNode at index
get_subtree_component: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, index: usize, subindex: usize, result: &mut VWeak<ComponentVTable, Dyn>)Return the ComponentRc at subindex below the dynamic ItemTreeNode at index
get_item_tree: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>) -> Slice<'_, ItemTreeNode>Return the item tree that is defined by this Component.
The return value is an item weak because it can be null if there is no parent.
And the return value is passed by &mut because ItemWeak has a destructor
parent_node: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, result: &mut ItemWeak)Return the node this component is a part of in the parent component.
The return value is an item weak because it can be null if there is no parent. And the return value is passed by &mut because ItemWeak has a destructor Note that the returned value will typically point to a repeater node, which is strictly speaking not an Item at all!
embed_component: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, parent_component: &VWeak<ComponentVTable>, parent_item_tree_index: usize) -> boolThis embeds this component into the item tree of another component
Returns true if this component was embedded into the parent_component
at parent_item_tree_index.
subtree_index: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>) -> usizeReturn the index of the current subtree or usize::MAX if this is not a subtree
layout_info: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, _: Orientation) -> LayoutInfoReturns the layout info for this component
accessible_role: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, item_index: usize) -> AccessibleRoleReturns the accessible role for a given item
accessible_string_property: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, item_index: usize, what: AccessibleStringProperty, result: &mut SharedString)Returns the accessible property
window_adapter: unsafe extern "C" fn(_: Pin<VRef<'_, ComponentVTable>>, do_create: bool, result: &mut Option<WindowAdapterRc>)Returns a Window, creating a fresh one if do_create is true.
drop_in_place: unsafe extern "C" fn(_: VRefMut<'_, ComponentVTable>) -> Layoutin-place destructor (for VRc)
dealloc: unsafe extern "C" fn(_: &ComponentVTable, ptr: *mut u8, layout: Layout)dealloc function (for VRc)