Skip to main content

Crate ferroui_base

Crate ferroui_base 

Source
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 Metadata namespace 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 Impl traits 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 markup part of ferro_class_info!; enumerations use ferro_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 Impl trait 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-metadata feature: 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. The Transition implementation 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 from UntypedBindingExpressionBase.
perf_count
Counts one occurrence of $counter (a variant of PerfCounter) on this thread. Without the feature perf-counters it 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 feature perf-counters it expands to the unit value: there is no code.

Structs§

AttachedProperty
An attached property: a styled property that is defined by one class and set on objects of another.
ClassBindingManager
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.
CornerRadius
Represents the radii of a rectangle’s corners.
DirectProperty
A direct property: a property whose value is stored in a field of its owner and accessed through a getter and an optional setter.
DirectPropertyBase
Base class for direct properties.
DirectPropertyMetadata
Metadata for direct properties.
DoNothingType
The type of the marker value that tells a binding target to do nothing.
ElementRef
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.
FerroInternalException
Exception signifying an internal logic error in the framework.
FerroLocator
A scoped service registry.
FerroObject
An object with FerroProperty support: the root of the class hierarchy.
FerroObjectVTable
The virtual table of FerroObject.
FerroProperty
Base class for properties: the untyped identity and description of a property that can be set on a FerroObject.
FerroPropertyChangedEventArgs
Provides information for a property change.
FerroPropertyMetadata
Metadata common to all property kinds.
FerroPropertyRegistry
Tracks registered property definitions.
Matrix
A 3x3 matrix.
MatrixDecomposed
The result of decomposing an affine Matrix into 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.
ObjectPropertyChangedObservable
The change notifications of one property on one object.
OwnedFerroPropertyChangedEventArgs
A property change held by value (FerroPropertyChangedEventArgs::to_owned_args): the object, the property and copies of the values in their untyped form.
PixelPoint
Represents a point in device pixels.
PixelRect
Represents a rectangle in device pixels. Integer arithmetic wraps on overflow.
PixelSize
Represents a size in device pixels.
PixelVector
Defines a vector in device pixels. Integer arithmetic wraps on overflow.
Point
Defines a point.
PropertyChangedObservable
The stream of change notifications of a property across all objects.
Rect
Defines a rectangle.
Ref
A strong reference to an object of class T or a class derived from it.
RegistrationHelper
Binds the service type T to an implementation; see FerroLocator::bind.
RelativePoint
Defines a point that may be defined relative to a containing element.
RelativeRect
Defines a rectangle that may be defined relative to a containing element.
RelativeScalar
Defines a scalar that may be defined relative to a containing element.
RenderTargetCorruptedException
The error a render target reports when it can no longer be drawn to and has to be created anew.
RenderTargetNotReadyException
The error a render target reports when it cannot be drawn to yet.
RoundedRect
Represents a rectangle with per-corner radii.
Size
Defines a size.
StyledElement
Extends an Animatable with the following features:
StyledElementVTable
The virtual table of the class.
StyledProperty
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.
StyledPropertyMetadata
Metadata for styled properties.
StyledPropertyOptions
Options for registering a styled or attached property.
Thickness
Describes the thickness of a frame around a rectangle.
TypeInfo
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.
UnsetValueType
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.
VisualTreeAttachmentEventArgs
Holds the event arguments for the attached_to_visual_tree and detached_from_visual_tree events.
VisualVTable
The virtual table of the class.
WeakRef
A weak reference to an object of class T or a class derived from it.

Enums§

InitializationError
Why the initialization of an object could not be completed (ISupportInitialize::try_end_init): what EndInit throws in the managed original.
RelativeUnit
Defines the reference point units of a RelativePoint or RelativeRect.

Traits§

AnyValue
A value of any property value type, for untyped access to properties.
ClassDefaults
What a type declares when it declares nothing: no default constructor, no interface casts, no properties and an empty static constructor.
FerroObjectExtensions
Extension members for FerroObject.
FerroObjectImpl
The overridable members of FerroObject.
FerroObjectImplExt
Access to the base implementations of the FerroObjectImpl members.
IDataContextProvider
Defines an element with a data context that can be used for binding.
IFerroDependencyResolver
Resolves services by type.
INamed
Objects implementing this contract and providing a value for name are registered in the relevant name scope when constructed in markup.
ISupportInitialize
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.
LocatorExtensions
Typed lookups for every IFerroDependencyResolver.
ObjectType
Implemented by every class.
PropertyValue
The bounds every property value type must satisfy.
Registrable
Property kinds that can be registered.
StaticType
A Rust type with an associated runtime TypeInfo.
StyledElementImpl
The overridable members introduced by the class.
StyledElementImplExt
Access to the base implementations of the overridable members.
Subclassable
Implemented by a class C for every class T that can derive from it: builds C’s part of the virtual table with T’s overrides.
TypedProperty
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.
VisualImpl
The overridable members introduced by the class.
VisualImplExt
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 constructed virtual member. The class (and its base classes) are initialised first if this is the first instance on the thread; see ObjectType::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§

BoxedValue
An untyped, shared property value. The contained value is always exactly of the property’s value type (or one of the marker types UnsetValueType and DoNothingType).
CoerceValueCallback
The coercion callback of a styled property.
NotifyingCallback
A callback invoked before and after a property change notification is raised on an object (true before, false after).
ServiceHandle
A type-erased service handle: an Rc<dyn Any> whose content is the Rc<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.