Expand description
FerroUI base library: the object model, property system, layout, input, media and rendering contracts shared by every other FerroUI crate.
Re-exports§
pub use metadata::IServiceProvider;pub use type_system::instantiate;pub use type_system::ClassDefaults;pub use type_system::IntoRef;pub use type_system::Nullable;pub use type_system::ObjectType;pub use type_system::Ref;pub use type_system::StaticType;pub use type_system::Subclassable;pub use type_system::TypeInfo;pub use type_system::Upcast;pub use type_system::WeakRef;
Modules§
- animation
- Animations and transitions.
- collections
- Observable collections.
- controls
- Control-related base types that live in the base library: style classes, name scopes and resources.
- data
- Data binding.
- diagnostics
- Diagnostics of the object model: what the developer tools and tests read about the state of a property on an object.
- ferro_
thread_ local - Thread-local variables for every target (
ferroui_system::ferro_thread_local): the module and the macro, at the paths they had when they were defined here. Thread-local variables that do not take a key of the C library each. - input
- The input system: input elements, routed input events, input devices and focus.
- interactivity
- Routed events: events that travel through the visual tree by tunnelling from the root to the source, bubbling from the source to the root, or going directly to the source.
- layout
- The layout system: measure/arrange and the layout manager.
- logging
- Logging: a process-wide sink that the framework writes diagnostic events to, filtered by level and area.
- logical_
tree - The logical tree.
- media
- Colors, brushes, geometry, text and drawing.
- metadata
- Metadata of types for markup and other untyped code: the counterpart of
the attribute classes of the managed original’s
Metadatanamespace and of the reflection data they annotate. - numerics
- Single-precision vector, quaternion and matrix value types used by the composition engine. They follow the semantics of the reference runtime’s numerics library (row vectors, row-major matrices, right-handed rotations).
- platform
- Platform abstraction contracts and their managed default implementations.
- reactive
- Lightweight reactive primitives: observables, observers and disposables.
- rendering
- Rendering contracts: the renderer of a visual tree and the presentation source that hosts one.
- styling
- Styling: styles, selectors, setters, control themes, theme variants and container queries.
- threading
- The dispatcher: the per-thread work queue that everything UI-related runs on, and the one place where other threads can hand work to a UI thread.
- utilities
- Internal and public helper types.
- visual_
tree - Helpers for traversing and querying the visual tree.
Macros§
- ferro_
class - Declares a class.
- ferro_
class_ info - Declares the facts about a class that untyped code (markup, untyped bindings) needs and cannot derive: its default constructor, the interface handles its handle converts to and its markup metadata. Every part is optional; the parts may be written in any order.
- ferro_
impl_ classes - Implements class
Impltraits with no overrides. - ferro_
markup_ enum - Declares the markup metadata of an enumeration: its members by name.
- ferro_
markup_ type - Declares the markup metadata of a type that is not a class of the object
model: a value type, a plain shared (reference) type, a contract, or a
type of another crate. (Classes state theirs in the
markuppart offerro_class_info!; enumerations useferro_markup_enum!.) - ferro_
model - Declares a model type: gives it identity equality (so shared instances can travel through bindings and be stored in properties) and its binding metadata.
- ferro_
overrides - Implements a class
Impltrait and states which of its members the implementation overrides: the ones written in the block. - ferro_
properties - Declares the property definitions of a type: the accessors, as
ferro_property!declares them one by one, and their registration as part of the static initialisation of the type. - ferro_
property - Declares the accessor of a single property definition.
- ferro_
routed_ event - Declares the accessor of a routed event definition.
- ferro_
routed_ event_ args - Declares a routed event args type derived from another one.
- ferro_
rust_ paths - Without the
compiler-metadatafeature:register_rust_paths()records nothing and the tables do not exist (see the other definition). - ferro_
static_ type - Declares the runtime type of a type that is not a class: a type that owns attached properties and cannot be instantiated as an object.
- ferro_
thread_ local - Thread-local variables for every target (
ferroui_system::ferro_thread_local): the module and the macro, at the paths they had when they were defined here. Declares thread-local variables:std::thread_local!on targets with thread-local statics, a slot of the table of the thread on Android (see the module). - ferro_
transition_ class - Declares a transition class for properties of the given value type:
the class struct deriving from
TransitionBase, its constructors and the override that applies it. TheTransitionimplementation supplies the values. - impl_
untyped_ binding_ expression - Implements the value entry, disposable and binding expression traits for
a type that implements
UntypedBindingExpression: what makes the type a binding expression class deriving fromUntypedBindingExpressionBase. - perf_
count - Counts one occurrence of
$counter(a variant ofPerfCounter) on this thread. Without the featureperf-countersit only names the counter, so that a misspelt one does not compile: there is no code. - perf_
count_ virtual - Counts one virtual call of the member
$member(a string literal,"Class::member") on this thread. Without the featureperf-countersit expands to the unit value: there is no code.
Structs§
- Attached
Property - An attached property: a styled property that is defined by one class and set on objects of another.
- Class
Binding Manager - Implements bindings to individual style classes of an element
(
Classes.name="{Binding ...}"): each class gets an intermediate boolean property whose value adds or removes the class. - Corner
Radius - Represents the radii of a rectangle’s corners.
- Direct
Property - A direct property: a property whose value is stored in a field of its owner and accessed through a getter and an optional setter.
- Direct
Property Base - Base class for direct properties.
- Direct
Property Metadata - Metadata for direct properties.
- DoNothing
Type - The type of the marker value that tells a binding target to do nothing.
- Element
Ref - A reference to an element that the holder does not own: the value type of properties such as a placement target, the target of a label or the element an adorner adorns.
- Ferro
Internal Exception - Exception signifying an internal logic error in the framework.
- Ferro
Locator - A scoped service registry.
- Ferro
Object - An object with
FerroPropertysupport: the root of the class hierarchy. - Ferro
ObjectV Table - The virtual table of
FerroObject. - Ferro
Property - Base class for properties: the untyped identity and description of a
property that can be set on a
FerroObject. - Ferro
Property Changed Event Args - Provides information for a property change.
- Ferro
Property Metadata - Metadata common to all property kinds.
- Ferro
Property Registry - Tracks registered property definitions.
- Matrix
- A 3x3 matrix.
- Matrix
Decomposed - The result of decomposing an affine
Matrixinto its components. - Nullable
- An optional object reference accepted by setters, convertible from a
handle (or a borrowed handle) of any derived class and from
None. - Object
Property Changed Observable - The change notifications of one property on one object.
- Owned
Ferro Property Changed Event Args - A property change held by value
(
FerroPropertyChangedEventArgs::to_owned_args): the object, the property and copies of the values in their untyped form. - Pixel
Point - Represents a point in device pixels.
- Pixel
Rect - Represents a rectangle in device pixels. Integer arithmetic wraps on overflow.
- Pixel
Size - Represents a size in device pixels.
- Pixel
Vector - Defines a vector in device pixels. Integer arithmetic wraps on overflow.
- Point
- Defines a point.
- Property
Changed Observable - The stream of change notifications of a property across all objects.
- Rect
- Defines a rectangle.
- Ref
- A strong reference to an object of class
Tor a class derived from it. - Registration
Helper - Binds the service type
Tto an implementation; seeFerroLocator::bind. - Relative
Point - Defines a point that may be defined relative to a containing element.
- Relative
Rect - Defines a rectangle that may be defined relative to a containing element.
- Relative
Scalar - Defines a scalar that may be defined relative to a containing element.
- Render
Target Corrupted Exception - The error a render target reports when it can no longer be drawn to and has to be created anew.
- Render
Target NotReady Exception - The error a render target reports when it cannot be drawn to yet.
- Rounded
Rect - Represents a rectangle with per-corner radii.
- Size
- Defines a size.
- Styled
Element - Extends an
Animatablewith the following features: - Styled
ElementV Table - The virtual table of the class.
- Styled
Property - A styled property: a property whose value is held by the property store and can come from local values, styles, templates, animations, bindings and inheritance, resolved by priority.
- Styled
Property Metadata - Metadata for styled properties.
- Styled
Property Options - Options for registering a styled or attached property.
- Thickness
- Describes the thickness of a frame around a rectangle.
- Type
Info - Describes a class (or a non-instantiable type that owns attached properties): its name, where it is declared, its base class, how to initialise it and how to create an instance of it.
- Unset
Value Type - The type of the marker value that represents an unset property value.
- Vector
- Defines a vector.
- Vector3D
- 3D vector with double-precision components.
- Visual
- Base class for controls that provides rendering and related visual properties.
- Visual
Tree Attachment Event Args - Holds the event arguments for the
attached_to_visual_treeanddetached_from_visual_treeevents. - VisualV
Table - The virtual table of the class.
- WeakRef
- A weak reference to an object of class
Tor a class derived from it.
Enums§
- Initialization
Error - Why the initialization of an object could not be completed
(
ISupportInitialize::try_end_init): whatEndInitthrows in the managed original. - Relative
Unit - Defines the reference point units of a
RelativePointorRelativeRect.
Traits§
- AnyValue
- A value of any property value type, for untyped access to properties.
- Class
Defaults - What a type declares when it declares nothing: no default constructor, no interface casts, no properties and an empty static constructor.
- Ferro
Object Extensions - Extension members for
FerroObject. - Ferro
Object Impl - The overridable members of
FerroObject. - Ferro
Object Impl Ext - Access to the base implementations of the
FerroObjectImplmembers. - IData
Context Provider - Defines an element with a data context that can be used for binding.
- IFerro
Dependency Resolver - Resolves services by type.
- INamed
- Objects implementing this contract and providing a value for
nameare registered in the relevant name scope when constructed in markup. - ISupport
Initialize - Specifies that an object supports a simple, transacted notification for batch initialization: the counterpart of the component model contract of the same name, which markup calls around the initialization of an object.
- IntoRef
- A non-optional object reference accepted by methods, convertible from a handle (or a borrowed handle) of any derived class.
- Locator
Extensions - Typed lookups for every
IFerroDependencyResolver. - Object
Type - Implemented by every class.
- Property
Value - The bounds every property value type must satisfy.
- Registrable
- Property kinds that can be registered.
- Static
Type - A Rust type with an associated runtime
TypeInfo. - Styled
Element Impl - The overridable members introduced by the class.
- Styled
Element Impl Ext - Access to the base implementations of the overridable members.
- Subclassable
- Implemented by a class
Cfor every classTthat can derive from it: buildsC’s part of the virtual table withT’s overrides. - Typed
Property - A property with a statically known value type: a styled, attached or direct property.
- Upcast
- Access to the embedded base-class data of an object.
- Visual
Impl - The overridable members introduced by the class.
- Visual
Impl Ext - Access to the base implementations of the overridable members.
Functions§
- instantiate
- Moves a constructed class value to the heap, attaches the virtual table of
its class and runs the
constructedvirtual member. The class (and its base classes) are initialised first if this is the first instance on the thread; seeObjectType::register_class. - register_
types - Registers the namespaces and the types of this crate with the table of
known types (
TypeInfo::find). Cheap and idempotent; nothing is initialised until a type is used or looked into. - to_
binding - Converts an observable to a binding (
source.ToBinding()).
Type Aliases§
- Boxed
Value - An untyped, shared property value. The contained value is always exactly
of the property’s value type (or one of the marker types
UnsetValueTypeandDoNothingType). - Coerce
Value Callback - The coercion callback of a styled property.
- Notifying
Callback - A callback invoked before and after a property change notification is
raised on an object (
truebefore,falseafter). - Service
Handle - A type-erased service handle: an
Rc<dyn Any>whose content is theRc<TService>handle of the service. Boxing the handle rather than the service is what lets trait objects (Rc<dyn IFoo>) be stored and recovered with their exact type.