use super::*;
#[derive(Clone, Copy)]
pub struct Keyframe(UI_ANIMATION_KEYFRAME);
#[derive(Clone)]
pub struct Storyboard(pub(crate) IUIAnimationStoryboard2);
impl Storyboard {
pub fn add_transition(&self, variable: &Variable, transition: &Transition) -> Result<Keyframe> {
unsafe {
self.0.AddTransition(&variable.0, &transition.0).ok()?;
let kf = self.0.AddKeyframeAfterTransition(&transition.0)?;
Ok(Keyframe(kf))
}
}
pub fn add_transition_at_keyframe(
&self,
variable: &Variable,
transition: &Transition,
keyframe: Keyframe,
) -> Result<()> {
unsafe {
self.0
.AddTransitionAtKeyframe(&variable.0, &transition.0, keyframe.0)
.ok()
}
}
pub fn schedule(&self, time: f64) -> Result<()> {
unsafe { self.0.Schedule(time, None) }.ok()?;
Ok(())
}
}