diff --git a/sixtyfps_runtime/corelib/abi/properties.rs b/sixtyfps_runtime/corelib/abi/properties.rs index 48a8b00cc..8736e1aae 100644 --- a/sixtyfps_runtime/corelib/abi/properties.rs +++ b/sixtyfps_runtime/corelib/abi/properties.rs @@ -593,13 +593,13 @@ impl Property { struct PropertyValueAnimationData { from_value: T, to_value: T, - details: crate::abi::primitives::PropertyAnimation, + details: PropertyAnimation, start_time: instant::Instant, loop_iteration: i32, } impl PropertyValueAnimationData { - fn new(from_value: T, to_value: T, details: crate::abi::primitives::PropertyAnimation) -> Self { + fn new(from_value: T, to_value: T, details: PropertyAnimation) -> Self { let start_time = crate::animations::CURRENT_ANIMATION_DRIVER.with(|driver| driver.current_tick()); @@ -691,8 +691,8 @@ impl BindingCallable for AnimatedBindingCallable) -> i32 { unsafe { Pin::new_unchecked(prop).get() } } @@ -845,7 +845,7 @@ fn c_set_animated_value( handle: &PropertyHandleOpaque, from: T, to: T, - animation_data: &crate::abi::primitives::PropertyAnimation, + animation_data: &PropertyAnimation, ) { let d = RefCell::new(PropertyValueAnimationData::new(from, to, animation_data.clone())); handle.0.set_binding(move |val: *mut ()| { @@ -869,7 +869,7 @@ pub unsafe extern "C" fn sixtyfps_property_set_animated_value_int( handle: &PropertyHandleOpaque, from: i32, to: i32, - animation_data: &crate::abi::primitives::PropertyAnimation, + animation_data: &PropertyAnimation, ) { c_set_animated_value(handle, from, to, animation_data) } @@ -880,7 +880,7 @@ pub unsafe extern "C" fn sixtyfps_property_set_animated_value_float( handle: &PropertyHandleOpaque, from: f32, to: f32, - animation_data: &crate::abi::primitives::PropertyAnimation, + animation_data: &PropertyAnimation, ) { c_set_animated_value(handle, from, to, animation_data) } @@ -891,7 +891,7 @@ pub unsafe extern "C" fn sixtyfps_property_set_animated_value_color( handle: &PropertyHandleOpaque, from: Color, to: Color, - animation_data: &crate::abi::primitives::PropertyAnimation, + animation_data: &PropertyAnimation, ) { c_set_animated_value(handle, from, to, animation_data); } @@ -901,7 +901,7 @@ unsafe fn c_set_animated_binding( binding: extern "C" fn(*mut c_void, *mut T), user_data: *mut c_void, drop_user_data: Option, - animation_data: &crate::abi::primitives::PropertyAnimation, + animation_data: &PropertyAnimation, ) { let binding = core::mem::transmute::< extern "C" fn(*mut c_void, *mut T), @@ -932,7 +932,7 @@ pub unsafe extern "C" fn sixtyfps_property_set_animated_binding_int( binding: extern "C" fn(*mut c_void, *mut i32), user_data: *mut c_void, drop_user_data: Option, - animation_data: &crate::abi::primitives::PropertyAnimation, + animation_data: &PropertyAnimation, ) { c_set_animated_binding(handle, binding, user_data, drop_user_data, animation_data); } @@ -944,7 +944,7 @@ pub unsafe extern "C" fn sixtyfps_property_set_animated_binding_float( binding: extern "C" fn(*mut c_void, *mut f32), user_data: *mut c_void, drop_user_data: Option, - animation_data: &crate::abi::primitives::PropertyAnimation, + animation_data: &PropertyAnimation, ) { c_set_animated_binding(handle, binding, user_data, drop_user_data, animation_data); } @@ -956,7 +956,7 @@ pub unsafe extern "C" fn sixtyfps_property_set_animated_binding_color( binding: extern "C" fn(*mut c_void, *mut Color), user_data: *mut c_void, drop_user_data: Option, - animation_data: &crate::abi::primitives::PropertyAnimation, + animation_data: &PropertyAnimation, ) { c_set_animated_binding(handle, binding, user_data, drop_user_data, animation_data); } diff --git a/sixtyfps_runtime/corelib/rtti.rs b/sixtyfps_runtime/corelib/rtti.rs index 0a22f2a6d..4a7f994dc 100644 --- a/sixtyfps_runtime/corelib/rtti.rs +++ b/sixtyfps_runtime/corelib/rtti.rs @@ -4,6 +4,7 @@ */ pub type FieldOffset = const_field_offset::FieldOffset; +use crate::abi::primitives::PropertyAnimation; use core::convert::{TryFrom, TryInto}; use core::pin::Pin; @@ -33,13 +34,13 @@ pub trait PropertyInfo { &self, item: Pin<&Item>, value: Value, - animation: Option, + animation: Option, ) -> Result<(), ()>; fn set_binding( &self, item: Pin<&Item>, binding: Box Value>, - animation: Option, + animation: Option, ) -> Result<(), ()>; /// The offset of the property in the item. @@ -69,7 +70,7 @@ where &self, item: Pin<&Item>, value: Value, - animation: Option, + animation: Option, ) -> Result<(), ()> { if animation.is_some() { Err(()) @@ -82,7 +83,7 @@ where &self, item: Pin<&Item>, binding: Box Value>, - animation: Option, + animation: Option, ) -> Result<(), ()> { if animation.is_some() { Err(()) @@ -117,7 +118,7 @@ where &self, item: Pin<&Item>, value: Value, - animation: Option, + animation: Option, ) -> Result<(), ()> { if let Some(animation) = &animation { self.apply_pin(item).set_animated_value(value.try_into().map_err(|_| ())?, animation); @@ -130,7 +131,7 @@ where &self, item: Pin<&Item>, binding: Box Value>, - animation: Option, + animation: Option, ) -> Result<(), ()> { if let Some(animation) = &animation { self.apply_pin(item).set_animated_binding( diff --git a/sixtyfps_runtime/interpreter/dynamic_component.rs b/sixtyfps_runtime/interpreter/dynamic_component.rs index 0a3b71095..05ebbc4c8 100644 --- a/sixtyfps_runtime/interpreter/dynamic_component.rs +++ b/sixtyfps_runtime/interpreter/dynamic_component.rs @@ -11,7 +11,7 @@ use sixtyfps_corelib::abi::datastructures::{ ComponentVTable, ItemTreeNode, ItemVTable, ItemVisitorRefMut, LayoutInfo, Resource, WindowProperties, }; -use sixtyfps_corelib::abi::primitives::PropertyAnimation; +use sixtyfps_corelib::abi::primitives::{Flickable, PropertyAnimation, Rectangle}; use sixtyfps_corelib::abi::{properties::PropertyListenerScope, slice::Slice}; use sixtyfps_corelib::rtti::PropertyInfo; use sixtyfps_corelib::ComponentRefPin; @@ -279,16 +279,9 @@ fn generate_component(root_component: &Rc) -> Rc