Skip to main content

Module generated

Module generated 

Source
Expand description

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 XChangedFieldsXChangedFields (bit flags)
fields, properties, InitializeDefaults, SerializeChangesCore, StartAnimation of XXProps
partial void methods of XXHooks (default: do nothing)
fields, properties, DeserializeChangesCore, GetCompositionProperty, SerializeAllChanges of ServerXServerXProps
partial void methods of ServerXServerXHooks (default: do nothing)
static CompositionProperty<T> s_IdOfPPropertyServerXProps::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.

Structs§

CompositionBitmapCacheChangedFields
The fields of CompositionBitmapCache that changed since its last serialization.
CompositionBitmapCacheProps
The UI-thread properties of CompositionBitmapCache.
CompositionBrushChangedFields
The fields of CompositionBrush that changed since its last serialization.
CompositionBrushProps
The UI-thread properties of CompositionBrush.
CompositionCacheModeProps
The UI-thread properties of CompositionCacheMode.
CompositionConicGradientBrushChangedFields
The fields of CompositionConicGradientBrush that changed since its last serialization.
CompositionConicGradientBrushProps
The UI-thread properties of CompositionConicGradientBrush.
CompositionContainerVisualProps
The UI-thread properties of CompositionContainerVisual.
CompositionExperimentalAcrylicVisualChangedFields
The fields of CompositionExperimentalAcrylicVisual that changed since its last serialization.
CompositionExperimentalAcrylicVisualProps
The UI-thread properties of CompositionExperimentalAcrylicVisual.
CompositionGradientStopChangedFields
The fields of CompositionGradientStop that changed since its last serialization.
CompositionGradientStopProps
The UI-thread properties of CompositionGradientStop.
CompositionLinearGradientBrushChangedFields
The fields of CompositionLinearGradientBrush that changed since its last serialization.
CompositionLinearGradientBrushProps
The UI-thread properties of CompositionLinearGradientBrush.
CompositionRadialGradientBrushChangedFields
The fields of CompositionRadialGradientBrush that changed since its last serialization.
CompositionRadialGradientBrushProps
The UI-thread properties of CompositionRadialGradientBrush.
CompositionSimpleBrushChangedFields
The fields of CompositionSimpleBrush that changed since its last serialization.
CompositionSimpleConicGradientBrushChangedFields
The fields of CompositionSimpleConicGradientBrush that changed since its last serialization.
CompositionSimpleGeometryChangedFields
The fields of CompositionSimpleGeometry that changed since its last serialization.
CompositionSimpleLinearGradientBrushChangedFields
The fields of CompositionSimpleLinearGradientBrush that changed since its last serialization.
CompositionSimplePenChangedFields
The fields of CompositionSimplePen that changed since its last serialization.
CompositionSimpleRadialGradientBrushChangedFields
The fields of CompositionSimpleRadialGradientBrush that changed since its last serialization.
CompositionSimpleSolidColorBrushChangedFields
The fields of CompositionSimpleSolidColorBrush that changed since its last serialization.
CompositionSimpleTileBrushChangedFields
The fields of CompositionSimpleTileBrush that changed since its last serialization.
CompositionSimpleTransformChangedFields
The fields of CompositionSimpleTransform that changed since its last serialization.
CompositionSolidColorBrushChangedFields
The fields of CompositionSolidColorBrush that changed since its last serialization.
CompositionSolidColorBrushProps
The UI-thread properties of CompositionSolidColorBrush.
CompositionSolidColorVisualChangedFields
The fields of CompositionSolidColorVisual that changed since its last serialization.
CompositionSolidColorVisualProps
The UI-thread properties of CompositionSolidColorVisual.
CompositionSurfaceVisualChangedFields
The fields of CompositionSurfaceVisual that changed since its last serialization.
CompositionSurfaceVisualProps
The UI-thread properties of CompositionSurfaceVisual.
CompositionTargetChangedFields
The fields of CompositionTarget that changed since its last serialization.
CompositionTargetProps
The UI-thread properties of CompositionTarget.
CompositionTileBrushChangedFields
The fields of CompositionTileBrush that changed since its last serialization.
CompositionVisualChangedFields
The fields of CompositionVisual that changed since its last serialization.
CompositionVisualCollectionProps
The UI-thread list of CompositionVisualCollection.
CompositionVisualProps
The UI-thread properties of CompositionVisual.
ServerCompositionBitmapCacheProps
The server-side properties of ServerCompositionBitmapCache.
ServerCompositionBrushProps
The server-side properties of ServerCompositionBrush.
ServerCompositionCacheModeProps
The server-side properties of ServerCompositionCacheMode.
ServerCompositionConicGradientBrushProps
The server-side properties of ServerCompositionConicGradientBrush.
ServerCompositionContainerVisualProps
The server-side properties of ServerCompositionContainerVisual.
ServerCompositionExperimentalAcrylicVisualProps
The server-side properties of ServerCompositionExperimentalAcrylicVisual.
ServerCompositionGradientStopProps
The server-side properties of ServerCompositionGradientStop.
ServerCompositionLinearGradientBrushProps
The server-side properties of ServerCompositionLinearGradientBrush.
ServerCompositionRadialGradientBrushProps
The server-side properties of ServerCompositionRadialGradientBrush.
ServerCompositionSimpleBrushProps
The server-side properties of ServerCompositionSimpleBrush.
ServerCompositionSimpleConicGradientBrushProps
The server-side properties of ServerCompositionSimpleConicGradientBrush.
ServerCompositionSimpleGeometryProps
The server-side properties of ServerCompositionSimpleGeometry.
ServerCompositionSimpleLinearGradientBrushProps
The server-side properties of ServerCompositionSimpleLinearGradientBrush.
ServerCompositionSimplePenProps
The server-side properties of ServerCompositionSimplePen.
ServerCompositionSimpleRadialGradientBrushProps
The server-side properties of ServerCompositionSimpleRadialGradientBrush.
ServerCompositionSimpleSolidColorBrushProps
The server-side properties of ServerCompositionSimpleSolidColorBrush.
ServerCompositionSimpleTileBrushProps
The server-side properties of ServerCompositionSimpleTileBrush.
ServerCompositionSimpleTransformProps
The server-side properties of ServerCompositionSimpleTransform.
ServerCompositionSolidColorBrushProps
The server-side properties of ServerCompositionSolidColorBrush.
ServerCompositionSolidColorVisualProps
The server-side properties of ServerCompositionSolidColorVisual.
ServerCompositionSurfaceVisualProps
The server-side properties of ServerCompositionSurfaceVisual.
ServerCompositionTargetProps
The server-side properties of ServerCompositionTarget.
ServerCompositionTileBrushProps
The server-side properties of ServerCompositionTileBrush.
ServerCompositionVisualCollectionProps
The server-side properties of ServerCompositionVisualCollection.
ServerCompositionVisualProps
The server-side properties of ServerCompositionVisual.

