|
| 1 | +// This file was generated by gir (https://github.com/gtk-rs/gir) |
| 2 | +// from gir-files (https://github.com/gtk-rs/gir-files) |
| 3 | +// DO NOT EDIT |
| 4 | + |
| 5 | +use crate::{ffi, PorterDuff, RenderNode}; |
| 6 | +use glib::{prelude::*, translate::*}; |
| 7 | + |
| 8 | +glib::wrapper! { |
| 9 | + #[doc(alias = "GskCompositeNode")] |
| 10 | + pub struct CompositeNode(Shared<ffi::GskCompositeNode>); |
| 11 | + |
| 12 | + match fn { |
| 13 | + ref => |ptr| ffi::gsk_render_node_ref(ptr as *mut ffi::GskRenderNode), |
| 14 | + unref => |ptr| ffi::gsk_render_node_unref(ptr as *mut ffi::GskRenderNode), |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +impl StaticType for CompositeNode { |
| 19 | + fn static_type() -> glib::Type { |
| 20 | + unsafe { from_glib(ffi::gsk_composite_node_get_type()) } |
| 21 | + } |
| 22 | +} |
| 23 | + |
| 24 | +impl CompositeNode { |
| 25 | + #[doc(alias = "gsk_composite_node_new")] |
| 26 | + pub fn new( |
| 27 | + child: impl AsRef<RenderNode>, |
| 28 | + mask: impl AsRef<RenderNode>, |
| 29 | + op: PorterDuff, |
| 30 | + ) -> CompositeNode { |
| 31 | + skip_assert_initialized!(); |
| 32 | + unsafe { |
| 33 | + from_glib_full(ffi::gsk_composite_node_new( |
| 34 | + child.as_ref().to_glib_none().0, |
| 35 | + mask.as_ref().to_glib_none().0, |
| 36 | + op.into_glib(), |
| 37 | + )) |
| 38 | + } |
| 39 | + } |
| 40 | + |
| 41 | + #[doc(alias = "gsk_composite_node_get_child")] |
| 42 | + #[doc(alias = "get_child")] |
| 43 | + pub fn child(&self) -> RenderNode { |
| 44 | + unsafe { from_glib_none(ffi::gsk_composite_node_get_child(self.to_glib_none().0)) } |
| 45 | + } |
| 46 | + |
| 47 | + #[doc(alias = "gsk_composite_node_get_mask")] |
| 48 | + #[doc(alias = "get_mask")] |
| 49 | + pub fn mask(&self) -> RenderNode { |
| 50 | + unsafe { from_glib_none(ffi::gsk_composite_node_get_mask(self.to_glib_none().0)) } |
| 51 | + } |
| 52 | + |
| 53 | + #[doc(alias = "gsk_composite_node_get_operator")] |
| 54 | + #[doc(alias = "get_operator")] |
| 55 | + pub fn operator(&self) -> PorterDuff { |
| 56 | + unsafe { from_glib(ffi::gsk_composite_node_get_operator(self.to_glib_none().0)) } |
| 57 | + } |
| 58 | +} |
0 commit comments