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

use crate::ffi;
use glib::translate::*;

glib::wrapper! {
    pub struct Rectangle(BoxedInline<ffi::PopplerRectangle>);

    match fn {
        copy => |ptr| ffi::poppler_rectangle_copy(mut_override(ptr)),
        free => |ptr| ffi::poppler_rectangle_free(ptr),
        type_ => || ffi::poppler_rectangle_get_type(),
    }
}

impl Rectangle {
    #[doc(alias = "poppler_rectangle_new")]
    pub fn new() -> Rectangle {
        unsafe { from_glib_full(ffi::poppler_rectangle_new()) }
    }

    #[cfg(feature = "v21_5")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v21_5")))]
    #[doc(alias = "poppler_rectangle_find_get_ignored_hyphen")]
    pub fn find_get_ignored_hyphen(&self) -> bool {
        unsafe {
            from_glib(ffi::poppler_rectangle_find_get_ignored_hyphen(
                self.to_glib_none().0,
            ))
        }
    }

    #[cfg(feature = "v21_5")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v21_5")))]
    #[doc(alias = "poppler_rectangle_find_get_match_continued")]
    pub fn find_get_match_continued(&self) -> bool {
        unsafe {
            from_glib(ffi::poppler_rectangle_find_get_match_continued(
                self.to_glib_none().0,
            ))
        }
    }
}

impl Default for Rectangle {
    fn default() -> Self {
        Self::new()
    }
}
