1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// @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`.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;