libadwaita/auto/
property_animation_target.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::{ffi, AnimationTarget};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    #[doc(alias = "AdwPropertyAnimationTarget")]
11    pub struct PropertyAnimationTarget(Object<ffi::AdwPropertyAnimationTarget, ffi::AdwPropertyAnimationTargetClass>) @extends AnimationTarget;
12
13    match fn {
14        type_ => || ffi::adw_property_animation_target_get_type(),
15    }
16}
17
18impl PropertyAnimationTarget {
19    #[doc(alias = "adw_property_animation_target_new")]
20    pub fn new(object: &impl IsA<glib::Object>, property_name: &str) -> PropertyAnimationTarget {
21        assert_initialized_main_thread!();
22        unsafe {
23            AnimationTarget::from_glib_full(ffi::adw_property_animation_target_new(
24                object.as_ref().to_glib_none().0,
25                property_name.to_glib_none().0,
26            ))
27            .unsafe_cast()
28        }
29    }
30
31    #[doc(alias = "adw_property_animation_target_new_for_pspec")]
32    #[doc(alias = "new_for_pspec")]
33    pub fn for_pspec(
34        object: &impl IsA<glib::Object>,
35        pspec: impl AsRef<glib::ParamSpec>,
36    ) -> PropertyAnimationTarget {
37        assert_initialized_main_thread!();
38        unsafe {
39            AnimationTarget::from_glib_full(ffi::adw_property_animation_target_new_for_pspec(
40                object.as_ref().to_glib_none().0,
41                pspec.as_ref().to_glib_none().0,
42            ))
43            .unsafe_cast()
44        }
45    }
46
47    #[doc(alias = "adw_property_animation_target_get_object")]
48    #[doc(alias = "get_object")]
49    pub fn object(&self) -> glib::Object {
50        unsafe {
51            from_glib_none(ffi::adw_property_animation_target_get_object(
52                self.to_glib_none().0,
53            ))
54        }
55    }
56
57    #[doc(alias = "adw_property_animation_target_get_pspec")]
58    #[doc(alias = "get_pspec")]
59    pub fn pspec(&self) -> glib::ParamSpec {
60        unsafe {
61            from_glib_none(ffi::adw_property_animation_target_get_pspec(
62                self.to_glib_none().0,
63            ))
64        }
65    }
66}