Skip to main content

libadwaita/auto/
timed_animation.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5
6use crate::{Animation, AnimationTarget, Easing, ffi};
7use glib::{
8    prelude::*,
9    signal::{SignalHandlerId, connect_raw},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    /// A time-based [`Animation`][crate::Animation].
16    ///
17    /// [`TimedAnimation`][crate::TimedAnimation] implements a simple animation interpolating the given
18    /// value from [`value-from`][struct@crate::TimedAnimation#value-from] to
19    /// [`value-to`][struct@crate::TimedAnimation#value-to] over
20    /// [`duration`][struct@crate::TimedAnimation#duration] milliseconds using the curve described by
21    /// [`easing`][struct@crate::TimedAnimation#easing].
22    ///
23    /// If [`reverse`][struct@crate::TimedAnimation#reverse] is set to `TRUE`, [`TimedAnimation`][crate::TimedAnimation]
24    /// will instead animate from [`value-to`][struct@crate::TimedAnimation#value-to] to
25    /// [`value-from`][struct@crate::TimedAnimation#value-from], and the easing curve will be inverted.
26    ///
27    /// The animation can repeat a certain amount of times, or endlessly, depending
28    /// on the [`repeat-count`][struct@crate::TimedAnimation#repeat-count] value. If
29    /// [`alternate`][struct@crate::TimedAnimation#alternate] is set to `TRUE`, it will also change the
30    /// direction every other iteration.
31    ///
32    /// ## Properties
33    ///
34    ///
35    /// #### `alternate`
36    ///  Whether the animation changes direction on every iteration.
37    ///
38    /// Readable | Writeable | Construct
39    ///
40    ///
41    /// #### `duration`
42    ///  Duration of the animation, in milliseconds.
43    ///
44    /// Describes how much time the animation will take.
45    ///
46    /// If the animation repeats more than once, describes the duration of one
47    /// iteration.
48    ///
49    /// Readable | Writeable | Construct
50    ///
51    ///
52    /// #### `easing`
53    ///  Easing function used in the animation.
54    ///
55    /// Describes the curve the value is interpolated on.
56    ///
57    /// See [`Easing`][crate::Easing] for the description of specific easing functions.
58    ///
59    /// Readable | Writeable | Construct
60    ///
61    ///
62    /// #### `repeat-count`
63    ///  Number of times the animation will play.
64    ///
65    /// If set to 0, the animation will repeat endlessly.
66    ///
67    /// Readable | Writeable | Construct
68    ///
69    ///
70    /// #### `reverse`
71    ///  Whether the animation plays backwards.
72    ///
73    /// Readable | Writeable | Construct
74    ///
75    ///
76    /// #### `value-from`
77    ///  The value to animate from.
78    ///
79    /// The animation will start at this value and end at
80    /// [`value-to`][struct@crate::TimedAnimation#value-to].
81    ///
82    /// If [`reverse`][struct@crate::TimedAnimation#reverse] is `TRUE`, the animation will end at
83    /// this value instead.
84    ///
85    /// Readable | Writeable | Construct
86    ///
87    ///
88    /// #### `value-to`
89    ///  The value to animate to.
90    ///
91    /// The animation will start at [`value-from`][struct@crate::TimedAnimation#value-from] and end at
92    /// this value.
93    ///
94    /// If [`reverse`][struct@crate::TimedAnimation#reverse] is `TRUE`, the animation will start
95    /// at this value instead.
96    ///
97    /// Readable | Writeable | Construct
98    /// <details><summary><h4>Animation</h4></summary>
99    ///
100    ///
101    /// #### `follow-enable-animations-setting`
102    ///  Whether to skip the animation when animations are globally disabled.
103    ///
104    /// The default behavior is to skip the animation. Set to `FALSE` to disable
105    /// this behavior.
106    ///
107    /// This can be useful for cases where animation is essential, like spinners,
108    /// or in demo applications. Most other animations should keep it enabled.
109    ///
110    /// See [`gtk-enable-animations`][struct@crate::gtk::Settings#gtk-enable-animations].
111    ///
112    /// Readable | Writeable
113    ///
114    ///
115    /// #### `state`
116    ///  The animation state.
117    ///
118    /// The state indicates whether the animation is currently playing, paused,
119    /// finished or hasn't been started yet.
120    ///
121    /// Readable
122    ///
123    ///
124    /// #### `target`
125    ///  The target to animate.
126    ///
127    /// Readable | Writeable | Construct
128    ///
129    ///
130    /// #### `value`
131    ///  The current value of the animation.
132    ///
133    /// Readable
134    ///
135    ///
136    /// #### `widget`
137    ///  The animation widget.
138    ///
139    /// It provides the frame clock for the animation. It's not strictly necessary
140    /// for this widget to be same as the one being animated.
141    ///
142    /// The widget must be mapped in order for the animation to work. If it's not
143    /// mapped, or if it gets unmapped during an ongoing animation, the animation
144    /// will be automatically skipped.
145    ///
146    /// Readable | Writeable | Construct Only
147    /// </details>
148    ///
149    /// # Implements
150    ///
151    /// [`AnimationExt`][trait@crate::prelude::AnimationExt], [`trait@glib::ObjectExt`]
152    #[doc(alias = "AdwTimedAnimation")]
153    pub struct TimedAnimation(Object<ffi::AdwTimedAnimation, ffi::AdwTimedAnimationClass>) @extends Animation;
154
155    match fn {
156        type_ => || ffi::adw_timed_animation_get_type(),
157    }
158}
159
160impl TimedAnimation {
161    /// Creates a new [`TimedAnimation`][crate::TimedAnimation] on @widget to animate @target from @from
162    /// to @to.
163    /// ## `widget`
164    /// a widget to create animation on
165    /// ## `from`
166    /// a value to animate from
167    /// ## `to`
168    /// a value to animate to
169    /// ## `duration`
170    /// a duration for the animation
171    /// ## `target`
172    /// a target value to animate
173    ///
174    /// # Returns
175    ///
176    /// the newly created animation
177    #[doc(alias = "adw_timed_animation_new")]
178    pub fn new(
179        widget: &impl IsA<gtk::Widget>,
180        from: f64,
181        to: f64,
182        duration: u32,
183        target: impl IsA<AnimationTarget>,
184    ) -> TimedAnimation {
185        skip_assert_initialized!();
186        unsafe {
187            Animation::from_glib_none(ffi::adw_timed_animation_new(
188                widget.as_ref().to_glib_none().0,
189                from,
190                to,
191                duration,
192                target.upcast().into_glib_ptr(),
193            ))
194            .unsafe_cast()
195        }
196    }
197
198    // rustdoc-stripper-ignore-next
199    /// Creates a new builder-pattern struct instance to construct [`TimedAnimation`] objects.
200    ///
201    /// This method returns an instance of [`TimedAnimationBuilder`](crate::builders::TimedAnimationBuilder) which can be used to create [`TimedAnimation`] objects.
202    pub fn builder() -> TimedAnimationBuilder {
203        TimedAnimationBuilder::new()
204    }
205
206    /// Gets whether @self changes direction on every iteration.
207    ///
208    /// # Returns
209    ///
210    /// whether @self alternates
211    #[doc(alias = "adw_timed_animation_get_alternate")]
212    #[doc(alias = "get_alternate")]
213    #[doc(alias = "alternate")]
214    pub fn is_alternate(&self) -> bool {
215        unsafe {
216            from_glib(ffi::adw_timed_animation_get_alternate(
217                self.to_glib_none().0,
218            ))
219        }
220    }
221
222    /// Gets the duration of @self.
223    ///
224    /// # Returns
225    ///
226    /// the duration of @self, in milliseconds
227    #[doc(alias = "adw_timed_animation_get_duration")]
228    #[doc(alias = "get_duration")]
229    pub fn duration(&self) -> u32 {
230        unsafe { ffi::adw_timed_animation_get_duration(self.to_glib_none().0) }
231    }
232
233    /// Gets the easing function @self uses.
234    ///
235    /// # Returns
236    ///
237    /// the easing function @self uses
238    #[doc(alias = "adw_timed_animation_get_easing")]
239    #[doc(alias = "get_easing")]
240    pub fn easing(&self) -> Easing {
241        unsafe { from_glib(ffi::adw_timed_animation_get_easing(self.to_glib_none().0)) }
242    }
243
244    /// Gets the number of times @self will play.
245    ///
246    /// # Returns
247    ///
248    /// the number of times @self will play
249    #[doc(alias = "adw_timed_animation_get_repeat_count")]
250    #[doc(alias = "get_repeat_count")]
251    #[doc(alias = "repeat-count")]
252    pub fn repeat_count(&self) -> u32 {
253        unsafe { ffi::adw_timed_animation_get_repeat_count(self.to_glib_none().0) }
254    }
255
256    /// Gets whether @self plays backwards.
257    ///
258    /// # Returns
259    ///
260    /// whether @self plays backwards
261    #[doc(alias = "adw_timed_animation_get_reverse")]
262    #[doc(alias = "get_reverse")]
263    #[doc(alias = "reverse")]
264    pub fn is_reverse(&self) -> bool {
265        unsafe { from_glib(ffi::adw_timed_animation_get_reverse(self.to_glib_none().0)) }
266    }
267
268    /// Gets the value @self will animate from.
269    ///
270    /// # Returns
271    ///
272    /// the value to animate from
273    #[doc(alias = "adw_timed_animation_get_value_from")]
274    #[doc(alias = "get_value_from")]
275    #[doc(alias = "value-from")]
276    pub fn value_from(&self) -> f64 {
277        unsafe { ffi::adw_timed_animation_get_value_from(self.to_glib_none().0) }
278    }
279
280    /// Gets the value @self will animate to.
281    ///
282    /// # Returns
283    ///
284    /// the value to animate to
285    #[doc(alias = "adw_timed_animation_get_value_to")]
286    #[doc(alias = "get_value_to")]
287    #[doc(alias = "value-to")]
288    pub fn value_to(&self) -> f64 {
289        unsafe { ffi::adw_timed_animation_get_value_to(self.to_glib_none().0) }
290    }
291
292    /// Sets whether @self changes direction on every iteration.
293    /// ## `alternate`
294    /// whether @self alternates
295    #[doc(alias = "adw_timed_animation_set_alternate")]
296    #[doc(alias = "alternate")]
297    pub fn set_alternate(&self, alternate: bool) {
298        unsafe {
299            ffi::adw_timed_animation_set_alternate(self.to_glib_none().0, alternate.into_glib());
300        }
301    }
302
303    /// Sets the duration of @self.
304    ///
305    /// If the animation repeats more than once, sets the duration of one iteration.
306    /// ## `duration`
307    /// the duration to use, in milliseconds
308    #[doc(alias = "adw_timed_animation_set_duration")]
309    #[doc(alias = "duration")]
310    pub fn set_duration(&self, duration: u32) {
311        unsafe {
312            ffi::adw_timed_animation_set_duration(self.to_glib_none().0, duration);
313        }
314    }
315
316    /// Sets the easing function @self will use.
317    ///
318    /// See [`Easing`][crate::Easing] for the description of specific easing functions.
319    /// ## `easing`
320    /// the easing function to use
321    #[doc(alias = "adw_timed_animation_set_easing")]
322    #[doc(alias = "easing")]
323    pub fn set_easing(&self, easing: Easing) {
324        unsafe {
325            ffi::adw_timed_animation_set_easing(self.to_glib_none().0, easing.into_glib());
326        }
327    }
328
329    /// Sets the number of times @self will play.
330    ///
331    /// If set to 0, @self will repeat endlessly.
332    /// ## `repeat_count`
333    /// the number of times @self will play
334    #[doc(alias = "adw_timed_animation_set_repeat_count")]
335    #[doc(alias = "repeat-count")]
336    pub fn set_repeat_count(&self, repeat_count: u32) {
337        unsafe {
338            ffi::adw_timed_animation_set_repeat_count(self.to_glib_none().0, repeat_count);
339        }
340    }
341
342    /// Sets whether @self plays backwards.
343    /// ## `reverse`
344    /// whether @self plays backwards
345    #[doc(alias = "adw_timed_animation_set_reverse")]
346    #[doc(alias = "reverse")]
347    pub fn set_reverse(&self, reverse: bool) {
348        unsafe {
349            ffi::adw_timed_animation_set_reverse(self.to_glib_none().0, reverse.into_glib());
350        }
351    }
352
353    /// Sets the value @self will animate from.
354    ///
355    /// The animation will start at this value and end at
356    /// [`value-to`][struct@crate::TimedAnimation#value-to].
357    ///
358    /// If [`reverse`][struct@crate::TimedAnimation#reverse] is `TRUE`, the animation will end at
359    /// this value instead.
360    /// ## `value`
361    /// the value to animate from
362    #[doc(alias = "adw_timed_animation_set_value_from")]
363    #[doc(alias = "value-from")]
364    pub fn set_value_from(&self, value: f64) {
365        unsafe {
366            ffi::adw_timed_animation_set_value_from(self.to_glib_none().0, value);
367        }
368    }
369
370    /// Sets the value @self will animate to.
371    ///
372    /// The animation will start at [`value-from`][struct@crate::TimedAnimation#value-from] and end at
373    /// this value.
374    ///
375    /// If [`reverse`][struct@crate::TimedAnimation#reverse] is `TRUE`, the animation will start
376    /// at this value instead.
377    /// ## `value`
378    /// the value to animate to
379    #[doc(alias = "adw_timed_animation_set_value_to")]
380    #[doc(alias = "value-to")]
381    pub fn set_value_to(&self, value: f64) {
382        unsafe {
383            ffi::adw_timed_animation_set_value_to(self.to_glib_none().0, value);
384        }
385    }
386
387    #[doc(alias = "alternate")]
388    pub fn connect_alternate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
389        unsafe extern "C" fn notify_alternate_trampoline<F: Fn(&TimedAnimation) + 'static>(
390            this: *mut ffi::AdwTimedAnimation,
391            _param_spec: glib::ffi::gpointer,
392            f: glib::ffi::gpointer,
393        ) {
394            unsafe {
395                let f: &F = &*(f as *const F);
396                f(&from_glib_borrow(this))
397            }
398        }
399        unsafe {
400            let f: Box_<F> = Box_::new(f);
401            connect_raw(
402                self.as_ptr() as *mut _,
403                c"notify::alternate".as_ptr(),
404                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
405                    notify_alternate_trampoline::<F> as *const (),
406                )),
407                Box_::into_raw(f),
408            )
409        }
410    }
411
412    #[doc(alias = "duration")]
413    pub fn connect_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
414        unsafe extern "C" fn notify_duration_trampoline<F: Fn(&TimedAnimation) + 'static>(
415            this: *mut ffi::AdwTimedAnimation,
416            _param_spec: glib::ffi::gpointer,
417            f: glib::ffi::gpointer,
418        ) {
419            unsafe {
420                let f: &F = &*(f as *const F);
421                f(&from_glib_borrow(this))
422            }
423        }
424        unsafe {
425            let f: Box_<F> = Box_::new(f);
426            connect_raw(
427                self.as_ptr() as *mut _,
428                c"notify::duration".as_ptr(),
429                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
430                    notify_duration_trampoline::<F> as *const (),
431                )),
432                Box_::into_raw(f),
433            )
434        }
435    }
436
437    #[doc(alias = "easing")]
438    pub fn connect_easing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
439        unsafe extern "C" fn notify_easing_trampoline<F: Fn(&TimedAnimation) + 'static>(
440            this: *mut ffi::AdwTimedAnimation,
441            _param_spec: glib::ffi::gpointer,
442            f: glib::ffi::gpointer,
443        ) {
444            unsafe {
445                let f: &F = &*(f as *const F);
446                f(&from_glib_borrow(this))
447            }
448        }
449        unsafe {
450            let f: Box_<F> = Box_::new(f);
451            connect_raw(
452                self.as_ptr() as *mut _,
453                c"notify::easing".as_ptr(),
454                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
455                    notify_easing_trampoline::<F> as *const (),
456                )),
457                Box_::into_raw(f),
458            )
459        }
460    }
461
462    #[doc(alias = "repeat-count")]
463    pub fn connect_repeat_count_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
464        unsafe extern "C" fn notify_repeat_count_trampoline<F: Fn(&TimedAnimation) + 'static>(
465            this: *mut ffi::AdwTimedAnimation,
466            _param_spec: glib::ffi::gpointer,
467            f: glib::ffi::gpointer,
468        ) {
469            unsafe {
470                let f: &F = &*(f as *const F);
471                f(&from_glib_borrow(this))
472            }
473        }
474        unsafe {
475            let f: Box_<F> = Box_::new(f);
476            connect_raw(
477                self.as_ptr() as *mut _,
478                c"notify::repeat-count".as_ptr(),
479                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
480                    notify_repeat_count_trampoline::<F> as *const (),
481                )),
482                Box_::into_raw(f),
483            )
484        }
485    }
486
487    #[doc(alias = "reverse")]
488    pub fn connect_reverse_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
489        unsafe extern "C" fn notify_reverse_trampoline<F: Fn(&TimedAnimation) + 'static>(
490            this: *mut ffi::AdwTimedAnimation,
491            _param_spec: glib::ffi::gpointer,
492            f: glib::ffi::gpointer,
493        ) {
494            unsafe {
495                let f: &F = &*(f as *const F);
496                f(&from_glib_borrow(this))
497            }
498        }
499        unsafe {
500            let f: Box_<F> = Box_::new(f);
501            connect_raw(
502                self.as_ptr() as *mut _,
503                c"notify::reverse".as_ptr(),
504                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
505                    notify_reverse_trampoline::<F> as *const (),
506                )),
507                Box_::into_raw(f),
508            )
509        }
510    }
511
512    #[doc(alias = "value-from")]
513    pub fn connect_value_from_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
514        unsafe extern "C" fn notify_value_from_trampoline<F: Fn(&TimedAnimation) + 'static>(
515            this: *mut ffi::AdwTimedAnimation,
516            _param_spec: glib::ffi::gpointer,
517            f: glib::ffi::gpointer,
518        ) {
519            unsafe {
520                let f: &F = &*(f as *const F);
521                f(&from_glib_borrow(this))
522            }
523        }
524        unsafe {
525            let f: Box_<F> = Box_::new(f);
526            connect_raw(
527                self.as_ptr() as *mut _,
528                c"notify::value-from".as_ptr(),
529                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
530                    notify_value_from_trampoline::<F> as *const (),
531                )),
532                Box_::into_raw(f),
533            )
534        }
535    }
536
537    #[doc(alias = "value-to")]
538    pub fn connect_value_to_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
539        unsafe extern "C" fn notify_value_to_trampoline<F: Fn(&TimedAnimation) + 'static>(
540            this: *mut ffi::AdwTimedAnimation,
541            _param_spec: glib::ffi::gpointer,
542            f: glib::ffi::gpointer,
543        ) {
544            unsafe {
545                let f: &F = &*(f as *const F);
546                f(&from_glib_borrow(this))
547            }
548        }
549        unsafe {
550            let f: Box_<F> = Box_::new(f);
551            connect_raw(
552                self.as_ptr() as *mut _,
553                c"notify::value-to".as_ptr(),
554                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
555                    notify_value_to_trampoline::<F> as *const (),
556                )),
557                Box_::into_raw(f),
558            )
559        }
560    }
561}
562
563impl Default for TimedAnimation {
564    fn default() -> Self {
565        glib::object::Object::new::<Self>()
566    }
567}
568
569// rustdoc-stripper-ignore-next
570/// A [builder-pattern] type to construct [`TimedAnimation`] objects.
571///
572/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
573#[must_use = "The builder must be built to be used"]
574pub struct TimedAnimationBuilder {
575    builder: glib::object::ObjectBuilder<'static, TimedAnimation>,
576}
577
578impl TimedAnimationBuilder {
579    fn new() -> Self {
580        Self {
581            builder: glib::object::Object::builder(),
582        }
583    }
584
585    /// Whether the animation changes direction on every iteration.
586    pub fn alternate(self, alternate: bool) -> Self {
587        Self {
588            builder: self.builder.property("alternate", alternate),
589        }
590    }
591
592    /// Duration of the animation, in milliseconds.
593    ///
594    /// Describes how much time the animation will take.
595    ///
596    /// If the animation repeats more than once, describes the duration of one
597    /// iteration.
598    pub fn duration(self, duration: u32) -> Self {
599        Self {
600            builder: self.builder.property("duration", duration),
601        }
602    }
603
604    /// Easing function used in the animation.
605    ///
606    /// Describes the curve the value is interpolated on.
607    ///
608    /// See [`Easing`][crate::Easing] for the description of specific easing functions.
609    pub fn easing(self, easing: Easing) -> Self {
610        Self {
611            builder: self.builder.property("easing", easing),
612        }
613    }
614
615    /// Number of times the animation will play.
616    ///
617    /// If set to 0, the animation will repeat endlessly.
618    pub fn repeat_count(self, repeat_count: u32) -> Self {
619        Self {
620            builder: self.builder.property("repeat-count", repeat_count),
621        }
622    }
623
624    /// Whether the animation plays backwards.
625    pub fn reverse(self, reverse: bool) -> Self {
626        Self {
627            builder: self.builder.property("reverse", reverse),
628        }
629    }
630
631    /// The value to animate from.
632    ///
633    /// The animation will start at this value and end at
634    /// [`value-to`][struct@crate::TimedAnimation#value-to].
635    ///
636    /// If [`reverse`][struct@crate::TimedAnimation#reverse] is `TRUE`, the animation will end at
637    /// this value instead.
638    pub fn value_from(self, value_from: f64) -> Self {
639        Self {
640            builder: self.builder.property("value-from", value_from),
641        }
642    }
643
644    /// The value to animate to.
645    ///
646    /// The animation will start at [`value-from`][struct@crate::TimedAnimation#value-from] and end at
647    /// this value.
648    ///
649    /// If [`reverse`][struct@crate::TimedAnimation#reverse] is `TRUE`, the animation will start
650    /// at this value instead.
651    pub fn value_to(self, value_to: f64) -> Self {
652        Self {
653            builder: self.builder.property("value-to", value_to),
654        }
655    }
656
657    /// Whether to skip the animation when animations are globally disabled.
658    ///
659    /// The default behavior is to skip the animation. Set to `FALSE` to disable
660    /// this behavior.
661    ///
662    /// This can be useful for cases where animation is essential, like spinners,
663    /// or in demo applications. Most other animations should keep it enabled.
664    ///
665    /// See [`gtk-enable-animations`][struct@crate::gtk::Settings#gtk-enable-animations].
666    #[cfg(feature = "v1_3")]
667    #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
668    pub fn follow_enable_animations_setting(self, follow_enable_animations_setting: bool) -> Self {
669        Self {
670            builder: self.builder.property(
671                "follow-enable-animations-setting",
672                follow_enable_animations_setting,
673            ),
674        }
675    }
676
677    /// The target to animate.
678    pub fn target(self, target: &impl IsA<AnimationTarget>) -> Self {
679        Self {
680            builder: self.builder.property("target", target.clone().upcast()),
681        }
682    }
683
684    /// The animation widget.
685    ///
686    /// It provides the frame clock for the animation. It's not strictly necessary
687    /// for this widget to be same as the one being animated.
688    ///
689    /// The widget must be mapped in order for the animation to work. If it's not
690    /// mapped, or if it gets unmapped during an ongoing animation, the animation
691    /// will be automatically skipped.
692    pub fn widget(self, widget: &impl IsA<gtk::Widget>) -> Self {
693        Self {
694            builder: self.builder.property("widget", widget.clone().upcast()),
695        }
696    }
697
698    // rustdoc-stripper-ignore-next
699    /// Build the [`TimedAnimation`].
700    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
701    pub fn build(self) -> TimedAnimation {
702        assert_initialized_main_thread!();
703        self.builder.build()
704    }
705}