// 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 crate::ffi;
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "GskPasteNode")]
    pub struct PasteNode(Shared<ffi::GskPasteNode>);

    match fn {
        ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode),
        unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode),
    }
}

impl StaticType for PasteNode {
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::gsk_paste_node_get_type()) }
    }
}

impl PasteNode {
    #[doc(alias = "gsk_paste_node_new")]
    pub fn new(bounds: &graphene::Rect, depth: usize) -> PasteNode {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::gsk_paste_node_new(bounds.to_glib_none().0, depth)) }
    }

    #[doc(alias = "gsk_paste_node_get_depth")]
    #[doc(alias = "get_depth")]
    pub fn depth(&self) -> usize {
        unsafe { ffi::gsk_paste_node_get_depth(self.to_glib_none().0) }
    }
}
