// 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 crate::ffi;
use glib::{prelude::*, translate::*};

#[doc(alias = "adw_get_enable_animations")]
#[doc(alias = "get_enable_animations")]
pub fn is_animations_enabled(widget: &impl IsA<gtk::Widget>) -> bool {
    assert_initialized_main_thread!();
    unsafe {
        from_glib(ffi::adw_get_enable_animations(
            widget.as_ref().to_glib_none().0,
        ))
    }
}

#[doc(alias = "adw_get_major_version")]
#[doc(alias = "get_major_version")]
pub fn major_version() -> u32 {
    assert_initialized_main_thread!();
    unsafe { ffi::adw_get_major_version() }
}

#[doc(alias = "adw_get_micro_version")]
#[doc(alias = "get_micro_version")]
pub fn micro_version() -> u32 {
    assert_initialized_main_thread!();
    unsafe { ffi::adw_get_micro_version() }
}

#[doc(alias = "adw_get_minor_version")]
#[doc(alias = "get_minor_version")]
pub fn minor_version() -> u32 {
    assert_initialized_main_thread!();
    unsafe { ffi::adw_get_minor_version() }
}

#[doc(alias = "adw_is_initialized")]
pub fn is_initialized() -> bool {
    assert_initialized_main_thread!();
    unsafe { from_glib(ffi::adw_is_initialized()) }
}

#[doc(alias = "adw_lerp")]
pub fn lerp(a: f64, b: f64, t: f64) -> f64 {
    assert_initialized_main_thread!();
    unsafe { ffi::adw_lerp(a, b, t) }
}

#[cfg(feature = "v1_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
#[doc(alias = "adw_rgba_to_standalone")]
pub fn rgba_to_standalone(rgba: &gdk::RGBA, dark: bool) -> gdk::RGBA {
    assert_initialized_main_thread!();
    unsafe {
        let mut standalone_rgba = gdk::RGBA::uninitialized();
        ffi::adw_rgba_to_standalone(
            rgba.to_glib_none().0,
            dark.into_glib(),
            standalone_rgba.to_glib_none_mut().0,
        );
        standalone_rgba
    }
}
