ferroui-base 0.1.0

The base library of FerroUI: the property system, layout, input, styling, media, text, animation, data binding and the compositor
Documentation
// @generated by scripts/generate_composition.py — do not edit

//! The composition object model generated from the composition schema.
//!
//! Upstream generates C# partial classes and completes them by hand in the
//! other half of each partial class. Here the generated half of a schema class
//! `X` is a pair of *property blocks* that the hand-written class embeds, and a
//! pair of *hook traits* through which the block calls back into that class:
//!
//! | Upstream (generated)                         | Here                                   |
//! |----------------------------------------------|----------------------------------------|
//! | `enum XChangedFields`                        | `XChangedFields` (bit flags)           |
//! | fields, properties, `InitializeDefaults`, `SerializeChangesCore`, `StartAnimation` of `X` | `XProps` |
//! | `partial void` methods of `X`                | `XHooks` (default: do nothing)         |
//! | fields, properties, `DeserializeChangesCore`, `GetCompositionProperty`, `SerializeAllChanges` of `ServerX` | `ServerXProps` |
//! | `partial void` methods of `ServerX`          | `ServerXHooks` (default: do nothing)   |
//! | `static CompositionProperty<T> s_IdOfPProperty` | `ServerXProps::id_of_p_property()`  |
//!
//! A `ServerOnly` class has no `XProps`; its UI-thread side is a media class
//! that calls `ServerXProps::serialize_all_changes`.
//!
//! # Embedding the UI-thread block
//!
//! The class holds an `XProps` (created with `XProps::new()`), implements
//! `ICompositionObjectHost` (registering for serialization, the id of its
//! server object, pending and implicit animations) and `XHooks`, and
//!
//! * calls `props.initialize_defaults(self)` where the upstream constructor
//!   calls `InitializeDefaults()` (use `initialize_own_defaults` when the
//!   constructor chain is customised);
//! * exposes the properties by forwarding to `props.p()` /
//!   `props.set_p(self, value)`; the setter raises the hooks, marks the field
//!   changed, registers the object and handles implicit animations exactly as
//!   the upstream setter does;
//! * forwards `ICompositorSerializable::serialize_changes` to
//!   `props.serialize_changes_core(self, writer)` and `StartAnimation` to
//!   `props.start_animation(self, name, animation, final_value)` (a `false`
//!   result means the property is unknown to the generated classes).
//!
//! # Embedding the server block
//!
//! The class holds a `ServerXProps`, implements `IServerPropertyHost` (or
//! `IServerAnimatedPropertyHost` when it derives from the animatable server
//! object) and `ServerXHooks`, and
//!
//! * forwards `IServerObject::deserialize_changes_core` to
//!   `props.deserialize_changes_core(self, reader, committed_at)`;
//! * returns `props.find_props(type_id)` from `IServerObject::get_props`, which
//!   is how composition properties reach the fields of the block;
//! * exposes the properties by forwarding to `props.p()` /
//!   `props.set_p(self, value)`.
//!
//! `IServerPropertyHost::set_value` is upstream's `SetValue(prop, ref field,
//! value)`: the block hands the class the assignment and the class decides what
//! surrounds it (nothing, animation subscriptions, or the observer bookkeeping
//! of a render resource).
//!
//! # Inheritance
//!
//! A class whose base class is generated embeds the block of the base
//! (`props.base()`), its hook trait extends the hook trait of the base, and its
//! `serialize_changes_core` / `deserialize_changes_core` run the base first, as
//! `base.SerializeChangesCore` does upstream. A class whose base is written by
//! hand (a `Manual` class of the schema, or a `ServerBase` that is not
//! generated) has a required hook instead, `base_serialize_changes_core` /
//! `base_deserialize_changes_core`, called at the same point.
//!
//! # Types
//!
//! Composition objects referenced by a property are held as
//! `Rc<dyn ICompositionObject>` on the UI thread and cross as the id of their
//! server object; the server block holds the resolved `Rc<dyn IServerObject>`.
//! Brushes and transforms are `BatchResource` values on the UI thread (the
//! value itself or the id of its server-side counterpart) and
//! `ServerResourceRef` values on the server. Other reference types cross as
//! payloads; plain values cross through `BatchValue`.
//!
//! The schema attributes `Internal`, `Private` and `InternalSet` are recorded
//! in the documentation of the generated items; everything is `pub` so the
//! hand-written classes, which live in other modules, can reach it.
//!
//! # Classes of the schema that are not generated
//!
//! Manual classes (written by hand): `CompositionSurface`, `CompositionDrawingSurface`, `CompositionDrawListVisual`, `CompositionSimpleGradientBrush`, `CompositionGradientBrush`.

mod composition_animations;
mod composition_bitmap_cache;
mod composition_brush;
mod composition_cache_mode;
mod composition_conic_gradient_brush;
mod composition_container_visual;
mod composition_experimental_acrylic_visual;
mod composition_gradient_stop;
mod composition_linear_gradient_brush;
mod composition_radial_gradient_brush;
mod composition_simple_brush;
mod composition_simple_conic_gradient_brush;
mod composition_simple_geometry;
mod composition_simple_linear_gradient_brush;
mod composition_simple_pen;
mod composition_simple_radial_gradient_brush;
mod composition_simple_solid_color_brush;
mod composition_simple_tile_brush;
mod composition_simple_transform;
mod composition_solid_color_brush;
mod composition_solid_color_visual;
mod composition_surface_visual;
mod composition_target;
mod composition_tile_brush;
mod composition_visual;
mod composition_visual_collection;

pub use composition_animations::*;
pub use composition_bitmap_cache::*;
pub use composition_brush::*;
pub use composition_cache_mode::*;
pub use composition_conic_gradient_brush::*;
pub use composition_container_visual::*;
pub use composition_experimental_acrylic_visual::*;
pub use composition_gradient_stop::*;
pub use composition_linear_gradient_brush::*;
pub use composition_radial_gradient_brush::*;
pub use composition_simple_brush::*;
pub use composition_simple_conic_gradient_brush::*;
pub use composition_simple_geometry::*;
pub use composition_simple_linear_gradient_brush::*;
pub use composition_simple_pen::*;
pub use composition_simple_radial_gradient_brush::*;
pub use composition_simple_solid_color_brush::*;
pub use composition_simple_tile_brush::*;
pub use composition_simple_transform::*;
pub use composition_solid_color_brush::*;
pub use composition_solid_color_visual::*;
pub use composition_surface_visual::*;
pub use composition_target::*;
pub use composition_tile_brush::*;
pub use composition_visual::*;
pub use composition_visual_collection::*;

#[cfg(test)]
mod tests;