// 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::{Annot, AnnotMarkup, Color, Document, Rectangle, ffi};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "PopplerAnnotCircle")]
    pub struct AnnotCircle(Object<ffi::PopplerAnnotCircle>) @extends AnnotMarkup, Annot;

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

impl AnnotCircle {
    #[doc(alias = "poppler_annot_circle_new")]
    pub fn new(doc: &Document, rect: &mut Rectangle) -> AnnotCircle {
        unsafe {
            Annot::from_glib_full(ffi::poppler_annot_circle_new(
                doc.to_glib_none().0,
                rect.to_glib_none_mut().0,
            ))
            .unsafe_cast()
        }
    }

    #[doc(alias = "poppler_annot_circle_get_interior_color")]
    #[doc(alias = "get_interior_color")]
    pub fn interior_color(&self) -> Option<Color> {
        unsafe {
            from_glib_full(ffi::poppler_annot_circle_get_interior_color(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "poppler_annot_circle_set_interior_color")]
    pub fn set_interior_color(&self, poppler_color: Option<&Color>) {
        unsafe {
            ffi::poppler_annot_circle_set_interior_color(
                self.to_glib_none().0,
                mut_override(poppler_color.to_glib_none().0),
            );
        }
    }
}
