azul_core::ui_state

Struct UiState

Source
pub struct UiState {
    pub dom_id: DomId,
    pub dynamic_css_overrides: BTreeMap<NodeId, FastHashMap<DomString, CssProperty>>,
    pub tag_ids_to_hover_active_states: BTreeMap<TagId, (NodeId, HoverGroup)>,
    pub tab_index_tags: BTreeMap<TagId, (NodeId, TabIndex)>,
    pub draggable_tags: BTreeMap<TagId, NodeId>,
    pub tag_ids_to_node_ids: BTreeMap<TagId, NodeId>,
    pub node_ids_to_tag_ids: BTreeMap<NodeId, TagId>,
    pub hover_callbacks: BTreeMap<NodeId, BTreeMap<HoverEventFilter, (Callback, RefAny)>>,
    pub focus_callbacks: BTreeMap<NodeId, BTreeMap<FocusEventFilter, (Callback, RefAny)>>,
    pub not_callbacks: BTreeMap<NodeId, BTreeMap<NotEventFilter, (Callback, RefAny)>>,
    pub window_callbacks: BTreeMap<NodeId, BTreeMap<WindowEventFilter, (Callback, RefAny)>>,
    /* private fields */
}

Fields§

§dom_id: DomId

Unique identifier for the DOM

§dynamic_css_overrides: BTreeMap<NodeId, FastHashMap<DomString, CssProperty>>

The style properties that should be overridden for this frame, cloned from the Css

§tag_ids_to_hover_active_states: BTreeMap<TagId, (NodeId, HoverGroup)>

Stores all tags for nodes that need to activate on a :hover or :active event.

§tab_index_tags: BTreeMap<TagId, (NodeId, TabIndex)>

Tags -> Focusable nodes

§draggable_tags: BTreeMap<TagId, NodeId>

Tags -> Draggable nodes

§tag_ids_to_node_ids: BTreeMap<TagId, NodeId>

Tag IDs -> Node IDs

§node_ids_to_tag_ids: BTreeMap<NodeId, TagId>

Reverse of tag_ids_to_node_ids.

§hover_callbacks: BTreeMap<NodeId, BTreeMap<HoverEventFilter, (Callback, RefAny)>>§focus_callbacks: BTreeMap<NodeId, BTreeMap<FocusEventFilter, (Callback, RefAny)>>§not_callbacks: BTreeMap<NodeId, BTreeMap<NotEventFilter, (Callback, RefAny)>>§window_callbacks: BTreeMap<NodeId, BTreeMap<WindowEventFilter, (Callback, RefAny)>>

Implementations§

Source§

impl UiState

Source

pub const fn get_dom(&self) -> &CompactDom

Source§

impl UiState

Source

pub fn new(dom: Dom, parent_dom: Option<(DomId, NodeId)>) -> UiState

The UiState contains all the tags (for hit-testing) as well as the mapping from Hit-testing tags to NodeIds (which are important for filtering input events and routing input events to the callbacks).

Source

pub fn new_from_app_state<'a>( data: &RefAny, layout_info: LayoutInfo<'a>, parent_dom: Option<(DomId, NodeId)>, layout_callback: LayoutCallback, ) -> UiState

Source

pub fn create_tags_for_hover_nodes( &mut self, hover_nodes: &BTreeMap<NodeId, HoverGroup>, )

Source

pub fn scan_for_iframe_callbacks( &self, ) -> Vec<(NodeId, &(IFrameCallback, RefAny))>

Source

pub fn scan_for_gltexture_callbacks( &self, ) -> Vec<(NodeId, &(GlCallback, RefAny))>

Trait Implementations§

Source§

impl Debug for UiState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for UiState

§

impl !RefUnwindSafe for UiState

§

impl !Send for UiState

§

impl !Sync for UiState

§

impl Unpin for UiState

§

impl !UnwindSafe for UiState

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.