ferroui-base 0.3.0

The base library of FerroUI: the property system, layout, input, styling, media, text, animation, data binding and the compositor
Documentation
//! Markup metadata of the types of this crate, declared apart from the
//! types themselves: enumerations, value types and their text forms,
//! contracts, plain classes and collections, and the `markup` part of the
//! classes of the object model.
//!
//! `enums.rs`, `classes.rs` and `named_values.rs` are generated by
//! `scripts/generate_markup_types.py` (hand-written members of classes are in
//! `scripts/markup_types_overrides.py`); the other files are written by hand.
//!
//! Everything here uses only the public interface of the types. A member
//! the managed original has and that is missing here is either not ported
//! or cannot be expressed with the current interface of its type.

use crate::data::core::ValueTypes;
use crate::metadata::MarkupType;

mod animation;
mod classes;
mod contracts;
mod enums;
mod named_values;
mod plain;
mod values;
mod well_known;

#[cfg(test)]
mod markup_types_tests;

/// The lists of the types declared in this module, by area.
pub(crate) const TYPE_LISTS: &[&[&MarkupType]] = 
    &[enums::TYPES, values::TYPES, named_values::TYPES, contracts::TYPES, plain::TYPES, classes::TYPES, well_known::TYPES, animation::TYPES];

/// Adds the types declared in this module to the process-wide table of
/// types with markup metadata. Called once by `register_types()`.
pub(crate) fn register() {
    for types in TYPE_LISTS {
        MarkupType::register_all(types);
    }
    ValueTypes::register_global(register_value_types);
}

/// Registers what the untyped value conversions need to know about the
/// types declared in this module (nullable forms, reference types). The
/// conversions are per thread: this runs on every thread, when the thread
/// next converts an untyped value ([`ValueTypes::register_global`]).
fn register_value_types() {
    enums::register_value_types();
    values::register_value_types();
    contracts::register_value_types();
    plain::register_value_types();
    classes::register_value_types();
    well_known::register_value_types();
    animation::register_value_types();
}