Rename ModelHandle to SharedModel

This patch is mostly a rename now, but also contains a few small
cleanups.

SharedModel implements the Model trait itself and gracefully falls back
to an empty model is no Model was provided. This allows for some small
simplifications.

Also make sure to use the same comparision for SharedModels everywhere.
This fixes the last remaining clippy errors we had.
This commit is contained in:
Tobias Hunger 2022-01-27 19:10:16 +01:00 committed by Tobias Hunger
parent afb3f269c1
commit 018c1a6666
22 changed files with 88 additions and 112 deletions

View file

@ -181,7 +181,7 @@ The follow table summarizes the entire mapping:
| `duration` | `i64` | At run-time, durations are always represented as signed 64-bit integers with millisecond precision. |
| `angle` | `f32` | The value in degrees |
| structure | `struct` of the same name | |
| array | [`ModelHandle`] | |
| array | [`ModelRc`] | |
For user defined structures in the .60, an extra struct is generated.
For example, if the `.60` contains
@ -233,7 +233,7 @@ pub use sixtyfps_corelib::graphics::{
Brush, Color, Image, LoadImageError, Rgb8Pixel, Rgba8Pixel, RgbaColor, SharedPixelBuffer,
};
pub use sixtyfps_corelib::model::{
Model, ModelHandle, ModelNotify, ModelPeer, ModelTracker, StandardListViewItem, VecModel,
Model, ModelNotify, ModelPeer, ModelRc, ModelTracker, StandardListViewItem, VecModel,
};
pub use sixtyfps_corelib::sharedvector::SharedVector;
pub use sixtyfps_corelib::string::SharedString;