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

use glib::translate::*;

use crate::{Cicp, MemoryFormat, ffi};

glib::wrapper! {
    #[doc(alias = "GlyFrame")]
    pub struct Frame(Object<ffi::GlyFrame, ffi::GlyFrameClass>);

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

impl Frame {
    #[doc(alias = "gly_frame_get_buf_bytes")]
    #[doc(alias = "get_buf_bytes")]
    pub fn buf_bytes(&self) -> glib::Bytes {
        unsafe { from_glib_none(ffi::gly_frame_get_buf_bytes(self.to_glib_none().0)) }
    }

    #[doc(alias = "gly_frame_get_color_cicp")]
    #[doc(alias = "get_color_cicp")]
    pub fn color_cicp(&self) -> Option<Cicp> {
        unsafe { from_glib_full(ffi::gly_frame_get_color_cicp(self.to_glib_none().0)) }
    }

    #[cfg(feature = "v2_2")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v2_2")))]
    #[doc(alias = "gly_frame_get_color_icc_profile")]
    #[doc(alias = "get_color_icc_profile")]
    pub fn color_icc_profile(&self) -> Option<glib::Bytes> {
        unsafe { from_glib_full(ffi::gly_frame_get_color_icc_profile(self.to_glib_none().0)) }
    }

    //#[cfg(feature = "v2_2")]
    //#[cfg_attr(docsrs, doc(cfg(feature = "v2_2")))]
    //#[doc(alias = "gly_frame_get_color_mode")]
    //#[doc(alias = "get_color_mode")]
    //pub fn color_mode(&self) -> /*Ignored*/ColorMode {
    //    unsafe { TODO: call ffi:gly_frame_get_color_mode() }
    //}

    #[doc(alias = "gly_frame_get_delay")]
    #[doc(alias = "get_delay")]
    pub fn delay(&self) -> i64 {
        unsafe { ffi::gly_frame_get_delay(self.to_glib_none().0) }
    }

    //#[cfg(feature = "v2_2")]
    //#[cfg_attr(docsrs, doc(cfg(feature = "v2_2")))]
    //#[doc(alias = "gly_frame_get_details")]
    //#[doc(alias = "get_details")]
    //pub fn details(&self) -> /*Ignored*/FrameDetails {
    //    unsafe { TODO: call ffi:gly_frame_get_details() }
    //}

    #[doc(alias = "gly_frame_get_height")]
    #[doc(alias = "get_height")]
    pub fn height(&self) -> u32 {
        unsafe { ffi::gly_frame_get_height(self.to_glib_none().0) }
    }

    #[doc(alias = "gly_frame_get_memory_format")]
    #[doc(alias = "get_memory_format")]
    pub fn memory_format(&self) -> MemoryFormat {
        unsafe { from_glib(ffi::gly_frame_get_memory_format(self.to_glib_none().0)) }
    }

    #[doc(alias = "gly_frame_get_stride")]
    #[doc(alias = "get_stride")]
    pub fn stride(&self) -> u32 {
        unsafe { ffi::gly_frame_get_stride(self.to_glib_none().0) }
    }

    #[doc(alias = "gly_frame_get_width")]
    #[doc(alias = "get_width")]
    pub fn width(&self) -> u32 {
        unsafe { ffi::gly_frame_get_width(self.to_glib_none().0) }
    }
}

unsafe impl Send for Frame {}
unsafe impl Sync for Frame {}
