// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::translate::*;

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

    match fn {
        ref => |ptr| ffi::gtk_scroll_info_ref(ptr),
        unref => |ptr| ffi::gtk_scroll_info_unref(ptr),
        type_ => || ffi::gtk_scroll_info_get_type(),
    }
}

impl ScrollInfo {
    #[doc(alias = "gtk_scroll_info_new")]
    pub fn new() -> ScrollInfo {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::gtk_scroll_info_new()) }
    }

    #[doc(alias = "gtk_scroll_info_get_enable_horizontal")]
    #[doc(alias = "get_enable_horizontal")]
    pub fn enables_horizontal(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_scroll_info_get_enable_horizontal(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gtk_scroll_info_get_enable_vertical")]
    #[doc(alias = "get_enable_vertical")]
    pub fn enables_vertical(&self) -> bool {
        unsafe {
            from_glib(ffi::gtk_scroll_info_get_enable_vertical(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gtk_scroll_info_set_enable_horizontal")]
    pub fn set_enable_horizontal(&self, horizontal: bool) {
        unsafe {
            ffi::gtk_scroll_info_set_enable_horizontal(
                self.to_glib_none().0,
                horizontal.into_glib(),
            );
        }
    }

    #[doc(alias = "gtk_scroll_info_set_enable_vertical")]
    pub fn set_enable_vertical(&self, vertical: bool) {
        unsafe {
            ffi::gtk_scroll_info_set_enable_vertical(self.to_glib_none().0, vertical.into_glib());
        }
    }
}

#[cfg(feature = "v4_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
impl Default for ScrollInfo {
    fn default() -> Self {
        Self::new()
    }
}
