1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct SpringParams(Shared<ffi::AdwSpringParams>);

    match fn {
        ref => |ptr| ffi::adw_spring_params_ref(ptr),
        unref => |ptr| ffi::adw_spring_params_unref(ptr),
        type_ => || ffi::adw_spring_params_get_type(),
    }
}

impl SpringParams {
    #[doc(alias = "adw_spring_params_new")]
    pub fn new(damping_ratio: f64, mass: f64, stiffness: f64) -> SpringParams {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::adw_spring_params_new(damping_ratio, mass, stiffness)) }
    }

    #[doc(alias = "adw_spring_params_new_full")]
    pub fn new_full(damping: f64, mass: f64, stiffness: f64) -> SpringParams {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::adw_spring_params_new_full(damping, mass, stiffness)) }
    }

    #[doc(alias = "adw_spring_params_get_damping")]
    #[doc(alias = "get_damping")]
    pub fn damping(&self) -> f64 {
        unsafe { ffi::adw_spring_params_get_damping(self.to_glib_none().0) }
    }

    #[doc(alias = "adw_spring_params_get_damping_ratio")]
    #[doc(alias = "get_damping_ratio")]
    pub fn damping_ratio(&self) -> f64 {
        unsafe { ffi::adw_spring_params_get_damping_ratio(self.to_glib_none().0) }
    }

    #[doc(alias = "adw_spring_params_get_mass")]
    #[doc(alias = "get_mass")]
    pub fn mass(&self) -> f64 {
        unsafe { ffi::adw_spring_params_get_mass(self.to_glib_none().0) }
    }

    #[doc(alias = "adw_spring_params_get_stiffness")]
    #[doc(alias = "get_stiffness")]
    pub fn stiffness(&self) -> f64 {
        unsafe { ffi::adw_spring_params_get_stiffness(self.to_glib_none().0) }
    }
}