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

#[cfg(feature = "v48")]
#[cfg_attr(docsrs, doc(cfg(feature = "v48")))]
use crate::Page;
use crate::{Annotation, AnnotationMarkup, ffi};
#[cfg(feature = "v48")]
#[cfg_attr(docsrs, doc(cfg(feature = "v48")))]
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "PpsAnnotationStamp")]
    pub struct AnnotationStamp(Object<ffi::PpsAnnotationStamp, ffi::PpsAnnotationStampClass>) @extends AnnotationMarkup, Annotation;

    match fn {
        type_ => || ffi::pps_annotation_stamp_get_type(),
    }
}

impl AnnotationStamp {
    #[cfg(feature = "v48")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v48")))]
    #[doc(alias = "pps_annotation_stamp_new")]
    pub fn new(page: &impl IsA<Page>) -> AnnotationStamp {
        skip_assert_initialized!();
        unsafe {
            Annotation::from_glib_full(ffi::pps_annotation_stamp_new(
                page.as_ref().to_glib_none().0,
            ))
            .unsafe_cast()
        }
    }

    #[cfg(feature = "v48")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v48")))]
    #[doc(alias = "pps_annotation_stamp_get_surface")]
    #[doc(alias = "get_surface")]
    pub fn surface(&self) -> Option<cairo::Surface> {
        unsafe { from_glib_none(ffi::pps_annotation_stamp_get_surface(self.to_glib_none().0)) }
    }

    #[cfg(feature = "v48")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v48")))]
    #[doc(alias = "pps_annotation_stamp_set_surface")]
    pub fn set_surface(&self, surface: &cairo::Surface) {
        unsafe {
            ffi::pps_annotation_stamp_set_surface(self.to_glib_none().0, surface.to_glib_none().0);
        }
    }
}