Constants§

KEY_FRAME_ANIMATIONS
The key frame animations of the schema: (name, schema type).

Traits§

CompositionBitmapCacheHooks
The partial methods of CompositionBitmapCache: implemented by the class that embeds CompositionBitmapCacheProps. Every hook defaults to doing nothing.
CompositionBrushHooks
The partial methods of CompositionBrush: implemented by the class that embeds CompositionBrushProps. Every hook defaults to doing nothing.
CompositionCacheModeHooks
The partial methods of CompositionCacheMode: implemented by the class that embeds CompositionCacheModeProps. Every hook defaults to doing nothing.
CompositionConicGradientBrushHooks
The partial methods of CompositionConicGradientBrush: implemented by the class that embeds CompositionConicGradientBrushProps. Every hook defaults to doing nothing.
CompositionContainerVisualHooks
The partial methods of CompositionContainerVisual: implemented by the class that embeds CompositionContainerVisualProps. Every hook defaults to doing nothing.
CompositionExperimentalAcrylicVisualHooks
The partial methods of CompositionExperimentalAcrylicVisual: implemented by the class that embeds CompositionExperimentalAcrylicVisualProps. Every hook defaults to doing nothing.
CompositionGradientStopHooks
The partial methods of CompositionGradientStop: implemented by the class that embeds CompositionGradientStopProps. Every hook defaults to doing nothing.
CompositionLinearGradientBrushHooks
The partial methods of CompositionLinearGradientBrush: implemented by the class that embeds CompositionLinearGradientBrushProps. Every hook defaults to doing nothing.
CompositionRadialGradientBrushHooks
The partial methods of CompositionRadialGradientBrush: implemented by the class that embeds CompositionRadialGradientBrushProps. Every hook defaults to doing nothing.
CompositionSolidColorBrushHooks
The partial methods of CompositionSolidColorBrush: implemented by the class that embeds CompositionSolidColorBrushProps. Every hook defaults to doing nothing.
CompositionSolidColorVisualHooks
The partial methods of CompositionSolidColorVisual: implemented by the class that embeds CompositionSolidColorVisualProps. Every hook defaults to doing nothing.
CompositionSurfaceVisualHooks
The partial methods of CompositionSurfaceVisual: implemented by the class that embeds CompositionSurfaceVisualProps. Every hook defaults to doing nothing.
CompositionTargetHooks
The partial methods of CompositionTarget: implemented by the class that embeds CompositionTargetProps. Every hook defaults to doing nothing.
CompositionVisualCollectionHooks
The partial methods of CompositionVisualCollection: implemented by the class that embeds CompositionVisualCollectionProps. TItem is the UI-thread class of the items (CompositionVisual). Every hook defaults to doing nothing.
CompositionVisualHooks
The partial methods of CompositionVisual: implemented by the class that embeds CompositionVisualProps. Every hook defaults to doing nothing.
ServerCompositionBitmapCacheHooks
The partial methods of ServerCompositionBitmapCache: implemented by the class that embeds ServerCompositionBitmapCacheProps. Every hook defaults to doing nothing.
ServerCompositionBrushHooks
The partial methods of ServerCompositionBrush: implemented by the class that embeds ServerCompositionBrushProps. Every hook defaults to doing nothing.
ServerCompositionCacheModeHooks
The partial methods of ServerCompositionCacheMode: implemented by the class that embeds ServerCompositionCacheModeProps. Every hook defaults to doing nothing.
ServerCompositionConicGradientBrushHooks
The partial methods of ServerCompositionConicGradientBrush: implemented by the class that embeds ServerCompositionConicGradientBrushProps. Every hook defaults to doing nothing.
ServerCompositionContainerVisualHooks
The partial methods of ServerCompositionContainerVisual: implemented by the class that embeds ServerCompositionContainerVisualProps. Every hook defaults to doing nothing.
ServerCompositionExperimentalAcrylicVisualHooks
The partial methods of ServerCompositionExperimentalAcrylicVisual: implemented by the class that embeds ServerCompositionExperimentalAcrylicVisualProps. Every hook defaults to doing nothing.
ServerCompositionGradientStopHooks
The partial methods of ServerCompositionGradientStop: implemented by the class that embeds ServerCompositionGradientStopProps. Every hook defaults to doing nothing.
ServerCompositionLinearGradientBrushHooks
The partial methods of ServerCompositionLinearGradientBrush: implemented by the class that embeds ServerCompositionLinearGradientBrushProps. Every hook defaults to doing nothing.
ServerCompositionRadialGradientBrushHooks
The partial methods of ServerCompositionRadialGradientBrush: implemented by the class that embeds ServerCompositionRadialGradientBrushProps. Every hook defaults to doing nothing.
ServerCompositionSimpleBrushHooks
The partial methods of ServerCompositionSimpleBrush: implemented by the class that embeds ServerCompositionSimpleBrushProps. Every hook defaults to doing nothing.
ServerCompositionSimpleConicGradientBrushHooks
The partial methods of ServerCompositionSimpleConicGradientBrush: implemented by the class that embeds ServerCompositionSimpleConicGradientBrushProps. Every hook defaults to doing nothing.
ServerCompositionSimpleGeometryHooks
The partial methods of ServerCompositionSimpleGeometry: implemented by the class that embeds ServerCompositionSimpleGeometryProps. Every hook defaults to doing nothing.
ServerCompositionSimpleLinearGradientBrushHooks
The partial methods of ServerCompositionSimpleLinearGradientBrush: implemented by the class that embeds ServerCompositionSimpleLinearGradientBrushProps. Every hook defaults to doing nothing.
ServerCompositionSimplePenHooks
The partial methods of ServerCompositionSimplePen: implemented by the class that embeds ServerCompositionSimplePenProps. Every hook defaults to doing nothing.
ServerCompositionSimpleRadialGradientBrushHooks
The partial methods of ServerCompositionSimpleRadialGradientBrush: implemented by the class that embeds ServerCompositionSimpleRadialGradientBrushProps. Every hook defaults to doing nothing.
ServerCompositionSimpleSolidColorBrushHooks
The partial methods of ServerCompositionSimpleSolidColorBrush: implemented by the class that embeds ServerCompositionSimpleSolidColorBrushProps. Every hook defaults to doing nothing.
ServerCompositionSimpleTileBrushHooks
The partial methods of ServerCompositionSimpleTileBrush: implemented by the class that embeds ServerCompositionSimpleTileBrushProps. Every hook defaults to doing nothing.
ServerCompositionSimpleTransformHooks
The partial methods of ServerCompositionSimpleTransform: implemented by the class that embeds ServerCompositionSimpleTransformProps. Every hook defaults to doing nothing.
ServerCompositionSolidColorBrushHooks
The partial methods of ServerCompositionSolidColorBrush: implemented by the class that embeds ServerCompositionSolidColorBrushProps. Every hook defaults to doing nothing.
ServerCompositionSolidColorVisualHooks
The partial methods of ServerCompositionSolidColorVisual: implemented by the class that embeds ServerCompositionSolidColorVisualProps. Every hook defaults to doing nothing.
ServerCompositionSurfaceVisualHooks
The partial methods of ServerCompositionSurfaceVisual: implemented by the class that embeds ServerCompositionSurfaceVisualProps. Every hook defaults to doing nothing.
ServerCompositionTargetHooks
The partial methods of ServerCompositionTarget: implemented by the class that embeds ServerCompositionTargetProps. Every hook defaults to doing nothing.
ServerCompositionTileBrushHooks
The partial methods of ServerCompositionTileBrush: implemented by the class that embeds ServerCompositionTileBrushProps. Every hook defaults to doing nothing.
ServerCompositionVisualCollectionHooks
The partial methods of ServerCompositionVisualCollection: implemented by the class that embeds ServerCompositionVisualCollectionProps. Every hook defaults to doing nothing.
ServerCompositionVisualHooks
The partial methods of ServerCompositionVisual: implemented by the class that embeds ServerCompositionVisualProps. Every hook defaults to doing nothing.